Network device and method for automatically detecting address configuration mode supported by IPv6 network

By using the automatic detection module in the network device to send router request messages and receive router notification messages, obtain the managed address configuration flag bits, and directly determine the address configuration method supported by the IPv6 network, solving the problem of slow detection speed in the prior art , improves automatic detection rate and user experience.

CN114051019BActive Publication Date: 2024-12-24TP-LINK INT SHENZHEN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111199227.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-14
Publication Date
2024-12-24
Estimated Expiration
2041-10-14

AI Technical Summary

Technical Problem

In the prior art, detecting the address configuration method supported by the IPv6 network requires the discover process of different address configuration methods or sending detection packets in sequence, resulting in slow detection speed and the address configuration method supported by the IPv6 network cannot be detected quickly.

Method used

Provide a network device, including a WAN port and an automatic detection module, by sending router request messages and receiving router notification messages, obtaining the managed address configuration flag bit, and determining the address supported by the IPv6 network accessed by the network device according to the flag bit Configuration method to simplify the detection process.

Benefits of technology

It realizes the address configuration method supported by IPv6 network quickly detects the IPv6 network, saving time, improving automatic detection speed, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114051019B_ABST
    Figure CN114051019B_ABST
Patent Text Reader

Abstract

The present invention discloses a network device and method for automatically detecting an address configuration mode supported by an IPv6 network, wherein the network device comprises a WAN port and an automatic detection module connected to the WAN port, wherein the automatic detection module is specifically used to: respond to an automatic detection instruction, send a router request message from the WAN port according to a preset sending cycle to trigger the upper gateway of the network device to generate a router advertisement message for the router request message, and send the router advertisement message to the network device; when receiving the router advertisement message, obtain a managed address configuration flag in the router advertisement message; and determine the address configuration mode supported by the IPv6 network accessed by the network device according to the managed configuration flag. The present invention can simplify the process of automatically detecting the address configuration mode, increase the rate of automatically detecting the address configuration mode, and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic detection of address configuration modes, and in particular to a network device and method for automatically detecting address configuration modes supported by an IPv6 network. Background Art

[0002] Compared with Internet Protocol Version 4 (IPv4), Internet Protocol Version 6 (IPv6) has more advantages such as sufficient address resources and is becoming more and more widely used. Network devices that need to access IPv6 networks also need to follow the corresponding protocol regulations.

[0003] Different network connections or network services require different address configuration methods for host address configuration. Only by using the corresponding address configuration method for dialing can the corresponding network connection or network service be established. For example, after accessing the IPv6 network, the address configuration methods of Linux devices or other embedded devices include static configuration method, stateful configuration method based on DHCPv6 protocol, and stateless configuration method based on SLAAC protocol. You need to select the address configuration method supported by the IPv6 network you access. Therefore, users need to understand the address configuration method supported by the IPv6 network to which the network device is connected, complete the address configuration of the network device, and obtain the IPv6 address of the network device.

[0004] However, in the prior art, the automatic detection of the address configuration mode is usually that after accessing the IPv6 network, the network device sequentially enters the discover process of different address configuration modes, directly broadcasts the corresponding initialization message to the outside, and when a reply is received, the address configuration mode is determined, otherwise it enters the discover process of the next address configuration mode until the address configuration mode is determined; similarly, detection packets corresponding to different configuration modes are sent sequentially, and when a reply is received from the corresponding server or gateway, the address configuration mode is determined, otherwise a detection packet of the next configuration mode is sent until the address configuration mode is confirmed.

[0005] The existing technology solution is used to detect the address configuration mode supported by the connected IPv6 network. It is necessary to execute the discover process corresponding to different address configuration modes in sequence or send different detection packets. It is not possible to quickly detect the address configuration mode supported by the IPv6 network. Summary of the invention

[0006] The technical problem to be solved by the embodiments of the present invention is to provide a network device and method for automatically detecting the address configuration mode supported by the IPv6 network, which can simplify the process of automatically detecting the address configuration mode, increase the rate of automatically detecting the address configuration mode, and improve the user experience.

[0007] In order to solve the above technical problems, in a first aspect, the present invention provides a network device for automatically detecting an address configuration mode supported by an IPv6 network, the network device comprising a WAN port and an automatic detection module connected to the WAN port, wherein the automatic detection module is specifically used for:

