CN103067533A - Data packet transmitting method and data packet transmitting device - Google Patents

Data packet transmitting method and data packet transmitting device Download PDF

Info

Publication number
CN103067533A
CN103067533A CN2012105624642A CN201210562464A CN103067533A CN 103067533 A CN103067533 A CN 103067533A CN 2012105624642 A CN2012105624642 A CN 2012105624642A CN 201210562464 A CN201210562464 A CN 201210562464A CN 103067533 A CN103067533 A CN 103067533A
Authority
CN
China
Prior art keywords
address
portable terminal
network
tuple
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105624642A
Other languages
Chinese (zh)
Other versions
CN103067533B (en
Inventor
刘刚
陆元飞
曾毓珑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shangge Intellectual Property Service Co ltd
Wuxi Zhuoneng Big Data Technology Co ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210562464.2A priority Critical patent/CN103067533B/en
Publication of CN103067533A publication Critical patent/CN103067533A/en
Application granted granted Critical
Publication of CN103067533B publication Critical patent/CN103067533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a data packet transmitting method and a data packet transmitting device, and belongs to the field of internet communications. The data packet transmitting method includes that when a mobile terminal is switched from a home network to an outer area network, a first data packet which carries a first four-tuple and is sent by a first network address translation (NAT) server is received; the first four-tuple carried by the first data packet is modified as a second four-tuple, wherein the second four-tuple is a four-tuple which is carried by a data packet received by an application layer of the mobile terminal when the mobile terminal is in the home network; and then the first data packet is submitted to the application layer of the mobile terminal. The data packet transmitting device comprises the mobile terminal, a server and a control server. According to the data packet transmitting method and the data packet transmitting device, through the modification of the four-tuple which is carried by the data packet received by the mobile terminal, the four-tuple which is carried by the data packet received by the mobile terminal is enabled to remain the same before the switch and after the switch of the networks, and therefore the effect that when the mobile terminal is switched from the home network to the outer area network, services are not interrupted is guaranteed.

Description

A kind of method and apparatus of the transmission of data bag
Technical field
The present invention relates to field of Internet communication, particularly a kind of method and apparatus of the transmission of data bag.
Background technology
In today of portable terminal explosive growth, abundant Internet resources are arranged around us, but current mobile terminal can only be used a kind of network, when portable terminal during from a Network Mobility to another network, portable terminal need to carry out network and switched this moment.
Obtain the home address of home agent during the present portable terminal access belonging network first time, by this home address set up with server between be connected, when portable terminal leaves home network and move to a foreign network, a Care-of Address is registered and registered to portable terminal in foreign network, by this Care-of Address set up with server between be connected, so portable terminal is realized switching to foreign network from home network.
In realizing process of the present invention, the inventor finds that there is following problem at least in prior art:
When at present portable terminal switched to foreign network from home network, portable terminal disconnected first and being connected of server, in foreign network, set up again with server between be connected, so can cause service disconnection.
Summary of the invention
Do not interrupt for assurance business when portable terminal switches to foreign network from home network, the invention provides a kind of method and apparatus of the transmission of data bag.Described technical scheme is as follows:
First aspect, a kind of method of the transmission of data bag, described method comprises:
When portable terminal switches to foreign network from home network, receive the first packet that first network address transition NAT server sends, described the first packet carries the first four-tuple, and the source address that described the first four-tuple comprises is that the address of server, the port numbers that source port number is described server, the first address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The first four-tuple that described the first packet is carried is revised as the second four-tuple, described the second four-tuple is the four-tuple that the packet of the application layer reception of described portable terminal described portable terminal when described home network carries, and the source address that described the second four-tuple comprises is that the address of described server, port numbers, the destination address that source port number is described server are the port numbers of described portable terminal for presetting address and destination slogan;
Described the first packet is submitted to the application layer of described portable terminal.
In conjunction with first aspect, in the possible implementation of the first of above-mentioned first aspect, described method also comprises:
When described portable terminal is positioned at described home network, receive the second packet that the 2nd NAT server sends, described the second packet carries the 3rd four-tuple, and the source address that described the 3rd four-tuple comprises is that the address of described server, the port numbers that source port number is described server, the second address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The 3rd four-tuple that described the second packet is carried is revised as described the second four-tuple, described the second packet is submitted to the application layer of described portable terminal.
In conjunction with first aspect, above-mentioned first aspect second in the possible implementation, before the first packet that described reception the one NAT server sends, described method also comprises:
Obtain the 3rd packet of the generation of described portable terminal application layer, described the 3rd packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 4th four-tuple that described the 3rd packet is carried is revised as the May 4th tuple, and to give a described NAT server, the source address that described the May 4th tuple comprises with described the 3rd Packet Generation be that the first address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
In conjunction with the possible implementation of the first of first aspect or first aspect, in the third possible implementation of above-mentioned first aspect, before the second packet that described reception the 2nd NAT server sends, described method also comprises:
Obtain the 4th packet of generation of the application layer of described portable terminal, described the 4th packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 4th four-tuple that described the 4th packet is carried is revised as the 6th four-tuple, and to give described the 2nd NAT server, the source address that described the 6th four-tuple comprises with described the 4th Packet Generation be that the second address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
In conjunction with the possible implementation of the second of first aspect or first aspect, in the 4th kind of possible implementation of above-mentioned first aspect, before the 3rd packet that the described application layer of obtaining described portable terminal generates, described method also comprises:
Obtain the first address of described portable terminal;
Send login request message to Control Server, the identify label number ID and first that described login request message is carried the first address of described portable terminal, described portable terminal switches sign, and described first switches sign is used for illustrating that described portable terminal is currently located at described foreign network.
In conjunction with the possible implementation of the first of first aspect or first aspect or the third possible implementation of first aspect, in the 5th kind of possible implementation of above-mentioned first aspect, before the 4th packet that the described application layer of obtaining described portable terminal generates, described method also comprises:
Obtain the second address of described portable terminal;
Send login request message to Control Server, the ID and second that described login request message is carried the second address of described portable terminal, described portable terminal switches sign, and described second switches sign is used for illustrating that described portable terminal is currently located at described home network.
Second aspect, a kind of method of the transmission of data bag, described method comprises:
When portable terminal switches to foreign network from home network, receive the 3rd packet that first network address transition NAT server sends, described the 3rd packet carries the 7th four-tuple, and the source address that described the 7th four-tuple comprises is that the address of described foreign network, the port numbers that source port number is described foreign network, address and the destination slogan that destination address is server are the port numbers of described server;
The 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, described the 8th four-tuple is the four-tuple that packet that the application layer of described portable terminal described server when home network receives carries, and the source address that described the 8th four-tuple comprises is that the address of described home network, the port numbers that source port number is described home network, address and the destination slogan that destination address is server are the port numbers of described server;
Described the 3rd packet is submitted to the application layer of described server.
In conjunction with second aspect, in the possible implementation of the first of second aspect, described the 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, specifically comprises:
The source address that the 7th four-tuple of carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, searches the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign;
Switch sign if find, described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, judges described portable terminal according to described switching sign and is currently located at described foreign network;
The source address that the 7th four-tuple of carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, obtains the address of described home network and the port numbers of described home network in the mapping relations tabulation of the port numbers of the address of the port numbers of the network address of the ownership of having stored, home network, foreign network and foreign network;
The source address modification that described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
In conjunction with the possible implementation of the first of second aspect or second aspect, in the possible implementation of the second of above-mentioned second aspect, described the 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, also comprises:
If find described switching sign, send and switch identification request message to Control Server, carry the address of the described foreign network that described the 7th four-tuple comprises and the port numbers of described foreign network in the described switching identification request message;
Receive the response message that described Control Server sends, described response message carries the address of home network corresponding to described portable terminal and the port numbers of home network;
The source address modification that described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
In conjunction with the possible implementation of the first of second aspect or second aspect, in the third possible implementation of above-mentioned first aspect, described response message also carries and switches sign, described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, after the response message that the described Control Server of described reception sends, also comprise:
The address of the described home network that carries according to described response message and the port numbers of described home network, find out from the corresponding relation tabulation that the described network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described home network;
The described switching sign that finds out is revised as the switching sign that described response message carries.
In conjunction with second aspect, in the 4th kind of possible implementation of above-mentioned second aspect, described method also comprises:
Obtain the first packet of the application layer generation of described server, described the first packet carries the 9th four-tuple, and the source address that described the 9th four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described home network are the port numbers of described home network;
Described the 9th four-tuple that described the first packet is carried is revised as the tenth four-tuple, and the source address that described the tenth four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described foreign network are the port numbers of described foreign network;
Give a described NAT server with described the first Packet Generation.
In conjunction with the 4th kind of possible implementation of second aspect or second aspect, in the 5th kind of possible implementation of above-mentioned second aspect, described the 9th four-tuple that described the first packet is carried is revised as the tenth four-tuple, specifically comprises:
The destination address that described the 9th four-tuple of carrying according to described the first packet comprises is the address of described home network and the port numbers of the described home network of destination slogan, find out from the corresponding relation tabulation that the network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described foreign network;
Judge described portable terminal according to described switching sign and be currently located at described foreign network;
The destination address that comprises according to described the 9th four-tuple is that address and the destination slogan of described home network is the port numbers of described home network, obtains the address of described foreign network and the port numbers of described foreign network from the mapping relations tabulation of the port numbers of the address of the port numbers of the home network address of having stored, home network, foreign network and foreign network;
The address that the destination address that described the 9th four-tuple is comprised is revised as described foreign network, and the port numbers that the destination slogan that described the 9th four-tuple comprises is revised as described foreign network, be revised as the tenth four-tuple to realize described the 9th four-tuple that described the first packet is carried.
The third aspect, a kind of method of the transmission of data bag, described method comprises:
Receive the identification request message that described server sends, described identification request message carries the address of foreign network corresponding to portable terminal and the port numbers of described foreign network;
According to the address of foreign network corresponding to described portable terminal and the port numbers of described foreign network, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network;
Send response message to described server, described response message carries the address of described home network and the port numbers of described home network, and the packet that described server is sent described portable terminal according to the port numbers of the address of described home network and described home network is submitted to the application layer of described server.
In conjunction with the third aspect, in the possible implementation of the first of the above-mentioned third aspect, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network, specifically comprise:
The address of the foreign network that the described portable terminal that carries according to described identification request message is corresponding and the port numbers of described foreign network are obtained described portable terminal in the address of foreign network and the port numbers of described portable terminal from the mapping relations tabulation of port numbers, the network address and the network terminal slogan of the address of the portable terminal stored, portable terminal;
According to described portable terminal in the address of the address of foreign network and the portable terminal stored, the identify label number ID of portable terminal and the corresponding relation tabulation of switching sign obtain described portable terminal in the address of home network;
In the address of home network and the port numbers of described portable terminal, from the mapping relations tabulation of the port numbers of the address of the portable terminal stored, portable terminal, the network address, network terminal slogan, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network according to described portable terminal.
In conjunction with the third aspect, in the possible implementation of the second of the above-mentioned third aspect, before the identification request message that the described server of described reception sends, described method also comprises:
Receive the mapping request message that network address translation NAT server sends, described mapping request message is carried the address of described portable terminal and the port numbers of described portable terminal;
The address of the described portable terminal that carries according to described mapping request message and the port numbers of described portable terminal are distributed a network address and network terminal slogan;
The port numbers of the address of described portable terminal, described portable terminal, the described network address and described network terminal slogan are stored in the mapping relations tabulation of port numbers, the network address, network terminal slogan of address, the portable terminal of portable terminal.
In conjunction with the third aspect, in the third possible implementation of the above-mentioned third aspect, before the identification request message that the described server of described reception sends, described method also comprises:
The login request message that mobile terminal receive sends is carried the ID of the address of described portable terminal, described portable terminal and is switched sign in the described login request message, described switching sign is used for illustrating the network that described portable terminal is positioned at;
The ID of the address of described portable terminal, described portable terminal and described switching sign are stored in portable terminal address, portable terminal ID and switch in the corresponding relation tabulation of sign.
Fourth aspect, a kind of portable terminal of the transmission of data bag, described portable terminal comprises:
The first receiver module, be used for when portable terminal switches to foreign network from home network, receive the first packet that first network address transition NAT server sends, described the first packet carries the first four-tuple, and the source address that described the first four-tuple comprises is that the address of server, the port numbers that source port number is described server, the first address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The first modified module, be used for the first four-tuple that the first packet that described the first receiver module receives carries is revised as the second four-tuple, described the second four-tuple is the four-tuple that the packet of the application layer reception of described portable terminal described portable terminal when described home network carries, and the source address that described the second four-tuple comprises is that the address of described server, port numbers, the destination address that source port number is described server are the port numbers of described portable terminal for presetting address and destination slogan;
First submits module to, is used for described the first packet is submitted to the application layer of described portable terminal.
In conjunction with fourth aspect, in the possible implementation of the first of fourth aspect, described portable terminal also comprises:
The second receiver module, be used for when described portable terminal is positioned at described home network, receive the second packet that the 2nd NAT server sends, described the second packet carries the 3rd four-tuple, and the source address that described the 3rd four-tuple comprises is that the address of described server, the port numbers that source port number is described server, the second address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
Second submits module to, is used for the 3rd four-tuple that the second packet that described the second receiver module receives carries is revised as described the second four-tuple, described the second packet is submitted to the application layer of described portable terminal.
In conjunction with fourth aspect, in the possible implementation of the second of fourth aspect, described portable terminal also comprises:
The first acquisition module, be used for before the first packet of described reception the one NAT server transmission, obtain the 3rd packet of generation of the application layer of described portable terminal, described the 3rd packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The second modified module, the 4th four-tuple that the 3rd packet that is used for that described the first acquisition module is obtained carries is revised as the May 4th tuple, and to give a described NAT server, the source address that described the May 4th tuple comprises with described the 3rd Packet Generation be that the first address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
In conjunction with the possible implementation of the first of fourth aspect or fourth aspect, in the third possible implementation of above-mentioned fourth aspect, described portable terminal also comprises:
The second acquisition module, be used for before the second packet of described reception the 2nd NAT server transmission, obtain the 4th packet of the application layer generation of described portable terminal, described the 4th packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 3rd modified module, the 4th four-tuple that the 4th packet that is used for that described the second acquisition module is obtained carries is revised as the 6th four-tuple, and to give described the 2nd NAT server, the source address that described the 6th four-tuple comprises with described the 4th Packet Generation be that the second address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
In conjunction with the possible implementation of the second of fourth aspect or fourth aspect, in the 4th kind of possible implementation of above-mentioned fourth aspect, described portable terminal also comprises:
The 3rd acquisition module is used for before the 3rd packet that the described application layer of obtaining described portable terminal generates the first address that obtains described portable terminal;
The first sending module, be used for sending login request message to Control Server, the identify label number ID and first that described login request message is carried the first address of described portable terminal, described portable terminal switches sign, and described first switches sign is used for illustrating that described portable terminal is currently located at described foreign network.
In conjunction with the possible implementation of the first of fourth aspect or fourth aspect or the third possible implementation of fourth aspect, in the 5th kind of possible implementation of above-mentioned fourth aspect, described portable terminal also comprises:
The 4th acquisition module is used for before the 4th packet that the described application layer of obtaining described portable terminal generates the second address that obtains described portable terminal;
The second sending module, be used for sending login request message to Control Server, the ID and second that described login request message is carried the second address of described portable terminal, described portable terminal switches sign, and described second switches sign is used for illustrating that described portable terminal is currently located at described home network.
The 5th aspect, a kind of server of the transmission of data bag, described server comprises:
Receiver module, be used for when portable terminal switches to foreign network from home network, receive the 3rd packet that first network address transition NAT server sends, described the 3rd packet carries the 7th four-tuple, and the source address that described the 7th four-tuple comprises is that the address of described foreign network, the port numbers that source port number is described foreign network, address and the destination slogan that destination address is server are the port numbers of described server;
The first modified module, be used for described the 7th four-tuple that the 3rd packet that described receiver module receives carries is revised as the 8th four-tuple, described the 8th four-tuple is the four-tuple that packet that the application layer of described portable terminal described server when home network receives carries, and the source address that described the 8th four-tuple comprises is that the address of described home network, the port numbers that source port number is described home network, address and the destination slogan that destination address is server are the port numbers of described server;
Submit module to, be used for described the 3rd packet is submitted to the application layer of described server.
In conjunction with the 5th aspect, in the possible implementation of the first aspect the above-mentioned the 5th, described the first modified module specifically comprises:
First searches the unit, the source address that the 7th four-tuple that is used for carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, searches the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign;
The first judging unit switches sign if be used for finding, and described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, judges described portable terminal according to described switching sign and is currently located at described foreign network;
The first acquiring unit, the source address that the 7th four-tuple that is used for carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, obtains the address of described home network and the port numbers of described home network in the mapping relations tabulation of the port numbers of the address of the port numbers of the network address of the ownership of having stored, home network, foreign network and foreign network;
First revises the unit, the source address modification that is used for described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
In conjunction with the possible implementation of the first of the 5th aspect or the 5th aspect, in the possible implementation of the second aspect the above-mentioned the 5th, described the first modified module specifically also comprises:
Transmitting element, if be used for not finding described switching sign, send to switch identification request message to Control Server, carry the address of the described foreign network that described the 7th four-tuple comprises and the port numbers of described foreign network in the described switching identification request message;
Receiving element is used for receiving the response message that described Control Server sends, and described response message carries the address of home network corresponding to described portable terminal and the port numbers of home network;
Second revises the unit, the source address modification that is used for described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
The possible implementation of the first in conjunction with the 5th aspect or the 5th aspect, in the third possible implementation aspect the above-mentioned the 5th, described response message also carries and switches sign, described switching sign is for illustrating that described portable terminal is currently located at described foreign network, and described the first modified module also comprises:
Second searches the unit, be used for after the response message of the described Control Server transmission of described reception, the address of the described home network that carries according to described response message and the port numbers of described home network, find out from the corresponding relation tabulation that the described network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described home network;
The 3rd revises the unit, is used for will described second searching switching sign that the unit finds out and is revised as the switching that described response message carries and identifies.
In conjunction with the 5th aspect, in the 4th kind of possible implementation aspect the above-mentioned the 5th, described server also comprises:
Acquisition module, the first packet for the application layer generation of obtaining described server, described the first packet carries the 9th four-tuple, and the source address that described the 9th four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described home network are the port numbers of described home network;
The second modified module, described the 9th four-tuple that the first packet that is used for that described acquisition module is obtained carries is revised as the tenth four-tuple, and the source address that described the tenth four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described foreign network are the port numbers of described foreign network;
Sending module is used for described the first Packet Generation to a described NAT server.
In conjunction with the 4th kind of possible implementation of the 5th aspect or the 5th aspect, in the 5th kind of possible implementation aspect the above-mentioned the 5th, described second revises the unit specifically comprises:
The 3rd searches the unit, the destination address that described the 9th four-tuple that is used for carrying according to described the first packet comprises is the address of described home network and the port numbers of the described home network of destination slogan, find out from the corresponding relation tabulation that the network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described foreign network;
The second judging unit is judged described portable terminal according to described switching sign and is currently located at described foreign network;
Second acquisition unit, the destination address that comprises according to described the 9th four-tuple is that address and the destination slogan of described home network is the port numbers of described home network, obtains the address of described foreign network and the port numbers of described foreign network from the mapping relations tabulation of the port numbers of the address of the port numbers of the home network address of having stored, home network, foreign network and foreign network;
The 4th revises the unit, the address that the destination address that described the 9th four-tuple is comprised is revised as described foreign network, and the port numbers that the destination slogan that described the 9th four-tuple comprises is revised as described foreign network, be revised as the tenth four-tuple to realize described the 9th four-tuple that described the first packet is carried.
The 6th aspect, a kind of Control Server of the transmission of data bag, described Control Server comprises:
The first receiver module is used for receiving the identification request message that described server sends, and described identification request message carries the address of foreign network corresponding to portable terminal and the port numbers of described foreign network;
Acquisition module is used for according to the address of foreign network corresponding to described portable terminal and the port numbers of described foreign network, obtains the address of home network corresponding to described portable terminal and the port numbers of described home network;
Sending module, be used for sending response message to described server, described response message carries the address of described home network and the port numbers of described home network, and the packet that described server is sent described portable terminal according to the port numbers of the address of described home network and described home network is submitted to the application layer of described server.
In conjunction with the 6th aspect, in the possible implementation of the first aspect the above-mentioned the 6th, described acquisition module specifically comprises:
The first acquiring unit, be used for the address of foreign network corresponding to the described portable terminal carry according to described identification request message and the port numbers of described foreign network, from the mapping relations tabulation of port numbers, the network address and the network terminal slogan of the address of the portable terminal stored, portable terminal, obtain described portable terminal in the address of foreign network and the port numbers of described portable terminal;
Second acquisition unit, be used for according to described portable terminal in the address of the address of foreign network and the portable terminal stored, the identify label number ID of portable terminal and the corresponding relation that switches sign tabulate and obtain described portable terminal in the address of home network;
The 3rd acquiring unit, in the address of home network and the port numbers of described portable terminal, from the mapping relations tabulation of the port numbers of the address of the portable terminal stored, portable terminal, the network address, network terminal slogan, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network according to described portable terminal.
In conjunction with the 6th aspect, in the possible implementation of the second aspect the above-mentioned the 6th, described Control Server also comprises:
The second receiver module, be used for before the identification request message of the described server transmission of described reception, receive the mapping request message that network address translation NAT server sends, described mapping request message is carried the address of described portable terminal and the port numbers of described portable terminal;
Distribution module for the address of the described portable terminal that carries according to described mapping request message and the port numbers of described portable terminal, is distributed a network address and network terminal slogan;
The first memory module is used for storing the port numbers of the address of described portable terminal, described portable terminal, the described network address and described network terminal slogan into port numbers, the network address of address, the portable terminal of portable terminal, the mapping relations tabulation of network terminal slogan.
In conjunction with the 6th aspect, in the third the possible implementation aspect the above-mentioned the 6th, described Control Server also comprises:
The 3rd receiver module, be used for before the identification request message of the described server transmission of described reception, the login request message that mobile terminal receive sends, carry the ID of the address of described portable terminal, described portable terminal in the described login request message and switch sign, described switching sign is used for illustrating the network that described portable terminal is positioned at;
The second memory module is used for ID and the described switching of the address of described portable terminal, described portable terminal are identified the address that is stored in portable terminal, the ID of portable terminal and the corresponding relation tabulation of switching sign.
The 7th aspect, a kind of portable terminal of the transmission of data bag is characterized in that, described portable terminal comprises first memory and first processor, is used for carrying out the method for each described a kind of the transmission of data bag that above-mentioned first aspect comprises.
Eight aspect, a kind of server of the transmission of data bag is characterized in that, described server comprises second memory and the second processor, is used for carrying out the method for each described a kind of the transmission of data bag that above-mentioned first aspect comprises.
The 9th aspect, a kind of Control Server of the transmission of data bag is characterized in that, described Control Server comprises the 3rd memory and the 3rd processor, is used for carrying out the method for each described a kind of the transmission of data bag that the above-mentioned third aspect comprises.
The beneficial effect of technical scheme provided by the invention is:
In embodiments of the present invention, by when portable terminal switches to foreign network from home network, the four-tuple that the packet that modification receives carries, so that the four-tuple that the packet that the application layer of portable terminal receives carries is identical with the four-tuple that packet that portable terminal receives when the home network carries all, application layer for server, the four-tuple that the packet that receives before and after network switches carries also is identical, because network switches and moves forward and backward terminal and server thinks that the four-tuple that the packet of its reception carries does not change, and has guaranteed that so business is not interrupted when portable terminal switches to foreign network from home network.
Description of drawings
Fig. 1 is the method flow diagram of a kind of the transmission of data bag of providing of the embodiment of the invention 1;
Fig. 2 is the flow chart of the first process of the method for a kind of the transmission of data bag of providing of the embodiment of the invention 2;
Fig. 3 is the flow chart of the second process of the method for a kind of the transmission of data bag of providing of the embodiment of the invention 2;
Fig. 4 is the flow chart of the 3rd process of the method for a kind of the transmission of data bag of providing of the embodiment of the invention 2;
Fig. 5 is the flow chart of the 4th process of the method for a kind of the transmission of data bag of providing of the embodiment of the invention 2;
Fig. 6 is the method flow diagram of a kind of the transmission of data bag of providing of the embodiment of the invention 3;
Fig. 7 is the method flow diagram of a kind of the transmission of data bag of providing of the embodiment of the invention 4;
Fig. 8 is the mobile terminal structure schematic diagram of a kind of the transmission of data bag of providing of the embodiment of the invention 5;
Fig. 9 is the server architecture schematic diagram of a kind of the transmission of data bag of providing of the embodiment of the invention 6;
Figure 10 is the Control Server structural representation of a kind of the transmission of data bag of providing of the embodiment of the invention 7;
Figure 11 is the mobile terminal structure schematic diagram of a kind of the transmission of data bag of providing of the embodiment of the invention 8;
Figure 12 is the server architecture schematic diagram of a kind of the transmission of data bag of providing of the embodiment of the invention 9;
Figure 13 is the Control Server structural representation of a kind of the transmission of data bag of providing of the embodiment of the invention 10.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
The embodiment of the invention provides a kind of method of the transmission of data bag, and referring to Fig. 1, the method comprises:
Step 101: when portable terminal switches to foreign network from home network, receive first network address transition NAT(Network Address Translation, network address translation) the first packet of server transmission, described the first packet carries the first four-tuple, and the source address that described the first four-tuple comprises is that the address of server, the port numbers that source port number is described server, the first address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
Step 102: the first four-tuple that described the first packet is carried is revised as the second four-tuple, described the second four-tuple is the four-tuple that the packet of the application layer reception of described portable terminal described portable terminal when described home network carries, and the source address that described the second four-tuple comprises is that the address of described server, port numbers, the destination address that source port number is described server are the port numbers of described portable terminal for presetting address and destination slogan;
Step 103: the application layer of described the first packet being submitted to described portable terminal.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, after the four-tuple that the packet that the portable terminal modification receives carries this packet is submitted to the application layer of portable terminal, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of portable terminal when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of portable terminal receives carries and portable terminal portable terminal when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
Embodiment 2
The embodiment of the invention provides a kind of method of the transmission of data bag, the method comprises Four processes, and the first process comprises step 201 to step 210, and the second process comprises that step 301 is to step 304, the 3rd process comprises step 401 to step 410, and the 4th process comprises that step 501 is to step 504.
Wherein, referring to Fig. 2, in the first process, portable terminal enters home network first, when portable terminal sends packet to server, specifically comprises the steps 201 to step 210:
Step 201: the second address of acquisition for mobile terminal portable terminal, and to Control Server transmission login request message, this login request message carries the second address of portable terminal, the ID(IDentity of portable terminal, the identify label number) and second switch sign, this second switches sign and is used for the explanation portable terminal and is currently located at home network;
Wherein, this portable terminal comprises the first physical network card and the second physical network card, and the second address of this portable terminal is the address of the second physical network card, and when portable terminal was positioned at home network, this portable terminal was by the second physical network card bag that transmits and receive data.
Step 202: Control Server receives this login request message, the second address of the portable terminal that this login request message is carried, the ID of portable terminal and second switch sign store into portable terminal address, portable terminal ID and switch in the corresponding relation tabulation of sign;
Step 203: the 4th packet that the application layer of acquisition for mobile terminal portable terminal generates, the 4th four-tuple that the 4th packet is carried is revised as the 6th four-tuple, the source address that the 4th four-tuple comprises is that the port numbers of portable terminal, address and the destination slogan that destination address is server are the port numbers of server for default address, source port number, and the source address that the 6th four-tuple comprises is that the second address of portable terminal, the port numbers that source port number is portable terminal, address and the destination slogan that destination address is server are the port numbers of server;
Particularly, the 4th packet that acquisition for mobile terminal portable terminal application layer generates, the 4th packet carries the 4th four-tuple, the source address that the 4th four-tuple comprises is default address, source port number is the port numbers of portable terminal, destination address is that address and the destination slogan of server is the port numbers of server, the second address that the source address that the 4th four-tuple that portable terminal carries the 4th packet comprises is revised as portable terminal by default address, obtain the 6th four-tuple, the source address that the 6th four-tuple comprises, source port number, destination address and destination slogan are respectively: the second address of portable terminal, the port numbers of portable terminal, the address of server and the port numbers of server.
Wherein, the fixing address that the virtual interface that this default address is portable terminal arranges, the source address of the entrained four-tuple of packet that the application layer of portable terminal generates is this default address.
Step 204: portable terminal is given the 2nd NAT server with the 4th Packet Generation;
Wherein, when portable terminal is positioned at home network, send packet by the second physical network card.
Step 205: the 2nd NAT server receives the 4th packet, the 6th four-tuple that the 4th packet is carried is revised as the 8th four-tuple, and with the 4th Packet Generation to server, the source address that the 8th four-tuple comprises is that address, the source port number of the 2nd NAT server place network is that the 2nd NAT server place network of network port numbers, destination address are that address and the destination slogan of server is the port numbers of server;
Particularly, this step comprises following (1) to (5):
(1): the 2nd NAT server receives the 4th packet, the source address that the 6th four-tuple of carrying according to the 4th packet comprises is that the second address and the source port number of portable terminal is the port numbers of portable terminal, search the address of the portable terminal as shown in table 1 of in the 2nd NAT server, storing, the port numbers of portable terminal, the mapping relations tabulation of the network address and network terminal slogan, if do not find the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers, execution in step (2), if find the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers, execution in step (5);
Table 1
Figure BDA00002630106100161
(2): the 2nd NAT server sends the request mapping message to Control Server, and it is that the second address and the source port number of portable terminal is the port numbers of portable terminal that this request message carries source address that the 6th four-tuple comprises;
(3): the source address that Control Server comprises according to the 6th four-tuple of carrying in this request mapping message is that the second address and the source port number of portable terminal is the port numbers of portable terminal, distribute a network address and network terminal slogan to the 2nd NAT server, the network address of this distribution and network terminal slogan are the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers, and the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers are sent to the 2nd NAT server;
Further, Control Server stores port numbers, the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers of the second address of portable terminal, portable terminal in the mapping relations tabulation of port numbers, the network address and network terminal slogan of the address of portable terminal, portable terminal.
(4): the 2nd NAT server receives the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers that Control Server sends, the 6th four-tuple that the 4th packet is carried is revised as the 8th four-tuple, and with the 4th Packet Generation to server, finish.
Particularly, the 2nd NAT server receives the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers that Control Server sends, the network terminal slogan that the source address that the 6th four-tuple is comprised is revised as the 2nd network of network address, NAT server place and the source port number that the 6th four-tuple comprises is revised as the net of the 2nd NAT server place network by the port numbers of portable terminal by the second address of portable terminal, obtain the 8th four-tuple, and with this 4th Packet Generation that carries the 8th four-tuple to server, the source address that the 8th four-tuple comprises is network of network address, the 2nd NAT server place, source port number is the 2nd NAT server place network of network port numbers, destination address is that address and the destination slogan of server is the port numbers of server.
Further, the 2nd NAT server stores port numbers, the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers of the second address of portable terminal, portable terminal in the mapping relations tabulation of port numbers, the network address and network terminal slogan of the address of portable terminal, portable terminal.
(5): the 2nd NAT server is according to the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers that find, the 6th four-tuple that the 4th packet is carried is revised as the 8th four-tuple, and with the 4th Packet Generation to server.
Particularly, the 2nd NAT server is according to the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers that find, the network terminal slogan that the source address that the 6th four-tuple is comprised is revised as the 2nd network of network address, NAT server place and the source port number that the 6th four-tuple comprises is revised as the net of the 2nd NAT server place network by the port numbers of portable terminal by the second address of portable terminal, obtain the 8th four-tuple, and with this 4th Packet Generation that carries the 8th four-tuple to server, the source address that the 8th four-tuple comprises is network of network address, the 2nd NAT server place, source port number is the 2nd NAT server place network of network port numbers, destination address is that address and the destination slogan of server is the port numbers of server.
Step 206: server receives the 4th packet, searches the second switching sign according to the 8th four-tuple that the 4th packet carries, and switches sign if find second, and execution in step 207 identifies execution in step 210 if find the second switching;
Particularly, server receives the 4th packet, the source address that the 8th four-tuple of carrying according to the 4th packet comprises is that the 2nd network of network address, NAT server place and source port number are the 2nd NAT server place network of network port numbers, search the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign, do not switch sign if find second, execution in step 207 is switched sign, execution in step 210 if find second.
Step 207: server sends identification request message to Control Server, and this identification request message carries the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers;
Step 208: Control Server receives this identification request message, sends response message to server, and this response message carries second and switches sign, and this second switching sign is used for the explanation portable terminal and is currently located at home network;
Particularly, Control Server receives this identification request message, the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers of carrying according to this identification request message, in table 1, find out the second address of portable terminal and the port numbers of portable terminal, and then the address of the portable terminal as shown in table 2 of in Control Server, having stored according to the second address of portable terminal, search and get access to second in the corresponding relation tabulation of the ID of portable terminal and switching sign and switch sign, this the second switching sign is used for the explanation portable terminal and is currently located at home network, judge portable terminal according to this second switching sign and be currently located at home network, send response message to server, this response message carries second and switches sign.
Table 2
The address of portable terminal The ID of portable terminal Switch sign
The first address of portable terminal The ID of portable terminal First switches sign
The second address of portable terminal The ID of portable terminal Second switches sign
Step 209: server receives response message, stores the second switching sign of carrying in this response message;
Particularly, server receives response message, and the second switching sign that network of network address, the 2nd NAT server place, the 2nd NAT server place network of network port numbers and this response message are carried stores in the corresponding relation tabulation of the network address, network terminal slogan and switching sign;
Step 210: server is judged portable terminal according to the second switching sign and is currently located at home network, and the 4th packet is submitted to server application layer.
Wherein, the four-tuple that the 4th packet that server application layer receives carries is the 8th four-tuple, and the source address that the 8th four-tuple comprises, source port number, destination address and destination slogan are respectively: the address of the address of home network, the port numbers of home network, server and the port numbers of server.
Wherein, when portable terminal is positioned at home network, when again sending packet to server, carry out by above-mentioned steps 201 to step 210.
Wherein, referring to Fig. 3, in the second process, server receives the 4th packet that the portable terminal be positioned at home network sends, and when sending the second packet to portable terminal, specifically comprises the steps 301 to step 304:
Step 301: server obtains the second packet of the application layer generation of server, obtains the second switching sign according to the 9th four-tuple that this second packet carries, and this second switching sign is for illustrating that portable terminal is currently located at home network;
Particularly, server obtains the second packet of the application layer generation of server, this second packet carries the 9th four-tuple, the source address that the 9th four-tuple comprises is the address of server, source port number is the port numbers of server, destination address is that the 2nd network of network address, NAT server place and destination slogan are the 2nd NAT server place network of network port numbers, the destination address that the 9th four-tuple that server carries according to this second packet comprises is that the 2nd network of network address, NAT server place and destination slogan are the 2nd NAT server place network of network port numbers, the network address of storing, search and obtain second in the corresponding relation tabulation of network terminal slogan and switching sign and switch sign;
Step 302: server is judged portable terminal according to the second switching sign and is currently located at home network, gives the 2nd NAT server with this second Packet Generation;
Step 303: the 2nd NAT server receives this second packet, the 9th four-tuple of carrying in this second packet is revised as the 3rd four-tuple, and with this second Packet Generation to portable terminal, the source address that the 3rd four-tuple comprises is that the address of server, the port numbers that source port number is server, the second address and the destination slogan that destination address is portable terminal are the port numbers of portable terminal;
Particularly, the 2nd NAT server receives this second packet, the destination address that the 9th four-tuple of carrying according to this second packet comprises is that the 2nd network of network address, NAT server place and destination slogan are the 2nd NAT server place network of network port numbers, in table 1, find out the second address of portable terminal and the port numbers of portable terminal, the second address that the destination address that the 9th four-tuple is comprised is revised as portable terminal by network of network address, the 2nd NAT server place, and the port numbers that the destination slogan that the 9th four-tuple comprises is revised as portable terminal by the 2nd NAT server place network of network port numbers, obtain the 3rd four-tuple, and this is carried the 3rd four-tuple the second Packet Generation to portable terminal, the source address that the 3rd four-tuple comprises is the address of server, source port number is the port numbers of server, destination address is that the second address and the destination slogan of portable terminal is the port numbers of portable terminal.
Step 304: portable terminal receives this second packet, the 3rd four-tuple that this second packet is carried is revised as the second four-tuple, and this second packet is submitted to the application layer of portable terminal, the source address that this second four-tuple comprises be the address of server, port numbers that source port number is server, destination address for default address and destination slogan be the port numbers of portable terminal;
Particularly, portable terminal receives this second packet, the destination address that the 3rd four-tuple that this second packet is carried comprises is revised as default address by the second address of portable terminal, obtain the second four-tuple, and this second packet that carries the second four-tuple is submitted to the application layer of portable terminal, the source address that this second four-tuple comprises be the address of server, port numbers that source port number is server, destination address for default address and destination slogan be the port numbers of portable terminal.
Wherein, when portable terminal is positioned at home network, by the second physical network card receive data bag.
Wherein, when portable terminal is positioned at home network, again reception server send packet the time, carry out by above-mentioned steps 301 to step 304.
Wherein, referring to Fig. 4, in the 4th process, when portable terminal switches to foreign network from home network, when portable terminal sends packet to server, specifically comprise the steps 401 to step 410:
Step 401: when portable terminal switches to foreign network from home network, the first address of acquisition for mobile terminal portable terminal, and to Control Server transmission login request message, carry the first address of portable terminal, ID and the first switching sign of portable terminal in this login request message, this first switching sign is used for illustrating the current foreign network that is in of portable terminal;
Wherein, this portable terminal comprises the first physical network card and the second physical network card, and the first address of this portable terminal is the address of the first physical network card, and when portable terminal was positioned at foreign network, this portable terminal was by the first physical network card bag that transmits and receive data.
Wherein, switch to the reason of foreign network from home network when portable terminal, can for: portable terminal leaves home network and enters into foreign network, also can be that the user selects to switch to another network from a network according to the demand of self, can also monitor by manufacturer the signal power of each network, switch to a network that signal is best.
Step 402: Control Server receives this login request message, the first address of the portable terminal that this login request message is carried, the ID of portable terminal and first switch sign store into portable terminal address, portable terminal ID and switch in the corresponding relation tabulation of sign;
Step 403: the 3rd packet that the application layer of acquisition for mobile terminal portable terminal generates, the 4th four-tuple that the 3rd packet is carried is revised as the May 4th tuple, the source address that the 4th four-tuple comprises is that the port numbers of portable terminal, address and the destination slogan that destination address is server are the port numbers of server for default address, source port number, and the source address that this May 4th tuple comprises is that the first address of portable terminal, the port numbers that source port number is portable terminal, address and the destination slogan that destination address is server are the port numbers of server;
Particularly, the 3rd packet the 3rd packet that the application layer of acquisition for mobile terminal portable terminal generates carries the 4th four-tuple, the source address that the 4th four-tuple comprises is default address, source port number is the port numbers of portable terminal, destination address is that address and the destination slogan of server is the port numbers of server, the first address that the source address that the 4th four-tuple that portable terminal carries the 3rd packet comprises is revised as portable terminal by default address, obtain the May 4th tuple, the source address that this May 4th tuple comprises, source port number, destination address and destination slogan are respectively: the first address of portable terminal, the port numbers of portable terminal, the address of server and the port numbers of server.
Step 404: portable terminal is given a NAT server with the 3rd Packet Generation;
Wherein, when portable terminal leaves home network and switches to foreign network, send packet by the first physical network card.
Step 405: a NAT server receives the 3rd packet, the May 4th tuple that the 3rd packet is carried is revised as the 7th four-tuple, and with the 3rd Packet Generation to server, the source address that the 7th four-tuple comprises is that network of network address, a NAT server place, source port number are that a NAT server place network of network port numbers, destination address are that address and the destination slogan of server is the port numbers of server;
Particularly, this step comprises following (1) to (5):
(1): a NAT server receives the 3rd packet, the source address that the May 4th tuple of carrying according to the 3rd packet comprises is that the first address and the source port number of portable terminal is the port numbers of portable terminal, look-up table 1, if do not find a network of network address, NAT server place and a NAT server place network of network port numbers, execution in step (2), if find a network of network address, NAT server place and a NAT server place network of network port numbers, execution in step (5);
(2): a NAT server sends the request mapping message to Control Server, and the first address and the source port number that carry source address that the May 4th tuple comprises in this request message and be portable terminal are the port numbers of portable terminal;
(3): the source address that Control Server comprises according to the May 4th tuple of carrying in this request mapping message is that the first address and the source port number of portable terminal is the port numbers of portable terminal, distribute a network address and network terminal slogan to a NAT server, the network address of this distribution and network terminal slogan are a network of network address, NAT server place and a NAT server place network of network port numbers, and a network of network address, NAT server place and a NAT server place network of network port numbers are sent to a NAT server;
Further, Control Server stores port numbers, a network of network address, NAT server place and a NAT server place network of network port numbers of the first address of portable terminal, portable terminal in the mapping relations tabulation of port numbers, the network address and network terminal slogan of the address of portable terminal, portable terminal.
(4): a NAT server receives a network of network address, NAT server place and the NAT server place network of network port numbers that Control Server sends, the May 4th tuple that the 3rd packet is carried is revised as the 7th four-tuple, and with the 3rd Packet Generation to server.
Particularly, the one NAT server receives a network of network address, NAT server place and the NAT server place network of network port numbers that Control Server sends, the source address that the May 4th tuple is comprised is revised as a network of network address, NAT server place by the first address of portable terminal and source port number that the May 4th tuple is comprised is revised as a NAT server place network of network port numbers by the port numbers of portable terminal, obtain the 7th four-tuple, and with this 3rd Packet Generation that carries the 7th four-tuple to server, the source address that the 7th four-tuple comprises is network of network address, a NAT server place, source port number is a NAT server place network of network port numbers, destination address is that address and the destination slogan of server is the port numbers of server.
Further, a NAT server stores port numbers, a network of network address, NAT server place and a NAT server place network of network port numbers of the first address of portable terminal, portable terminal in the mapping relations tabulation of port numbers, the network address and network terminal slogan of the address of portable terminal, portable terminal.
(5): a NAT server is according to the network of network address, NAT server place and the NAT server place network of network port numbers that find, the May 4th tuple that the 3rd packet is carried is revised as the 7th four-tuple, and with the 3rd Packet Generation to server.
Particularly, the one NAT server is according to the network of network address, NAT server place and the NAT server place network of network port numbers that find, the source address that the May 4th tuple is comprised is revised as a network of network address, NAT server place by the first address of portable terminal and source port number that the May 4th tuple is comprised is revised as a NAT server place network of network port numbers by the port numbers of portable terminal, obtain the 7th four-tuple, and with this 3rd Packet Generation that carries the 7th four-tuple to server, the source address that the 7th four-tuple comprises is network of network address, a NAT server place, source port number is a NAT server place network of network port numbers, destination address is that address and the destination slogan of server is the port numbers of server.
Step 406: server receives the 3rd packet, searches the first switching sign according to the 7th four-tuple that the 3rd packet carries, and switches sign if find first, and execution in step 407 identifies execution in step 410 if find the first switching;
Particularly, server receives the 3rd packet, the source address that the 7th four-tuple of carrying according to the 3rd packet comprises is a network of network address, NAT server place and source port number the one NAT server place network of network port numbers, search the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign, do not switch sign if find first, execution in step 407 is switched sign, execution in step 410 if find first.
Step 407: server sends identification request message to Control Server, the network of network address, NAT server place that this identification request message carries and a NAT server place network of network port numbers;
Step 408: Control Server receives this identification request message, sends response message to server, and this response message carries first and switches sign, the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers;
Particularly, Control Server receives this identification request message, the one network of network address, NAT server place and a NAT server place network of network port numbers of carrying according to this identification request message, in table 1, find out the first address of portable terminal and the port numbers of portable terminal, and then in table 2, search and obtain first according to the first address of portable terminal and switch sign, this first switches sign and is used for the explanation portable terminal and is currently located at foreign network, first switches sign and judges portable terminal and be currently located at foreign network according to this;
Control Server obtains the ID of portable terminal in table 2 according to the first address of portable terminal, and get access to the second address of portable terminal in table 2 according to the ID of portable terminal;
Control Server obtains the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers according to the second address of portable terminal and the port numbers of portable terminal in table 1;
Control Server sends response message to server, and this response message carries first and switches sign, the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers.
Step 409: server receives response message, first switch sign and judge portable terminal and be currently located at foreign network according to what this response message carried, the 7th four-tuple that the 3rd packet is carried is revised as the 8th four-tuple, and the 3rd packet is submitted to the application layer of server, finishes;
Particularly, server receives response message, first switch sign and judge portable terminal and be currently located at foreign network according to what this response message carried, the source address that the 7th four-tuple is comprised is revised as the 2nd network of network address, NAT server place that response message carries by network of network address, a NAT server place and source that the 7th four-tuple is comprised number is revised as the 2nd NAT server place network of network port numbers that response message carries by a NAT server place network of network port numbers, obtain the 8th four-tuple, and the 3rd packet is submitted to the application layer of server.
Further, server stores the first switching sign that network of network address, a NAT server place, a NAT server place network of network port numbers and this response message carry in the corresponding relation tabulation of the network address, network terminal slogan and switching sign into.
Further, the network of network address, the 2nd NAT server place of carrying in the response message of server with reception is as home network address, the 2nd NAT server place network of network port numbers is as the home network port numbers, the source port number that the source address that the 7th four-tuple that the 3rd packet carries comprises the 7th four-tuple that to be network of network address, a NAT server place carry as foreign network address and the 3rd packet comprises is that a NAT server place network of network port numbers is as the foreign network port numbers, with network of network address, the 2nd NAT server place, the 2nd NAT server place network of network port numbers, the mapping relations of the one network of network address, NAT server place and a NAT server place network of network port numbers are stored in home network address, the home network port numbers, in the mapping relations tabulation of foreign network address and foreign network port numbers.
Further, in the corresponding relation tabulation of server according to the 2nd network of network address, NAT server place of carrying in the response message and network of network port numbers Network Search address, the 2nd NAT server place, network terminal slogan and switching sign, obtain second and switch sign, and the second switching sign is revised as the first switching sign that response message carries.
Step 410: server is judged portable terminal according to the first switching sign that finds and is currently located at foreign network, and the 7th four-tuple that the 3rd packet is carried is revised as the 8th four-tuple, and the 3rd packet is submitted to the application layer of server.
Particularly, the source address that the 7th four-tuple that the 3rd packet that server will receive carries comprises is that network of network address, a NAT server place is as the foreign network address, source port number is that a NAT server place network of network port numbers is as the foreign network port numbers, the home network address of storing, the home network port numbers, find the 2nd network of network address, NAT server place and the 2nd NAT server place network of network port numbers in the mapping relations tabulation of foreign network address and foreign network port numbers, the source address that the 7th four-tuple is comprised is revised as the 2nd network of network address, NAT server place by network of network address, a NAT server place and source that the 7th four-tuple is comprised number is revised as the 2nd NAT server place network of network port numbers by a NAT server place network of network port numbers, obtain the 8th four-tuple, and the 3rd packet is submitted to the application layer of server.
Wherein, when portable terminal switches to foreign network from home network, when again sending packet to server, carry out by above-mentioned steps 401 to step 410.
Wherein, referring to Fig. 5, in the 4th process, server receives the packet that the portable terminal be positioned at foreign network sends, and when sending packet to portable terminal, specifically comprises the steps 501 to step 504:
Step 501: server obtains the first packet of the application layer generation of server, obtains the first switching sign according to the 9th four-tuple that this first packet carries, and this second switching sign is for illustrating that portable terminal is currently located at foreign network;
Particularly, server obtains the first packet of the application layer generation of server, this first packet carries the 9th four-tuple, the source address that the 9th four-tuple comprises is the address of server, source port number is the port numbers of server, destination address is for being that the 2nd network of network address, NAT server place and destination slogan are the 2nd NAT server place network of network port numbers, the destination address that the 9th four-tuple of carrying according to this first packet comprises is that the 2nd network of network address, NAT server place and destination slogan are the 2nd NAT server place network of network port numbers, the network address of storing, search and get access to first in the corresponding relation tabulation of network terminal slogan and switching sign and switch sign;
Step 502: server is judged current mobile terminal according to the first switching sign and is positioned at foreign network, the 9th four-tuple that this first packet is carried is revised as the tenth four-tuple, and give a NAT server with this first Packet Generation, the tenth four-tuple comprises that source address is that the address of server, port numbers, the destination address that source port number is server are that a network of network address, NAT server place and destination interface are a NAT server place network of network port numbers;
Particularly, the destination address that the 9th four-tuple that server carries according to this first packet comprises is that the 2nd network of network address, NAT server place and destination slogan are the 2nd NAT server place network of network port numbers, in the corresponding relation tabulation of the network address of having stored, network terminal slogan and switching sign, find out first and switch sign, judge portable terminal and be currently located at foreign network;
The destination address that server comprises the 9th four-tuple destination slogan that to be network of network address, the 2nd NAT server place comprise as address and the 9th four-tuple of home network is that the 2nd NAT server place network of network port numbers is as the port numbers of home network, the home network address of storing, the home network port numbers, find a network of network address, NAT server place and a NAT server place network of network port numbers in the mapping relations tabulation of foreign network address and foreign network port numbers, the destination address that the 9th four-tuple is comprised is revised as network of network address, a NAT server place by network of network address, the 2nd NAT server place, and the destination slogan that the 9th four-tuple comprises is revised as a NAT server place network of network port numbers by the 2nd NAT server place network of network port numbers, obtain the tenth four-tuple, and give a NAT server with this first Packet Generation that carries the tenth four-tuple, the tenth four-tuple comprises that source address is the address of server, source port number is the port numbers of server, destination address is that a network of network address, NAT server place and destination interface are a NAT server place network of network port numbers.
Step 503: a NAT server receives this first packet, the tenth four-tuple of carrying in this first packet is revised as the first four-tuple, and with this first Packet Generation to portable terminal, the source address that this first four-tuple comprises is that the address of server, the port numbers that source port number is server, the first address and the destination slogan that destination address is portable terminal are the port numbers of portable terminal;
Particularly, the one NAT server receives this first packet, the destination address that the tenth four-tuple of carrying according to this first packet comprises is that a NAT server place network of network address address and destination slogan are a NAT server place network of network port numbers, find out the first address of portable terminal and the port numbers of portable terminal in the table 1, the first address that the destination address that the tenth four-tuple is comprised is revised as portable terminal by network of network address, a NAT server place, and the port numbers that the destination slogan that the tenth four-tuple comprises is revised as portable terminal by a NAT server place network of network port numbers, obtain the first four-tuple, and with this first Packet Generation that carries the first four-tuple to portable terminal, the source address that this first four-tuple comprises is the address of server, source port number is the port numbers of server, destination address is that the first address and the destination slogan of portable terminal is the port numbers of portable terminal.
Step 504: portable terminal receives this first packet, the first four-tuple that this first packet is carried is revised as the second four-tuple, and this first packet is sent to the application layer of portable terminal, the source address that this second four-tuple comprises be the address of server, port numbers that source port number is server, destination address for default address and destination slogan be the port numbers of portable terminal.
Particularly, portable terminal receives this first packet, the destination address that the first four-tuple that this first packet is carried comprises is revised as default address by the first address of portable terminal, obtain the second four-tuple, and this first packet that carries the second four-tuple is submitted to the application layer of portable terminal, the source address that this second four-tuple comprises be the address of server, port numbers that source port number is server, destination address for default address and destination slogan be the port numbers of portable terminal.
Wherein, when portable terminal switches to foreign network from home network, by the first physical network card receive data bag.
Wherein, when portable terminal switches to foreign network from home network, when portable terminal again reception server send packet the time, carry out by above-mentioned steps 501 to step 504.
In embodiments of the present invention, portable terminal is from home network and when switching to home network, when sending packet to server, obtain the packet of the application layer generation of portable terminal, the four-tuple that the packet that the application layer of the four-tuple that this packet carries and portable terminal portable terminal when home network generates carries is identical, revise the application layer of this packet being submitted to after the four-tuple that this packet carries portable terminal during packet that reception server sends, so that the four-tuple that the packet of the four-tuple that the packet that the application layer of portable terminal receives carries and this portable terminal application layer reception of portable terminal when home network carries is identical, during packet that the server mobile terminal receive sends, revise the application layer of this packet being submitted to after the four-tuple that this packet carries server, so that the four-tuple that the packet of the four-tuple that the packet that the application layer of server receives carries and the portable terminal application layer reception of server when home network carries is identical, simultaneously also so that server sends to the four-tuple that four-tuple that the data of portable terminal carry and portable terminal send to portable terminal when home network packet carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the application layer of portable terminal receives and the packet that sends to carries all and the portable terminal four-tuple that the packet of reception and transmission carries when home network be identical, application layer for server, the four-tuple that the packet that receives carries is identical, the four-tuple that the packet that sends carries also is identical, has guaranteed that so business is not interrupted when portable terminal switches to foreign network from home network.
Embodiment 3
The embodiment of the invention provides a kind of method of the transmission of data bag, and referring to Fig. 6, the method comprises:
Step 601: when portable terminal switches to foreign network from home network, receive the 3rd packet that first network address transition NAT server sends, described the 3rd packet carries the 7th four-tuple, and the source address that described the 7th four-tuple comprises is that the address of described foreign network, the port numbers that source port number is described foreign network, address and the destination slogan that destination address is server are the port numbers of described server;
Step 602: described the 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, described the 8th four-tuple is the four-tuple that packet that the application layer of described portable terminal described server when home network receives carries, and the source address that described the 8th four-tuple comprises is that the address of described home network, the port numbers that source port number is described home network, address and the destination slogan that destination address is server are the port numbers of described server;
Step 603: the application layer of described the 3rd packet being submitted to described server.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, after the four-tuple that the packet that server modifications receives carries this packet is submitted to the application layer of server, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of server when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the four-tuple that the packet that the application layer of server receives carries and the application layer of portable terminal server at home network the time receive carries is identical, has guaranteed that so business is not interrupted when portable terminal switches to foreign network from home network.
Embodiment 4
The embodiment of the invention provides a kind of method of the transmission of data bag, and referring to Fig. 7, the method comprises:
Step 701: receive the identification request message that described server sends, described identification request message carries the address of foreign network corresponding to portable terminal and the port numbers of described foreign network;
Step 702: according to the address of foreign network corresponding to described portable terminal and the port numbers of described foreign network, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network;
Step 703: send response message to described server, described response message carries the address of described home network and the port numbers of described home network, and the packet that described server is sent described portable terminal according to the port numbers of the address of described home network and described home network is submitted to the application layer of described server.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, server receives the response message that Control Server sends, server is revised the application layer of this packet being submitted to after the four-tuple that the packet that receives carries server according to the port numbers of the address of the home network that carries in the response message and home network, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of server when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of server receives carries and portable terminal server when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
Embodiment 5
The embodiment of the invention provides a kind of portable terminal of the transmission of data bag, and referring to Fig. 8, this portable terminal comprises:
The first receiver module 801, be used for when portable terminal switches to foreign network from home network, receive the first packet that first network address transition NAT server sends, described the first packet carries the first four-tuple, and the source address that described the first four-tuple comprises is that the address of server, the port numbers that source port number is described server, the first address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The first modified module 802, be used for the first four-tuple that the first packet that described the first receiver module receives carries is revised as the second four-tuple, described the second four-tuple is the four-tuple that the packet of the application layer reception of described portable terminal described portable terminal when described home network carries, and the source address that described the second four-tuple comprises is that the address of described server, port numbers, the destination address that source port number is described server are the port numbers of described portable terminal for presetting address and destination slogan;
First submits module 803 to, is used for described the first packet is submitted to the application layer of described portable terminal.
Further, this portable terminal also comprises:
The second receiver module 804, be used for when described portable terminal is positioned at described home network, receive the second packet that the 2nd NAT server sends, described the second packet carries the 3rd four-tuple, and the source address that described the 3rd four-tuple comprises is that the address of described server, the port numbers that source port number is described server, the second address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
Second submits module 805 to, is used for the 3rd four-tuple that the second packet that described the second receiver module receives carries is revised as described the second four-tuple, described the second packet is submitted to the application layer of described portable terminal.
Further, this portable terminal also comprises:
The first acquisition module 806, be used for before the first packet of described reception the one NAT server transmission, obtain the 3rd packet of generation of the application layer of described portable terminal, described the 3rd packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The second modified module 807, the 4th four-tuple that the 3rd packet that is used for that described the first acquisition module is obtained carries is revised as the May 4th tuple, and to give a described NAT server, the source address that described the May 4th tuple comprises with described the 3rd Packet Generation be that the first address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
Further, this portable terminal also comprises:
The second acquisition module 808, be used for before the second packet of described reception the 2nd NAT server transmission, obtain the 4th packet of the application layer generation of described portable terminal, described the 4th packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 3rd modified module 809, the 4th four-tuple that the 4th packet that is used for that described the second acquisition module is obtained carries is revised as the 6th four-tuple, and to give described the 2nd NAT server, the source address that described the 6th four-tuple comprises with described the 4th Packet Generation be that the second address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
Further, this portable terminal also comprises:
The 3rd acquisition module 810 is used for before the 3rd packet that the described application layer of obtaining described portable terminal generates the first address that obtains described portable terminal;
Wherein, this portable terminal comprises the first physical network card and the second physical network card, the first address of the portable terminal that the 3rd acquisition module obtains is the address of the first physical network card, and when portable terminal was positioned at foreign network, this portable terminal was by the first physical network card bag that transmits and receive data.
The first sending module 811, be used for sending login request message to Control Server, the identify label number ID and first that described login request message is carried the first address of described portable terminal, described portable terminal switches sign, and described first switches sign is used for illustrating that described portable terminal is currently located at described foreign network.
Further, this portable terminal also comprises:
The 4th acquisition module 812 is used for before the 4th packet that the described application layer of obtaining described portable terminal generates the second address that obtains described portable terminal;
Wherein, this portable terminal comprises the first physical network card and the second physical network card, the second address of the portable terminal that the 4th acquisition module obtains is the address of the second physical network card, and when portable terminal was positioned at home network, this portable terminal was by the second physical network card bag that transmits and receive data.
The second sending module 813, be used for sending login request message to Control Server, the ID and second that described login request message is carried the second address of described portable terminal, described portable terminal switches sign, and described second switches sign is used for illustrating that described portable terminal is currently located at described home network.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, after the four-tuple that the packet that the portable terminal modification receives carries this packet is submitted to the application layer of portable terminal, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of portable terminal when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of portable terminal receives carries and portable terminal portable terminal when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
Embodiment 6
The embodiment of the invention provides a kind of server of the transmission of data bag, and referring to Fig. 9, this server comprises:
Receiver module 901, be used for when portable terminal switches to foreign network from home network, receive the 3rd packet that first network address transition NAT server sends, described the 3rd packet carries the 7th four-tuple, and the source address that described the 7th four-tuple comprises is that the address of described foreign network, the port numbers that source port number is described foreign network, address and the destination slogan that destination address is server are the port numbers of described server;
The first modified module 902, be used for described the 7th four-tuple that the 3rd packet that described receiver module receives carries is revised as the 8th four-tuple, described the 8th four-tuple is the four-tuple that packet that the application layer of described portable terminal described server when home network receives carries, and the source address that described the 8th four-tuple comprises is that the address of described home network, the port numbers that source port number is described home network, address and the destination slogan that destination address is server are the port numbers of described server;
Submit module 903 to, be used for described the 3rd packet is submitted to the application layer of described server.
Wherein, these the first modification 902 modules specifically comprise:
First searches unit 9021, the source address that the 7th four-tuple that is used for carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, searches the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign;
The first judging unit 9022 switches sign if be used for finding, and described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, judges described portable terminal according to described switching sign and is currently located at described foreign network;
The first acquiring unit 9023, the source address that the 7th four-tuple that is used for carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, obtains the address of described home network and the port numbers of described home network in the mapping relations tabulation of the port numbers of the address of the port numbers of the network address of the ownership of having stored, home network, foreign network and foreign network;
First revises unit 9024, the source address modification that is used for described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
Wherein, this first modified module 902 specifically also comprises:
Transmitting element 9025, if be used for not finding described switching sign, send to switch identification request message to Control Server, carry the address of the described foreign network that described the 7th four-tuple comprises and the port numbers of described foreign network in the described switching identification request message;
Receiving element 9026 is used for receiving the response message that described Control Server sends, and described response message carries the address of home network corresponding to described portable terminal and the port numbers of home network;
Second revises unit 9027, the source address modification that is used for described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
Wherein, described response message also carries and switches sign, and described switching sign is for illustrating that described portable terminal is currently located at described foreign network, and this first modified module also comprises:
Second searches unit 9028, be used for after the response message of the described Control Server transmission of described reception, the address of the described home network that carries according to described response message and the port numbers of described home network, find out from the corresponding relation tabulation that the described network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described home network;
The 3rd revises unit 9029, is used for will described second searching switching sign that the unit finds out and is revised as the switching that described response message carries and identifies.
Further, this server also comprises:
Acquisition module 904, the first packet for the application layer generation of obtaining described server, described the first packet carries the 9th four-tuple, and the source address that described the 9th four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described home network are the port numbers of described home network;
The second modified module 905, described the 9th four-tuple that the first packet that is used for that described acquisition module is obtained carries is revised as the tenth four-tuple, and the source address that described the tenth four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described foreign network are the port numbers of described foreign network;
Sending module 906 is used for described the first Packet Generation to a described NAT server.
Wherein, this second modification unit 905 specifically comprises:
Second searches unit 9051, the destination address that described the 9th four-tuple that is used for carrying according to described the first packet comprises is the address of described home network and the port numbers of the described home network of destination slogan, find out from the corresponding relation tabulation that the network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described foreign network;
The second judging unit 9052 is judged described portable terminal according to described switching sign and is currently located at described foreign network;
Second acquisition unit 9053, the destination address that comprises according to described the 9th four-tuple is that address and the destination slogan of described home network is the port numbers of described home network, obtains the address of described foreign network and the port numbers of described foreign network from the mapping relations tabulation of the port numbers of the address of the port numbers of the home network address of having stored, home network, foreign network and foreign network;
The 4th revises unit 9054, the address that the destination address that described the 9th four-tuple is comprised is revised as described foreign network, and the port numbers that the destination slogan that described the 9th four-tuple comprises is revised as described foreign network, be revised as the tenth four-tuple to realize described the 9th four-tuple that described the first packet is carried.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, after the four-tuple that the packet that server modifications receives carries this packet is submitted to the application layer of server, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of server when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of server receives carries and portable terminal server when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
Embodiment 7
The embodiment of the invention provides a kind of Control Server of the transmission of data bag, and referring to Figure 10, this Control Server comprises:
The first receiver module 1001 is used for receiving the identification request message that described server sends, and described identification request message carries the address of foreign network corresponding to portable terminal and the port numbers of described foreign network;
Acquisition module 1002 is used for according to the address of foreign network corresponding to described portable terminal and the port numbers of described foreign network, obtains the address of home network corresponding to described portable terminal and the port numbers of described home network;
Sending module 1003, be used for sending response message to described server, described response message carries the address of described home network and the port numbers of described home network, and the packet that described server is sent described portable terminal according to the port numbers of the address of described home network and described home network is submitted to the application layer of described server.
Wherein, this acquisition module 1002 specifically comprises:
The first acquiring unit 10021, be used for the address of foreign network corresponding to the described portable terminal carry according to described identification request message and the port numbers of described foreign network, from the mapping relations tabulation of port numbers, the network address and the network terminal slogan of the address of the portable terminal stored, portable terminal, obtain described portable terminal in the address of foreign network and the port numbers of described portable terminal;
Second acquisition unit 10022, be used for according to described portable terminal in the address of the address of foreign network and the portable terminal stored, the identify label number ID of portable terminal and the corresponding relation that switches sign tabulate and obtain described portable terminal in the address of home network;
The 3rd acquiring unit 10023, in the address of home network and the port numbers of described portable terminal, from the mapping relations tabulation of the port numbers of the address of the portable terminal stored, portable terminal, the network address, network terminal slogan, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network according to described portable terminal.
Further, this Control Server also comprises:
The second receiver module 1004, be used for before the identification request message of the described server transmission of described reception, receive the mapping request message that network address translation NAT server sends, described mapping request message is carried the address of described portable terminal and the port numbers of described portable terminal;
Distribution module 1005 for the address of the described portable terminal that carries according to described mapping request message and the port numbers of described portable terminal, is distributed a network address and network terminal slogan;
The first memory module 1006 is used for storing the port numbers of the address of described portable terminal, described portable terminal, the described network address and described network terminal slogan into port numbers, the network address of address, the portable terminal of portable terminal, the mapping relations tabulation of network terminal slogan.
Further, this Control Server also comprises:
The 3rd receiver module 1007, be used for before the identification request message of the described server transmission of described reception, the login request message that mobile terminal receive sends, carry the ID of the address of described portable terminal, described portable terminal in the described login request message and switch sign, described switching sign is used for illustrating the network that described portable terminal is positioned at;
The second memory module 1008 is used for ID and the described switching of the address of described portable terminal, described portable terminal are identified the address that is stored in portable terminal, the ID of portable terminal and the corresponding relation tabulation of switching sign.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, server receives the response message that Control Server sends, server is revised the application layer of this packet being submitted to after the four-tuple that the packet that receives carries server according to the port numbers of the address of the home network that carries in the response message and home network, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of server when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of server receives carries and portable terminal server when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
Embodiment 8
The embodiment of the invention provides a kind of portable terminal of the transmission of data bag, and referring to Figure 11, this portable terminal comprises:
First memory 1101 and first processor 1102 are used for carrying out the method for following the transmission of data bag:
When portable terminal switches to foreign network from home network, receive the first packet that first network address transition NAT server sends, described the first packet carries the first four-tuple, and the source address that described the first four-tuple comprises is that the address of server, the port numbers that source port number is described server, the first address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The first four-tuple that described the first packet is carried is revised as the second four-tuple, described the second four-tuple is the four-tuple that the packet of the application layer reception of described portable terminal described portable terminal when described home network carries, and the source address that described the second four-tuple comprises is that the address of described server, port numbers, the destination address that source port number is described server are the port numbers of described portable terminal for presetting address and destination slogan;
Described the first packet is submitted to the application layer of described portable terminal.
When described portable terminal is positioned at described home network, receive the second packet that the 2nd NAT server sends, described the second packet carries the 3rd four-tuple, and the source address that described the 3rd four-tuple comprises is that the address of described server, the port numbers that source port number is described server, the second address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The 3rd four-tuple that described the second packet is carried is revised as described the second four-tuple, described the second packet is submitted to the application layer of described portable terminal.
Before the first packet that described reception the one NAT server sends, described method also comprises:
Obtain the 3rd packet of the generation of described portable terminal application layer, described the 3rd packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 4th four-tuple that described the 3rd packet is carried is revised as the May 4th tuple, and to give a described NAT server, the source address that described the May 4th tuple comprises with described the 3rd Packet Generation be that the first address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
Before the second packet that described reception the 2nd NAT server sends, described method also comprises:
Obtain the 4th packet of generation of the application layer of described portable terminal, described the 4th packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 4th four-tuple that described the 4th packet is carried is revised as the 6th four-tuple, and to give described the 2nd NAT server, the source address that described the 6th four-tuple comprises with described the 4th Packet Generation be that the second address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
Before the 3rd packet that the described application layer of obtaining described portable terminal generates, described method also comprises:
Obtain the first address of described portable terminal;
Send login request message to Control Server, the identify label number ID and first that described login request message is carried the first address of described portable terminal, described portable terminal switches sign, and described first switches sign is used for illustrating that described portable terminal is currently located at described foreign network.
Before the 4th packet that the described application layer of obtaining described portable terminal generates, described method also comprises:
Obtain the second address of described portable terminal;
Send login request message to Control Server, the ID and second that described login request message is carried the second address of described portable terminal, described portable terminal switches sign, and described second switches sign is used for illustrating that described portable terminal is currently located at described home network.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, after the four-tuple that the packet that the portable terminal modification receives carries this packet is submitted to the application layer of portable terminal, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of portable terminal when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of portable terminal receives carries and portable terminal portable terminal when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
Embodiment 9
The embodiment of the invention provides a kind of server of the transmission of data bag, and referring to Figure 12, this server comprises:
Second memory 1201 and the second processor 1202 are used for carrying out the method for following the transmission of data bag:
When portable terminal switches to foreign network from home network, receive the 3rd packet that first network address transition NAT server sends, described the 3rd packet carries the 7th four-tuple, and the source address that described the 7th four-tuple comprises is that the address of described foreign network, the port numbers that source port number is described foreign network, address and the destination slogan that destination address is server are the port numbers of described server;
The 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, described the 8th four-tuple is the four-tuple that packet that the application layer of described portable terminal described server when home network receives carries, and the source address that described the 8th four-tuple comprises is that the address of described home network, the port numbers that source port number is described home network, address and the destination slogan that destination address is server are the port numbers of described server;
Described the 3rd packet is submitted to the application layer of described server.
Described the 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, specifically comprises:
The source address that the 7th four-tuple of carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, searches the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign;
Switch sign if find, described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, judges described portable terminal according to described switching sign and is currently located at described foreign network;
The source address that the 7th four-tuple of carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, obtains the address of described home network and the port numbers of described home network in the mapping relations tabulation of the port numbers of the address of the port numbers of the network address of the ownership of having stored, home network, foreign network and foreign network;
The source address modification that described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
Described the 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, also comprises:
If find described switching sign, send and switch identification request message to Control Server, carry the address of the described foreign network that described the 7th four-tuple comprises and the port numbers of described foreign network in the described switching identification request message;
Receive the response message that described Control Server sends, described response message carries the address of home network corresponding to described portable terminal and the port numbers of home network;
The source address modification that described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
Described response message also carries and switches sign, and described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, after the response message that the described Control Server of described reception sends, also comprises:
The address of the described home network that carries according to described response message and the port numbers of described home network, find out from the corresponding relation tabulation that the described network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described home network;
The described switching sign that finds out is revised as the switching sign that described response message carries.
Obtain the first packet of the application layer generation of described server, described the first packet carries the 9th four-tuple, and the source address that described the 9th four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described home network are the port numbers of described home network;
Described the 9th four-tuple that described the first packet is carried is revised as the tenth four-tuple, and the source address that described the tenth four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described foreign network are the port numbers of described foreign network;
Give a described NAT server with described the first Packet Generation.
Described the 9th four-tuple that described the first packet is carried is revised as the tenth four-tuple, specifically comprises:
The destination address that described the 9th four-tuple of carrying according to described the first packet comprises is the address of described home network and the port numbers of the described home network of destination slogan, find out from the corresponding relation tabulation that the network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described foreign network;
Judge described portable terminal according to described switching sign and be currently located at described foreign network;
The destination address that comprises according to described the 9th four-tuple is that address and the destination slogan of described home network is the port numbers of described home network, obtains the address of described foreign network and the port numbers of described foreign network from the mapping relations tabulation of the port numbers of the address of the port numbers of the home network address of having stored, home network, foreign network and foreign network;
The address that the destination address that described the 9th four-tuple is comprised is revised as described foreign network, and the port numbers that the destination slogan that described the 9th four-tuple comprises is revised as described foreign network, be revised as the tenth four-tuple to realize described the 9th four-tuple that described the first packet is carried.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, after the four-tuple that the packet that server modifications receives carries this packet is submitted to the application layer of server, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of server when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of server receives carries and portable terminal server when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
Embodiment 10
The embodiment of the invention provides a kind of Control Server of the transmission of data bag, and referring to Figure 13, this Control Server comprises:
The 3rd memory 1301 and the 3rd processor 1302 are used for carrying out the method for following the transmission of data bag:
Receive the identification request message that described server sends, described identification request message carries the address of foreign network corresponding to portable terminal and the port numbers of described foreign network;
According to the address of foreign network corresponding to described portable terminal and the port numbers of described foreign network, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network;
Send response message to described server, described response message carries the address of described home network and the port numbers of described home network, and the packet that described server is sent described portable terminal according to the port numbers of the address of described home network and described home network is submitted to the application layer of described server.
Obtain the address of home network corresponding to described portable terminal and the port numbers of described home network, specifically comprise:
The address of the foreign network that the described portable terminal that carries according to described identification request message is corresponding and the port numbers of described foreign network are obtained described portable terminal in the address of foreign network and the port numbers of described portable terminal from the mapping relations tabulation of port numbers, the network address and the network terminal slogan of the address of the portable terminal stored, portable terminal;
According to described portable terminal in the address of the address of foreign network and the portable terminal stored, the identify label number ID of portable terminal and the corresponding relation tabulation of switching sign obtain described portable terminal in the address of home network;
In the address of home network and the port numbers of described portable terminal, from the mapping relations tabulation of the port numbers of the address of the portable terminal stored, portable terminal, the network address, network terminal slogan, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network according to described portable terminal.
Before the identification request message that the described server of described reception sends, described method also comprises:
Receive the mapping request message that network address translation NAT server sends, described mapping request message is carried the address of described portable terminal and the port numbers of described portable terminal;
The address of the described portable terminal that carries according to described mapping request message and the port numbers of described portable terminal are distributed a network address and network terminal slogan;
The port numbers of the address of described portable terminal, described portable terminal, the described network address and described network terminal slogan are stored in the mapping relations tabulation of port numbers, the network address, network terminal slogan of address, the portable terminal of portable terminal.
Before the identification request message that the described server of described reception sends, described method also comprises:
The login request message that mobile terminal receive sends is carried the ID of the address of described portable terminal, described portable terminal and is switched sign in the described login request message, described switching sign is used for illustrating the network that described portable terminal is positioned at;
The ID of the address of described portable terminal, described portable terminal and described switching sign are stored in portable terminal address, portable terminal ID and switch in the corresponding relation tabulation of sign.
In embodiments of the present invention, when portable terminal switches to foreign network from home network, server receives the response message that Control Server sends, server is revised the application layer of this packet being submitted to after the four-tuple that the packet that receives carries server according to the port numbers of the address of the home network that carries in the response message and home network, so that the four-tuple that the packet of the four-tuple that the packet that obtains after revising carries and this portable terminal application layer reception of server when home network carries is identical, because when portable terminal switches to foreign network from home network, the four-tuple that the packet that the application layer of the four-tuple that the packet that the application layer of server receives carries and portable terminal server when home network receives carries is identical, and business is not interrupted when having guaranteed so that portable terminal switches to foreign network from home network.
The all or part of step that one of ordinary skill in the art will appreciate that realization above-described embodiment can be finished by hardware, also can come the relevant hardware of instruction to finish by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
The above only is preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (35)

1. the method for a transmission of data bag is characterized in that, described method comprises:
When portable terminal switches to foreign network from home network, receive the first packet that first network address transition NAT server sends, described the first packet carries the first four-tuple, and the source address that described the first four-tuple comprises is that the address of server, the port numbers that source port number is described server, the first address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The first four-tuple that described the first packet is carried is revised as the second four-tuple, described the second four-tuple is the four-tuple that the packet of the application layer reception of described portable terminal described portable terminal when described home network carries, and the source address that described the second four-tuple comprises is that the address of described server, port numbers, the destination address that source port number is described server are the port numbers of described portable terminal for presetting address and destination slogan;
Described the first packet is submitted to the application layer of described portable terminal.
2. the method for claim 1 is characterized in that, described method also comprises:
When described portable terminal is positioned at described home network, receive the second packet that the 2nd NAT server sends, described the second packet carries the 3rd four-tuple, and the source address that described the 3rd four-tuple comprises is that the address of described server, the port numbers that source port number is described server, the second address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The 3rd four-tuple that described the second packet is carried is revised as described the second four-tuple, described the second packet is submitted to the application layer of described portable terminal.
3. the method for claim 1 is characterized in that, before the first packet that described reception the one NAT server sends, described method also comprises:
Obtain the 3rd packet of the generation of described portable terminal application layer, described the 3rd packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 4th four-tuple that described the 3rd packet is carried is revised as the May 4th tuple, and to give a described NAT server, the source address that described the May 4th tuple comprises with described the 3rd Packet Generation be that the first address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
4. method as claimed in claim 2 is characterized in that, before the second packet that described reception the 2nd NAT server sends, described method also comprises:
Obtain the 4th packet of generation of the application layer of described portable terminal, described the 4th packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 4th four-tuple that described the 4th packet is carried is revised as the 6th four-tuple, and to give described the 2nd NAT server, the source address that described the 6th four-tuple comprises with described the 4th Packet Generation be that the second address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
5. method as claimed in claim 3 is characterized in that, before the 3rd packet that the described application layer of obtaining described portable terminal generates, described method also comprises:
Obtain the first address of described portable terminal;
Send login request message to Control Server, the identify label number ID and first that described login request message is carried the first address of described portable terminal, described portable terminal switches sign, and described first switches sign is used for illustrating that described portable terminal is currently located at described foreign network.
6. method as claimed in claim 4 is characterized in that, before the 4th packet that the described application layer of obtaining described portable terminal generates, described method also comprises:
Obtain the second address of described portable terminal;
Send login request message to Control Server, the ID and second that described login request message is carried the second address of described portable terminal, described portable terminal switches sign, and described second switches sign is used for illustrating that described portable terminal is currently located at described home network.
7. the method for a transmission of data bag is characterized in that, described method comprises:
When portable terminal switches to foreign network from home network, receive the 3rd packet that first network address transition NAT server sends, described the 3rd packet carries the 7th four-tuple, and the source address that described the 7th four-tuple comprises is that the address of described foreign network, the port numbers that source port number is described foreign network, address and the destination slogan that destination address is server are the port numbers of described server;
The 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, described the 8th four-tuple is the four-tuple that packet that the application layer of described portable terminal described server when home network receives carries, and the source address that described the 8th four-tuple comprises is that the address of described home network, the port numbers that source port number is described home network, address and the destination slogan that destination address is server are the port numbers of described server;
Described the 3rd packet is submitted to the application layer of described server.
8. method as claimed in claim 7 is characterized in that, described the 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, specifically comprises:
The source address that the 7th four-tuple of carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, searches the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign;
Switch sign if find, described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, judges described portable terminal according to described switching sign and is currently located at described foreign network;
The source address that the 7th four-tuple of carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, obtains the address of described home network and the port numbers of described home network in the mapping relations tabulation of the port numbers of the address of the port numbers of the network address of the ownership of having stored, home network, foreign network and foreign network;
The source address modification that described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
9. method as claimed in claim 8 is characterized in that, described the 7th four-tuple that described the 3rd packet is carried is revised as the 8th four-tuple, also comprises:
If find described switching sign, send and switch identification request message to Control Server, carry the address of the described foreign network that described the 7th four-tuple comprises and the port numbers of described foreign network in the described switching identification request message;
Receive the response message that described Control Server sends, described response message carries the address of home network corresponding to described portable terminal and the port numbers of home network;
The source address modification that described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
10. method as claimed in claim 8, it is characterized in that, described response message also carries and switches sign, and described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, after the response message that the described Control Server of described reception sends, also comprise:
The address of the described home network that carries according to described response message and the port numbers of described home network, find out from the corresponding relation tabulation that the described network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described home network;
The described switching sign that finds out is revised as the switching sign that described response message carries.
11. method as claimed in claim 7 is characterized in that, described method also comprises:
Obtain the first packet of the application layer generation of described server, described the first packet carries the 9th four-tuple, and the source address that described the 9th four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described home network are the port numbers of described home network;
Described the 9th four-tuple that described the first packet is carried is revised as the tenth four-tuple, and the source address that described the tenth four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described foreign network are the port numbers of described foreign network;
Give a described NAT server with described the first Packet Generation.
12. method as claimed in claim 11 is characterized in that, described the 9th four-tuple that described the first packet is carried is revised as the tenth four-tuple, specifically comprises:
The destination address that described the 9th four-tuple of carrying according to described the first packet comprises is the address of described home network and the port numbers of the described home network of destination slogan, find out from the corresponding relation tabulation that the network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described foreign network;
Judge described portable terminal according to described switching sign and be currently located at described foreign network;
The destination address that comprises according to described the 9th four-tuple is that address and the destination slogan of described home network is the port numbers of described home network, obtains the address of described foreign network and the port numbers of described foreign network from the mapping relations tabulation of the port numbers of the address of the port numbers of the home network address of having stored, home network, foreign network and foreign network;
The address that the destination address that described the 9th four-tuple is comprised is revised as described foreign network, and the port numbers that the destination slogan that described the 9th four-tuple comprises is revised as described foreign network, be revised as the tenth four-tuple to realize described the 9th four-tuple that described the first packet is carried.
13. the method for a transmission of data bag is characterized in that, described method comprises:
Receive the identification request message that described server sends, described identification request message carries the address of foreign network corresponding to portable terminal and the port numbers of described foreign network;
According to the address of foreign network corresponding to described portable terminal and the port numbers of described foreign network, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network;
Send response message to described server, described response message carries the address of described home network and the port numbers of described home network, and the packet that described server is sent described portable terminal according to the port numbers of the address of described home network and described home network is submitted to the application layer of described server.
14. method as claimed in claim 13 is characterized in that, obtains the address of home network corresponding to described portable terminal and the port numbers of described home network, specifically comprises:
The address of the foreign network that the described portable terminal that carries according to described identification request message is corresponding and the port numbers of described foreign network are obtained described portable terminal in the address of foreign network and the port numbers of described portable terminal from the mapping relations tabulation of port numbers, the network address and the network terminal slogan of the address of the portable terminal stored, portable terminal;
According to described portable terminal in the address of the address of foreign network and the portable terminal stored, the identify label number ID of portable terminal and the corresponding relation tabulation of switching sign obtain described portable terminal in the address of home network;
In the address of home network and the port numbers of described portable terminal, from the mapping relations tabulation of the port numbers of the address of the portable terminal stored, portable terminal, the network address, network terminal slogan, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network according to described portable terminal.
15. method as claimed in claim 13 is characterized in that, before the identification request message that the described server of described reception sends, described method also comprises:
Receive the mapping request message that network address translation NAT server sends, described mapping request message is carried the address of described portable terminal and the port numbers of described portable terminal;
The address of the described portable terminal that carries according to described mapping request message and the port numbers of described portable terminal are distributed a network address and network terminal slogan;
The port numbers of the address of described portable terminal, described portable terminal, the described network address and described network terminal slogan are stored in the mapping relations tabulation of port numbers, the network address, network terminal slogan of address, the portable terminal of portable terminal.
16. method as claimed in claim 13 is characterized in that, before the identification request message that the described server of described reception sends, described method also comprises:
The login request message that mobile terminal receive sends is carried the ID of the address of described portable terminal, described portable terminal and is switched sign in the described login request message, described switching sign is used for illustrating the network that described portable terminal is positioned at;
The ID of the address of described portable terminal, described portable terminal and described switching sign are stored in portable terminal address, portable terminal ID and switch in the corresponding relation tabulation of sign.
17. the portable terminal of a transmission of data bag is characterized in that, described portable terminal comprises:
The first receiver module, be used for when portable terminal switches to foreign network from home network, receive the first packet that first network address transition NAT server sends, described the first packet carries the first four-tuple, and the source address that described the first four-tuple comprises is that the address of server, the port numbers that source port number is described server, the first address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
The first modified module, be used for the first four-tuple that the first packet that described the first receiver module receives carries is revised as the second four-tuple, described the second four-tuple is the four-tuple that the packet of the application layer reception of described portable terminal described portable terminal when described home network carries, and the source address that described the second four-tuple comprises is that the address of described server, port numbers, the destination address that source port number is described server are the port numbers of described portable terminal for presetting address and destination slogan;
First submits module to, is used for described the first packet is submitted to the application layer of described portable terminal.
18. portable terminal as claimed in claim 17 is characterized in that, described portable terminal also comprises:
The second receiver module, be used for when described portable terminal is positioned at described home network, receive the second packet that the 2nd NAT server sends, described the second packet carries the 3rd four-tuple, and the source address that described the 3rd four-tuple comprises is that the address of described server, the port numbers that source port number is described server, the second address and the destination slogan that destination address is described portable terminal are the port numbers of described portable terminal;
Second submits module to, is used for the 3rd four-tuple that the second packet that described the second receiver module receives carries is revised as described the second four-tuple, described the second packet is submitted to the application layer of described portable terminal.
19. portable terminal as claimed in claim 17 is characterized in that, described portable terminal also comprises:
The first acquisition module, be used for before the first packet of described reception the one NAT server transmission, obtain the 3rd packet of generation of the application layer of described portable terminal, described the 3rd packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The second modified module, the 4th four-tuple that the 3rd packet that is used for that described the first acquisition module is obtained carries is revised as the May 4th tuple, and to give a described NAT server, the source address that described the May 4th tuple comprises with described the 3rd Packet Generation be that the first address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
20. portable terminal as claimed in claim 18 is characterized in that, described portable terminal also comprises:
The second acquisition module, be used for before the second packet of described reception the 2nd NAT server transmission, obtain the 4th packet of the application layer generation of described portable terminal, described the 4th packet carries the 4th four-tuple, and the source address that described the 4th four-tuple comprises is that described default address, source port number are that the port numbers of described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server;
The 3rd modified module, the 4th four-tuple that the 4th packet that is used for that described the second acquisition module is obtained carries is revised as the 6th four-tuple, and to give described the 2nd NAT server, the source address that described the 6th four-tuple comprises with described the 4th Packet Generation be that the second address of described portable terminal, the port numbers that source port number is described portable terminal, address and the destination slogan that destination address is described server are the port numbers of described server.
21. portable terminal as claimed in claim 19 is characterized in that, described portable terminal also comprises:
The 3rd acquisition module is used for before the 3rd packet that the described application layer of obtaining described portable terminal generates the first address that obtains described portable terminal;
The first sending module, be used for sending login request message to Control Server, the identify label number ID and first that described login request message is carried the first address of described portable terminal, described portable terminal switches sign, and described first switches sign is used for illustrating that described portable terminal is currently located at described foreign network.
22. portable terminal as claimed in claim 20 is characterized in that, described portable terminal also comprises:
The 4th acquisition module is used for before the 4th packet that the described application layer of obtaining described portable terminal generates the second address that obtains described portable terminal;
The second sending module, be used for sending login request message to Control Server, the ID and second that described login request message is carried the second address of described portable terminal, described portable terminal switches sign, and described second switches sign is used for illustrating that described portable terminal is currently located at described home network.
23. the server of a transmission of data bag is characterized in that, described server comprises:
Receiver module, be used for when portable terminal switches to foreign network from home network, receive the 3rd packet that first network address transition NAT server sends, described the 3rd packet carries the 7th four-tuple, and the source address that described the 7th four-tuple comprises is that the address of described foreign network, the port numbers that source port number is described foreign network, address and the destination slogan that destination address is server are the port numbers of described server;
The first modified module, be used for described the 7th four-tuple that the 3rd packet that described receiver module receives carries is revised as the 8th four-tuple, described the 8th four-tuple is the four-tuple that packet that the application layer of described portable terminal described server when home network receives carries, and the source address that described the 8th four-tuple comprises is that the address of described home network, the port numbers that source port number is described home network, address and the destination slogan that destination address is server are the port numbers of described server;
Submit module to, be used for described the 3rd packet is submitted to the application layer of described server.
24. server as claimed in claim 23 is characterized in that, described the first modified module specifically comprises:
First searches the unit, the source address that the 7th four-tuple that is used for carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, searches the network address, the network terminal slogan of having stored and the corresponding relation tabulation of switching sign;
The first judging unit switches sign if be used for finding, and described switching sign is used for illustrating that described portable terminal is currently located at described foreign network, judges described portable terminal according to described switching sign and is currently located at described foreign network;
The first acquiring unit, the source address that the 7th four-tuple that is used for carrying according to described the 3rd packet comprises is that address and the source port number of described foreign network is the port numbers of described foreign network, obtains the address of described home network and the port numbers of described home network in the mapping relations tabulation of the port numbers of the address of the port numbers of the network address of the ownership of having stored, home network, foreign network and foreign network;
First revises the unit, the source address modification that is used for described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
25. server as claimed in claim 24 is characterized in that, described the first modified module specifically also comprises:
Transmitting element, if be used for not finding described switching sign, send to switch identification request message to Control Server, carry the address of the described foreign network that described the 7th four-tuple comprises and the port numbers of described foreign network in the described switching identification request message;
Receiving element is used for receiving the response message that described Control Server sends, and described response message carries the address of home network corresponding to described portable terminal and the port numbers of home network;
Second revises the unit, the source address modification that is used for described the 7th four-tuple is comprised is the address of described home network, and the port numbers that the source port number that described the 7th four-tuple comprises is revised as described home network, be revised as the 8th four-tuple to realize described the 7th four-tuple that described the 3rd packet is carried.
26. server as claimed in claim 24 is characterized in that, described response message also carries and switches sign, and described switching sign is for illustrating that described portable terminal is currently located at described foreign network, and described the first modified module also comprises:
Second searches the unit, be used for after the response message of the described Control Server transmission of described reception, the address of the described home network that carries according to described response message and the port numbers of described home network, find out from the corresponding relation tabulation that the described network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described home network;
The 3rd revises the unit, is used for will described second searching switching sign that the unit finds out and is revised as the switching that described response message carries and identifies.
27. server as claimed in claim 23 is characterized in that, described server also comprises:
Acquisition module, the first packet for the application layer generation of obtaining described server, described the first packet carries the 9th four-tuple, and the source address that described the 9th four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described home network are the port numbers of described home network;
The second modified module, described the 9th four-tuple that the first packet that is used for that described acquisition module is obtained carries is revised as the tenth four-tuple, and the source address that described the tenth four-tuple comprises is that the address of described server, the port numbers that source port number is described server, address and the destination slogan that destination address is described foreign network are the port numbers of described foreign network;
Sending module is used for described the first Packet Generation to a described NAT server.
28. server as claimed in claim 27 is characterized in that, described second revises the unit specifically comprises:
The 3rd searches the unit, the destination address that described the 9th four-tuple that is used for carrying according to described the first packet comprises is the address of described home network and the port numbers of the described home network of destination slogan, find out from the corresponding relation tabulation that the network address, network terminal slogan and the switching of having stored identifies and switch sign, described switching identifies for illustrating that described portable terminal is currently located at described foreign network;
The second judging unit is judged described portable terminal according to described switching sign and is currently located at described foreign network;
Second acquisition unit, the destination address that comprises according to described the 9th four-tuple is that address and the destination slogan of described home network is the port numbers of described home network, obtains the address of described foreign network and the port numbers of described foreign network from the mapping relations tabulation of the port numbers of the address of the port numbers of the home network address of having stored, home network, foreign network and foreign network;
The 4th revises the unit, the address that the destination address that described the 9th four-tuple is comprised is revised as described foreign network, and the port numbers that the destination slogan that described the 9th four-tuple comprises is revised as described foreign network, be revised as the tenth four-tuple to realize described the 9th four-tuple that described the first packet is carried.
29. the Control Server of a transmission of data bag is characterized in that, described Control Server comprises:
The first receiver module is used for receiving the identification request message that described server sends, and described identification request message carries the address of foreign network corresponding to portable terminal and the port numbers of described foreign network;
Acquisition module is used for according to the address of foreign network corresponding to described portable terminal and the port numbers of described foreign network, obtains the address of home network corresponding to described portable terminal and the port numbers of described home network;
Sending module, be used for sending response message to described server, described response message carries the address of described home network and the port numbers of described home network, and the packet that described server is sent described portable terminal according to the port numbers of the address of described home network and described home network is submitted to the application layer of described server.
30. Control Server as claimed in claim 29 is characterized in that, described acquisition module specifically comprises:
The first acquiring unit, be used for the address of foreign network corresponding to the described portable terminal carry according to described identification request message and the port numbers of described foreign network, from the mapping relations tabulation of port numbers, the network address and the network terminal slogan of the address of the portable terminal stored, portable terminal, obtain described portable terminal in the address of foreign network and the port numbers of described portable terminal;
Second acquisition unit, be used for according to described portable terminal in the address of the address of foreign network and the portable terminal stored, the identify label number ID of portable terminal and the corresponding relation that switches sign tabulate and obtain described portable terminal in the address of home network;
The 3rd acquiring unit, in the address of home network and the port numbers of described portable terminal, from the mapping relations tabulation of the port numbers of the address of the portable terminal stored, portable terminal, the network address, network terminal slogan, obtain the address of home network corresponding to described portable terminal and the port numbers of described home network according to described portable terminal.
31. Control Server as claimed in claim 29 is characterized in that, described Control Server also comprises:
The second receiver module, be used for before the identification request message of the described server transmission of described reception, receive the mapping request message that network address translation NAT server sends, described mapping request message is carried the address of described portable terminal and the port numbers of described portable terminal;
Distribution module for the address of the described portable terminal that carries according to described mapping request message and the port numbers of described portable terminal, is distributed a network address and network terminal slogan;
The first memory module is used for storing the port numbers of the address of described portable terminal, described portable terminal, the described network address and described network terminal slogan into port numbers, the network address of address, the portable terminal of portable terminal, the mapping relations tabulation of network terminal slogan.
32. Control Server as claimed in claim 29 is characterized in that, described Control Server also comprises:
The 3rd receiver module, be used for before the identification request message of the described server transmission of described reception, the login request message that mobile terminal receive sends, carry the ID of the address of described portable terminal, described portable terminal in the described login request message and switch sign, described switching sign is used for illustrating the network that described portable terminal is positioned at;
The second memory module is used for ID and the described switching of the address of described portable terminal, described portable terminal are identified the address that is stored in portable terminal, the ID of portable terminal and the corresponding relation tabulation of switching sign.
33. the portable terminal of a transmission of data bag is characterized in that, described portable terminal comprises first memory and first processor, is used for carrying out the method such as the described a kind of the transmission of data bag of each claim of claim 1 to 6.
34. the server of a transmission of data bag is characterized in that, described server comprises second memory and the second processor, is used for carrying out the method such as the described a kind of the transmission of data bag of each claim of claim 7 to 12.
35. the Control Server of a transmission of data bag is characterized in that, described Control Server comprises the 3rd memory and the 3rd processor, is used for carrying out the method such as the described a kind of the transmission of data bag of each claim of claim 13 to 16.
CN201210562464.2A 2012-12-21 2012-12-21 A kind of method and apparatus transmitting packet Active CN103067533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210562464.2A CN103067533B (en) 2012-12-21 2012-12-21 A kind of method and apparatus transmitting packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210562464.2A CN103067533B (en) 2012-12-21 2012-12-21 A kind of method and apparatus transmitting packet

Publications (2)

Publication Number Publication Date
CN103067533A true CN103067533A (en) 2013-04-24
CN103067533B CN103067533B (en) 2016-08-17

Family

ID=48109986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210562464.2A Active CN103067533B (en) 2012-12-21 2012-12-21 A kind of method and apparatus transmitting packet

Country Status (1)

Country Link
CN (1) CN103067533B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338488A (en) * 2013-06-21 2013-10-02 华为技术有限公司 Network switching method, terminal, controller, gateway and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070047585A1 (en) * 2005-06-23 2007-03-01 Xds Inc. Methods and apparatus for network address change for mobile devices
CN101199189A (en) * 2004-12-01 2008-06-11 诺基亚西门子通信有限责任两合公司 Network address translation by the home network domain of a moving network
CN101330460A (en) * 2008-05-13 2008-12-24 武汉理工大学 New construction model and routing method for mobile IP
US20110142005A1 (en) * 2009-12-15 2011-06-16 Electronics And Telecommunications Research Institute Method and system for fast layer 3 hand-over

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101199189A (en) * 2004-12-01 2008-06-11 诺基亚西门子通信有限责任两合公司 Network address translation by the home network domain of a moving network
US20070047585A1 (en) * 2005-06-23 2007-03-01 Xds Inc. Methods and apparatus for network address change for mobile devices
CN101330460A (en) * 2008-05-13 2008-12-24 武汉理工大学 New construction model and routing method for mobile IP
US20110142005A1 (en) * 2009-12-15 2011-06-16 Electronics And Telecommunications Research Institute Method and system for fast layer 3 hand-over

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103338488A (en) * 2013-06-21 2013-10-02 华为技术有限公司 Network switching method, terminal, controller, gateway and system
WO2014201868A1 (en) * 2013-06-21 2014-12-24 华为技术有限公司 Method, terminal, controller, gateway, and system for network switchover
CN103338488B (en) * 2013-06-21 2016-03-09 华为技术有限公司 Method for switching network, terminal, controller, gateway and system
US9723521B2 (en) 2013-06-21 2017-08-01 Huawei Technologies Co., Ltd. Network handover method, terminal, controller, gateway, and system

Also Published As

Publication number Publication date
CN103067533B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
US10939404B2 (en) User-equipment location area updating method, access network entity, user equipment and core network entity
US20190174321A1 (en) Network slice selection method, device and system
US20170244792A1 (en) Power-Line Carrier Terminal Control Apparatus, System, and Method
US20140022894A1 (en) Network system, switch and connected terminal detection method
CN103079286A (en) Method and device for intelligently disconnecting wifi (wireless fidelity) hot points
CN101764751A (en) Method, system and equipment for forwarding roaming messages for wireless user terminal travelling across VLAN
US11847091B2 (en) Data transmission method and device for network on chip and electronic apparatus
US11528184B2 (en) Processing method, device and apparatus for mesh network, and storage medium
US10764821B2 (en) System and method for wireless network selection
CN104426816B (en) A kind of virtual machine communication method and device
US10511956B2 (en) Device association method and related device
CN104601561A (en) Registration method of network, registration terminal, registration device and home network
CN103067533A (en) Data packet transmitting method and data packet transmitting device
CN105812495A (en) Message forwarding method and device
CN109219046A (en) Method for switching network and device
CN112770370B (en) Method and device for intelligent equipment to access network and intelligent equipment
US11871464B2 (en) Unified graphical user interface for devices in a wireless network
CN106550349B (en) Management method, server and the service node of subscription data based on group
CN104486252B (en) A kind of method and device of thin-client access standard client
CN116226505A (en) Service processing device and equipment
CN110341545B (en) Method, system and storage medium for displaying battery parameters
CN104427553A (en) Multicast group optimization method and anchor point
CN105682181A (en) Local area network access method, gateway equipment and user equipment
CN109429215B (en) Data transmission method, related device and computer readable storage medium
CN105813082A (en) Access method and access apparatus of wireless local area network hotspot

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200616

Address after: No. 228, Xinzhou Road, Xinwu District, Wuxi City, Jiangsu Province, 214000

Patentee after: Wuxi zhuoneng Big Data Technology Co.,Ltd.

Address before: 625, room 269, Connaught platinum Plaza, No. 518101, Qianjin Road, Xin'an street, Shenzhen, Guangdong, Baoan District

Patentee before: SHENZHEN SHANGGE INTELLECTUAL PROPERTY SERVICE Co.,Ltd.

Effective date of registration: 20200616

Address after: 625, room 269, Connaught platinum Plaza, No. 518101, Qianjin Road, Xin'an street, Shenzhen, Guangdong, Baoan District

Patentee after: SHENZHEN SHANGGE INTELLECTUAL PROPERTY SERVICE Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.