Search

CN-116527636-B - Communication method and device

CN116527636BCN 116527636 BCN116527636 BCN 116527636BCN-116527636-B

Abstract

The application provides a communication method and device, the method comprises the steps of receiving service messages sent by DHCPv6 clients, wherein the service messages are used for requesting the DHCPv6 servers to execute corresponding services, sending a Relay-forward message to each DHCPv6 server indicated by attribute information of a plurality of DHCPv6 servers, the Relay-forward message comprises the service messages, and if a first Relay-reply message sent by any one DHCPv6 server is received within a preset time period and the first reply message included in the first Relay-reply message indicates that the DHCPv6 server has successfully executed the corresponding services, sending the first reply message to the DHCPv6 clients.

Inventors

  • LI FANGYUAN

Assignees

  • 新华三技术有限公司

Dates

Publication Date
20260505
Application Date
20230425

Claims (8)

  1. 1. A communication method, wherein the method is applied to a DHCPv6 Relay, and attribute information of a plurality of DHCPv6 servers is configured in the DHCPv6 Relay, the method comprising: Receiving a service message sent by a DHCPv6 client, wherein the service message is used for requesting a DHCPv6 server to execute a corresponding service; Sending a Relay-forward message to each DHCPv6 server indicated by attribute information of the plurality of DHCPv6 servers, wherein the Relay-forward message comprises the service message; If a first Relay-reply message sent by any one DHCPv6 server is received within a preset time period and the first reply message included in the first Relay-reply message indicates that the DHCPv6 server successfully executes a corresponding service, sending the first reply message to the DHCPv6 client; the service message is specifically a DHCPv6 Rebind message or a DHCPv6 Confirm message.
  2. 2. The method according to claim 1, wherein the method further comprises: and if a second Relay-reply message sent by any one DHCPv6 server is received within a preset time period and the second reply message included in the second Relay-reply message indicates that the DHCPv6 server does not successfully execute the corresponding service, caching the second reply message.
  3. 3. The method of claim 2, wherein after the sending the first reply message to the DHCPv6 client, the method further comprises: discarding all the cached second reply messages; And discarding the third Relay-reply message if the third Relay-reply message sent by any DHCPv6 server is received again.
  4. 4. The method according to claim 2, wherein the method further comprises: and if the first Relay-reply message is not received after the preset time period and the locally cached fourth reply message indicates that the DHCPv6 server does not successfully execute the corresponding service, sending the fourth reply message to the DHCPv6 client.
  5. 5. A communication apparatus, the apparatus being applied to a DHCPv6 Relay, the DHCPv6 Relay having attribute information of a plurality of DHCPv6 servers configured therein, the apparatus comprising: the receiving unit is used for receiving a service message sent by the DHCPv6 client, wherein the service message is used for requesting the DHCPv6 server to execute the corresponding service; A sending unit, configured to send a Relay-forward message to each DHCPv6 server indicated by attribute information of the multiple DHCPv6 servers, where the Relay-forward message includes the service message; The sending unit is configured to send a first reply message to the DHCPv6 client if the first reply message sent by any one DHCPv6 server is received within a preset period of time and the first reply message included in the first reply-reply message indicates that the DHCPv6 server has successfully executed the corresponding service; the service message is specifically a DHCPv6 Rebind message or a DHCPv6 Confirm message.
  6. 6. The apparatus of claim 5, wherein the apparatus further comprises: And the caching unit is used for caching the second reply message if the second reply message sent by any one DHCPv6 server is received within a preset time period and the second reply message included in the second reply message indicates that the DHCPv6 server does not successfully execute the corresponding service.
  7. 7. The apparatus of claim 6, wherein the apparatus further comprises: a discarding unit, configured to discard all the cached second reply messages; and if the receiving unit receives a third Relay-reply message sent by any DHCPv6 server again, discarding the third Relay-reply message.
  8. 8. The apparatus of claim 6, wherein the sending unit is further configured to send the fourth reply message to the DHCPv6 client if the first Relay-reply message is not received after a preset period of time and the locally cached fourth reply message indicates that the DHCPv6 server has not successfully performed the corresponding service.

Description