[0008] In response to the automatic detection instruction, a router request message is sent from the WAN port according to a preset sending cycle to trigger the upper-level gateway of the network device to generate a router advertisement message for the router request message, and send the router advertisement message to the network device;

[0009] When receiving the router advertisement message, obtaining a managed address configuration flag bit in the router advertisement message;

[0010] According to the managed configuration flag, the address configuration mode supported by the IPv6 network to which the network device accesses is determined.

[0011] Furthermore, the network device further comprises an IPv6 dial-up control module; wherein, before the automatic detection module responds to the automatic detection instruction, the IPv6 dial-up control module is used to:

[0012] After the network device is connected to the IPv6 network, detecting whether the user inputs a dial-up connection creation instruction;

[0013] When the dial-up connection creation instruction is detected, the response to the automatic detection instruction is triggered, and a dial-up connection with an unspecified address configuration mode is created according to the connection information input by the user, so that the network device can communicate with the upper-level gateway.

[0014] Furthermore, the automatic detection module is also used for:

[0015] According to the determined address configuration mode, setting the parameter value of the dialing flag; wherein different parameter values ​​of the dialing flag correspond to different address configuration modes;

[0016] Then, the network device further includes an IPv6 dial-up control module, and the IPv6 dial-up control module is used to:

[0017] Acquire the parameter value of the dialing flag bit according to a preset acquisition method and acquisition period;

[0018] According to the acquired parameter value of the dialing flag, the address configuration process of the address configuration mode corresponding to the parameter value of the dialing flag is automatically started.

[0019] Further, the acquisition method is an active acquisition method in which the IPv6 dial-up control module actively queries the automatic detection module for the parameter value of the dial-up flag; or,

[0020] The acquisition method is a passive acquisition method in which the automatic detection module reports the parameter value of the dialing flag to the IPv6 dialing control module.

[0021] Furthermore, the automatic detection module is also used for:

[0022] For each router request message sent, when the router advertisement message corresponding to the router request message is not received, the value of the preset sending number statistical parameter is increased according to the preset numerical step; and,

[0023] Determine whether the value of the sending number statistical parameter is greater than a preset number threshold;

[0024] When the value of the sending number statistical parameter is greater than the number threshold, the address configuration mode supported by the IPv6 network to which the network device accesses is determined as a preset default address configuration mode, and the parameter value of the dialing flag is set to correspond to the default address configuration mode;

[0025] Then, after the IPv6 dial-up control module automatically starts the address configuration process of the address configuration mode corresponding to the parameter value of the dial-up flag, the automatic detection module is further used to:

[0026] The value of the sending times statistical parameter is restored to a preset initial value.

[0027] Furthermore, the default address configuration mode is a static configuration mode.

[0028] Further, the managed address configuration flag is in the flag field of the router advertisement message, and the value of the managed address configuration flag includes 1 and 0; then, when determining the address configuration mode supported by the IPv6 network accessed by the network device according to the managed configuration flag, the automatic detection module is specifically used to:

[0029] When the value of the managed address configuration flag is 1, determining that the address configuration mode is a stateful address configuration mode based on the DHCPv6 protocol;

[0030] When the value of the managed address configuration flag is 0, determine whether the prefix option in the router advertisement message is a valid prefix option; when the prefix option is a valid prefix option, determine that the address configuration mode is a stateless address configuration mode based on the SLAAC protocol; when the prefix option is not a valid prefix option, determine that the address configuration mode is a static configuration mode.

[0031] Further, when determining whether the prefix option in the router advertisement message is a valid prefix option, the automatic detection module is specifically used to:

[0032] Determine whether the format of the prefix option in the router advertisement message complies with SLAAC protocol regulations;

[0033] If the format of the prefix option complies with the SLAAC protocol specification, the prefix option is determined to be a valid prefix option;

[0034] If the format of the prefix option does not comply with the SLAAC protocol specification, it is determined that the prefix option is not a valid prefix option.

[0035] In order to solve the corresponding technical problems, in a second aspect, the present invention also provides a method for automatically detecting an address configuration mode supported by an IPv6 network, the method being performed by a network device, the network device comprising a WAN port and an automatic detection module connected to the WAN port, the method comprising:

[0036] The automatic detection module responds to the automatic detection instruction and sends a router request message from the WAN port according to a preset sending period to trigger the upper-level gateway of the network device to generate a router advertisement message for the router request message, and send the router advertisement message to the network device;

