Disclosure of Invention
In view of this, the present invention provides a method for processing multiple VLANs, so that a host can only receive RA messages in the VLAN to which the host belongs, thereby ensuring that the host can only generate available IPv6 addresses.
The invention also provides a node for processing the multiple VLANs, so that the host can only receive RA messages in the VLAN to which the host belongs, and the host can only generate available IPv6 addresses.
In order to achieve the purpose, the technical scheme provided by the invention is as follows:
a method of handling multiple virtual local area network VLANs, the method comprising:
after receiving a Router advertisement RA message sent by a Router, generating a corresponding relation table containing VLAN and RA parameters carrying the advertisement RA message;
after receiving a unicast router request RS message sent by a host, inquiring the generated corresponding relation table, and generating a corresponding unicast RA message according to RA parameters corresponding to the VLAN in the inquired corresponding relation table;
and unicasting the generated unicast RA message to a host in a corresponding VLAN, so that the host generates an IPv6 address in the VLAN according to parameters in the unicast RA message, and the communication with the Internet is realized.
Before receiving the Router advertisement RA message sent by the Router, the method further includes:
and receiving an RS message sent by the host, and sending the RS message to the Router to request prefix information and other configuration information for automatic configuration of the host.
A node for handling multiple virtual local area network VLANs, the node comprising: a second receiving unit, a first generating unit, a third receiving unit, a second generating unit and a transmitting unit, wherein,
the second receiving unit is configured to receive a Router advertisement RA message sent by a Router, where the Router advertisement RA message includes prefix information and other configuration information, and is used for automatic configuration of a host;
the first generating unit is used for generating a corresponding relation table containing VLAN and RA parameters carrying the notification RA message according to the notification RA message received by the second receiving unit;
the third receiving unit is configured to receive a unicast router request RS message sent by a host;
the second generating unit is configured to query the correspondence table generated by the first generating unit according to the unicast RS message received by the third receiving unit, and generate a corresponding unicast RA message according to the RA parameter corresponding to the vlan in the queried correspondence table;
and the sending unit is used for unicasting the unicast RA message generated by the second generating unit to the corresponding host, so that the host generates an IPv6 address in the VLAN according to the parameters in the received unicast RA message, and the communication with the Internet is realized.
The node further comprises: the first receiving unit is used for receiving the RS message sent by the host computer and sending the RS message to the Router so as to request prefix information and other configuration information for automatic configuration of the host computer;
then, the second receiving unit is configured to receive an advertisement RA message sent by the Router after the first receiving unit sends the RS message to the Router, where the advertisement RA message includes prefix information and other configuration information, so as to be used for host automatic configuration.
A method of handling multiple virtual local area network VLANs, the method comprising:
generating a corresponding relation table containing VLAN and media access control MAC addresses corresponding to all hosts;
after receiving a Router advertisement RA message sent by a Router, inquiring a generated corresponding relation table, and generating a unicast message which takes a host MAC address as a destination address in a corresponding VLAN according to the corresponding relation table;
and unicasting the unicast message to the corresponding host so that the host generates an IPv6 address in the VLAN to realize the communication with the Internet.
Before receiving the Router advertisement RA message sent by the Router, the method further includes:
and receiving a Router request RS message sent by the host, and sending the RS message to the Router to request prefix information and other configuration information for automatic configuration of the host.
A node for handling multiple virtual local area network VLANs, the node comprising: the device comprises a first generating unit, a second receiving unit, a second generating unit and a transmitting unit. Wherein,
the first generating unit is used for generating a corresponding relation table containing the VLAN and the media access control MAC address corresponding to each host;
the second receiving unit is configured to receive a Router advertisement RA message sent by a Router, where the Router advertisement RA message includes prefix information and other configuration information, and is used for automatic configuration of a host;
the second generating unit is used for inquiring the corresponding relation table generated by the first generating unit when receiving the notification RA message of the second receiving unit, and generating a unicast message which takes the MAC address as a destination address in the corresponding VLAN according to the corresponding relation table;
and the sending unit is used for unicasting the unicast message generated by the second generating unit to the corresponding host, so that the host generates an IPv6 address in the VLAN and realizes communication with the Internet.
The node further comprises: the first receiving unit is used for receiving the RS message sent by the host computer and sending the RS message to the Router so as to request prefix information and other configuration information for automatic configuration of the host computer;
then, the second receiving unit is configured to receive an advertisement RA message sent by the Router after the first receiving unit sends the RS message to the Router, where the advertisement RA message includes prefix information and other configuration information, so as to be used for host automatic configuration.
In summary, the method and node for processing multiple VLANs according to the present invention generate a correspondence table including a VLAN and an RA parameter carrying an advertisement RA message, or a correspondence table including a VLAN and MAC addresses corresponding to respective hosts, by an access point AP, and further generate a unicast RA message or a unicast packet corresponding to a host in the VLAN by querying the correspondence table by the AP, and unicast the unicast RA message or the unicast packet to the host in the corresponding VLAN. Because the method of the invention queries the corresponding relation table containing VLAN, the AP can only send the unicast RA message to the host in the corresponding VLAN, namely the host can only receive the unicast RA message in the VLAN and can not receive the messages in other VLANs, and the problem that the IPv6 address generated by the host can not be used for surfing the Internet can not occur, therefore, the host can only receive the unicast RA message in the VLAN to which the host belongs by adopting the method of the invention, thereby ensuring that the host can only generate the usable IPv6 address.
Detailed Description
In order to solve the technical problem provided by the invention, the specific implementation of the scheme of the invention comprises the following steps:
after receiving the notification RA message sent by the Router, generating a corresponding relation table containing the VLAN and the RA parameter carrying the notification RA message; after receiving the unicast RS message sent by the host, inquiring the generated corresponding relation table, and generating a corresponding unicast RA message according to the RA parameter corresponding to the VLAN in the inquired corresponding relation table; unicasting the generated unicast RA message to a host in a corresponding VLAN, so that the host generates an IPv6 address in the VLAN according to parameters in the unicast RA message to realize communication with the Internet,
or, generating a corresponding relation table containing VLAN and MAC address corresponding to each host; after receiving an announcement RA message sent by an outer, inquiring a generated corresponding relation table, and generating a unicast message which takes a host MAC address as a destination address in a corresponding VLAN according to the corresponding relation table; and unicasting the unicast message to the corresponding host so that the host generates an IPv6 address in the VLAN to realize the communication with the Internet.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Example one
Fig. 2 is a flowchart of a first embodiment of a method for processing multiple VLANs according to the present embodiment, where a node may be separately configured or configured in an AP in the present embodiment, and the present embodiment is described by taking the node located in the AP as an example. As shown in fig. 2, the process includes:
step 201-202: the user host is on-line, and the interaction with an authentication, authorization and accounting server (AAA server) is completed through the AP.
The details of how to interact with AAA server are known in the art and will not be described herein.
Step 203: the host sends an RS message to the AP, which then sends the RS message to a Router (Router) to request prefix information and other configuration information for automatic configuration of the host.
It should be noted that the operation of this step is only needed when the Router cannot periodically send the notification RA message to the AP, and this step may be omitted when the Router periodically sends the notification RA message to the AP.
Step 204: router sends an announce RA message to the AP, which includes prefix information and other configuration information for host auto-configuration.
Step 205: after receiving the notification RA message, a correspondence table is generated that contains the VLAN and the RA parameter carrying the notification RA message.
It should be noted that, in this step, the correspondence table is mainly used to indicate which advertised RA messages exist in a certain VLAN, specifically which prefixes, corresponding lifetimes, and the like are included in the advertised RA messages, and a specific format of the correspondence table may be referred to in table 1.
TABLE 1
Step 206: the AP receives a unicast RS message sent by the host.
Step 207: and after receiving the unicast RS message, the AP inquires the generated corresponding relation table and generates a corresponding unicast RA message according to the inquired RA parameter corresponding to the VALN.
In this step, according to the VLAN of the host sending the unicast RS message, the RA parameters corresponding thereto can be obtained from the table, thereby generating the corresponding unicast RA message for the host.
Step 208: and unicasting the generated unicast RA message to the corresponding host.
Step 209: the host generates an IPv6 address in the VLAN according to the parameters in the received unicast RA message.
Step 210: and communicating with the Internet according to the generated IPv6 address to complete the internet surfing process.
Thus, the working flow chart of the embodiment of the method for processing multiple VLANs is completed.
Based on the method in this embodiment, fig. 3 shows a structure for processing a multi-VLAN node in this embodiment, as shown in fig. 3, the node includes: a second receiving unit 32, a first generating unit 33, a third receiving unit 34, a second generating unit 35, and a transmitting unit 36. Wherein,
the second receiving unit 32 is configured to receive an advertisement RA message sent by a Router, where the advertisement RA message includes prefix information and other configuration information, so as to be used for host auto-configuration.
The first generating unit 33 is configured to generate a correspondence table including VLANs and RA parameters carrying the notification RA message according to the notification RA message received by the second receiving unit 32.
The third receiving unit 34 is configured to receive a unicast RS message sent by the host.
The second generating unit 35 is configured to query the correspondence table generated by the first generating unit 33 according to the unicast RS message received by the third receiving unit 34, and generate a corresponding unicast RA message according to the RA parameter corresponding to the vlan in the queried correspondence table.
The sending unit 36 is configured to unicast the unicast RA message generated by the second generating unit 35 to the corresponding host, so that the host generates an IPv6 address in the local VLAN according to the parameter in the received unicast RA message, thereby implementing communication with the internet.
Further, the node may further include a first receiving unit 31 for receiving an RS message sent by the host and sending the RS message to the Router to request prefix information and other configuration information, for automatic configuration of the host,
then, the second receiving unit 32 is configured to receive an advertisement RA message sent by the Router after the first receiving unit 31 sends the RS message to the Router, where the advertisement RA message includes prefix information and other configuration information, so as to be used for host auto-configuration.
Thus, the processing multi-VLAN node adopted in this embodiment is obtained. For the specific work flow of the node adopted in fig. 3, please refer to the corresponding description in the embodiment of the method shown in fig. 2, which is not described herein again.
Example two
Fig. 4 is a flowchart of a method for processing multiple VLANs according to an embodiment of the present invention, and like the embodiment, in the present embodiment, a node may be separately configured or may be configured in an AP. As shown in fig. 4, the process includes:
step 401-402: the user host is on line, and the interaction with the AAA server is completed through the AP.
The details of how to interact with AAA server are known in the art and will not be described herein.
Step 403: the AP generates a correspondence table containing VLANs and MAC addresses corresponding to the respective hosts.
In this embodiment, the specific format of the correspondence table can be seen in table 2 below.
TABLE 2
LAN |
MAC address |
MAC address |
MAC address |
MAC address | MAC address | |
1 |
MAC11 |
MAC12 |
MAC13 |
MAC14 |
…… |
2 |
MAC21 |
MAC22 |
MAC23 |
MAC24 |
…… |
3 |
MAC31 |
MAC32 |
MAC33 |
MAC34 |
…… |
Step 404: the host sends the RS message to the AP, and the AP sends the RS message to the Router so as to request prefix information and other configuration information for automatic configuration of the host.
It should be noted that the operation of this step needs to be executed only when the Router cannot periodically send the unicast RA message to the AP, and this step may be omitted when the Router periodically sends the unicast RA message to the AP.
Step 405: router sends a unicast RA message to the AP, including prefix information and other configuration information, for host auto-configuration.
Step 406: and after receiving the unicast RA message, the AP inquires the generated corresponding relation table and generates a unicast message which takes the host MAC address as a destination address in the corresponding VLAN according to the corresponding relation table.
Step 407: and the AP unicasts the generated unicast message to the host of the corresponding VLAN.
Step 408: the host generates an IPv6 address in the VLAN according to the parameters in the received unicast RA message.
Step 409: and communicating with the Internet according to the generated IPv6 address to complete the internet surfing process.
Thus, the working flow chart of the embodiment of the method for processing multiple VLANs is completed.
Like the embodiment, based on the method in this embodiment, fig. 5 shows a structure for processing a multi-VLAN node in this embodiment, and as shown in fig. 5, the node includes: a first generating unit 51, a second receiving unit 53, a second generating unit 54, and a transmitting unit 55. Wherein,
the first generation unit 51 is configured to generate a correspondence table including a VLAN and a MAC address corresponding to each host.
In this embodiment, the correspondence table includes the VLAN and the MAC address of the host belonging to the VLAN, which can be specifically referred to as table 2.
The second receiving unit 53 is configured to receive an advertisement RA message sent by a Router, where the advertisement RA message includes prefix information and other configuration information for host automatic configuration.
The second generating unit 54 is configured to, when receiving the notification RA message from the second receiving unit 53, query the correspondence table generated by the first generating unit 51, and generate a unicast message using the host MAC address as the destination address in the corresponding VLAN according to the correspondence table.
The sending unit 55 is configured to unicast the unicast message generated by the second generating unit 54 to the corresponding host, so that the host generates an IPv6 address in the local VLAN, thereby realizing communication with the internet.
Further, the node may further include a first receiving unit 52, configured to receive an RS message sent by the host, and send the RS message to the Router to request prefix information and other configuration information, for automatic configuration of the host,
then, the second receiving unit 53 is configured to receive an advertisement RA message sent by the Router after the first receiving unit 52 sends the RS message to the Router, where the advertisement RA message includes prefix information and other configuration information for host automatic configuration.
Thus, the processing multi-VLAN node adopted in this embodiment is obtained. For the specific work flow of the node adopted in fig. 5, please refer to the corresponding description in the embodiment of the method shown in fig. 4, which is not described herein again.
In summary, the method and node for processing multiple VLANs according to the present invention generate a correspondence table including a VLAN and an RA parameter carrying an advertisement RA message, or a correspondence table including a VLAN and an MAC address corresponding to each host, by an access point AP, and further generate a unicast RA message or a unicast packet corresponding to a host in the VLAN by querying the correspondence table by the AP, and unicast the unicast RA message or the unicast packet to the host in the corresponding VLAN. Because the method of the invention queries the corresponding relation table containing VLAN, the AP can only send the unicast RA message to the host in the corresponding VLAN, namely the host can only receive the unicast RA message in the VLAN and can not receive the messages in other VLANs, and the problem that the IPv6 address generated by the host can not be used for surfing the Internet can not occur, therefore, the host can only receive the unicast RA message in the VLAN to which the host belongs by adopting the method of the invention, thereby ensuring that the host can only generate the usable IPv6 address.
In addition, the method of the invention does not modify the configuration of the router, namely does not change the existing network deployment, thereby not increasing a large workload.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.