Communication method and device Technical Field The present application relates to the field of communications technologies, and in particular, to a communications method and apparatus. Background The dynamic host configuration protocol (English: dynamic Host Configuration Protocol for IPv, abbreviated: DHCPv 6) supporting IPv6 is designed for IPv6 addressing schemes to allocate IPv6 prefixes, IPv6 addresses and other network configuration parameters to DHCPv6 clients. Of course, to facilitate the rational use of the assigned address by the DHCPv6 client, DHCPv6 also includes a number of mechanisms, such as a DHCPv6 rebinding (Rebind) mechanism, a DHCPv6 acknowledgement (Confirm) mechanism, and so on. The specific process of the DHCPv6Rebind mechanism is that after the DHCPv6 client applies for the address, the address is continued after the interval T1. If the response of the DHCPv6 server is not obtained, the DHCPv6 client re-binds after the interval T2. The DHCPv6 client sends DHCPv6Rebind messages to the reachable DHCPv6 server to extend the time of use of the address. When the DHCPv6 server judges that the service time of the address applied by the DHCPv6 client can be extended, the address applied by the DHCPv6 client can be prolonged by confirming success of a reply (reply) message, and when the DHCPv6 server judges that the service time of the address applied by the DHCPv6 client can not be extended, the DHCPv6 server replies a reply message which comprises an error code of unbinding (NO BINDING), the DHCPv6 client can not continue to use the applied address, and the address can be reapplied to the DHCPv6 server. The specific process of the DHCPv6 Confirm mechanism is that the DHCPv6 client sends a DHCPv6 Confirm message to an reachable DHCPv6 server to Confirm whether the address applied by the DHCPv6 client is still available. When the DHCPv6 server judges that the address applied by the DHCPv6 client is still available, the address applied by the DHCPv6 client is continuously used by the reply message, when the DHCPv6 server judges that the address applied by the DHCPv6 client is NOT available any more, the DHCPv6 server replies a reply message which comprises an error code which is NOT ON line (NOT ON LINK), the DHCPv6 client does NOT continuously use the applied address, and the address can be reapplied to the DHCPv6 server. Currently, DHCPv6 clients typically communicate with DHCPv6 servers via link-local range multicast addresses to obtain IPv6 addresses and other network configuration parameters. When the DHCPv6 server and the DHCPv6 client are not in the same link range, the DHCPv6 server and the DHCPv6 client cannot directly communicate, and forwarding of the message is required to be realized through a DHCPv6 Relay (Relay). The deployment of the DHCPv6 Relay can avoid the deployment of the DHCPv6 server in each link range, thereby saving the cost and facilitating the centralized management. The process of acquiring IPv6 addresses and other network configuration parameters from a DHCPv6 server through a DHCPv6 Relay by the DHCPv6 client comprises the steps that the DHCPv6 client sends a solution message to a multicast address FF02 of all the DHCPv6 servers and Relay 1:2, the DHCPv6 Relay receives the solution message, packages the solution message in a Relay message Option (RELAY MESSAGE Option) of a Relay-forward message, sends a Relay-forward message to the DHCPv6 server, analyzes the solution message of the DHCPv6 client from the Relay-forward message, selects the IPv6 address and other parameters for the DHCPv6 client, constructs an advertisement message, and packages the advertisement message in the Relay message Option (RELAY MESSAGE Option) of the Relay-forward message, and sends the Relay-forward message to the DHCPv6 server. The DHCPv6 Relay analyzes the advertisement message of the DHCPv6 server from the Relay-reply message, forwards the advertisement message to the DHCPv6 client so that the DHCPv6 client can perform network configuration according to the IPv6 address and other parameters distributed by the DHCPv6 server, the DHCPv6 client sends a Request message to multicast addresses FF02 of all the DHCPv6 servers and the Relay in a ratio of 1:2, the DHCPv6 Relay packages the Request message in a Relay message option of the Relay-forward message and sends the Relay-forward message to the DHCPv6 server, the DHCPv6 server analyzes the Request message of the client from the Relay-forward message, selects the IPv6 address and other parameters for the client, constructs a reply message, and packages the reply message in the Relay message of the Relay-reply message and sends the Relay-reply message to the Relay-6. The DHCPv6 Relay analyzes the Reply message of the server from the Relay-Reply message, and forwards the Reply message to the DHCPv6 client so that the DHCPv6 client can perform network configuration according to the IPv6 address and other parameters distributed by the DHCP