[0037] When receiving the router advertisement message, the automatic detection module obtains the managed address configuration flag bit in the router advertisement message;

[0038] The automatic detection module determines the address configuration mode supported by the IPv6 network to which the network device accesses according to the managed configuration flag.

[0039] Furthermore, the network device further comprises an IPv6 dial-up control module; wherein, before the automatic detection module responds to the automatic detection instruction, the method further comprises:

[0040] The IPv6 dial-up control module detects whether the user inputs a dial-up connection creation instruction after the network device accesses the IPv6 network;

[0041] When the dial-up connection creation instruction is detected, the IPv6 dial-up control module triggers a response to the automatic detection instruction and creates a dial-up connection with an unspecified address configuration mode according to the connection information input by the user, so that the network device can communicate with the upper-level gateway.

[0042] The above-mentioned network device and method for automatically detecting the address configuration mode supported by the IPv6 network can actively send RS messages to the superior gateway during detection, receive RA messages replied by the superior gateway, and directly determine the address configuration mode supported by the IPv6 network to which the network device accesses according to the address configuration mode required by the network device indicated by the superior gateway. The network device can then obtain the IPv6 address of the network device according to the determined address configuration mode, without the need for the network device to continuously try different address configuration modes to detect the address configuration mode. Compared with the solutions of the prior art, this saves time, simplifies the detection process, improves the automatic detection rate of the address configuration mode, and provides user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a schematic diagram of a first application scenario of the network device provided by the present invention;

[0044] Figure 2 is a flowchart of a first preferred embodiment of the network device execution steps provided by the present invention;

[0045] Figure 3 is a schematic diagram of a second application scenario of the network device provided by the present invention;

[0046] Figure 4 is a flowchart of a second preferred embodiment of the network device execution steps provided by the present invention;

[0047] Figure 5 A flow chart of a preferred embodiment of a method for automatically detecting an address configuration mode supported by an IPv6 network provided by the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] The present invention provides a network device that automatically detects the address configuration mode supported by the IPv6 network. Figures 1 to 2 , Figure 1 This is a schematic diagram of a first application scenario of the network device provided by the present invention; Figure 2 1 is a flowchart of a first preferred embodiment of the network device execution steps provided by the present invention; specifically, the network device 1 includes a WAN port 12 and an automatic detection module 11 connected to the WAN port 12, wherein the automatic detection module 11 is specifically used for:

[0050] In response to the automatic detection instruction, a router request message is sent from the WAN port according to a preset sending cycle to trigger the upper-level gateway 2 of the network device to generate a router advertisement message for the router request message, and send the router advertisement message to the network device;

[0051] When receiving the router advertisement message, obtaining a managed address configuration flag bit in the router advertisement message;

[0052] According to the managed configuration flag, the address configuration mode supported by the IPv6 network to which the network device accesses is determined.

[0053] It should be noted that the router solicitation message, namely the RS (Router Solicitation) message, is broadcasted by the network device; the router advertisement message, namely the RA (Router Advertisement) message, is generated by the upper-level gateway that receives the RS message in response to the RS message, and is a reply message to the network device. The RA message contains a 64-bit prefix option, which is used to generate a 128-bit IPv6 address in combination with the MAC address of the user-side network device in the stateless address configuration method; in the current communication protocol, RFC 4861 (Neighbor Discovery for IPv6) stipulates that the RA message also includes a Flag field (flag field), which includes the managed configuration flag (Managed Address Configuration Flag, or M bit), and its value represents the upper-level gateway notifying the network device which protocol to obtain the address.

[0054] Specifically, when the automatic detection instruction is triggered, the automatic detection module of the network device responds to the automatic detection instruction and periodically sends a router request message from the WAN port according to the sending cycle; if the upper-level gateway receives the router request message, it generates a router advertisement message and sends it out; when the network device receives the router advertisement message, it obtains the managed address configuration flag in the router advertisement message to determine the address configuration method supported by the IPv6 network to which the network device is connected.

[0055] It should be noted that when determining the address configuration mode according to the managed address configuration flag in the RA message, the address configuration mode may be determined directly according to the managed address configuration flag, or the address configuration mode may be determined according to the managed address configuration flag combined with other information.

[0056] It should be noted that the triggering of the response to the automatic detection instruction may be when the user needs to obtain the address configuration mode, the corresponding operation of the user is received to trigger the response; or it may be when other modules of the network device perform a certain operation to trigger the response of the automatic detection instruction. Preferably, the automatic detection module includes an RA / RS transceiver unit in the kernel of the network device, which is used to execute all or part of the steps executed by the automatic detection module.

