Method and device for processing prefix conflict
By discarding conflicting Relay-reply messages in DHCPv6 relay, releasing prefix information, and sending Reconfigure messages to the client, the problem of prefix conflicts in the DHCPv6 relay network is solved, ensuring that the client can correctly obtain IPv6 prefixes and avoiding routing conflicts.
Patent Information
- Application Number
- CN202510082150.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-19
- Publication Date
- 2025-04-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When existing DHCPv6 relays handle prefix conflicts, it is easy for different DHCPv6 clients to hold the same IPv6 prefix, resulting in routing conflicts, or causing DHCPv6 clients to be unable to obtain IPv6 prefixes.
After the DHCPv6 relay receives the Relay-reply message, if there is a matching prefix entry in the local prefix table, the message will be discarded and the Release message will be sent to the DHCPv6 server to release the prefix information. Then, a Reconfigure message is sent to the second DHCPv6 client, including a message mark. The message is resent to the DHCPv6 server to allocate new prefix information until the DHCPv6 protocol message is received by the client within a preset time.
By coordinating the consistency of prefix information in the DHCPv6 relay network, the problem that DHCPv6 clients cannot obtain IPv6 prefix or hold the same prefix is avoided, ensuring the stable network and correct packet forwarding.
Smart Images

Figure CN119906697A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method and device for processing prefix conflicts. Background Art
[0002] The Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is designed for the IPv6 addressing scheme and is used to allocate IPv6 prefixes, IPv6 addresses and other network configuration parameters to hosts.
[0003] DHCPv6 clients usually communicate with DHCPv6 servers through link-local multicast addresses to obtain IPv6 prefixes, IPv6 addresses, and other network configuration parameters. When a DHCPv6 server and a DHCPv6 client are not in the same link scope, the two ends cannot communicate directly and need to forward DHCP messages through a DHCPv6 relay agent.
[0004] The DHCPv6 client applies for an IPv6 prefix from the DHCPv6 server. After receiving the Relay-reply message from the DHCPv6 server, the DHCPv6 relay agent obtains the IA_PD prefix option from the Advertise message carried in the Relay-reply message. The local relay table is searched based on the prefix information stored in the IA_PD prefix option. If there is a relay table entry in the relay table that matches the prefix information, and the DHCPv6 client information recorded in the relay table entry does not match the DHCPv6 client information currently applying for the IPv6 prefix, there is a prefix conflict.
[0005] In one existing processing method, the DHCPv6 relay continues to forward the above Advertise message to the DHCPv6 client that is currently applying for an IPv6 prefix, and does not generate a relay table entry corresponding to the DHCPv6 client that is currently applying for an IPv6 prefix. In another existing processing method, DHCPv6 discards the Relay-reply message and sends a Release message to the DHCPv6 server, so that the DHCPv6 server releases the IPv6 prefix allocated this time; and the DHCPv6 relay does not generate a relay table entry corresponding to the DHCPv6 client that is currently applying for an IPv6 prefix.
[0006] However, the above processing methods also expose the following problems: 1) In the first method, different DHCPv6 clients will hold the same IPv6 prefix, causing routing conflicts in the network, and data packets cannot be forwarded correctly and are discarded; 2) In the second method, the DHCPv6 client currently applying for an IPv6 prefix will not be able to obtain the IPv6 prefix. Summary of the invention
[0007] In view of this, the present application provides a method and device for processing prefix conflicts, so as to solve the problem that different DHCPv6 clients hold the same IPv6 or the DHCPv6 client cannot obtain the IPv6 prefix in the existing DHCPv6 relay network.
[0008] In a first aspect, the present application provides a method for handling prefix conflicts, the method being applied to a DHCPv6 relay, the method comprising:
[0009] Acquire a Relay-reply message sent by a DHCPv6 server, where the Relay-reply message includes first prefix information allocated by the DHCPv6 server to the first DHCPv6 client;
[0010] If a first prefix table entry matching the first prefix information exists in the local prefix table, discarding the Relay-reply message;
[0011] Sending a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information;
[0012] Sending a Reconfigure message to the second DHCPv6 client according to the first prefix table entry, where the Reconfigure message includes a message tag;
[0013] When the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag is received within a preset time, the DHCPv6 protocol message is sent to the DHCPv6 server, so that the DHCPv6 server re-allocates a second prefix information to the second DHCPv6 client.
[0014] In a second aspect, the present application provides a device for processing prefix conflicts, the device being applied to a DHCPv6 relay, the device comprising:
[0015] A receiving unit, configured to receive a Relay-reply message sent by a DHCPv6 server, wherein the Relay-reply message includes first prefix information allocated by the DHCPv6 server to a first DHCPv6 client;
[0016] a discarding unit, configured to discard the Relay-reply message if a first prefix table entry matching the first prefix information exists in the local prefix table;
[0017] a sending unit, configured to send a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information;
[0018] The sending unit is further configured to send a Reconfigure message to the second DHCPv6 client according to the first prefix table entry, wherein the Reconfigure message includes a message tag;
[0019] The sending unit is further configured to, when the receiving unit receives the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag within a preset time, send the DHCPv6 protocol message to the DHCPv6 server, so that the DHCPv6 server re-allocates second prefix information to the second DHCPv6 client.
[0020] In a third aspect, the present application provides a network device, including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to execute the method provided in the first aspect of the present application.
[0021] Therefore, by applying the prefix conflict processing method and device provided in the present application, the DHCPv6 relay receives a Relay-reply message sent by the DHCPv6 server, and the Relay-reply message includes the first prefix information allocated by the DHCPv6 server to the first DHCPv6 client; if there is a first prefix table item matching the first prefix information in the local prefix table, the DHCPv6 relay discards the Relay-reply message; the DHCPv6 relay sends a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information; according to the first prefix table item, the DHCPv6 relay sends a Reconfigure message to the second DHCPv6 client, and the Reconfigure message includes a message tag; when a DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag is received within a preset time, the DHCPv6 relay sends a DHCPv6 protocol message to the DHCPv6 server, so that the DHCPv6 server re-allocates the second prefix information to the second DHCPv6 client.
[0022] In this way, the DHCPv6 relay acts as a conflict detection device to coordinate the consistency of prefix information within the DHCPv6 relay network, avoiding the DHCPv6 client from being unable to obtain the IPv6 prefix or different DHCPv6 clients holding the same IPv6 prefix. In addition, the messages used in this application comply with RFC regulations and are also consistent with the consistency and universality of the DHCPv6 protocol.
[0023] In addition, this application can ensure to the greatest extent that old users continue to obtain the IPv6 prefix they currently hold and new users obtain the newly allocated IPv6 prefix. After the DHCPv6 server failure is restored, the impact on the user network is very small. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of a method for handling prefix conflicts provided in an embodiment of the present application;
[0025] Figure 2 A flowchart of another method for handling prefix conflicts provided in an embodiment of the present application;
[0026] Figure 3 A structural diagram of a prefix conflict processing device provided in an embodiment of the present application;
[0027] Figure 4 The network device hardware structure provided in the embodiment of the present application. DETAILED DESCRIPTION
[0028] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0029] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more corresponding listed items.
[0030] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0031] The following is a detailed description of the method for handling prefix conflicts provided in the embodiment of the present application. Figure 1 , Figure 1 A flowchart of a method for handling prefix conflicts provided in an embodiment of the present application. The method is applied to a DHCPv6 relay, and the DHCPv6 relay establishes communication connections with a DHCPv6 client and a DHCPv6 server respectively. A method for handling prefix conflicts provided in an embodiment of the present application may include the following steps.
[0032] Step 110: Receive a Relay-reply message sent by a DHCPv6 server, where the Relay-reply message includes first prefix information allocated by the DHCPv6 server to a first DHCPv6 client;
[0033] Specifically, the first DHCPv6 client and the DHCPv6 server are not within the same link range, and the first DHCPv6 client and the DHCPv6 server cannot communicate directly, and communication interaction needs to be achieved through a DHCPv6 relay.
[0034] The first DHCPv6 client wants to apply for prefix information from the DHCPv6 server. The first DHCPv6 client generates and sends a Solicit message. After receiving the Solicit message, the DHCPv6 relay encapsulates the Solicit message in a Relay Message Option and carries the Relay Message Option in a Relay-forward message.
[0035] The DHCPv6 relay agent sends a Relay-forward message to the DHCPv6 server.
[0036] After receiving the Relay-forward message, the DHCPv6 server obtains the Solicit message from it. According to the existing address allocation policy, the DHCPv6 server selects the IPv6 address prefix information and other parameters for the first DHCPv6 client and generates an Advertise message. The DHCPv6 server also encapsulates the Adcertise message in the relay message option and carries the relay message option in the Relay-reply message. The DHCPv6 server sends a Relay-reply message to the DHCPv6 relay.
[0037] After receiving the Relay-reply message, the DHCPv6 relay agent obtains the Advertise message therefrom, and obtains the first prefix information allocated by the DHCPv6 server to the first DHCPv6 client from the IA_PD prefix option included in the Advertise message.
[0038] Step 120: If a first prefix table entry matching the first prefix information exists in the local prefix table, discard the Relay-reply message;
[0039] Specifically, according to the description of step 110, after the DHCPv6 relay obtains the first prefix information, it determines whether there is a first prefix table entry matching the first prefix information in the local prefix table.
[0040] In one implementation, if the first prefix table entry exists in the prefix table, the DHCPv6 relay determines that a conflicting prefix currently exists (i.e., the first prefix table entry corresponding to the first prefix information has been stored), that is, the DHCPv6 server has assigned the same prefix information to two DHCPv6 clients and the DHCPv6 client information is different, one is the first DHCPv6 client and the other is the second DHCPv6 client. The second DHCPv6 client previously applied for prefix information from the DHCPv6 server, and the DHCPv6 relay generated the first prefix table entry according to the Advertise message sent by the DHCPv6 server at that time.
[0041] After the DHCPv6 relay determines that there is a conflicting prefix, it discards the Relay-reply message. It should be noted that after the DHCPv6 relay discards the Relay-reply message, the first DHCPv6 client cannot receive the Advertise message and thus obtain the first prefix information. Subsequently, the first DHCPv6 client can trigger the process of requesting prefix information from the DHCPv6 server again.
[0042] Optionally, in an embodiment of the present application, another implementation method is also included: if the first prefix table entry does not exist in the prefix table, the DHCPv6 relay determines that there is no conflicting prefix at present. At this time, the DHCPv6 relay will send an Advertise message to the first DHCPv6 client in accordance with the provisions of the existing DHCPv6 protocol. It can be understood that the Advertise message includes the first prefix information. At the same time, the DHCPv6 relay generates a prefix table entry corresponding to the first prefix information and stores it in the local prefix table.
[0043] After receiving the Advertise message, the first DHCPv6 client will send a request message to the DHCPv6 relay again according to the provisions of the existing DHCPv6 protocol. The subsequent process is the same as the process of the existing DHCPv6 client requesting IPv6 prefix information, IPv6 address, and other network configuration parameters (DNS, etc.), which will not be repeated here.
[0044] Step 130: Send a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information;
[0045] Specifically, according to the description of step 120, after discarding the Relay-reply message, the DHCPv6 relay generates and sends a Release message to the DHCPv6 server. The Release message includes the identifier of the first DHCPv6 client and the first prefix information.
[0046] After receiving the Release message, the DHCPv6 server obtains the identifier of the first DHCPv6 client and the first prefix information from the message, releases the first prefix information previously allocated to the first DHCPv6 client indicated by the identifier, and recycles and caches the first prefix information into the address pool.
[0047] Subsequently, the DHCPv6 server may again wait to receive the Solicit message sent by the first DHCPv6 client, and select IPv6 address prefix information and other parameters for the first DHCPv6 client. The selected IPv6 address prefix information may also be the first prefix information.
[0048] Step 140: Send a reconfiguration message to the second DHCPv6 client according to the first prefix table entry, where the reconfigure message includes a message tag;
[0049] Specifically, according to the description of step 130, after sending the Release message, the DHCPv6 relay generates and sends a Reconfigure message to the DHCPv6 client according to the first prefix table entry. The Reconfigure message includes a message tag.
[0050] The message tag is used to specify the message type of the DHCPv6 protocol message used by the DHCPv6 client to obtain the prefix information allocated by the DHCPv6 server again.
[0051] In the embodiment of the present application, according to the provisions of the existing DHCPv6 Reconfigure mechanism, the DHCPv6 protocol message specified by the message tag is specifically an information request (Information-Request) message or a renew (Renew) message.
[0052] Optionally, in an embodiment of the present application, the first prefix table entry includes an identifier of the second DHCPv6 client, an address of the DHCPv6 server, and the first prefix information;
[0053] The specific process of the DHCPv6 relay sending the Reconfigure message to the second DHCPv6 client according to the first prefix table item is as follows: according to the reconfiguration policy, the DHCPv6 relay determines the message tag of the message type of the DHCPv6 protocol message sent by the second DHCPv6 client, that is, the message tag of the Information-Request message or the message tag of the Renew message sent by the second DHCPv6 client; according to the identifier of the second DHCPv6 client, the DHCPv6 relay sends the Reconfigure message to the second DHCPv6 client. The Reconfigure message includes the message tag and the identifier of the second DHCPv6 client.
[0054] The above message tag may be carried in option (Option) 19 specified in the DHCPv6 protocol.
[0055] Step 150: When receiving the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag within a preset time, send the DHCPv6 protocol message to the DHCPv6 server, so that the DHCPv6 server re-allocates second prefix information to the second DHCPv6 client.
[0056] Specifically, according to the description of step 140, after the DHCPv6 relay sends the Reconfigure message to the second DHCPv6 client, the DHCPv6 relay creates a timer (Timer) and waits for the DHCPv6 protocol message sent by the second DHCPv6 client.
[0057] After receiving the Reconfigure message, the second DHCPv6 client obtains the identifier of the second DHCPv6 client from the message. According to the identifier of the second DHCPv6 client, the second DHCPv6 client determines that it is its own identifier and obtains the message tag from the Reconfigure message again. According to the message tag, the second DHCPv6 client determines to send the Renew message again.
[0058] According to the existing DHCPv6 protocol, the second DHCPv6 client re-triggers the prefix information application process. The second DHCPv6 client generates and sends a Renew message to the DHCPv6 relay again.
[0059] After creating the timer, the DHCPv6 relay determines whether a Renew message sent by the second DHCPv6 client is received within a preset time (for example, 3 seconds).
[0060] In one implementation, if the DHCPv6 relay receives a Renew message sent by the second DHCPv6 client within a preset time, the DHCPv6 relay sends a Renew message to the DHCPv6 server, so that the DHCPv6 server re-allocates the second prefix information to the second DHCPv6 client according to the Renew message.
[0061] It should be noted that, when the DHCPv6 server is in the process of reassigning the second prefix information to the second DHCPv6 client, the DHCPv6 relay will still receive the Relay-reply message sent by the DHCPv6 server. The DHCPv6 relay performs prefix conflict detection again, that is, executes the aforementioned step 110, and sends an Advertise message to the DHCPv6 client when there is no matching prefix table entry in the local prefix table. When there is a matching prefix table entry in the local prefix table, execute the aforementioned steps 120-150 until there is no matching prefix table entry in the local prefix table, and stop sending the Advertise message to the DHCPv6 client.
[0062] In another implementation, if the preset time has passed and the Renew message has not been received, DHCPv6 deletes the first prefix table entry. It should be noted that after the DHCPv6 relay sends the Reconfigure message to the second DHCPv6 client, it is expected that the second DHCPv6 client will send a Renew message to re-trigger the prefix application after receiving it. Therefore, if the Renew message is still not received after the timer expires, the DHCPv6 relay determines that the second DHCPv6 client has been offline and no longer holds the first prefix information (i.e., the conflicting prefix no longer exists).
[0063] Optionally, in an embodiment of the present application, there is also another implementation method. If the DHCPv6 relay receives any DHCPv6 protocol message sent by the DHCPv6 server within a preset time and any DHCPv6 protocol message includes the first prefix information, then the DHCPv6 relay discards any DHCPv6 protocol message in the prefix conflict processing stage.
[0064] The above-mentioned arbitrary DHCPv6 protocol message can specifically be an Advertise message and a Reply message. It can be understood that the Advertise message is carried in a Relay-reply message; and the Reply message is carried in a Relay-reply message.
[0065] Therefore, by applying the prefix conflict processing method provided by the present application, the DHCPv6 relay receives a Relay-reply message sent by the DHCPv6 server, and the Relay-reply message includes the first prefix information allocated by the DHCPv6 server to the first DHCPv6 client; if there is a first prefix table item matching the first prefix information in the local prefix table, the DHCPv6 relay discards the Relay-reply message; the DHCPv6 relay sends a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information; according to the first prefix table item, the DHCPv6 relay sends a Reconfigure message to the second DHCPv6 client, and the Reconfigure message includes a message tag; when a DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag is received within a preset time, the DHCPv6 relay sends a DHCPv6 protocol message to the DHCPv6 server, so that the DHCPv6 server re-allocates the second prefix information to the second DHCPv6 client.
[0066] In this way, the DHCPv6 relay acts as a conflict detection device to coordinate the consistency of prefix information within the DHCPv6 relay network, avoiding the DHCPv6 client from being unable to obtain the IPv6 prefix or different DHCPv6 clients holding the same IPv6 prefix. In addition, the messages used in this application comply with RFC regulations and are also consistent with the consistency and universality of the DHCPv6 protocol.
[0067] In addition, this application can ensure to the greatest extent that old users continue to obtain the IPv6 prefix they currently hold and new users obtain the newly allocated IPv6 prefix. After the DHCPv6 server failure is restored, the impact on the user network is very small.
[0068] The following is a detailed description of the method for handling prefix conflicts provided in the embodiment of the present application. Figure 2 , Figure 2 A flowchart of another method for handling prefix conflicts provided in an embodiment of the present application. Another method for handling prefix conflicts provided in an embodiment of the present application may include the following steps.
[0069] Step 200: The DHCPv6 relay agent receives a Relay-reply message sent by the DHCPv6 server.
[0070] Specifically, the DHCPv6 client 1 and the DHCPv6 server are not within the same link range, and the DHCPv6 client 1 and the DHCPv6 server cannot communicate directly, and communication interaction needs to be achieved through the DHCPv6 relay.
[0071] DHCPv6 client 1 wants to request prefix information from the DHCPv6 server. DHCPv6 client 1 generates and sends a Solicit message. After receiving the Solicit message, the DHCPv6 relay agent encapsulates the Solicit message in a Relay Message Option and carries the Relay Message Option in a Relay-forward message.
[0072] The DHCPv6 relay agent sends a Relay-forward message to the DHCPv6 server.
[0073] After receiving the Relay-forward message, the DHCPv6 server obtains the Solicit message from it. According to the existing address allocation policy, the DHCPv6 server selects the IPv6 address prefix information and other parameters for DHCPv6 client 1 and generates an Advertise message. The DHCPv6 server also encapsulates the Adcertise message in the relay message option and carries the relay message option in the Relay-reply message. The DHCPv6 server sends a Relay-reply message to the DHCPv6 relay.
[0074] The DHCPv6 relay agent receives the Relay-reply message.
[0075] Step 201: The DHCPv6 relay agent obtains prefix information 1 from a Relay-reply message.
[0076] Specifically, after receiving the Relay-reply message, the DHCPv6 relay agent obtains the Advertise message therefrom, and obtains the prefix information 1 allocated by the DHCPv6 server to the DHCPv6 client 1 from the Advertise message.
[0077] Step 202: The DHCPv6 relay agent searches the local relay table.
[0078] Specifically, after obtaining prefix information 1, the DHCPv6 relay agent searches the local relay table according to prefix information 1.
[0079] Step 203: The DHCPv6 relay determines whether there is a prefix entry 1 matching the prefix information 1 in the local relay table.
[0080] Specifically, the DHCPv6 relay determines whether there is a prefix table entry 1 matching the prefix information 1 in the local prefix table.
[0081] If prefix entry 1 exists in the prefix table, the DHCPv6 relay determines that a conflicting prefix already exists (i.e., prefix entry 1 corresponding to prefix information 1 has been stored), which means that the DHCPv6 server has assigned the same prefix information to two DHCPv6 clients with different DHCPv6 client information, one is DHCPv6 client 1, and the other is DHCPv6 client 2. DHCPv6 client 2 first applied for prefix information from the DHCPv6 server, and the DHCPv6 relay generated prefix entry 1 according to the Advertise message sent by the DHCPv6 server at that time.
[0082] After the DHCPv6 relay determines that a conflicting prefix currently exists, step 204 is executed; after the DHCPv6 relay determines that no conflicting prefix currently exists, step 213 is executed.
[0083] Step 204: If there is a prefix entry 1 matching the prefix information 1 in the local prefix table, the DHCPv6 relay discards the Relay-reply message.
[0084] Specifically, according to the description of step 203, after the DHCPv6 relay determines that a conflicting prefix currently exists, the DHCPv6 relay discards the Relay-reply message.
[0085] It should be noted that, since the DHCPv6 relay discards the Relay-reply message, the DHCPv6 client 1 cannot receive the Advertise message and thus obtain the prefix information 1. Subsequently, the DHCPv6 client 1 can trigger the process of requesting the prefix information from the DHCPv6 server again.
[0086] Step 205: The DHCPv6 relay agent sends a Release message to the DHCPv6 server.
[0087] Specifically, after discarding the Relay-reply message, the DHCPv6 relay generates and sends a Release message to the DHCPv6 server. The Release message includes the identifier of the DHCPv6 client 1 and the prefix information 1.
[0088] After receiving the Release message, the DHCPv6 server obtains the identifier of DHCPv6 client 1 and prefix information 1. The DHCPv6 server releases the prefix information previously allocated to DHCPv6 client 1 indicated by the identifier, recovers the prefix information, and caches it in the address pool.
[0089] Subsequently, the DHCPv6 server may again wait to receive the Solicit message sent by the DHCPv6 client 1 , and select the IPv6 address prefix information and other parameters for the DHCPv6 client 1 . The selected IPv6 address prefix information may also be prefix information 1 .
[0090] Step 206: The DHCPv6 relay agent sends a Reconfigure message to the DHCPv6 client 2.
[0091] Specifically, after sending the Release message, the DHCPv6 relay generates and sends a Reconfigure message to the DHCPv6 client 2 according to the prefix table entry 1. The Reconfigure message includes a message tag and an identifier of the DHCPv6 client 2.
[0092] The message tag is used to specify the message type of the DHCPv6 protocol message that the DHCPv6 client uses to obtain the prefix information assigned by the DHCPv6 server again. The message tag can be carried in option 19 specified in the DHCPv6 protocol.
[0093] In the embodiment of the present application, the DHCPv6 protocol message specified by the message mark is specifically a Renew message.
[0094] In the embodiment of the present application, the prefix table entry 1 includes the identifier of the DHCPv6 client 2, the address of the DHCPv6 server and the prefix information 1.
[0095] According to the reconfiguration strategy, the DHCPv6 relay determines the message tag of the message type of the DHCPv6 protocol message sent by the DHCPv6 client 2, that is, the message tag of the Renew message sent by the DHCPv6 client 2; according to the identifier of the DHCPv6 client 2, the DHCPv6 relay sends a Reconfigure message to the DHCPv6 client 2. The Reconfigure message includes the message tag of sending the Renew message and the identifier of the DHCPv6 client 2.
[0096] Step 207: The DHCPv6 relay starts a timer.
[0097] Specifically, after the DHCPv6 relay sends the Reconfigure message to the DHCPv6 client 2 , the DHCPv6 relay creates a timer and waits for the Renew message sent by the DHCPv6 client 2 .
[0098] After receiving the Reconfigure message, DHCPv6 client 2 obtains the identifier of DHCPv6 client 2. According to the identifier of DHCPv6 client 2, DHCPv6 client 2 determines that it is its own identifier and obtains the message tag from the Reconfigure message again. According to the message tag, DHCPv6 client 2 determines to send a Renew message again.
[0099] According to the existing DHCPv6 protocol, DHCPv6 client 2 triggers the process of applying for prefix information again. DHCPv6 client 2 generates and sends a Renew message to the DHCPv6 relay again.
[0100] Step 208: The DHCPv6 relay agent determines whether the timer has timed out.
[0101] Specifically, the DHCPv6 relay determines whether it has received a Renew message sent by the DHCPv6 client 2 within a preset time of the timer (for example, 3 seconds); if the timer has not timed out and the Renew message has been received, the DHCPv6 relay executes step 209; if the timer has timed out and the Renew message has not been received, the DHCPv6 relay executes step 212.
[0102] Step 209: If it has not timed out and the DHCPv6 relay agent has received the Renew message sent by the DHCPv6 client 2, the DHCPv6 relay agent sends a Renew message to the DHCPv6 server.
[0103] Specifically, according to the description of step 208, if the DHCPv6 relay receives the Renew message sent by the DHCPv6 client 2 within the preset time, the DHCPv6 relay sends a Renew message to the DHCPv6 server.
[0104] Step 210 : The DHCPv6 server re-allocates prefix information 2 to the DHCPv6 client 2 .
[0105] Specifically, after receiving the Renew message, the DHCPv6 server re-allocates prefix information 2 to the DHCPv6 client 2 according to the existing DHCPv6 protocol regulations.
[0106] It should be noted that, when the DHCPv6 server is reassigning prefix information 2 to the DHCPv6 client 2, the DHCPv6 relay agent will still receive the Relay-reply message sent by the DHCPv6 server. The DHCPv6 relay agent performs prefix conflict detection again, that is, executes the aforementioned step 200.
[0107] Step 211: The DHCPv6 relay agent waits for the DHCPv6 client 1 to re-apply for prefix information.
[0108] Specifically, according to the description of the above steps, if DHCPv6 client 1 continues not to receive the Advertise message sent by the DHCPv6 relay agent, DHCPv6 client 1 will trigger the process of applying for prefix information again.
[0109] It should be noted that, in the process of DHCPv6 client 1 triggering the application for prefix information, the DHCPv6 relay will still receive various DHCPv6 protocol messages sent by DHCPv6 client 1 and DHCPv6 server. The DHCPv6 relay performs prefix conflict detection again, that is, executes the above step 200.
[0110] Step 212: If the timeout expires and the DHCPv6 relay agent does not receive the Renew message sent by the DHCPv6 client 2, the DHCPv6 relay agent deletes the prefix entry 1.
[0111] Specifically, according to the description of step 208, if the preset time has passed and the DHCPv6 relay has not received the Renew message, the DHCPv6 deletes the first prefix table entry.
[0112] It should be noted that after the DHCPv6 relay sends the Reconfigure message to the DHCPv6 client 2, it is expected that the DHCPv6 client 2 will send a Renew message to re-trigger the prefix application after receiving it. Therefore, if the Renew message is not received after the timer expires, the DHCPv6 relay determines that the DHCPv6 client 2 has been offline and no longer holds the prefix information 1 (that is, the conflicting prefix no longer exists).
[0113] Step 213: If there is no prefix table entry 1 matching the prefix information 1 in the local prefix table, the DHCPv6 relay agent sends an Advertise message to the DHCPv6 client 1.
[0114] Specifically, according to the description of step 203, after the DHCPv6 relay determines that there is no conflicting prefix, the DHCPv6 relay will send an Advertise message to the DHCPv6 client 1 according to the provisions of the existing DHCPv6 protocol. It can be understood that the Advertise message includes prefix information 1.
[0115] After receiving the Advertise message, DHCPv6 client 1 will send a Request message to the DHCPv6 relay agent again according to the existing DHCPv6 protocol. The subsequent process is the same as the process of the existing DHCPv6 client requesting IPv6 prefix information, IPv6 address, and other network configuration parameters, and will not be repeated here.
[0116] Based on the same inventive concept, the embodiment of the present application also provides a prefix conflict processing device corresponding to the prefix conflict processing method. Figure 3 , Figure 3 A prefix conflict processing device provided in an embodiment of the present application includes:
[0117] The receiving unit 310 is configured to receive a Relay-reply message sent by a DHCPv6 server, wherein the Relay-reply message includes first prefix information allocated by the DHCPv6 server to a first DHCPv6 client;
[0118] a discarding unit 320, configured to discard the Relay-reply message if a first prefix table entry matching the first prefix information exists in the local prefix table;
[0119] The sending unit 330 is configured to send a Release message to the DHCPv6 server so that the DHCPv6 server releases the first prefix information;
[0120] The sending unit 330 is further configured to send a Reconfigure message to the second DHCPv6 client according to the first prefix table entry, wherein the Reconfigure message includes a message tag;
[0121] The sending unit 330 is further configured to, when the receiving unit 310 receives the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag within a preset time, send the DHCPv6 protocol message to the DHCPv6 server, so that the DHCPv6 server re-allocates second prefix information to the second DHCPv6 client.
[0122] Optionally, the Relay-reply message includes an Advertise message;
[0123] The sending unit 330 is further configured to send the Advertise message to the first DHCPv6 client if there is no first prefix table entry matching the first prefix information in the local prefix table.
[0124] Optionally, the discarding unit 320 is further configured to discard any DHCPv6 protocol message sent by the DHCPv6 server when the DHCPv6 protocol message is received within the preset time and the DHCPv6 protocol message includes the first prefix information.
[0125] Optionally, the device further comprises:
[0126] A deleting unit (not shown in the figure) is configured to delete the first prefix table entry when the preset time has expired and the receiving unit has not received the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag.
[0127] Optionally, the first prefix table entry further includes an identifier of the second DHCPv6 client;
[0128] The sending unit 330 is specifically configured to determine, according to the reconfiguration strategy, a message tag of the message type of the DHCPv6 protocol message sent by the second DHCPv6 client;
[0129] Send a Reconfigure message to the second DHCPv6 client according to the identifier of the second DHCPv6 client.
[0130] Therefore, by applying the prefix conflict processing device provided by the present application, the DHCPv6 relay receives a Relay-reply message sent by the DHCPv6 server, and the Relay-reply message includes the first prefix information allocated by the DHCPv6 server to the first DHCPv6 client; if there is a first prefix table item matching the first prefix information in the local prefix table, the DHCPv6 relay discards the Relay-reply message; the DHCPv6 relay sends a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information; according to the first prefix table item, the DHCPv6 relay sends a Reconfigure message to the second DHCPv6 client, and the Reconfigure message includes a message tag; when a DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag is received within a preset time, the DHCPv6 relay sends a DHCPv6 protocol message to the DHCPv6 server, so that the DHCPv6 server re-allocates the second prefix information to the second DHCPv6 client.
[0131] In this way, the DHCPv6 relay acts as a conflict detection device to coordinate the consistency of prefix information within the DHCPv6 relay network, avoiding the DHCPv6 client from being unable to obtain the IPv6 prefix or different DHCPv6 clients holding the same IPv6 prefix. In addition, the messages used in this application comply with RFC regulations and are also consistent with the consistency and universality of the DHCPv6 protocol.
[0132] In addition, this application can ensure to the greatest extent that old users continue to obtain the IPv6 prefix they currently hold and new users obtain the newly allocated IPv6 prefix. After the DHCPv6 server failure is restored, the impact on the user network is very small.
[0133] Based on the same inventive concept, the embodiment of the present application also provides a network device, such as Figure 4 As shown, it includes a processor 410, a transceiver 420 and a machine-readable storage medium 430, the machine-readable storage medium 430 stores machine-executable instructions that can be executed by the processor 410, and the processor 410 is prompted by the machine-executable instructions to execute the prefix conflict processing method provided in the embodiment of the present application. Figure 3 The prefix conflict processing device shown in FIG. Figure 4 The network device hardware structure shown is implemented.
[0134] The computer-readable storage medium 430 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage.
[0135] Optionally, the computer-readable storage medium 430 may also be at least one storage device located away from the aforementioned processor 410 .
[0136] The processor 410 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components.
[0137] In the embodiment of the present application, the processor 410 reads the machine executable instructions stored in the machine readable storage medium 430, and the machine executable instructions enable the processor 410 itself and the transceiver 420 to execute the prefix conflict processing method described in the aforementioned embodiment of the present application.
[0138] In addition, an embodiment of the present application provides a machine-readable storage medium 430, which stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions prompt the processor 410 itself and the calling transceiver 420 to execute the prefix conflict processing method described in the aforementioned embodiment of the present application.
[0139] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0140] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0141] As for the prefix conflict processing device and machine-readable storage medium embodiments, since the method contents involved are basically similar to the aforementioned method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0142] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for handling prefix conflicts, characterized in that: The method is applied to a DHCPv6 relay, and the method comprises: receiving a Relay-reply message sent by a DHCPv6 server, wherein the Relay-reply message includes first prefix information allocated by the DHCPv6 server to a first DHCPv6 client; If a first prefix table entry matching the first prefix information exists in the local prefix table, discarding the Relay-reply message; Sending a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information; Sending a Reconfigure message to the second DHCPv6 client according to the first prefix table entry, where the Reconfigure message includes a message tag; When the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag is received within a preset time, the DHCPv6 protocol message is sent to the DHCPv6 server, so that the DHCPv6 server re-allocates the second prefix information to the second DHCPv6 client.
2. The method according to claim 1, characterized in that The Relay-reply message includes an Advertise message; After receiving the Relay-reply message sent by the DHCPv6 server, the method further includes: If there is no first prefix table entry matching the first prefix information in the local prefix table, sending the Advertise message to the first DHCPv6 client.
3. The method according to claim 1, characterized in that The method further comprises: When any DHCPv6 protocol message sent by the DHCPv6 server is received within the preset time and the any DHCPv6 protocol message includes the first prefix information, the any DHCPv6 protocol message is discarded.
4. The method according to claim 1, characterized in that: The method further comprises: When the preset time has expired and the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag is not received, the first prefix table entry is deleted.
5. The method according to claim 1, characterized in that The first prefix table entry also includes an identifier of the second DHCPv6 client; The sending a Reconfigure message to the second DHCPv6 client according to the first prefix table entry specifically includes: Determining, according to the reconfiguration strategy, a message tag of a message type of the DHCPv6 protocol message sent by the second DHCPv6 client; Send a Reconfigure message to the second DHCPv6 client according to the identifier of the second DHCPv6 client.
6. A prefix conflict processing device, characterized in that: The device is applied to a DHCPv6 relay, and the device comprises: A receiving unit, configured to receive a Relay-reply message sent by a DHCPv6 server, wherein the Relay-reply message includes first prefix information allocated by the DHCPv6 server to a first DHCPv6 client; a discarding unit, configured to discard the Relay-reply message if a first prefix table entry matching the first prefix information exists in the local prefix table; a sending unit, configured to send a Release message to the DHCPv6 server, so that the DHCPv6 server releases the first prefix information; The sending unit is further configured to send a Reconfigure message to the second DHCPv6 client according to the first prefix table entry, wherein the Reconfigure message includes a message tag; The sending unit is further configured to, when the receiving unit receives the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag within a preset time, send the DHCPv6 protocol message to the DHCPv6 server, so that the DHCPv6 server re-allocates second prefix information to the second DHCPv6 client.
7. The device according to claim 6, characterized in that The Relay-reply message includes an Advertise message; The sending unit is further configured to send the Advertise message to the first DHCPv6 client if there is no first prefix table entry matching the first prefix information in the local prefix table.
8. The device according to claim 6, characterized in that The discarding unit is further configured to discard any DHCPv6 protocol message sent by the DHCPv6 server when receiving the message within the preset time and the message includes the first prefix information.
9. The device according to claim 6, characterized in that The device also includes: and a deleting unit, configured to delete the first prefix table entry when the preset time has expired and the receiving unit has not received the DHCPv6 protocol message sent by the second DHCPv6 client according to the message tag.
10. The device according to claim 6, characterized in that The first prefix table entry also includes an identifier of the second DHCPv6 client; The sending unit is specifically configured to determine, according to a reconfiguration strategy, a message tag of a message type of the DHCPv6 protocol message sent by the second DHCPv6 client; Send a Reconfigure message to the second DHCPv6 client according to the identifier of the second DHCPv6 client.
Citation Information
Patent Citations
Method and system for managing internet protocol version 6 (IPV6) address conflicts automatically
CN102984288A
Client end IP address assignment method and device
CN106254571A
Internet protocol address allocation method and relay device
WO2017000128A1