Summary of the invention
In view of this, the present invention provides a kind of wireless roaming method and device, the address to solve because of STA can change
The problem of leading to STA service disconnection.
Specifically, the present invention is achieved through the following technical solutions:
A kind of wireless roaming method, the method are applied to the first AC, and the first AC is connected with MC, and the MC is also connected with
2nd AC, which comprises
After the STA establishes session connection by the first private net address and destination server, the first AC receive by
The corresponding second level NAT table item of the session connection that 2nd AC is sent, the second level NAT table item include the of the STA
The corresponding relationship of one private net address and the first public network address;
It is that the session connection distributes the second public network address according to first private net address, establishes new second level NAT table
, the new second level NAT table item includes that first private net address of the STA and the corresponding of second public network address are closed
System;
After the STA roams into the first AC and certification passes through, send the second public network address of the STA to
MC, so that second public network address replaces first public network address private as the level-one in the level-one NAT table item of the MC
Net address;
When receiving the data message that the STA is sent, which is forwarded according to the new second level NAT table item.
Further, before distributing the second public network address for the session connection, the method also includes:
Check whether first private net address is occupied;
If so, the 2nd AC is notified to replace first private net address.
It is further, described that the data message is forwarded according to the new second level NAT table item, comprising:
When receiving the data message that the STA is sent, according to the new second level NAT table item by the source of the data message
Address is substituted for second public network address, and is forwarded to MC.
Based on identical design, the present invention also provides a kind of wireless roaming method, the method is applied to the 2nd AC, described
2nd AC is connected with MC, and the MC is also connected with the first AC, which comprises
When receiving the Address requests message that the STA is sent, the first private net address is distributed for the STA, so that described
STA establishes session connection by first private net address and destination server;With distributing the first public network for the session connection
Location;
Second level NAT table item is established, the second level NAT table item includes first private net address and described of the STA
The corresponding relationship of one public network address;
The second level NAT table item is synchronized to the first AC, so that the first AC is according in the second level NAT table item
First private net address be the second public network address of distribution, and make second public network address instead of first public network
Location is as the level-one private net address in the level-one NAT table item of the MC.
Further, described to distribute the first private network for the STA as the 2nd AC as Dynamic Host Configuration Protocol server when acting on behalf of
Address, further includes:
The first private net address of the STA is requested to the Dynamic Host Configuration Protocol server according to the MAC Address of the STA.
Based on identical design, the present invention also provides a kind of radio roaming device, described device is applied to the first AC, described
First AC is connected with MC, and the MC is also connected with the 2nd AC, and described device includes:
List item receiving unit, for after the STA establishes session connection by the first private net address and destination server,
The corresponding second level NAT table item of the session connection sent by the 2nd AC is received, the second level NAT table item includes described
The first private net address of STA and the corresponding relationship of the first public network address;
Allocation unit, for being that the session connection distributes the second public network address according to first private net address,
New second level NAT table item is established, the new second level NAT table item includes first private net address and described of the STA
The corresponding relationship of two public network addresses;
Address transmission unit, for after the STA roams into the first AC and authenticates and pass through, by the of the STA
Two public network addresses are sent to the MC so that second public network address replace first public network address as the MC one
Level-one private net address in grade NAT table item;
Message retransmission unit, for when receiving the data message that the STA is sent, according to the new second level NAT table
Item forwards the data message.
Further, described device further include:
Address check unit, for before distributing the second public network address for the session connection, checking that described first is private
Whether net address is occupied;If so, the 2nd AC is notified to replace first private net address.
Further, the message retransmission unit, specifically for when receiving the data message that the STA is sent, according to
The source address of the data message is substituted for second public network address by the new second level NAT table item, and is forwarded to MC.
Based on identical design, the present invention also provides a kind of radio roaming device, described device is applied to the 2nd AC, described
2nd AC is connected with MC, and the MC is also connected with the first AC, and described device includes:
Allocation unit, for distributing first for the STA when receiving the Address requests message that the STA is sent
Private net address, so that the STA establishes session connection by first private net address and destination server;For session company
Connect the first public network address of distribution;
List item establishes unit, and for establishing second level NAT table item, the second level NAT table item includes described the first of the STA
The corresponding relationship of private net address and first public network address;
List item synchronization unit, for the second level NAT table item to be synchronized to the first AC so that the first AC according to
First private net address in the second level NAT table item is the second public network address of distribution, and makes second public network address
Instead of first public network address as the level-one private net address in the level-one NAT table item of the MC.
Further, as the 2nd AC as Dynamic Host Configuration Protocol server when acting on behalf of,
The allocation unit is also used to according to the MAC Address of the STA to described in Dynamic Host Configuration Protocol server request
The first private net address of STA.
It can be seen that the present invention can be by establishing second level NAT table item on the 2nd AC with saving the first private network of STA
The corresponding relationship of location and the first public network address, then the second level NAT table item is synchronized on the first AC, and the first AC can be according to
One private net address distributes the second public network address, establishes new second level NAT table item, and contact with the level-one NAT table item foundation on MC,
To guarantee to can be realized NAT conversion on MC.Therefore present invention can ensure that the first private net address of STA will not in roam procedure
It changes, so as to avoid the problem of service interruption in STA roaming, promotes user experience.
Specific embodiment
Referring to Figure 1, it is group-network construction figure in a kind of illustrative embodiments of the present invention, wherein AC1, AC2 belong to together
The different grouping of one ESS, and three layer intercommunications can be realized by MC.Under existing network environment, due to AC1 and AC2
Come to distribute address for STA as Dynamic Host Configuration Protocol server, but the network segment and difference of AC1 and AC2 distribution address, such as AC1 network segment is
1.0.0.1 AC2 network segment is 2.0.0.1.Assuming that STA is under AP1 before roaming, the corresponding Dynamic Host Configuration Protocol server of the STA is AC1/
1.0.0.1, when STA and destination server establish session connection, the private net address being assigned to is 1.0.0.100, and gateway is
1.0.0.1.When the STA is roamed under AP2, the corresponding Dynamic Host Configuration Protocol server of the STA is AC2/2.0.0.1, and gateway should be
2.0.0.1, since original private net address 1.0.0.100 cannot have been used, STA then needs to obtain to AC2 applied address again
Private net address 2.0.0.100 and gateway 2.0.0.1 newly is obtained, it could normal use network service.
For the NAT disposed on MC, because the private net address of the STA is changed, MC needs to build again for it
Vertical NAT table item, therefore the STA may be mapped to other public network addresses and port up, so that, destination server is had to
It re-establishes and connect with STA interrupting service, the problems such as login is lost is likely to result in during interruption, seriously affects user experience.
To solve the above-mentioned problems, the present invention can save the of STA by establishing second level NAT table item on the 2nd AC
The corresponding relationship of one private net address and the first public network address, then the second level NAT table item is synchronized on the first AC, and the first AC
The second public network address can be distributed according to the first private net address, establish new second level NAT table item, and with the level-one NAT table item on MC
Connection is established, to guarantee to can be realized NAT conversion on MC.Therefore present invention can ensure that the first private net address of STA is roaming
It will not change in the process, so as to avoid the problem of service interruption in STA roaming, promote user experience.
Referring to FIG. 2, be a kind of process flow diagram of one of illustrative embodiments of present invention wireless roaming method,
This method is applied to the first AC, and the first AC is connected with MC, and the MC is also connected with the 2nd AC, this method comprises:
Step 201, after the STA establishes session connection by the first private net address and destination server, described first
AC receives the corresponding second level NAT table item of the session connection sent by the 2nd AC, and the second level NAT table item includes described
The first private net address of STA and the corresponding relationship of the first public network address;
In the present embodiment, after establishing session connection due to STA and destination server, the 2nd AC can build for the session connection
Vertical second level NAT table item, and can be synchronized on the first AC, therefore the first AC can receive the second level NAT table item, including institute
State the first private net address of STA and the corresponding relationship of the first public network address.In the present invention, the 2nd AC can represent the ESS
In support roaming function in addition to the first AC AC, be not limited only to specific a certain AC.
Step 202 is that the session connection distributes the second public network address according to first private net address, establishes new two
Grade NAT table item, the new second level NAT table item includes first private net address and second public network address of the STA
Corresponding relationship;
In the present embodiment, the first AC can be session company according to the first private net address in the second NAT table item
Connect the second public network address of distribution.Later, the first AC can establish new second level NAT table item, the new second level for the session connection
It include the corresponding relationship of first private net address and second public network address in NAT table item, to guarantee that the STA is roamed into
When one AC, private net address will not change, and avoid the problem that service disconnection.
Step 203, the STA roam into the first AC and authenticate pass through after, by the second public network address of the STA
It is sent to MC, so that second public network address replaces first public network address as in the level-one NAT table item of the MC
Level-one private net address;
In the present embodiment, when STA is roamed on the first AC and authenticate by when, the first AC can be by the STA
The second public network address be sent to MC so that MC using second public network address replace first public network address as described one
Level-one private net address in grade NAT table item.Therefore the present invention can be built by second public network address and the level-one NAT table item on MC
Vertical connection, to guarantee to can be realized NAT conversion on MC.
Step 204 when receiving the data message that the STA is sent, forwards the data according to the new second level NAT table item
Message.
It in the present embodiment, can be according to two newly when the first AC receives the data message that the STA is sent
Grade NAT table item forwards the data message.Specifically, when the first AC receives the data message that the STA is sent, it can be according to institute
It states new second level NAT table item and the source address of the data message is substituted for second public network address, and be forwarded to MC.Due to
The level-one private net address in level-one NAT table item in MC has replaced with second public network address, therefore MC may be implemented one
Grade NAT conversion, and guarantee that the first private net address of STA will not change in roam procedure.
It can be seen that the present invention can be by establishing second level NAT table item on the 2nd AC with saving the first private network of STA
The corresponding relationship of location and the first public network address, then the second level NAT table item is synchronized on the first AC, and the first AC can be according to
One private net address distributes the second public network address, establishes new second level NAT table item, and contact with the level-one NAT table item foundation on MC,
To guarantee to can be realized NAT conversion on MC.Therefore present invention can ensure that the first private net address of STA will not in roam procedure
It changes, so as to avoid the problem of service interruption in STA roaming, promotes user experience.
In optional embodiment of the present invention, the first AC is the session after according to first private net address received
Before connection the second public network address of distribution, can further check whether first private net address is occupied;If then leading to
Know that the 2nd AC replaces first private net address.To guarantee that private net address will not generate conflict when STA is roamed.
In optional embodiment of the present invention, due to address resource shortage, the side NAT-PT also can be used in second level NAT
Formula is similar to the transformation of addr:port to addr:port in level-one NAT, then first private net address can also be by the
One private net address adds port numbers to indicate, first public network address can add port numbers by the first public network address to indicate,
Therefore the occupancy of address resource can be reduced.
In optional embodiment of the present invention, second level NAT table item further includes the state of AC, such as has used state or spare shape
State usually can refer to the AC being attached in the ESS with the STA with state;Stand-by state can refer to support that the STA is unrestrained in the ESS
Trip but not connected AC.When STA accesses an AC, the state in the second level NAT table item of the AC is then to have used state.When this
STA and when being disconnected with the AC of state, it is believed that the service ending of the STA, then the AC can will be corresponding with the STA
Second level NAT table entry deletion, so as to save network storage space.
Referring to FIG. 3, being the process flow of another wireless roaming method in a kind of illustrative embodiments of the present invention
Figure, the method are applied to the 2nd AC, and the 2nd AC is connected with MC, and the MC is also connected with the first AC, which comprises
Step 301, when receiving the Address requests message that the STA is sent, distribute the first private net address for the STA,
So that the STA establishes session connection by first private net address and destination server;For session connection distribution the
One public network address;
In the present embodiment, after the 2nd AC receives the Address requests message that STA is sent, since the 2nd AC can be used as DHCP
Server uses, therefore the Address requests message that the 2nd AC can be sent according to STA is that the STA distributes the first private net address,
So that the STA can access wireless network by first private net address, and session connection is established with the destination server of distal end.
In optional embodiment of the present invention, when proxy server of the 2nd AC as Dynamic Host Configuration Protocol server, second
AC can request the first private net address of the STA according to the MAC Address of STA to the Dynamic Host Configuration Protocol server.Due to each STA's
MAC Address is different, therefore the problem of can conflict to avoid request address on the 2nd AC and the first AC, thereby may be ensured that every
A STA can request corresponding private net address.
In the present embodiment, when STA and destination server conversate, the 2nd AC can distribute for the session connection
First public network address, the second level NAT which can be used to implement on the 2nd AC are passed through, and first public network
Location is also used as the level-one private net address in the level-one NAT table item that MC is session connection foundation, thus on the 2nd AC
Second level NAT table item on MC level-one NAT table item foundation contact.
Step 302 establishes second level NAT table item, and the second level NAT table item includes first private net address of the STA
With the corresponding relationship of first public network address;
In the present embodiment, the 2nd AC can establish second level NAT table item according to for the session connection.Second level NAT
The corresponding relationship of the first private net address and the first public network address in list item including the STA.
The second level NAT table item is synchronized to the first AC by step 303, so that the first AC is according to the second level
First private net address in NAT table item is the second public network address of distribution, and is made described in the second public network address replacement
First public network address is as the level-one private net address in the level-one NAT table item of the MC.
In the present embodiment, the second level NAT table item can be synchronized to the first AC by the 2nd AC, so that described first
AC is the second public network address of distribution according to first private net address in the second level NAT table item, so that the first AC exists
The STA issues MC when local authentication passes through, by second public network address, and MC is made to replace institute with second public network address
The first public network address is stated as the level-one private net address in the level-one NAT table item.So as to so that the first AC can be according to new
Second level NAT table item by the data message forwarding of STA to MC.
It can be seen that the present invention can be by establishing second level NAT table item on the 2nd AC with saving the first private network of STA
The corresponding relationship of location and the first public network address, then the second level NAT table item is synchronized on the first AC, and the first AC can be according to
One private net address distributes the second public network address, establishes new second level NAT table item, and contact with the level-one NAT table item foundation on MC,
To guarantee to can be realized NAT conversion on MC.Therefore present invention can ensure that the first private net address of STA will not in roam procedure
It changes, so as to avoid the problem of service interruption in STA roaming, promotes user experience.
To make the objectives, technical solutions, and advantages of the present invention more comprehensible, right below based on the group-network construction of Fig. 1
Scheme of the present invention is described in further detail.
In the present embodiment, AC1 is consistent with the DHCP network segment of AC2, it is assumed that the user side address of AC1 and AC2 is
172.0.0.1.When STA requests online at AC1 for the first time, STA can send dhcp address request message to AC1 to apply
The private net address of session connection is established with destination server.Interaction flow between STA-AC1-AC2 is as shown in figure 4, wherein wrap
It includes:
After AC1 receives dhcp address request message, the first private net address 172.0.0.10 is distributed for the session connection:
2000, gateway 172.0.0.1, and be to STA return the first private net address 172.0.0.10:2000 of carrying and gateway
172.0.0.1 DHCP response message, STA receive the DHCP response message, obtain the first private net address 172.0.0.10:
2000, gateway 172.0.0.1.
After the first private net address 172.0.0.10:2000 and gateway 172.0.0.1 that STA is obtained, it can be sent to AP1
Authentication information carries out authentication, after certification passes through, AC1 can pre-allocate the first public network address for the session connection and (be assumed to be
11.0.0.100:1000), so that STA is communicated by first public network address 11.0.0.100:1000 with MC.
AC1 establishes second level NAT table item to save the MAC Address 1-1-1 of STA, the first private net address 172.0.0.10 simultaneously:
2000 and first public network address 11.0.0.100:1000 corresponding relationship, the second level NAT table item is as shown in table 1:
STA ID |
MAC |
First public network IP |
First private network IP |
State |
1 |
1-1-1 |
11.0.0.100:1000 |
172.0.0.10:2000 |
Used |
Table 1
Wherein, the state of AC1 is that " Used " indicates that STA is online at AC1.
Meanwhile the user information of STA, authentication information and the second level NAT table item etc. can be synchronized to AC2 by AC1.
After AC2 receives the synchronizing information, i.e. starting roaming pretreatment.
AC2 is first the second new public network address of STA predistribution according to the first private net address 172.0.0.10:2000
12.0.0.100:1000 and saving.The second new public network address is the address that STA is communicated at AC2 with MC.AC2 can be with
New second level NAT table item is further created according to the second new public network address, as shown in table 2:
STA ID |
MAC |
Second public network IP |
First private network IP |
State |
1 |
1-1-1 |
12.0.0.100:1000 |
172.0.0.10:2000 |
Pre-Roam |
Table 2
Wherein, the state of AC2 is that " Pre-Roam " indicates that STA is online not at AC2.
After above-mentioned processing, STA from AC1 access network when, it is assumed that STA send message destination address be
10.0.0.1:1000 the interaction flow before roaming between STA-AC1-MC is as shown in Figure 5 a, including:
When the message passes through AC1, because AC1 has generated second level NAT table item (table 1), therefore source address (the first private network
Location) 172.0.0.10:2000 is converted into the first public network address 11.0.0.100:1000, and destination address is constant, is subsequently forwarded to
MC。
When message reaches MC, according to the level-one NAT table item configured on MC, by the source address 11.0.0.100 of the message:
1000 are converted into public network address 16.182.17.100:32484, are sent to the destination service that destination address is 10.0.0.1:1000
Device.The level-one NAT table item is as shown in table 3:
Source address |
Public network address |
Destination address |
11.0.0.100:1000 |
16.182.17.100:32484 |
10.0.0.1:1000 |
Table 3
When MC receives the response message of destination server, replaced according to above-mentioned replacement process is counter, AC2 also carries out phase
The anti-replacement operation answered, enables the end STA to receive the response message.
When STA is roamed to AP2, according to normal roaming process, it is connected to AP2, and it is online to initiate roam-requests authentication-exempt.
AC2 carries out identification checkup to the STA according to the authentication information in synchronizing information, and after certification passes through, STA may be connected to AP2.This
When, it is Used that AC2, which can modify the state in the second level NAT table item locally saved, and notifies AC1 by corresponding table item status modifier
For Pre-Roam.Meanwhile AC2 notifies MC, the level-one private net address (source address) of STA to be changed to 12.0.0.100:
1000。
After MC is connected to the message, local level-one NAT table item (table 3) is searched, source address 11.0.0.100:1000 is corresponding
List item replace all with 12.0.0.100:1000, replaced level-one NAT table item is as shown in table 4:
Source address |
Public network address |
Destination address |
12.0.0.100:1000 |
16.182.17.100:32484 |
10.0.0.1:1000 |
Table 4
After roaming, the interaction flow between STA-AC2-MC is as shown in Figure 5 b, including:
When the message that STA is sent passes through AC2, because AC2 has generated second level NAT table item (table 2), therefore source address (the
One private net address) 172.0.0.10:2000 is converted into the second public network address 12.0.0.100:1000, and destination address is not
Become, is subsequently forwarded to MC.
When message reaches MC, according to the level-one NAT table item (table 4) configured on MC, source address 12.0.0.100:1000 is turned
It changes public network address 16.182.17.100:32484 into, is sent to destination server.When MC receives response message, replaced according to above-mentioned
Change that process is counter to be replaced, AC2 also carries out corresponding anti-replacement operation, and the end STA is enable to receive the response message.
It can be seen that the source address of STA is only changed in the repeating process of AC to MC, and taken relative to target
It is engaged in for device, the source address of STA is there is no any variation, therefore STA may be implemented the unaware of distal end the case where in the present invention
AP belonging to lower change, and guarantee that business is not interrupted.
Based on identical design, the present invention also provides a kind of radio roaming device, described device can by software realization,
It can also be realized by way of hardware or software and hardware combining.Taking software implementation as an example, radio roaming device of the invention is made
It is that corresponding computer program instructions in memory are read by the CPU of equipment where it for the device on a logical meaning
After run.
Fig. 6 a and Fig. 6 b is please referred to, is a kind of one of illustrative embodiments of present invention radio roaming device 600, institute
It states device to be connected applied to the first AC, the first AC with MC, the MC is also connected with the 2nd AC, the basic running environment of described device
Including CPU, memory and other hardware, from logic level, described device 600 includes:
List item receiving unit 601, for establishing session connection by the first private net address and destination server in the STA
Afterwards, the corresponding second level NAT table item of the session connection sent by the 2nd AC is received, the second level NAT table item includes institute
State the first private net address of STA and the corresponding relationship of the first public network address;
Allocation unit 602 is used for according to first private net address for the session connection the second public network of distribution
Location, establishes new second level NAT table item, and the new second level NAT table item includes first private net address of the STA and described
The corresponding relationship of second public network address;
Address transmission unit 603, for the STA roam into the first AC and authenticate pass through after, by the STA's
Second public network address is sent to the MC, so that second public network address replaces first public network address as the MC's
Level-one private net address in level-one NAT table item;
Message retransmission unit 604, for when receiving the data message that the STA is sent, according to the new second level NAT
List item forwards the data message.
Optionally, described device 600 further include:
Address check unit 605, for checking described first before distributing the second public network address for the session connection
Whether private net address is occupied;If so, the 2nd AC is notified to replace first private net address.
Optionally, the message retransmission unit 604, specifically for when receiving the data message that the STA is sent, according to
The source address of the data message is substituted for second public network address by the new second level NAT table item, and is forwarded to MC.
Fig. 7 a and Fig. 7 b is please referred to, is another radio roaming device 700 in a kind of illustrative embodiments of the present invention,
Described device is applied to the 2nd AC, and the 2nd AC is connected with MC, and the MC is also connected with the first AC, and described device runs ring substantially
Border includes CPU, memory and other hardware, and from logic level, described device 700 includes:
Allocation unit 701, for when receiving the Address requests message that the STA is sent, for STA distribution the
One private net address, so that the STA establishes session connection by first private net address and destination server;For the session
Connection the first public network address of distribution;
List item establishes unit 702, and for establishing second level NAT table item, the second level NAT table item includes the described of the STA
The corresponding relationship of first private net address and first public network address;
List item synchronization unit 703, for the second level NAT table item to be synchronized to the first AC, so that the first AC
It is the second public network address of distribution according to first private net address in the second level NAT table item, and makes second public network
Address replaces first public network address as the level-one private net address in the level-one NAT table item of the MC.
Optionally, as the 2nd AC as Dynamic Host Configuration Protocol server when acting on behalf of,
The allocation unit 701 is also used to request institute to the Dynamic Host Configuration Protocol server according to the MAC Address of the STA
State the first private net address of STA.
In conclusion the present invention can be by establishing second level NAT table item on the 2nd AC with saving the first private network of STA
The corresponding relationship of location and the first public network address, then the second level NAT table item is synchronized on the first AC, and the first AC can be according to
One private net address distributes the second public network address, establishes new second level NAT table item, and contact with the level-one NAT table item foundation on MC,
To guarantee to can be realized NAT conversion on MC.Therefore present invention can ensure that the first private net address of STA will not in roam procedure
It changes, so as to avoid the problem of service interruption in STA roaming, promotes user experience.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.