[0057] The present invention provides a network device that automatically detects the address configuration mode supported by the IPv6 network. The device can actively send an RS message to the superior gateway during detection, receive an RA message replied by the superior gateway, and directly determine the address configuration mode supported by the IPv6 network to which the network device accesses according to the address configuration mode required by the network device indicated by the superior gateway. The network device can then obtain the IPv6 address of the network device according to the determined address configuration mode, without the need for the network device to continuously try different address configuration modes to detect the address configuration mode. Compared with the solutions in the prior art, the present invention saves time, simplifies the detection process, improves the automatic detection rate of the address configuration mode, and provides user experience.

[0058] Preferably, see Figure 3 , Figure 3 is a schematic diagram of a second application scenario of the network device provided by the present invention; specifically, the network device 1 further includes an IPv6 dial-up control module 13, wherein, before the automatic detection module 11 responds to the automatic detection instruction, the IPv6 dial-up control module 13 is used to:

[0059] After the network device is connected to the IPv6 network, detecting whether the user inputs a dial-up connection creation instruction;

[0060] When the dial-up connection creation instruction is detected, the response to the automatic detection instruction is triggered, and a dial-up connection with an unspecified address configuration mode is created according to the connection information input by the user, so that the network device can communicate with the upper-level gateway.

[0061] Specifically, after the network device is connected to the IPv6 network, when the user needs to create a dial-up connection, the network device creates a dial-up connection without specifying the address configuration mode according to the dial-up connection creation instruction input by the user. For the address configuration mode, it is necessary to trigger the automatic detection instruction for detection and determination. It should be noted that when creating a dial-up connection, IPoE dial-up or PPPoE dial-up can be selected according to the user; if it is PPPoE dial-up, the user needs to provide a user name and password for authentication. During the dial-up negotiation process, the server will issue a local link address. With the local link address, the network device has the ability to communicate with the upper-level gateway and can perform the RS / RA message interaction process to obtain its global IPv6 address for Internet access after detecting the address configuration mode; if it is IPoE dial-up, the network device already has a local link address for LAN communication when the IPoE interface is created. The network device has the ability to communicate with the upper-level gateway and can perform the RS / RA message interaction process. After further detecting the address configuration mode, it can obtain its global IPv6 address for Internet access.

[0062] Preferably, if Figure 2 As shown, the automatic detection module 11 is also used for:

[0063] According to the determined address configuration mode, setting the parameter value of the dialing flag; wherein different parameter values ​​of the dialing flag correspond to different address configuration modes;

[0064] Then, the network device further includes an IPv6 dial-up control module 13, and the IPv6 dial-up control module 13 is used to:

[0065] Acquire the parameter value of the dialing flag bit according to a preset acquisition method and acquisition period;

[0066] According to the acquired parameter value of the dialing flag, the address configuration process of the address configuration mode corresponding to the parameter value of the dialing flag is automatically started.

[0067] Specifically, since the automatic detection module and the IPv6 dial-up control module for executing address configuration are relatively independently set, usually the RA message will not be sent to the IPv6 dial-up control module for processing, and there may be a situation where the RA message is not received. Therefore, in order to ensure that the IPv6 dial-up control module has a basis for executing address configuration, the present invention informs the IPv6 dial-up control module of the address configuration method to be executed by setting the dial-up flag. Specifically, the automatic detection module sets the parameter value of the dial-up flag according to the address configuration method determined by the detection, and the IPv6 dial-up control module regularly obtains the parameter value of the dial-up flag according to a feasible acquisition means, for example, inquiring the parameter value of the dial-up flag set by the automatic detection module according to a preset query cycle, or regularly reporting the parameter value of the dial-up flag to the IPv6 dial-up control module through the automatic detection module; after the IPv6 dial-up control module learns the parameter value of the dial-up flag, it automatically starts the address configuration process of the address configuration method corresponding to the parameter value of the dial-up flag.

