Method, apparatus, computing device, and storage medium for sending response messages
In the DHCP relay anycast scenario, network devices and relay devices jointly generate and send routed publishing messages, ensuring that the destination address of the reply message is different from the IP address of the tunnel endpoint of the relay device, solving the problem of reply message bypassing, improving the stability of client online and the efficiency of network equipment.
Patent Information
- Application Number
- CN202010026742.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-10
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2040-01-10
AI Technical Summary
In the DHCP relay anycast scenario, the reply message may be detoured because multiple relay devices have the same IP address, affecting the client's online stability, bandwidth and CPU usage of network devices.
Through the network device and the relay device working together, routed and publishing messages are generated and sent, ensuring that the destination address of the reply message is different from the IP address of the tunnel endpoint of the relay device, and avoiding detours. Specific measures include that the network device determines a unique next hop address based on the routing table, and the relay device generates multiple route publishing messages to instruct the network device to send a reply message.
Reduces the detour of the reply message, improves the stability of the client online, and reduces the bandwidth and CPU usage of other relay devices in the target anycast group.
Smart Images

Figure CN113132505B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technologies, and particularly relates to a method, apparatus, computing device, and storage medium for sending response messages. Background Art
[0002] The Dynamic Host Configuration Protocol (DHCP) is a protocol for dynamically managing and configuring Internet Protocol (IP) addresses of clients. IP addresses include Internet Protocol Version 4th (IPv4) addresses and Internet Protocol Version 6th (IPv6) addresses. With the expansion of the network scale and the development of network technologies, the application of DHCP is becoming more and more widespread. DHCP can be applied to the DHCP relay anycast scenario. In this scenario, a client accesses multiple relay devices (i.e., gateway devices), and the IP addresses on the access sides of the multiple relay devices are the same. The multiple relay devices present as one device to the DHCP service side, that is, the IP addresses presented to the DHCP service side are the same.
[0003] In the DHCP relay anycast scenario, when a client applies for an IP address, an address request message can be sent to a certain relay device according to the hash principle. After receiving the address request message, the relay device can encapsulate the IP address presented by the relay device to the DHCP service side and the IP address of the interface that received the address request message in the address request message, and add the IP address of the DHCP service device on the DHCP service side. Then, the added address request message can be sent to the network device connected to the DHCP service side through a tunnel. After receiving the added address request message, the network device forwards the address request message to the DHCP service side. The DHCP service device on the DHCP service side allocates an IP address for the client based on the IP address of the interface in the address request message. Then, the allocated IP address for the client is encapsulated, and the destination address is added as the IP address of the relay device carried in the address request message to obtain a response message. The DHCP service device on the DHCP service side sends the response message to the network device. After receiving the response message, the network device can obtain the destination address in the response message, query the routing table, and determine the next hop. The network device sends the response message to the relay device, and the relay device sends the IP address in the response message to the client.
[0004] In the DHCP relay anycast scenario, since multiple relay devices present the same IP address to the DHCP service side, the response message may be sent to other relay devices. When other relay devices send the response message to the relay device that sent the address request message, it may cause a detour in the forwarding path of the response message. Summary of the Invention
[0005] An embodiment of the present application provides a method, apparatus, computing device, and storage medium for sending a response message. By using the present application, the detour situation in the forwarding path of the response message can be reduced.
[0006] In a first aspect, a method for sending a response message is provided, which is applied to a network device connected to a DHCP service device. The method includes:
[0007] The network device receives a response message sent by the DHCP service device. The destination address of the response message is the first Internet Protocol (IP) address of the relay device. The relay device has a communication connection with the client, and the client is the client that applies for an IP address from the DHCP service device. The network device determines multiple next-hop addresses corresponding to the destination IP address according to the destination IP address of the response message, and determines a first next-hop address among the multiple next-hop addresses. The first next-hop address is the first tunnel endpoint IP address of the relay device and is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs. Each relay device in the target anycast group has a communication connection with the client. The network device forwards the response message to the relay device according to the first next-hop address.
[0008] In the solution shown in the present application, after receiving an address request message, the DHCP service device can generate a response message corresponding to the address request message. The response message includes the IP address assigned to the client that applies for the IP address. The destination address of the response message is the first IP address of the relay device. The relay device has a communication connection with the client, and the address request message is sent by the relay device to the DHCP service device. The DHCP service device sends the response message to the connected network device. The network device receives the response message sent by the DHCP service device. The network device can view the destination IP address of the response message, then look up the routing table, and determine that there are multiple next-hop addresses corresponding to the destination IP address in the routing table. The network device can determine a first next-hop address among the multiple next-hop addresses. The first next-hop address is the first tunnel endpoint IP address of the relay device. The first tunnel endpoint IP address is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs. The network device can use the first next-hop address to forward the response message to the relay device to which the destination address of the response message belongs.
[0009] In this way, since the first tunnel endpoint IP address is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs, the response message will not be sent to other relay devices in the target anycast group, so that the response message does not detour.
[0010] In a possible implementation, the network device determines a first next-hop address among multiple next-hop addresses according to the straight-through flag.
[0011] In a possible implementation, the network device receives a first route advertisement message through a first tunnel to which the first tunnel endpoint IP address belongs. The first route advertisement message includes a first IP address, a first tunnel endpoint IP address, and a straight-through flag corresponding to the first tunnel endpoint IP address. The tunnel endpoints of the first tunnel are a relay device and the network device. The network device stores the first tunnel endpoint IP address as the first next-hop address of the first IP address and adds a straight-through flag to the first tunnel endpoint IP address.
[0012] In the solution shown in this application, after the network device receives the first route advertisement message and determines that the destination address is its own IP address, it can resolve the first IP address and the straight-through flag of the relay device from the message, and can resolve that the source address is the first tunnel endpoint IP address. Then the network device can add the first IP address to the routing table, store the first tunnel endpoint IP address as the first next-hop address of the first IP address in the routing table, and the first tunnel endpoint IP address corresponds to a straight-through flag. In this way, the network device stores the next-hop address of the first IP address, and the next-hop address corresponds to a straight-through flag.
[0013] In a possible implementation, the network device receives a second route advertisement message through a second tunnel to which the second tunnel endpoint IP address belongs. The second route advertisement message includes a first IP address and a second tunnel endpoint IP address. The tunnel endpoints of the second tunnel are a relay device and the network device. The second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group. The network device stores the second tunnel endpoint IP address as the second next-hop address of the first IP address.
[0014] In the solution shown in this application, after the network device receives the second route advertisement message and determines that the destination address is its own IP address, it can resolve the first IP address and the straight-through flag of the relay device from the message, and can resolve that the source address is the second tunnel endpoint IP address. Then the network device can add the first IP address to the routing table and store the second tunnel endpoint IP address as the second next-hop address of the first IP address in the routing table. In this way, the network device stores another next-hop address of the first IP address.
[0015] In a possible implementation, the network device receives the encapsulated address request message sent by the relay device through the first tunnel or the second tunnel to which the first tunnel endpoint IP address belongs. The destination address of the encapsulated address request message is the IP address of the DHCP service device. The network device sends the encapsulated address request message to the DHCP service device.
[0016] In this way, the network device can receive the address request message in multiple ways.
[0017] In a second aspect, a method for sending a route advertisement message is provided, which is applied to a relay device. The method includes:
[0018] The relay device generates multiple route advertisement messages. Each route advertisement message of the multiple route advertisement messages includes the first IP address of the relay device and one tunnel endpoint IP address of the relay device. The tunnel endpoint IP address included in each route advertisement message is different. The tunnel endpoint IP address included in the first route advertisement message among the multiple route advertisement messages is the first tunnel endpoint IP address. The first tunnel endpoint IP address is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs. Each relay device in the target anycast group has established a communication connection with the client applying for the IP address. The relay device sends the multiple route advertisement messages to the network device to instruct the network device to send a response message to the relay device through the first tunnel endpoint IP address in the first route advertisement message. The response message is sent by the DHCP service device to the network device, and the destination IP address of the response message is the first IP address.
[0019] In the solution shown in this application, the relay device can generate a corresponding number of route advertisement messages based on the number of tunnels established between itself and the network device. Each route advertisement message includes the first IP address of the relay device and one tunnel endpoint IP address of the relay device. The tunnel endpoint IP address included in the first route advertisement message among the multiple route advertisement messages is the first tunnel endpoint IP address. The first tunnel endpoint IP address is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs. Each relay device in the target anycast group has established a communication connection with the client applying for the IP address. The relay device can send these multiple route advertisement messages to the network device. After receiving them, the network device can record the first tunnel endpoint IP address in the first route advertisement message as the next-hop address of the response message sent to the relay device. In this way, the network device can send the response message to the relay device through the first tunnel endpoint IP address later, reducing the detour of the response message.
[0020] In a possible implementation, the relay device receives a response message sent by the network device based on the first tunnel endpoint IP address, and sends the IP address assigned by the DHCP service device to the client in the response message to the client according to the media access control (MAC) address of the client corresponding to the response message.
[0021] In the solution shown in this application, the relay device can send the IP address assigned to the client in the response message to the client according to the MAC address in the established temporary user table. In this way, the address request message and the response message for the client to apply for an IP address pass through the same relay device, so the situation of the response message detouring will not occur.
[0022] In a possible implementation, the IP address assigned to the client is an IPv4 address or an IPv6 address. In this way, the response messages for applying for an IPv4 address or an IPv6 address can both reduce detouring.
[0023] In a possible implementation, the first routing advertisement message further includes a direct pass flag corresponding to the first tunnel endpoint IP address.
[0024] In a possible implementation, the multiple routing advertisement messages include a first routing advertisement message and a second routing advertisement message; the relay device sends the first routing advertisement message to the network device through the first tunnel to which the first tunnel endpoint IP address belongs; and sends the second routing advertisement message to the network device through the second tunnel to which the second tunnel endpoint IP address belongs, where the tunnel endpoints of the first tunnel and the second tunnel are the relay device and the network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group.
[0025] In the solution shown in this application, the relay device can carry the first IP address of the relay device in the first routing advertisement message, and encapsulate the first tunnel endpoint IP address as the source IP address of the first routing advertisement message, that is, the first routing advertisement message includes the first IP address of the relay device and the first tunnel endpoint IP address. The destination address of the first routing advertisement message is the tunnel endpoint IP address of the network device. The relay device sends the first routing advertisement message to the network device through the first tunnel. In this way, the relay device can notify its own first address to the peer device (i.e., the network device) of the first tunnel.
[0026] The relay device may carry the first IP address of the relay device in the second routing advertisement message, and encapsulate the second tunnel endpoint IP address as the source IP address of the second routing advertisement message, that is, the second routing advertisement message includes the first IP address of the relay device and the second tunnel endpoint IP address. The destination address of the second routing advertisement message is the tunnel endpoint IP address of the network device. The relay device sends the second routing advertisement message to the network device through the second tunnel. In this way, the relay device can advertise its own first address to the peer device (i.e., the network device) of the second tunnel.
[0027] In this way, the network device can store two next-hop addresses corresponding to the first address.
[0028] In a possible implementation, the relay device receives an address request message sent by a client; encapsulates the first IP address and the second IP address into the address request message, where the second IP address is the IP address of the interface through which the relay device receives the address request message; encapsulates the IP address of the DHCP service device as the destination address of the address request message; and forwards the encapsulated address request message to the network device through the first tunnel or the second tunnel according to the destination address.
[0029] In this way, the relay device can send the address request message to the DHCP service device.
[0030] In a third aspect, the present application provides a device for sending a response message, which is applied to a network device. The device includes multiple modules, and the multiple modules implement the method for sending a response message provided in the first aspect above by executing instructions.
[0031] In a fourth aspect, the present application provides a device for sending a routing advertisement message, which is applied to a relay device. The device includes multiple modules, and the multiple modules implement the method for sending a routing advertisement message provided in the second aspect above by executing instructions.
[0032] In a fifth aspect, the present application provides a computing device, which includes a memory and a processor. The processor executes computer instructions stored in the memory, so that the computing device executes the method for sending a response message described in the first aspect above.
[0033] In a sixth aspect, the present application provides a computing device, which includes a memory and a processor. The processor executes computer instructions stored in the memory, so that the computing device executes the method for sending a routing advertisement message described in the second aspect above.
[0034] In a seventh aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions. When the computer instructions in the computer-readable storage medium are executed by a computing device, the computing device is caused to execute the method for sending a response message described in the first aspect above, or the computing device is caused to implement the functions of the apparatus described in the third aspect.
[0035] In an eighth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions. When the computer instructions in the computer-readable storage medium are executed by a computing device, the computing device is caused to execute the method for sending a routing advertisement message described in the second aspect above, or the computing device is caused to implement the functions of the apparatus described in the fourth aspect.
[0036] In a ninth aspect, the present application provides a computer program product. The computer program product includes computer instructions. When the computer instructions are executed by a computing device, the computing device executes the method for sending a response message described in the first aspect above.
[0037] In a tenth aspect, the present application provides a computer program product. The computer program product includes computer instructions. When the computer instructions are executed by a computing device, the computing device executes the method for sending a routing advertisement message described in the second aspect above.
[0038] In an eleventh aspect, a system for sending a response message is provided. The system includes a network device and a relay device. Among them, the network device is the network device described in the third aspect above, and the relay device is the relay device described in the fourth aspect above. Description of the Drawings
[0039] Figure 1 is a schematic diagram of a DHCP relay anycast scenario provided by an exemplary embodiment of the present application;
[0040] Figure 2 is a schematic structural diagram of a relay device provided by an exemplary embodiment of the present application;
[0041] Figure 3 is a schematic structural diagram of a relay device provided by an exemplary embodiment of the present application;
[0042] Figure 4 is a schematic structural diagram of a network device provided by an exemplary embodiment of the present application;
[0043] Figure 5 is a schematic structural diagram of a network device provided by an exemplary embodiment of the present application;
[0044] Figure 6It is a schematic diagram of an application scenario provided by an exemplary embodiment of the present application;
[0045] Figure 7 It is a schematic flowchart of a method for notifying an IP address provided by an exemplary embodiment of the present application;
[0046] Figure 8 It is a schematic flowchart of a method for sending a response message provided by an exemplary embodiment of the present application;
[0047] Figure 9 It is a schematic flowchart of a process for applying for an IPv4 address provided by an exemplary embodiment of the present application;
[0048] Figure 10 It is a schematic flowchart of a process for applying for an IPv4 address provided by an exemplary embodiment of the present application;
[0049] Figure 11 It is a schematic flowchart of a process for applying for an IPv6 address provided by an exemplary embodiment of the present application;
[0050] Figure 12 It is a schematic diagram of the structure of a device for sending a response message provided by an exemplary embodiment of the present application;
[0051] Figure 13 It is a schematic diagram of the structure of a device for sending a response message provided by an exemplary embodiment of the present application;
[0052] Figure 14 It is a schematic diagram of the structure of a device for sending a response message provided by an exemplary embodiment of the present application. Detailed implementation manners
[0053] To make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0054] To facilitate the understanding of the embodiments of the present application, the concepts of the terms involved are first introduced below:
[0055] DHCP is a protocol for dynamically managing and configuring client IP addresses (such as IPv4 addresses, IPv6 addresses, etc.).
[0056] Anycast is to assign an IP address to hosts at different physical locations in the same network, and the packets sent to this host are routed by the network to the "nearest" host.
[0057] The DHCP relay anycast scenario is one in which the client connects to multiple relay devices, and the IP addresses on the access sides of the multiple relay devices are the same; the multiple relay devices present as a single device to the DHCP service side, that is, the IP addresses presented to the DHCP service side are the same; usually, tunneling technology is used for packet forwarding between the multiple relay devices and the network devices connected to the DHCP service device (the device that assigns IP addresses to the clients), and the multiple relay devices appear as anycast to the network devices. For example, as Figure 1 shown, the client connects to relay device 1 and relay device 2, and the IP addresses of the client connecting to relay device 1 and relay device 2 are both IP1; the DHCP service device is connected to the network device, and relay device 1 and relay device 2 have established tunnels with the network device. The IP addresses presented by relay device 1 and relay device 2 to the network device are the same, that is, relay device 1 and relay device 2 appear as anycast to the network device.
[0058] In the related art, in Figure 1 , when the client applies for an IP address, the client sends an address request packet to relay device 1 according to the hash principle. After receiving it, relay device 1 can encapsulate the IP address of relay device 1 (the globally unique IP address) and the IP address of the interface receiving the address request packet in the address request packet, and add the IP address of the DHCP service device (as the destination IP address of the address request packet). Then relay device 1 can send the added address request packet to the network device connected to the DHCP service device through the tunnel. After receiving the added address request packet, the network device forwards the address request packet to the DHCP service device. The DHCP service device assigns an IP address to the client based on the IP address of the interface in the address request packet. Then the assigned IP address for the client is encapsulated, and the destination address is added as the IP address of relay device 1 carried in the address request packet to obtain a response packet. The DHCP service device sends the response packet to the network device. After receiving the response packet, the network device can obtain the destination address of the response packet, query the routing table, and determine the next hop. Based on the next hop, the network device sends response packet 1 to the relay device. Since the IP addresses presented by relay device 1 and relay device 2 to the network device are the same, the next hop determined by the network device is the same IP address of relay device 1 and relay device 2, so the response packet is very likely to be sent to relay device 2 and then sent to relay device 1 by relay device 2, which will cause the response packet to detour. Therefore, a method for sending the response packet is needed to reduce the probability of the response packet detouring.
[0059] The present application provides a method for sending a response message, which can be executed by a network device and / or a relay device. The relay device can be a gateway device. The network device can be a software device or a hardware device. When the network device is a hardware device, the network device can be a router, a switch, etc. implemented by hardware. When the network device is a software device, the network device can be a router, a switch, etc. implemented by software. The relay device can be a software device or a hardware device. When the relay device is a hardware device, the relay device can be a server, a computing device, a terminal, etc. When the relay device is a software device, the software device can be installed on a server, a computing device, etc.
[0060] In addition, the embodiments of the present application also relate to a DHCP service device. The DHCP service device can be a software device or a hardware device. When the DHCP service device is a software device, it can be a program installed on a router, a switch, a server, etc. for allocating IP addresses to clients; when the DHCP service device is a hardware device, it can be a router, a switch, a server, etc. implemented by hardware.
[0061] When the relay device is a hardware device, as Figure 2 shown, a schematic structural diagram of a router or a switch is provided. The relay device includes a main control board 201 and an interface board 202. The main control board 201 includes a processor 2011 and a memory 2012. The interface board 202 includes a processor 2021, a memory 2022, and an interface card 2023. A communication connection is established between the main control board 201 and the interface board 202.
[0062] The processor 2011 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), etc. The processor 302 can include one or more chips. The memory 2012 can be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 2012 can store computer instructions. When the computer instructions stored in the memory 2012 are executed by the processor 201, the processor 201 executes the methods of sending a response message and sending a routing advertisement message.
[0063] The processor 2021 can be a CPU, an application-specific integrated circuit (ASIC), etc. The processor 2021 can include one or more chips. The memory 2022 can be a ROM, a static storage device, a dynamic storage device, or a RAM. The memory 2022 can store computer instructions. When the computer instructions stored in the memory 2022 are executed by the processor 2021, the processor 2021 executes the method of sending response messages and sending routing advertisement messages. The interface board can implement the reception and transmission processing of messages.
[0064] When the relay device is a hardware device, such as Figure 3 As shown, another schematic diagram of the structure of a router or a switch is provided. The relay device includes a memory 301, a processor 302, a transceiver 303, and a bus 304. Among them, the memory 301, the processor 302, and the transceiver 303 are communicatively connected to each other through the bus 304.
[0065] The memory 301 can be a ROM, a static storage device, a dynamic storage device, or a RAM. The memory 301 can store computer instructions. When the computer instructions stored in the memory 301 are executed by the processor 302, the processor 302 and the transceiver 303 are used to execute the method of sending response messages and sending routing advertisement messages. The memory can also store data. For example, a part of the memory 301 is used to store the data required for the method of sending response messages and sending routing advertisement messages, as well as to store the intermediate data or result data during the execution of the program.
[0066] The processor 302 can be a general-purpose CPU, an application ASIC, a graphics processing unit (GPU), or any combination thereof. The processor 302 can include one or more chips.
[0067] The transceiver 303 uses a transceiver module such as, but not limited to, a transceiver to implement the communication between the relay device and other devices or communication networks. For example, the data required for sending response messages can be obtained through the transceiver 303.
[0068] The bus 304 can include a path for transmitting information between various components of the relay device (for example, the memory 301, the processor 302, and the transceiver 303).
[0069] When the network device is a hardware device, such as Figure 4 As shown, a schematic diagram of the structure of a router or a switch is provided. The network device includes a main control board 401 and an interface board 402. The main control board 401 includes a processor 4011 and a memory 4012. The interface board 402 includes a processor 4021, a memory 4022, and an interface card 4023. A communication connection is established between the main control board 401 and the interface board 402.
[0070] The processor 4011 can be a central processing unit, an application-specific integrated circuit, etc. The processor 302 can include one or more chips. The memory 4012 can be a read-only memory, a static storage device, a dynamic storage device, or a random access memory. The memory 4012 can store computer instructions. When the computer instructions stored in the memory 4012 are executed by the processor 401, the processor 401 executes the method of sending a response message.
[0071] The processor 4021 can be a CPU, an application-specific integrated circuit (ASIC), etc. The processor 4021 can include one or more chips. The memory 4022 can be a ROM, a static storage device, a dynamic storage device, or a RAM. The memory 4022 can store computer instructions. When the computer instructions stored in the memory 4022 are executed by the processor 4021, the processor 4021 executes the method of sending a response message. The interface board can implement the receiving and sending processing of messages.
[0072] When the network device is a hardware device, such as Figure 5 As shown, there is also provided a schematic structural diagram of another router or switch. The network device includes a memory 501, a processor 502, a transceiver 503, and a bus 504. Among them, the memory 501, the processor 502, and the transceiver 503 are communicatively connected to each other through the bus 504.
[0073] The memory 501 can be a ROM, a static storage device, a dynamic storage device, or a RAM. The memory 501 can store computer instructions. When the computer instructions stored in the memory 501 are executed by the processor 502, the processor 502 and the transceiver 503 are used to execute the method of sending a response message. The memory can also store data. For example, a part of the memory 501 is used to store the data required for the method of sending a response message, as well as to store the intermediate data or result data during the execution of the program.
[0074] The processor 502 can be a general-purpose CPU, an application ASIC, a graphics processor, or any combination thereof. The processor 502 can include one or more chips.
[0075] The transceiver 503 uses a transceiver module such as, but not limited to, a transceiver to implement communication between the network device and other devices or communication networks. For example, the data required when sending a response message can be obtained through the transceiver 503.
[0076] The bus 504 can include a path for transmitting information between various components of the network device (such as the memory 501, the processor 502, and the transceiver 503).
[0077] An embodiment of the present application provides a method for sending a response message, where the response message is a response message corresponding to an address request message. As Figure 6 shown, the client can establish communication connections with multiple relay devices (there may be other forwarding devices between the client and the relay devices). The message forwarding between the client and the multiple relay devices is based on a layer 2 network, and the IP addresses of the client when accessing the multiple relay devices are the same. The message forwarding between the multiple relay devices and the network device connected to the DHCP service device is based on tunneling technology, and the multiple relay devices appear as anycast to the network device connected to the DHCP service device. There may be other forwarding devices between the network device and the DHCP service device. The messages between the network device and the DHCP service device can be forwarded based on a layer 2 network or a layer 3 network, which is not limited in the embodiments of the present application.
[0078] Taking the multiple relay devices as two relay devices (relay device 1 and relay device 2) in the embodiments of the present application as an example, the following Figure 7 describes the process of the relay device notifying the network device connected to the DHCP service device of the IP address:
[0079] Step 701, the relay device generates multiple route advertisement messages.
[0080] In this embodiment, relay device 1 and relay device 2 form a target anycast group. Both relay device 1 and relay device 2 have established communication connections with the client applying for an IP address, and the IP address applied for by the client is an IPv4 address or an IPv6 address. Technicians configure the tunnel endpoint IP address (IP2) on relay device 1 and relay device 2, and technicians configure the tunnel endpoint IP address (IP3) belonging to relay device 1 on relay device 1, and technicians configure the tunnel endpoint IP address (IP4) belonging to relay device 2 on relay device 2. IP3 and IP4 are different. The IP3 of relay device 1 is a globally unique IP address, and the IP4 of relay device 2 is a globally unique IP address. In this way, relay device 1 and relay device 2 have the same tunnel endpoint IP address (IP2), and relay device 1 and relay device 2 also have different tunnel endpoint IP addresses. The IP3 address of relay device 1 is the first tunnel endpoint IP address of relay device 1 in the following text, and the IP4 of relay device 2 is the first tunnel endpoint IP address of relay device 2 in the following text.
[0081] After the relay device 1 goes online, the relay device 1 can generate multiple route advertisement messages. Each route advertisement message includes the first IP address of the relay device 1 (the first IP address of the relay device 1 is the IP address configured on the relay device 1 (such as the IP address on the loopback interface). The source IP address of each route advertisement message is a tunnel endpoint IP address of the relay device 1, and the source IP addresses of each route advertisement message are different. In this way, each route advertisement message is equivalent to including the first IP address of the relay device 2 and a tunnel endpoint IP address of the relay device 1. In addition, when the relay device includes two tunnel endpoint IP addresses (IP2 address and IP3 address), since the relay device 1 has only two tunnel endpoint IP addresses, the relay device 1 only generates two route advertisement messages.
[0082] Similarly, the processing of the relay device 2 can refer to the processing process of the relay device 1, which will not be elaborated here.
[0083] Step 702, the relay device sends multiple route advertisement messages to the network device to instruct the network device to send a response message to the relay device through the first tunnel endpoint IP address. Among them, the response message is sent by the DHCP service device to the network device, and the destination IP address of the response message is the first IP address.
[0084] In this embodiment, the relay device 1 sends the generated multiple route advertisement messages to the network device. After the network device receives the multiple route advertisement messages sent by the relay device 1, it can parse the multiple route advertisement messages, obtain the first IP address of the relay device 1 from them, and obtain the tunnel endpoint IP address of each route advertisement message. Then the network device records each tunnel endpoint IP address as the next-hop address of the first IP address of the relay device 1. In this way, when there are multiple tunnel endpoint IP addresses for the relay device 1, the network device will record multiple next-hop addresses (i.e., IP2 address and IP3 address) for the first IP address of the relay device 1.
[0085] Similarly, the network device will record multiple next-hop addresses (i.e., IP2 address and IP4 address) for the first IP address of the relay device 2.
[0086] In a possible implementation, the first route advertisement message further includes a direct-pass flag corresponding to the first tunnel endpoint IP address. In this way, when the network device receives the first route advertisement message, when storing the first tunnel endpoint IP address as the next-hop address of the first IP address, it stores the direct-pass flag.
[0087] In addition, in a possible implementation, among the multiple route advertisement messages, other route advertisement messages except the first route advertisement message further include a non-direct transit flag corresponding to the tunnel endpoint IP address. In this way, when the network device receives the other route advertisement message and stores these tunnel endpoint IP addresses as the next-hop addresses of the first IP address, it stores the non-direct transit flag, while when there is a first tunnel endpoint IP address as the next-hop address of the first IP address, it stores the direct transit flag.
[0088] In a possible implementation, the route advertisement messages generated by the relay device 1 include a first route advertisement message and a second route advertisement message. The processing in step 702 can be:
[0089] Send the first route advertisement message to the network device through the first tunnel to which the first tunnel endpoint IP address belongs, and send the second route advertisement message to the network device through the second tunnel to which the second tunnel endpoint IP address belongs, where the tunnel endpoints of the first tunnel and the second tunnel are the relay device and the network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group.
[0090] In this embodiment, a first tunnel and a second tunnel are established between the relay device 1 and the network device. The tunnel endpoint IP address of the first tunnel on the relay device 1 side is the first tunnel endpoint IP address; the tunnel endpoint IP address of the second tunnel on the relay device 1 side is the second tunnel endpoint IP address. The process of establishing the first tunnel and the second tunnel can be manually configured. Of course, other methods can also be used. The embodiments of the present application do not make limitations. In addition, the first tunnel and the second tunnel can be virtual extensible local area network (vxlan) tunnels.
[0091] The relay device 1 can carry the first IP address of the relay device 1 in the first route advertisement message, and encapsulate the first tunnel endpoint IP address as the source IP address of the first route advertisement message, that is, the first route advertisement message includes the first IP address of the relay device 1 and the first tunnel endpoint IP address. The destination address of the first route advertisement message is the tunnel endpoint IP address of the network device. The relay device 1 sends the first route advertisement message to the network device through the first tunnel. In this way, the relay device 1 can advertise its own first address to the peer device (i.e., the network device) of the first tunnel.
[0092] The relay device 1 may carry the first IP address of the relay device 1 in the second routing advertisement message and encapsulate the second tunnel endpoint IP address as the source IP address of the second routing advertisement message, that is, the second routing advertisement message includes the first IP address of the relay device 1 and the second tunnel endpoint IP address. The destination address of the second routing advertisement message is the tunnel endpoint IP address of the network device. The relay device 1 sends the second routing advertisement message to the network device through the second tunnel. In this way, the relay device 1 can advertise its own first address to the peer device (i.e., the network device) of the second tunnel.
[0093] It should be noted that a new command can be added under the interface (such as the loopback interface, etc.) to which the first IP address of the relay device 1 belongs, for instructing the relay device 1 to send the first routing advertisement message to the network device through the first tunnel. Of course, other methods can also be used. For example, when the relay device detects that there are multiple tunnel endpoint IP addresses configured, it advertises to the network device based on the tunnels to which they belong respectively. The embodiments of the present application do not make limitations. The new command can be directly stored in the relay device 1 by a technician, or can be sent to the relay device 1 by a controller.
[0094] In a possible implementation manner, the processing of the first routing advertisement message sent by the relay device 1 received by the network device may be as follows:
[0095] The network device receives the first routing advertisement message through the first tunnel to which the first tunnel endpoint IP address belongs. The first routing advertisement message includes the first IP address, the first tunnel endpoint IP address, and a straight-through flag corresponding to the first tunnel endpoint IP address. The tunnel endpoints of the first tunnel are the relay device and the network device. The first tunnel endpoint IP address is stored as the first next-hop address of the first IP address, and a straight-through flag is added to the first tunnel endpoint IP address.
[0096] In this embodiment, after the network device receives the first routing advertisement message and determines that the destination address is its own IP address, it can resolve the first IP address and the straight-through flag of the relay device 1 from it, and can resolve that the source IP address is the first tunnel endpoint IP address. Then the network device can add the first IP address to the routing table, store the first tunnel endpoint IP address as the first next-hop address of the first IP address in the routing table, and the first tunnel endpoint IP address corresponds to a straight-through flag. In this way, the network device stores the next-hop address of the first IP address, and the next-hop address corresponds to a straight-through flag.
[0097] In a possible implementation manner, the processing of the second routing advertisement message sent by the relay device 1 received by the network device may be as follows:
[0098] Receive a second route advertisement message through a second tunnel whose second tunnel endpoint IP address belongs to, where the second route advertisement message includes a first IP address and a second tunnel endpoint IP address, the tunnel endpoints of the second tunnel are a relay device and a network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group. Store the second tunnel endpoint IP address as the second next-hop address of the first IP address.
[0099] In this embodiment, after the network device receives the second route advertisement message, if it determines that the destination address is its own IP address, it can resolve the first IP address of relay device 1 from it, and can resolve that the source IP address is the second tunnel endpoint IP address. Then the network device can add the first IP address to the routing table, and store the second tunnel endpoint IP address as the second next-hop address of the first IP address in the routing table. In this way, another next-hop address of the first IP address is stored in the network device.
[0100] In this way, through the above processing, two next-hop addresses (i.e., the first next-hop address and the second next-hop address) are stored on the network device corresponding to the first IP address.
[0101] Only relay device 1 is used as an example in the above process for illustration. The processing of other relay devices in the target anycast group is the same as this, and will not be elaborated here.
[0102] The following will combine Figure 8 to illustrate the process of the method for sending an acknowledgment message (illustrated by taking relay device 1 as an example):
[0103] Step 801, the network device receives an acknowledgment message sent by the DHCP service device; wherein, the destination address of the acknowledgment message is the first IP address of the relay device, a communication connection is established between the relay device and the client, and the client is the client that applies for an IP address from the DHCP service device.
[0104] In this embodiment, after the DHCP service device receives the address request message, it can generate an acknowledgment message corresponding to the address request message. The acknowledgment message includes the IP address assigned to the client that applies for the IP address, the destination address of the acknowledgment message is the first IP address of the relay device, a communication connection is established between the relay device and the client, and the address request message is sent by the relay device to the DHCP service device. The DHCP service device sends the acknowledgment message to the connected network device. The network device receives the acknowledgment message sent by the DHCP service device.
[0105] Step 802, the network device determines multiple next-hop addresses corresponding to the destination IP address according to the destination IP address of the acknowledgment message.
[0106] In this embodiment, the network device can view the destination IP address of the response packet, then search the routing table, and determine that there are multiple next-hop addresses corresponding to the destination IP address in the routing table.
[0107] Step 803: The network device determines a first next-hop address among the multiple next-hop addresses. The first next-hop address is the first tunnel endpoint IP address of the relay device and is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs. Each relay device in the target anycast group has established a communication connection with the client.
[0108] In this embodiment, the network device can determine a first next-hop address among the multiple next-hop addresses. The first next-hop address is the first tunnel endpoint IP address of the relay device, and the first tunnel endpoint IP address is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs.
[0109] In a possible implementation, the first next-hop address corresponds to a direct-through flag. The network device can determine, among the multiple next-hop addresses, the next-hop address corresponding to the direct-through flag and determine it as the first next-hop address.
[0110] Step 804: The network device forwards the response packet to the relay device according to the first next-hop address.
[0111] In this embodiment, the network device can use the first next-hop address, encapsulate the first next-hop address as the outer IP address of the response packet, and encapsulate the tunnel endpoint IP address of the network device as the source IP address. And encapsulate the source MAC address of the response packet as the MAC address of the network device, and encapsulate the MAC address of the next-hop used to forward the response packet to the relay device as the next-hop MAC address. Then the network device forwards the encapsulated response packet to the relay device to which the destination address of the response packet belongs. After receiving the encapsulated response packet, the relay device determines that the outer IP address of the encapsulated response packet is its own, and can de-encapsulate the encapsulated response packet, remove the outer encapsulation of the tunnel, and obtain the response packet carrying the IP address assigned to the client. Then the relay device sends the response packet to the corresponding client of the response packet (this process is described later).
[0112] In this way, since the first tunnel endpoint IP address is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs, the response packet will not be sent to other relay devices in the target anycast group, so that the response packet can avoid detours, improving the stability of the client going online. It can also reduce the bandwidth occupancy and CPU occupancy of other relay devices in the target anycast group.
[0113] In the embodiment of the present application, the IP address applied by the client can be an IPv4 address or an IPv6 address. When the client applies for an IPv4 address, it is allocated by an IPv4 DHCP service device, and when the client applies for an IPv6 address, it is allocated by an IPv6 DHCP service device.
[0114] The following will be combined Figure 9 This section describes the process of a client applying for an IPv4 address.
[0115] Step 901: The relay device receives an address request message sent by a client.
[0116] When applying for an IPv4 address, the address request message is a discover message.
[0117] In this embodiment, if the client wants to apply for an IPv4 address, it can generate an address request message, and then determine the hash value from itself to each relay device in the target anycast group through the hash principle. Assume that relay device 1 is selected based on the hash value from itself to each relay device in the target anycast group. If the hash value from the client to relay device 1 is the smallest, relay device 1 is selected. Then the client sends an address request message to relay device 1.
[0118] Step 902: The relay device encapsulates the first IP address and the second IP address into an address request message, wherein the second IP address is the IP address of the interface of the relay device that receives the address request message.
[0119] The first IP address and the second IP address are both IPv4 addresses.
[0120] In this embodiment, after receiving the address request message sent by the client, the relay device 1 determines the IP address of the interface receiving the address request message (i.e., the second IP address), and then generates a temporary user table, which includes the MAC address of the client and the interface name of the interface. Then the relay device 1 inserts the second IP address in the sub-option (sub5) numbered 5 of the option (option82) numbered 82 in the configured relay agent information option. The relay device 1 encapsulates the first IP address that is unique to the entire network into the Gateway IP address (Giaddr) field of the address request message.
[0121] Step 903: The relay device encapsulates the IP address of the IPv4 DHCP service device as the destination address of the address request message.
[0122] In this embodiment, the relay device 1 may determine the IP address of the IPv4 DHCP service device corresponding to the interface to which the second IP address belongs, and encapsulate the IP address of the IPv4 DHCP service device as the destination IPv4 address of the address request message.
[0123] Step 904: The relay device forwards the encapsulated address request message to the network device through the first tunnel or the second tunnel according to the destination address of the address request message.
[0124] In this embodiment, the relay device 1 may look up the routing table to determine that the next hop is the network device connected to the DHCP service device. The relay device 1 may encapsulate the outer IP address and the outer MAC address of the outer layer of the address request message. The outer IP address includes the source IP address (the tunnel endpoint IP address of the relay device) and the destination IP address (the tunnel endpoint IP address of the network device), and the outer MAC address includes the source MAC address (the MAC address of the relay device) and the destination MAC address (the MAC address of the next hop for forwarding the address request message to the network device). Then the relay device 1 looks up the routing table and sends the encapsulated address request message to the network device.
[0125] Step 905: The network device receives the encapsulated address request message, and based on the destination IPv4 address of the de-tunneled address request message, sends the de-tunneled address request message to the IPv4 DHCP service device.
[0126] In this embodiment, after receiving the encapsulated address request message, the network device recognizes that the destination IP address of the outer IP address of the outer layer encapsulation is its own IP address, and can perform de-encapsulation to obtain the de-tunneled address request message. Then the network device sends the de-tunneled address request message to the IPv4 DHCP service device.
[0127] Step 906: The IPv4 DHCP service device receives the de-tunneled address request message, allocates an IPv4 address for the client, generates a response message, and sends it to the network device.
[0128] In this embodiment, after receiving the address request message, the IPv4 DHCP service device may parse to obtain the second IP address in sub5 of option82, and determine the IP address belonging to the same network segment as the second IP address in its stored address pool as the IP address allocated for the client. The IPv4 DHCP service device generates a response message, and the response message includes the IP address allocated for the client. The IPv4 DHCP service device may also encapsulate the IP address in the Giaddr field (i.e., the first IP address) as the destination IPv4 address of the response message. Then the IPv4 DHCP service device sends the response message to the network device.
[0129] Step 907: The network device receives the response message sent by the DHCP service device of IPv4, determines multiple next-hop addresses corresponding to the destination IPv4 address according to the destination IPv4 address of the response message, determines the first next-hop address among the multiple next-hop addresses, and forwards the response message to the relay device according to the first next-hop address.
[0130] The process of step 907 is exactly the same as that of Figure 8 which will not be elaborated here.
[0131] Step 908: The relay device receives the response message sent by the network device based on the first tunnel endpoint IP address through the first tunnel.
[0132] Step 909: The relay device sends the IPv4 address assigned by the DHCP service device to the client in the response message to the client according to the media access control (MAC) address of the client corresponding to the response message.
[0133] In this embodiment, the relay device 1 may send the response message carrying the IPv4 address assigned to the client to the client according to the MAC address and interface name in the established temporary user table. In this way, the address request message and the response message for the client to apply for the IPv4 address pass through the same relay device, so the situation of the response message detouring will not occur, improving the stability of the client going online. It can also reduce the bandwidth occupancy and CPU occupancy of other relay devices in the target anycast group.
[0134] Figure 9 Only the case where the address request message is sent to the relay device 1 is taken as an example for illustration. Of course, the same principle applies to other relay devices in the target anycast group except the relay device 1, which will not be elaborated in this embodiment of the present application.
[0135] In addition, for the convenience of understanding, this embodiment of the present application also provides a message route map for applying for an IPv4 address as shown in Figure 10 The solid black line with an arrow is the route of the address request message, and the dashed black line with an arrow is the route of the response message.
[0136] It should be noted that in the scenario of applying for an IPv4 address, the tunnel endpoint IP address may be an IPv4 address.
[0137] The following will describe the process of the client applying for an IPv6 address in combination with Figure 11 which is processed as follows:
[0138] Step 1101: The relay device receives the address request message sent by the client.
[0139] When applying for an IPv6 address, the address request message is a solicitation message.
[0140] In this embodiment, if the client wants to apply for an IPv6 address, it can generate an address request message, and then select relay device 1 in the target anycast group through the hash principle. Then the client sends an address request message to relay device 1.
[0141] Step 1102: The relay device encapsulates the first IP address and the second IP address into an address request message.
[0142] The first IP address and the second IP address are both IPv6 addresses.
[0143] In this embodiment, after receiving the address request message sent by the client, the relay device 1 determines the IP address of the interface receiving the address request message (i.e., the second IP address), and then generates a temporary user table, which includes the MAC address of the client and the interface name of the interface. The relay device 1 can encapsulate the address request message in the relay message option of the newly constructed relay-forward message. The relay device 1 encapsulates the first IP address that is unique in the entire network as the source IPv6 address, and the relay device 1 encapsulates the second IP address in the link address field.
[0144] Step 1103: The relay device encapsulates the IP address of the IPv6 DHCP service device as the destination address of the address request message.
[0145] In this embodiment, the relay device 1 may determine the IP address of the IPv6 DHCP service device corresponding to the interface to which the second IP address belongs, and encapsulate the IP address of the IPv6 DHCP service device as the destination IPv6 address of the address request message.
[0146] Step 1104: The relay device forwards the encapsulated address request message to the network device through the first tunnel or the second tunnel according to the destination address of the encapsulated address request message.
[0147] In this embodiment, the relay device 1 can look up the routing table and determine that the next hop is the network device connected to the DHCP service device of IPv6. The relay device 1 can encapsulate the outer layer of the address request message with an outer layer IP address and an outer layer MAC address. The outer layer IP address includes a source IP address (the tunnel endpoint IP address of the relay device) and a destination IP address (the tunnel endpoint IP address of the network device). The outer layer MAC address includes a source MAC address (the MAC address of the relay device) and a destination MAC address (the MAC address of the next hop for forwarding the address request message to the network device). Then the relay device 1 looks up the routing table and sends the encapsulated address request message to the network device.
[0148] Step 1105: The network device receives the encapsulated address request message and, based on the destination IPv6 address of the de-encapsulated address request message, sends the de-encapsulated address request message to the DHCP service device of IPv6.
[0149] In this embodiment, after receiving the encapsulated address request message, the network device can identify that the destination IP address of the outer layer IP address in the outer layer encapsulation is its own IP address, de-encapsulate it, and obtain the de-encapsulated address request message. Then the network device sends the de-encapsulated address request message to the DHCP service device of IPv6.
[0150] Step 1106: The DHCP service device of IPv6 receives the address request message, assigns an IPv6 address to the client, generates a response message, and sends it to the network device.
[0151] In this embodiment, after receiving the address request message, the DHCP service device of IPv6 can parse the solicit message from the relay-forward message, generate an advertisement (advertise) response message for the corresponding solicit message, and encapsulate the advertise response message in the relay message option of the response message. The DHCP service device of IPv6 looks up the ipv6 address in the same network segment in the address pool according to the second IP address encapsulated in the link-address field and determines the ipv6 address assigned to the client. The DHCP service device of IPv6 encapsulates the first IP address as the destination IPv6 address of the response message. Then the DHCP service device of IPv6 sends the response message to the network device.
[0152] Step 1107: The network device receives the response message sent by the DHCP service device of IPv6, determines multiple next-hop addresses corresponding to the destination IP address according to the destination IP address of the response message, determines the first next-hop address among the multiple next-hop addresses, and forwards the response message to the relay device according to the first next-hop address.
[0153] The process of step 1107 is exactly the same as that of Figure 8 and will not be elaborated here.
[0154] Step 1108, the relay device receives the response message sent by the network device based on the first tunnel endpoint IP address through the first tunnel.
[0155] Step 1109, the relay device sends the response message carrying the IPv6 address assigned by the DHCP service device with IPv6 for the client to the client according to the MAC address of the client corresponding to the response message.
[0156] In this embodiment, the relay device 1 can send the response message carrying the IPv6 address assigned for the client to the client according to the MAC address and interface name in the established temporary user table. In this way, the address request message and the response message for the client to apply for the IPv6 address pass through the same relay device, so the situation of the response message detouring will not occur, and the stability of the client going online is improved. It can also reduce the bandwidth occupation and CPU occupation of other relay devices in the target anycast group.
[0157] Figure 11 Only the case where the address request message is sent to the relay device 1 is taken as an example for illustration. Of course, the same principle applies to other relay devices in the target anycast group except the relay device 1, and this will not be elaborated in the embodiments of this application.
[0158] It should be noted that in the scenario of applying for an IPv6 address, the tunnel endpoint IP address can be an IPv4 address or an IPv6 address.
[0159] Figure 12 is the structural diagram of the device for sending the response message provided by the embodiments of this application. This device can be implemented as part or all of the device through software, hardware or a combination of both. The device provided by the embodiments of this application can implement the embodiments of this application Figure 8 、 Figure 9 and Figure 11 The processes described above. This device includes: a receiving module 1210, a determining module 1220, and a sending module 130, where:
[0160] A receiving module 1210, configured to receive a response message sent by the DHCP service device; wherein, the destination address of the response message is the first IP address of the relay device, the relay device is communicatively connected to a client, and the client is a client that applies for an IP address from the DHCP service device, and specifically may be used to implement the receiving function of step 801 and the implicit steps included in step 801, specifically may be used to implement the receiving function of step 907 and the implicit steps included in step 907, specifically may be used to implement the receiving function of step 1107 and the implicit steps included in step 1107;
[0161] A determining module 1220, configured to determine, according to the destination IP address of the response message, a plurality of next-hop addresses corresponding to the destination IP address; and determine a first next-hop address from the plurality of next-hop addresses, where the first next-hop address is the first tunnel endpoint IP address of the relay device and is different from the tunnel endpoint IP addresses of other relay devices belonging to the target anycast group, and each relay device in the target anycast group is communicatively connected to the client, and specifically may be used to implement the determining functions of steps 802 and 803 and the implicit steps included in steps 802 and 803, specifically may be used to implement the determining function of step 907 and the implicit steps included in step 907, specifically may be used to implement the determining function of step 1107 and the implicit steps included in step 1107;
[0162] A sending module 1230, configured to forward the response message to the relay device according to the first next-hop address, and specifically may be used to implement the sending function of step 804 and the implicit steps included in step 804, specifically may be used to implement the sending function of step 907 and the implicit steps included in step 907, specifically may be used to implement the sending function of step 1107 and the implicit steps included in step 1107.
[0163] In a possible implementation manner, the first next-hop address corresponds to a direct-through flag, and the determining module 1220 is configured to:
[0164] Determine the first next-hop address from the plurality of next-hop addresses according to the direct-through flag.
[0165] In a possible implementation manner, the receiving module 1210 is further configured to:
[0166] Receive a first routing advertisement message through a first tunnel to which the first tunnel endpoint IP address belongs, where the first routing advertisement message includes the first IP address, the first tunnel endpoint IP address, and the direct-through flag corresponding to the first tunnel endpoint IP address, and the tunnel endpoints of the first tunnel are the relay device and the network device;
[0167] Store the first tunnel endpoint IP address as the first next-hop address of the first IP address, and add the direct-through mark to the first tunnel endpoint IP address.
[0168] In a possible implementation, the receiving module 1210 is further configured to:
[0169] Receive a second routing advertisement message through a second tunnel to which the second tunnel endpoint IP address belongs, where the second routing advertisement message includes the first IP address and the second tunnel endpoint IP address, the tunnel endpoints of the second tunnel are the relay device and the network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group;
[0170] Store the second tunnel endpoint IP address as the second next-hop address of the first IP address.
[0171] In a possible implementation, the receiving module 1210 is further configured to receive the encapsulated address request message sent by the relay device through the first tunnel or the second tunnel to which the first tunnel endpoint IP address belongs, where the destination address of the encapsulated address request message is the IP address of the DHCP service device;
[0172] The sending module 1230 is further configured to send the encapsulated address request message to the DHCP service device.
[0173] The division of the modules in the above embodiments of the present application is illustrative. It is only a logical function division. In actual implementation, there may be other division methods. In addition, in each embodiment of the present application, each functional module may be integrated in a processor, may exist separately physically, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0174] Figure 13 It is a structural diagram of a device for sending a routing advertisement message provided by an embodiment of the present application. The device can be implemented as part or all of the device through software, hardware, or a combination of both. The device provided by the embodiment of the present application can implement the Figure 7 、 Figure 9 and Figure 11 processes described above. The device includes a generating module 1310 and a sending module 1320, where:
[0175] A generating module 1310, configured to generate a plurality of route advertisement messages, each of the plurality of route advertisement messages including a first IP address of the relay device and a tunnel endpoint IP address of the relay device, the tunnel endpoint IP address of the relay device included in each of the route advertisement messages being different, the tunnel endpoint IP address included in the first route advertisement message among the plurality of route advertisement messages being a first tunnel endpoint IP address, the first tunnel endpoint IP address being different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs, and each relay device in the target anycast group being respectively established with a communication connection with a client applying for an IP address, and specifically being applicable to implement the generating function of step 701 and the implicit steps included in step 701;
[0176] A sending module 1320, configured to send the plurality of route advertisement messages to the network device, so as to instruct the network device to send a response message to the relay device through the first tunnel endpoint IP address in the first route advertisement message, wherein the response message is sent by a DHCP service device to the network device, and the destination IP address of the response message is the first IP address, and specifically being applicable to implement the sending function of step 702 and the implicit steps included in step 702.
[0177] In a possible implementation manner, as Figure 14 shown, the apparatus further includes: a receiving module 1330, configured to receive the response message sent by the network device based on the first tunnel endpoint IP address;
[0178] The sending module 1320 is further configured to send, to the client, the IP address assigned by the DHCP service device to the client in the response message according to the media access control (MAC) address of the client corresponding to the response message.
[0179] In a possible implementation manner, the first route advertisement message further includes a direct pass flag corresponding to the first tunnel endpoint IP address.
[0180] In a possible implementation manner, the plurality of route advertisement messages include a first route advertisement message and a second route advertisement message;
[0181] The sending module 1320 is configured to:
[0182] send the first route advertisement message to the network device through a first tunnel to which the first tunnel endpoint IP address belongs;
[0183] Send a second route advertisement message to the network device through a second tunnel to which the second tunnel endpoint IP address belongs, where tunnel endpoints of the first tunnel and the second tunnel are the relay device and the network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group.
[0184] In a possible implementation, the apparatus further includes:
[0185] The receiving module 1330 is further configured to:
[0186] Receive an address request message sent by the client;
[0187] Encapsulate a first IP address and a second IP address into the address request message, where the second IP address is the IP address of the interface through which the relay device receives the address request message;
[0188] Encapsulate the IP address of the DHCP service device as the destination address of the address request message;
[0189] The sending module 1320 is further configured to forward the encapsulated address request message to the network device through the first tunnel or the second tunnel according to the destination address.
[0190] The division of modules in the embodiments of the present application above is illustrative. It is only a logical function division. In actual implementation, there may be other division methods. In addition, in each embodiment of the present application, each functional module may be integrated in a processor, or may exist physically alone, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0191] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a server or a terminal, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial optical cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a server or a terminal, or a data storage device such as a server or a data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, and a magnetic tape, etc.), an optical medium (such as a Digital Video Disk (DVD), etc.), or a semiconductor medium (such as a solid-state drive, etc.).
[0192] In this application, terms such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions. It should be understood that there is no logical or chronological dependency between "first", "second", and "nth", nor are the quantity and execution order limited. It should also be understood that although the following description uses terms such as first and second to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various examples, the first image can be referred to as the second image, and similarly, the second image can be referred to as the first image. Both the first image and the second image can be images, and in some cases, they can be separate and different images.
[0193] In this application, the meaning of the term "at least one" refers to one or more, and the meaning of the term "a plurality of" refers to two or more. For example, a plurality of second messages refers to two or more second messages. In this article, the terms "system" and "network" are often used interchangeably.
[0194] It should be understood that the terms used in the description of the various examples in this article are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0195] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a correlative relationship describing associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0196] It should also be understood that in various embodiments of the present application, the magnitude of the serial numbers of the respective processes does not imply the order of execution, and the order of execution of each process should be determined based on its function and internal logic, and should not impose any limitation on the implementation process of the embodiments of the present application.
[0197] It should be understood that determining B based on A does not mean determining B solely based on A, and B can also be determined based on A and / or other information.
[0198] It should also be understood that the term "comprises" (also referred to as "includes", "including", "comprises", and / or "comprising") when used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups.
[0199] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a correlative relationship describing associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0200] It should also be understood that the term "if" can be interpreted to mean "when" ("when" or "upon") or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if it is determined..." or "if [the stated condition or event] is detected" can be interpreted to mean "when determining..." or "in response to determining..." or "when [the stated condition or event] is detected" or "in response to detecting [the stated condition or event]".
[0201] It should be understood that the "one embodiment", "an embodiment", and "a possible implementation" mentioned throughout the specification mean that the specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment", "a possible implementation" that appear throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner.
Claims
1. A method for sending an acknowledgment message, characterized in that A network device applied to the connection of a Dynamic Host Configuration Protocol (DHCP) service device. The method includes: Receiving a first routing advertisement message through a first tunnel to which the Internet Protocol (IP) address of a first tunnel endpoint belongs. The first routing advertisement message includes a first IP address, the IP address of the first tunnel endpoint, and a straight-through label corresponding to the IP address of the first tunnel endpoint. The tunnel endpoints of the first tunnel are a relay device and the network device, and the first IP address belongs to the relay device; Storing the IP address of the first tunnel endpoint as the first next-hop address of the first IP address, and adding the straight-through label to the IP address of the first tunnel endpoint; Receiving a response message sent by the DHCP service device, where the destination address of the response message is the first IP address. A communication connection is established between the relay device and a client, and the client is a client that applies for an IP address from the DHCP service device; Determining multiple next-hop addresses corresponding to the destination IP address according to the destination IP address of the response message; Determining a first next-hop address from the multiple next-hop addresses according to the straight-through label. The first next-hop address is the IP address of the first tunnel endpoint of the relay device and is different from the IP addresses of the tunnel endpoints of other relay devices in the target anycast group to which the relay device belongs. Each relay device in the target anycast group has established a communication connection with the client; Forwarding the response message to the relay device according to the first next-hop address.
2. The method according to claim 1, wherein The method further includes: Receiving a second routing advertisement message through a second tunnel to which the IP address of a second tunnel endpoint belongs. The second routing advertisement message includes the first IP address and the IP address of the second tunnel endpoint. The tunnel endpoints of the second tunnel are the relay device and the network device, and the IP address of the second tunnel endpoint is the same IP address of the tunnel endpoints of each relay device in the target anycast group; Storing the IP address of the second tunnel endpoint as the second next-hop address of the first IP address.
3. The method according to claim 2, wherein The method further includes: Receiving an encapsulated address request message sent by the relay device through the first tunnel to which the IP address of the first tunnel endpoint belongs or through the second tunnel. The destination address of the encapsulated address request message is the IP address of the DHCP service device; Sending the encapsulated address request message to the DHCP service device.
4. A method for sending a routing advertisement message, characterized in that, Applied to a relay device; the method includes: Generate multiple route advertisement messages, each of the multiple route advertisement messages including a first Internet Protocol (IP) address of the relay device and a tunnel endpoint IP address of the relay device, the tunnel endpoint IP address of the relay device included in each of the route advertisement messages being different, the tunnel endpoint IP address included in the first route advertisement message among the multiple route advertisement messages being a first tunnel endpoint IP address, the first tunnel endpoint IP address being different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs, and each relay device in the target anycast group having established a communication connection with a client applying for an IP address; Send the multiple route advertisement messages to a network device to instruct the network device to send a response message to the relay device through the first tunnel endpoint IP address in the first route advertisement message, wherein the response message is sent by a Dynamic Host Configuration Protocol (DHCP) service device to the network device, and the destination IP address of the response message is the first IP address.
5. The method according to claim 4, wherein The method further includes: Receive the response message sent by the network device based on the first tunnel endpoint IP address; Send the IP address assigned by the DHCP service device to the client in the response message to the client according to the Media Access Control (MAC) address of the client corresponding to the response message.
6. The method according to claim 5, wherein Assign an IP address for the client as an Internet Protocol version 4 (IPv4) address or an Internet Protocol version 6 (IPv6) address.
7. The method according to any one of claims 4 to 6, characterized in that The first route advertisement message further includes a pass-through flag corresponding to the first tunnel endpoint IP address.
8. The method according to any one of claims 4 to 6, characterized in that The multiple route advertisement messages include a first route advertisement message and a second route advertisement message; The sending the multiple route advertisement messages to the network device includes: Send the first route advertisement message to the network device through a first tunnel to which the first tunnel endpoint IP address belongs; Send a second route advertisement message to the network device through a second tunnel to which a second tunnel endpoint IP address belongs, wherein the tunnel endpoints of the first tunnel and the second tunnel are the relay device and the network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group.
9. The method according to claim 8, wherein The method further includes: Receive an address request message sent by the client; Encapsulate the first IP address and a second IP address into the address request message, wherein the second IP address is the IP address of the interface through which the relay device receives the address request message; Encapsulate the IP address of the DHCP service device as the destination address of the address request message; Forward the encapsulated address request message to the network device through the first tunnel or the second tunnel according to the destination address.
10. A device for sending an acknowledgment message, characterized in that, Applied to a network device connected to a Dynamic Host Configuration Protocol (DHCP) service device, the apparatus includes: A receiving module, configured to: receive a first routing advertisement message through a first tunnel to which the first tunnel endpoint Internet Protocol (IP) address belongs, where the first routing advertisement message includes a first IP address, the first tunnel endpoint IP address, and a straight-through flag corresponding to the first tunnel endpoint IP address, the tunnel endpoints of the first tunnel are a relay device and the network device, and the first IP address belongs to the relay device; store the first tunnel endpoint IP address as the first next-hop address of the first IP address, and add the straight-through flag to the first tunnel endpoint IP address; receive a response message sent by the DHCP service device; where the destination address of the response message is the first IP address of the relay device, the relay device has a communication connection with a client, and the client is a client that applies for an IP address from the DHCP service device; A determining module, configured to determine, according to the destination IP address of the response message, a plurality of next-hop addresses corresponding to the destination IP address; and determine, according to the straight-through flag, a first next-hop address among the plurality of next-hop addresses, where the first next-hop address is the first tunnel endpoint IP address of the relay device and is different from the tunnel endpoint IP addresses of other relay devices belonging to a target anycast group, and each relay device in the target anycast group has a communication connection with the client; A sending module, configured to forward the response message to the relay device according to the first next-hop address.
11. The device according to claim 10, wherein The receiving module is further configured to: receive a second routing advertisement message through a second tunnel to which the second tunnel endpoint IP address belongs, where the second routing advertisement message includes the first IP address and the second tunnel endpoint IP address, the tunnel endpoints of the second tunnel are the relay device and the network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group; store the second tunnel endpoint IP address as the second next-hop address of the first IP address.
12. The device according to claim 11, characterized in that, The receiving module is further configured to receive, through the first tunnel to which the first tunnel endpoint IP address belongs or the second tunnel, an encapsulated address request message sent by the relay device, where the destination address of the encapsulated address request message is the IP address of the DHCP service device; The sending module is further configured to send the encapsulated address request message to the DHCP service device.
13. A device for sending a routing advertisement message, characterized in that Applied to a relay device; the apparatus includes: A generating module, configured to generate a plurality of route advertisement messages, each of the plurality of route advertisement messages including a first Internet Protocol (IP) address of the relay device and a tunnel endpoint IP address of the relay device, wherein the tunnel endpoint IP addresses of the relay device included in each of the route advertisement messages are different, the tunnel endpoint IP address included in the first route advertisement message among the plurality of route advertisement messages is a first tunnel endpoint IP address, and the first tunnel endpoint IP address is different from the tunnel endpoint IP addresses of other relay devices in the target anycast group to which the relay device belongs, and each relay device in the target anycast group has established a communication connection with a client applying for an IP address; A sending module, configured to send the plurality of route advertisement messages to a network device, so as to instruct the network device to send a response message to the relay device through the first tunnel endpoint IP address in the first route advertisement message, wherein the response message is sent by a Dynamic Host Configuration Protocol (DHCP) service device to the network device, and a destination IP address of the response message is the first IP address.
14. The device according to claim 13, characterized in that, The apparatus further includes: a receiving module, configured to receive the response message sent by the network device based on the first tunnel endpoint IP address; The sending module is further configured to send, to the client, an IP address assigned by the DHCP service device to the client in the response message according to a Media Access Control (MAC) address of the client corresponding to the response message.
15. The device according to claim 13 or 14, characterized in that The first route advertisement message further includes a through tag corresponding to the first tunnel endpoint IP address.
16. The device according to any one of claims 13 to 14, characterized in that The plurality of route advertisement messages include a first route advertisement message and a second route advertisement message; The sending module is configured to: send the first route advertisement message to the network device through a first tunnel to which the first tunnel endpoint IP address belongs; send the second route advertisement message to the network device through a second tunnel to which a second tunnel endpoint IP address belongs, wherein tunnel endpoints of the first tunnel and the second tunnel are the relay device and the network device, and the second tunnel endpoint IP address is the same tunnel endpoint IP address of each relay device in the target anycast group.
17. The device according to claim 16, characterized in that, The apparatus further includes: The receiving module is further configured to: receive an address request message sent by the client; encapsulate the first IP address and a second IP address into the address request message, wherein the second IP address is an IP address of an interface of the relay device for receiving the address request message; encapsulate an IP address of the DHCP service device as a destination address of the address request message; The sending module is further configured to forward the encapsulated address request message to the network device through the first tunnel or the second tunnel according to the destination address.
18. A computing device, characterized in that, The computing device includes a processor and a memory, wherein: computer instructions are stored in the memory; the processor executes the computer instructions to implement the method according to any one of claims 1-3.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions. When the computer instructions in the computer-readable storage medium are executed by a computing device, the computing device is caused to execute the method described in any one of claims 1-9, or the computing device is caused to implement the functions of the device described in any one of claims 10-17.
Citation Information
Patent Citations
Client Address Based Forwarding of Dynamic Host Configuration Protocol Response Packets
US20180091471A1
Cited By
Method and apparatus for sending response message, computing device and storage medium
WO2021139568A1