[0068] It should be noted that the parameter values ​​of the dial-up flag corresponding to different address configuration methods can be set according to actual needs. For example, when the parameter value of the dial-up flag is "N", it corresponds to the static configuration method, and the corresponding configuration process can be to prompt the user to manually configure the IPv6 address, routing gateway, IPv6 domain name server and other information of the network device, and / or directly display the static configuration input interface for the user to input information; when the parameter value of the dial-up flag is "D", it corresponds to the stateful address configuration method based on the DHCPv6 protocol, and the corresponding configuration process can be to start the DHCPv6 stateful dial-up logic; when the parameter value of the dial-up flag is "S", it corresponds to the stateless address configuration method based on the SLAAC protocol, and the corresponding configuration process can be to start the SLAAC stateless dial-up logic.

[0069] The present invention provides a network device that automatically detects the address configuration mode supported by the IPv6 network. In addition to being able to automatically detect the address configuration mode, it also automatically starts the corresponding configuration process after the detection is completed, thereby reducing the user's configuration time and eliminating the need for the user to master network knowledge to choose to start the corresponding configuration process, thereby further improving the user experience.

[0070] Preferably, if Figure 2 As shown, the automatic detection module 11 is also used for:

[0071] For each router request message sent, when the router advertisement message corresponding to the router request message is not received, the value of the preset sending number statistical parameter is increased according to the preset numerical step; and,

[0072] Determine whether the value of the sending number statistical parameter is greater than a preset number threshold;

[0073] When the value of the sending number statistical parameter is greater than the number threshold, the address configuration mode supported by the IPv6 network to which the network device accesses is determined as a preset default address configuration mode, and the parameter value of the dialing flag is set to correspond to the default address configuration mode;

[0074] Then, after the IPv6 dial-up control module 4 automatically starts the address configuration process of the address configuration mode corresponding to the parameter value of the dial-up flag, the automatic detection module 1 is further used to:

[0075] The value of the sending times statistical parameter is restored to a preset initial value.

[0076] Specifically, assuming that the initial value of the transmission count statistics is 0, the numerical threshold is 5 times, and the numerical step is 1; if the automatic detection module sends RS messages in sequence according to the transmission cycle, and the corresponding RA message is not received after five consecutive transmissions, the value of the transmission count statistics has gradually increased from the initial value 0 to 5. If the RS message sent for the sixth time still does not receive the corresponding RA message, the value of the transmission count statistics increases to 6, exceeding the numerical threshold 5. At this time, the automatic detection module determines the preset default address configuration method based on the address configuration method supported by the IPv6 network to which the network device is connected, and sets the parameter value of the dial-up flag to correspond to the default address configuration method. In this way, even if the RA message is not received, the subsequent IPv6 dial-up control module can still execute the corresponding configuration process, reducing the user's waiting time.

[0077] Furthermore, since it is not possible to determine whether the accessed IPv6 network supports stateful address configuration and stateless address configuration when no RA message is received, the default address configuration mode is set to static configuration mode, and the user manually configures the relevant address. Preferably, the parameter value of the dial flag is set to "N" at this time, and can also be set to other parameter values ​​according to actual needs.

[0078] Preferably, see Figure 4 , Figure 4 is a flowchart of a second preferred embodiment of the network device execution steps provided by the present invention; specifically, the managed address configuration flag is in the flag field of the router advertisement message, and the value of the managed address configuration flag includes 1 and 0; then, when determining the address configuration mode supported by the IPv6 network accessed by the network device according to the managed configuration flag, the automatic detection module is specifically used to:

[0079] When the value of the managed address configuration flag is 1, determining that the address configuration mode is a stateful address configuration mode based on the DHCPv6 protocol;

[0080] When the value of the managed address configuration flag is 0, determine whether the prefix option in the router advertisement message is a valid prefix option; when the prefix option is a valid prefix option, determine that the address configuration mode is a stateless address configuration mode based on the SLAAC protocol; when the prefix option is not a valid prefix option, determine that the address configuration mode is a static configuration mode.

[0081] Specifically, in the current communication rules, it is stipulated that when the managed configuration flag bit (M bit) is 1, it is used to instruct the network device to obtain the IPv6 address through a stateful address configuration method. In this case, the address configuration method is determined to be a stateful address configuration method based on the DHCPv6 protocol; when the managed configuration flag bit (M bit) is 0, it is used to instruct the network device to obtain the IPv6 address through a stateless address configuration method. However, since the stateless address configuration method needs to generate a complete IPv6 address based on the prefix option of the RA message, when the prefix option of the RA message is illegal, the address cannot be obtained through the stateless address configuration method. Therefore, when the managed configuration flag bit (M bit) is 0, if the prefix option is valid and legal, the address configuration method is determined to be a stateless address configuration method based on the SLAAC protocol; if the prefix option is not a valid prefix option, the address configuration method is determined to be a static configuration method, and the corresponding address information is manually configured by the user.

[0082] Preferably, when determining whether the prefix option in the router advertisement message is a valid prefix option, the automatic detection module 2 is specifically used to:

[0083] Determine whether the format of the prefix option in the router advertisement message complies with SLAAC protocol regulations;

[0084] If the format of the prefix option complies with the SLAAC protocol specification, the prefix option is determined to be a valid prefix option;

[0085] If the format of the prefix option does not comply with the SLAAC protocol specification, it is determined that the prefix option is not a valid prefix option.

[0086] Specifically, to determine whether the prefix option in the router advertisement message is a valid prefix option, it is necessary to determine whether the format of the prefix option in the router advertisement message complies with the SLAAC protocol regulations, such as the length of the prefix option and other formats. When its format complies with the SLAAC protocol regulations, the prefix option is determined to be a valid prefix option, otherwise it is not a valid prefix option.

[0087] In specific implementation, the network device that automatically detects the address configuration method supported by the IPv6 network provided in any of the above embodiments can achieve that when the automatic detection instruction is triggered, the automatic detection module of the network device responds to the automatic detection instruction and periodically sends a router request message from the WAN port according to the sending cycle; if the upper-level gateway receives the router request message, it generates a router advertisement message and sends it to the outside; when the network device receives the router advertisement message, it obtains the managed address configuration flag in the router advertisement message to determine the address configuration method supported by the IPv6 network to which the network device is connected.

[0088] The present invention provides a network device that automatically detects the address configuration mode supported by the IPv6 network. The device can actively send an RS message to the superior gateway during detection, receive an RA message replied by the superior gateway, and directly determine the address configuration mode supported by the IPv6 network to which the network device accesses according to the address configuration mode required by the network device indicated by the superior gateway. The network device can then obtain the IPv6 address of the network device according to the determined address configuration mode, without the need for the network device to continuously try different address configuration modes to detect the address configuration mode. Compared with the solutions in the prior art, the present invention saves time, simplifies the detection process, improves the automatic detection rate of the address configuration mode, and provides user experience.

[0089] The present invention also provides a method for automatically detecting the address configuration mode supported by the IPv6 network, see Figure 5 , Figure 5 A flow chart of a preferred embodiment of a method for automatically detecting an address configuration mode supported by an IPv6 network provided by the present invention; the method is executed by a network device, the network device includes a WAN port and an automatic detection module connected to the WAN port, and the method includes:

[0090] S1, the automatic detection module responds to the automatic detection instruction, sends a router request message from the WAN port according to a preset sending cycle, so as to trigger the upper gateway of the network device to generate a router advertisement message for the router request message, and send the router advertisement message to the network device;

[0091] S2. When receiving the router advertisement message, the automatic detection module obtains the managed address configuration flag in the router advertisement message;

[0092] S3. The automatic detection module determines the address configuration mode supported by the IPv6 network to which the network device accesses according to the managed configuration flag.

[0093] Preferably, the network device further comprises an IPv6 dial-up control module; wherein, before the automatic detection module responds to the automatic detection instruction, the method further comprises:

[0094] The IPv6 dial-up control module detects whether the user inputs a dial-up connection creation instruction after the network device accesses the IPv6 network;

[0095] When the dial-up connection creation instruction is detected, the IPv6 dial-up control module triggers a response to the automatic detection instruction and creates a dial-up connection with an unspecified address configuration mode according to the connection information input by the user, so that the network device can communicate with the upper-level gateway.

[0096] Preferably, the method further comprises:

[0097] The automatic detection module sets the parameter value of the dialing flag according to the determined address configuration mode; wherein different parameter values ​​of the dialing flag correspond to different address configuration modes;

[0098] Then, the network device further includes an IPv6 dial-up control module, and the method includes:

[0099] The IPv6 dial-up control module obtains the parameter value of the dial-up flag bit according to a preset obtaining method and obtaining period;

[0100] The IPv6 dial control module automatically starts the address configuration process of the address configuration mode corresponding to the parameter value of the dial flag bit according to the learned parameter value of the dial flag bit.

[0101] Further, the acquisition method is an active acquisition method in which the IPv6 dial-up control module actively queries the automatic detection module for the parameter value of the dial-up flag; or,

[0102] The acquisition method is a passive acquisition method in which the automatic detection module reports the parameter value of the dialing flag to the IPv6 dialing control module.

[0103] Furthermore, the method further comprises:

[0104] The automatic detection module increases the value of the preset sending times statistical parameter according to the preset numerical step size for each router request message sent when the router advertisement message corresponding to the router request message is not received;

[0105] The automatic detection module determines whether the value of the sending number statistical parameter is greater than a preset number threshold;

[0106] When the value of the sending times statistical parameter is greater than the times threshold, the automatic detection module determines the preset default address configuration mode according to the address configuration mode supported by the IPv6 network to which the network device is connected, and sets the parameter value of the dialing flag to correspond to the default address configuration mode;

[0107] Then, after the IPv6 dial-up control module automatically starts the address configuration process of the address configuration mode corresponding to the parameter value of the dial-up flag, the method further includes:

[0108] The automatic detection module restores the value of the sending times statistical parameter to a preset initial value.

[0109] Furthermore, the default address configuration mode is a static configuration mode.

[0110] Further, the managed address configuration flag is in the flag field of the router advertisement message, and the value of the managed address configuration flag includes 1 and 0; then, the automatic detection module determines, according to the managed configuration flag, that the address configuration mode supported by the IPv6 network to which the network device accesses is specifically:

[0111] When the value of the managed address configuration flag is 1, the automatic detection module determines that the address configuration mode is a stateful address configuration mode based on the DHCPv6 protocol;

[0112] When the value of the managed address configuration flag is 0, the automatic detection module determines whether the prefix option in the router advertisement message is a valid prefix option; when the prefix option is a valid prefix option, the automatic detection module determines that the address configuration method is a stateless address configuration method based on the SLAAC protocol; when the prefix option is not a valid prefix option, the automatic detection module determines that the address configuration method is a static configuration method.

[0113] Further, the automatic detection module determines whether the prefix option in the router advertisement message is a valid prefix option specifically as follows:

[0114] The automatic detection module determines whether the format of the prefix option in the router advertisement message complies with the SLAAC protocol regulations;

[0115] If the format of the prefix option complies with the SLAAC protocol specification, the automatic detection module determines that the prefix option is a valid prefix option;

[0116] If the format of the prefix option does not comply with the SLAAC protocol specification, the automatic detection module determines that the prefix option is not a valid prefix option.

[0117] The embodiment of the present invention provides a method for automatically detecting the address configuration mode supported by the IPv6 network. The method can actively send an RS message to the upper-level gateway during detection, receive the RA message replied by the upper-level gateway, and directly determine the address configuration mode supported by the IPv6 network to which the network device accesses according to the address configuration mode required by the network device indicated by the upper-level gateway. The network device can obtain the IPv6 address of the network device according to the determined address configuration mode, and the network device does not need to continuously try different address configuration modes to detect the address configuration mode. Compared with the solutions of the prior art, time is saved, the detection process can be simplified, the automatic detection rate of the address configuration mode is improved, and user experience is improved.

[0118] It should be noted that the method for automatically detecting the address configuration mode supported by the IPv6 network provided in the embodiment of the present invention corresponds to the function of the network device described in the above embodiment, and the working principles and beneficial effects of the two correspond one to one, so they are not repeated here.

[0119] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A network device for automatically detecting an address configuration method supported by an IPv6 network, characterized in that: The network device includes a WAN port and an automatic detection module connected to the WAN port, wherein the automatic detection module is specifically used for: In response to the automatic detection instruction, a router request message is sent from the WAN port according to a preset sending cycle to trigger the upper-level gateway of the network device to generate a router advertisement message for the router request message, and send the router advertisement message to the network device; When receiving the router advertisement message, obtaining a managed address configuration flag bit in the router advertisement message; Determining, according to the managed address configuration flag, an address configuration mode supported by the IPv6 network to which the network device accesses; The network device further includes an IPv6 dial-up control module; wherein, before the automatic detection module responds to the automatic detection instruction, the IPv6 dial-up control module is used to: After the network device is connected to the IPv6 network, detecting whether the user inputs a dial-up connection creation instruction; When the dial-up connection creation instruction is detected, the response to the automatic detection instruction is triggered, and a dial-up connection with an unspecified address configuration mode is created according to the connection information input by the user, so that the network device can communicate with the upper-level gateway.

2. The network device for automatically detecting the address configuration mode supported by the IPv6 network according to claim 1, characterized in that: The automatic detection module is also used for: According to the determined address configuration mode, setting the parameter value of the dialing flag; wherein different parameter values ​​of the dialing flag correspond to different address configuration modes; Then, the network device further includes an IPv6 dial-up control module, and the IPv6 dial-up control module is used to: Acquire the parameter value of the dialing flag bit according to a preset acquisition method and acquisition period; According to the acquired parameter value of the dialing flag, the address configuration process of the address configuration mode corresponding to the parameter value of the dialing flag is automatically started.

3. The network device for automatically detecting the address configuration mode supported by the IPv6 network according to claim 2, characterized in that: The acquisition method is an active acquisition method in which the IPv6 dial-up control module actively queries the automatic detection module for the parameter value of the dial-up flag; or, The acquisition method is a passive acquisition method in which the automatic detection module reports the parameter value of the dialing flag to the IPv6 dialing control module.

4. The network device for automatically detecting the address configuration mode supported by the IPv6 network according to claim 2, characterized in that: The automatic detection module is also used for: For each router request message sent, when the router advertisement message corresponding to the router request message is not received, the value of the preset sending number statistical parameter is increased according to the preset numerical step; and, Determine whether the value of the sending number statistical parameter is greater than a preset number threshold; When the value of the sending number statistical parameter is greater than the number threshold, the address configuration mode supported by the IPv6 network to which the network device accesses is determined as a preset default address configuration mode, and the parameter value of the dialing flag is set to correspond to the default address configuration mode; Then, after the IPv6 dial-up control module automatically starts the address configuration process of the address configuration mode corresponding to the parameter value of the dial-up flag, the automatic detection module is further used to: The value of the sending times statistical parameter is restored to a preset initial value.

5. The network device for automatically detecting the address configuration mode supported by the IPv6 network according to claim 4, characterized in that: The default address configuration mode is a static configuration mode.

6. The network device for automatically detecting the address configuration mode supported by the IPv6 network according to claim 1, characterized in that: The managed address configuration flag is in the flag field of the router advertisement message, and the value of the managed address configuration flag includes 1 and 0; then, when determining the address configuration mode supported by the IPv6 network accessed by the network device according to the managed address configuration flag, the automatic detection module is specifically used to: When the value of the managed address configuration flag is 1, determining that the address configuration mode is a stateful address configuration mode based on the DHCPv6 protocol; When the value of the managed address configuration flag is 0, determine whether the prefix option in the router advertisement message is a valid prefix option; when the prefix option is a valid prefix option, determine that the address configuration mode is a stateless address configuration mode based on the SLAAC protocol; when the prefix option is not a valid prefix option, determine that the address configuration mode is a static configuration mode.

7. The network device for automatically detecting the address configuration mode supported by the IPv6 network according to claim 6, characterized in that: When determining whether the prefix option in the router advertisement message is a valid prefix option, the automatic detection module is specifically used to: Determine whether the format of the prefix option in the router advertisement message complies with SLAAC protocol regulations; If the format of the prefix option complies with the SLAAC protocol specification, the prefix option is determined to be a valid prefix option; If the format of the prefix option does not comply with the SLAAC protocol specification, it is determined that the prefix option is not a valid prefix option.

8. A method for automatically detecting address configuration modes supported by an IPv6 network, characterized in that: The method is performed by a network device, the network device includes a WAN port and an automatic detection module connected to the WAN port, and the method includes: The automatic detection module responds to the automatic detection instruction and sends a router request message from the WAN port according to a preset sending period to trigger the upper-level gateway of the network device to generate a router advertisement message for the router request message, and send the router advertisement message to the network device; When receiving the router advertisement message, the automatic detection module obtains the managed address configuration flag bit in the router advertisement message; The automatic detection module determines the address configuration mode supported by the IPv6 network to which the network device accesses according to the managed address configuration flag bit; The network device further includes an IPv6 dial-up control module; wherein, before the automatic detection module responds to the automatic detection instruction, the method further includes: The IPv6 dial-up control module detects whether the user inputs a dial-up connection creation instruction after the network device accesses the IPv6 network; When the dial-up connection creation instruction is detected, the IPv6 dial-up control module triggers a response to the automatic detection instruction and creates a dial-up connection with an unspecified address configuration mode according to the connection information input by the user, so that the network device can communicate with the upper-level gateway.