Method for sending and receiving interface identification message, related network equipment and system
By sending interface identification messages and using aggregate interfaces and LLDP messages to determine the number of links, flexible load sharing between PE devices and CE devices is realized, which solves the waste of resources and low efficiency caused by inconsistent link bandwidths in the existing technology. problem, improving traffic forwarding efficiency.
Patent Information
- Application Number
- CN202010648463.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-07
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-07-07
AI Technical Summary
The existing dual-homing and active-active solution has inconsistent link bandwidths between PE devices and CE devices, resulting in the inability to flexibly use the equal-value load sharing method, resulting in a waste of bandwidth resources and low traffic forwarding efficiency.
By sending interface identification messages, the number of available links is determined for load balancing. The aggregate interface and LLDP packets are used to determine the number of interfaces. The interface identification is generated and carried in the BGP route, so that the receiving device can perform load balancing based on the number of available links.
It improves link bandwidth utilization and packet forwarding efficiency, solves the problem of resource waste caused by inconsistent link bandwidth, and achieves more efficient traffic forwarding.
Smart Images

Figure CN113923165B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method for sending and receiving interface identification messages, and related network equipment and systems. Background Art
[0002] Virtual Private Network (VPN) technology is widely used in the network design of major operators. VPN includes multiple provider edge (PE) devices, which are connected to each other. Customer edge (CE) devices can connect to the PE devices in the VPN to access the VPN.
[0003] At present, in order to improve reliability, a dual-homing dual-active solution can be used. Specifically, Figure 1 As shown in the figure, CE1 is dual-homed to PE1 and PE2. PE3 is a neighbor device of PE1 and PE2, and CE2 is connected to PE3. PE1 and PE2 forward the upstream traffic of CE1 to CE2 in a load-sharing manner, and forward the downstream traffic of CE2 to CE1 in a load-sharing manner.
[0004] However, in the above dual-home dual-active solution, when PE3 forwards the downlink traffic of CE2 to CE1, it can only perform 1:1 equal load sharing of the downlink traffic of CE2 between PE1 and PE2. However, the link bandwidth between PE1 and CE1 and the link bandwidth between PE2 and CE1 may be different. This direct equal load sharing method cannot flexibly use the link bandwidth between PE1, PE2 and CE1. Summary of the invention
[0005] The present application provides a method for sending and receiving interface identification messages, related network equipment and system, which can perform load sharing based on the number of links.
[0006] In a first aspect, a method for sending an interface identification message is provided. In the method, a first network device determines the number of at least one interface used to communicate with a second network device, and then generates at least one interface identification, the number of the at least one interface identification being the same as the number of the at least one interface. Afterwards, the first network device sends a message, the message including an address of a destination device and the at least one interface identification, the destination device being the second network device or a device connected to the second network device.
[0007] The type of the at least one interface identifier may be a SID or an MPLS label. The message is used to announce the route of the destination device. For example, the message may be a BGP route. The at least one interface identifier may be carried in the tlv information in the BGP route. Furthermore, the number of the at least one interface identifier may also be carried in the tlv information. Optionally, the at least one interface identifier may also be carried in multiple messages for announcement.
[0008] In the present application, the first network device sends a message carrying the address of the destination device and at least one interface identifier. Since the number of the at least one interface identifier is the same as the number of the at least one interface used by the first network device to communicate with the second network device, the number of the at least one interface identifier can indicate the number of available links between the first network device and the second network device. In this way, other network devices that receive the message can implement load sharing of messages sent to the destination device based on the number of available links between the first network device and the second network device. In addition, since in most cases, the link bandwidth allocated to a link is the same, the link bandwidth utilization can be improved by load sharing based on the number of links, thereby improving the message forwarding efficiency and business efficiency.
[0009] In a first possible implementation, a first network device is connected to a second network device via an aggregate interface, and the operation of the first network device determining the number of at least one interface for communicating with the second network device may be: the first network device determines at least one member interface included in the aggregate interface, and then determines the number of at least one interface for communicating with the second network device based on the at least one member interface.
[0010] The first network device can communicate with the second network device through a logical interface formed by aggregating multiple physical interfaces, and the logical interface can be called an aggregation interface, also known as a LAG. The physical interface in this logical interface can be called a member interface of this logical interface.
[0011] Since the first network device is connected to the second network device through the aggregate interface, the first network device can communicate with the second network device through some or all of the member interfaces in the aggregate interface. Therefore, the first network device can determine the number of at least one interface used to communicate with the second network device according to the number of member interfaces included in the aggregate interface.
[0012] Optionally, the first network device uses the number of the at least one member interface as the number of at least one interface for communicating with the second network device.
[0013] When the business traffic is large and the first network device runs at full load, the first network device can forward traffic to the second network device through all member interfaces in the aggregate interface. Therefore, the first network device can use the number of at least one member interface as the number of at least one interface for communicating with the second network device.
[0014] Optionally, the first network device uses the number of member interfaces selected for use among the at least one member interface as the number of at least one interface for communicating with the second network device.
[0015] Link aggregation can be implemented based on LACP, and each member interface belonging to the aggregated interface can use LACP notification information. The states of the member interfaces in the aggregated interface include selected for use and standby. The member interface selected for use is the member interface that is currently forwarding traffic. The standby member interface does not forward traffic for the time being, and it can change its state to selected for use and then forward traffic when the member interface selected for use fails. In other words, the member interface selected for use in the aggregated interface is the member interface that the first network device currently communicates with the second network device, and thus the first network device can use the number of member interfaces selected for use in the at least one member interface as the number of at least one interface for communicating with the second network device.
[0016] Optionally, the first network device receives multiple LLDP messages from the at least one member interface, and determines the number of at least one interface that communicates with the second network device from the at least one member interface based on the multiple LLDP messages.
[0017] The multiple LLDP messages include device information of multiple network devices connected to the first network device, the multiple network devices include the second network device. The device information includes an aggregation port ID and a chassis ID, the chassis ID is used to identify the network device, and the aggregation port ID is used to identify the aggregation interface of the network device.
[0018] Among them, the operation of the first network device determining the number of at least one interface that communicates with the second network device from the at least one member interface based on the multiple LLDP messages can be: the first network device determines the first number of LLDP messages in which the chassis ID is the identifier of the second network device and the aggregation port ID is the identifier of the aggregated interface connecting the second network device and the first network device based on the multiple chassis IDs and the multiple aggregation port IDs included in the multiple LLDP messages; and uses the first number as the number of at least one interface that communicates with the second network device.
[0019] For any one of the multiple LLDP messages received by the first network device from the at least one member interface, if the chassis ID in the LLDP message is the identifier of the second network device, and the aggregationport ID is the identifier of the aggregation interface connecting the second network device and the first network device, it is determined that the network device sending the LLDP message is the second network device, and it can also be determined that the member interface receiving the LLDP message is the interface for communicating with the second network device. Therefore, the first network device can use the number of LLDP messages whose chassis ID is the identifier of the second network device and whose aggregationport ID is the identifier of the aggregation interface connecting the second network device and the first network device (i.e., the first number) as the number of at least one interface communicating with the second network device.
[0020] In a second possible implementation, the operation of the first network device determining the number of at least one interface for communicating with the second network device may be: the first network device determines the number of at least one next-hop address from the first network device to the destination device, and then uses the number of the at least one next-hop address as the number of at least one interface for communicating with the second network device.
[0021] The next hop address from the first network device to the destination device is the address of the outgoing interface from the first network device to the destination device, such as the IP address of the outgoing interface from the first network device to the destination device. There are several next hop addresses if there are several outgoing interfaces from the first network device to the destination device. Since the destination device is the second network device or a device connected to the second network device, the outgoing interface from the first network device to the destination device is also the interface for the first network device to communicate with the second network device. Therefore, the first network device can use the number of at least one next hop address from the first network device to the destination device as the number of at least one interface for communicating with the second network device.
[0022] In a possible implementation manner, the first network device may be one of the multi-homed network devices of the second network device, that is, the second network device is multi-homedly connected to the first network device and one or more other network devices.
[0023] In a possible implementation, when the first network device sends a message, the first network device may send the message to the third network device. Afterwards, the first network device may receive a message sent by the third network device to the destination device, the message carrying the first interface identifier in the at least one interface identifier; the first network device forwards the message to the second network device according to the first interface identifier.
[0024] The operation of the first network device forwarding the message to the second network device according to the first interface identifier may be: the first network device obtains interface information corresponding to the first interface identifier, and then forwards the message to the second network device according to the interface identified by the interface information.
[0025] In the Layer 2 access scenario, the interface information corresponding to the first interface identifier may be aggregated interface information. In this case, the first network device may determine the aggregated interface information corresponding to the first interface identifier, and forward the message to the second network device through the aggregated interface identified by the aggregated interface information. Alternatively, the first network device may obtain the first interface information from a mapping relationship table between the interface identifier and the interface information according to the first interface identifier, and forward the message to the second network device through the first interface identified by the first interface information.
[0026] In a layer 3 access scenario, the interface information corresponding to the first interface identifier may be outbound interface information. In this case, the first network forwards the message to the second network device through the outbound interface identified by the first interface identifier.
[0027] In a second aspect, a first network device is provided, wherein the first network device has a function of implementing the method behavior of sending an interface identification message in the first aspect or any implementation of the first aspect. The first network device includes at least one module, and the at least one module is used to implement the method of sending an interface identification message provided in the first aspect.
[0028] In one possible implementation, the first network device includes: a determination module, used to determine the number of at least one interface used to communicate with the second network device; a generation module, used to generate at least one interface identifier, the number of the at least one interface identifier is the same as the number of the at least one interface; a sending module, used to send a message, the message including an address of a destination device and the at least one interface identifier, the destination device being the second network device or a device connected to the second network device.
[0029] In a possible implementation, the sending module is used to send the message to a third network device. The first network device further includes a receiving module for receiving a message sent by the third network device to the destination device, the message carrying a first interface identifier among the at least one interface identifier; the sending module is also used to forward the message to the second network device according to the first interface identifier.
[0030] In a possible implementation manner, the sending module is further used to: obtain interface information corresponding to the first interface identifier; and forward the message to the second network device according to the interface identified by the interface information.
[0031] In a possible implementation, the sending module is also used to: obtain the first interface information from a mapping relationship table between the interface identifier and the interface information according to the first interface identifier, and forward the message to the second network device through the first interface identified by the first interface information; or, determine the aggregate interface information corresponding to the first interface identifier, and forward the message to the second network device through the aggregate interface identified by the aggregate interface information.
[0032] In a possible implementation, the first network device is connected to the second network device via an aggregate interface, and the determination module is used to: determine at least one member interface included in the aggregate interface; and determine the number of at least one interface used to communicate with the second network device based on the at least one member interface.
[0033] In one possible implementation, the determination module is used to: use the number of the at least one member interface as the number of at least one interface for communicating with the second network device; or use the number of member interfaces selected for use among the at least one member interface as the number of at least one interface for communicating with the second network device.
[0034] In one possible implementation, the determination module is used to: receive multiple link layer discovery protocol LLDP messages from the at least one member interface, the multiple LLDP messages including device information of multiple network devices connected to the first network device, the multiple network devices including the second network device; and determine the number of at least one interface that communicates with the second network device from the at least one member interface based on the multiple LLDP messages.
[0035] In one possible implementation, the device information includes an aggregation interface identifier aggregation portID and a device identifier chassis ID, the chassis ID is used to identify a network device, and the aggregation port ID is used to identify an aggregation interface of the network device, and the determination module is used to: determine, based on the multiple chassis IDs and multiple aggregation port IDs included in the multiple LLDP messages, the first number of the LLDP message in which the chassis ID is the identifier of the second network device and the aggregation port ID is the identifier of the aggregation interface connecting the second network device and the first network device; and use the first number as the number of at least one interface for communicating with the second network device.
[0036] In a possible implementation, the determination module is used to: determine the number of at least one next-hop address from the first network device to the destination device; and use the number of the at least one next-hop address as the number of at least one interface for communicating with the second network device.
[0037] In a possible implementation manner, the at least one interface identifier is a segment identifier SID or a multi-protocol label switching MPLS label.
[0038] In a possible implementation, the message is a Border Gateway Protocol BGP route, and the at least one interface identifier is carried in type-length-value tlv information in the BGP route.
[0039] In a third aspect, a first network device is provided, wherein the structure of the first network device includes a processor and a memory, wherein the memory is used to store a program that supports the first network device to execute the method for sending an interface identification message provided in the first aspect or any possible implementation of the first aspect, and to store data involved in the method for sending an interface identification message described in the first aspect. The processor is configured to execute the program stored in the memory to implement the method involved in the first aspect or any possible implementation of the first aspect. The first network device may also include a transceiver, wherein the transceiver is used to receive and / or send the data involved in the first aspect or any possible implementation of the first aspect.
[0040] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the method for sending an interface identification message described in the above-mentioned first aspect or any possible implementation of the first aspect.
[0041] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method for sending an interface identification message described in the first aspect or any possible implementation of the first aspect.
[0042] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here.
[0043] In a sixth aspect, a method for receiving an interface identification message is provided. In the method, a third network device receives a first message from a first network device, the first message includes an address of a destination device and at least one interface identification, the number of the at least one interface identification is the same as the number of at least one interface, the at least one interface is an interface used by the first network device to communicate with a second network device, the at least one interface identification includes a first interface identification, and the destination device is the second network device or a device connected to the second network device. Afterwards, the third network device sends a first message to the first network device, the destination address of the first message is the address of the destination device, and the first message includes the first interface identification.
[0044] The type of the at least one interface identifier may be a SID or an MPLS label. The message is used to announce the route of the destination device. For example, the message may be a BGP route. The at least one interface identifier may be carried in the tlv information in the BGP route. Furthermore, the number of the at least one interface identifier may also be carried in the tlv information. Optionally, the at least one interface identifier may also be carried in multiple messages for announcement.
[0045] In the present application, the third network device receives a first message carrying the address of the destination device and at least one interface identifier from the first network device. Since the number of the at least one interface identifier is the same as the number of at least one interface used by the first network device to communicate with the second network device, the number of the at least one interface identifier can indicate the number of available links between the first network device and the second network device. In this way, the third network device can implement load sharing of messages sent to the destination device based on the number of available links between the first network device and the second network device. In addition, since in most cases, the link bandwidth allocated to a link is the same, the link bandwidth utilization rate can be improved by load sharing based on the number of links, and then the message forwarding efficiency and business efficiency can be improved.
[0046] Among them, the operation of the third network device sending the first message to the first network device can be: the third network device saves the correspondence between the first interface identifier and the address of the destination device according to the first message, and then determines that the destination address of the first message is the address of the destination device, determines the first interface identifier in the first message according to the correspondence, and then sends the first message to the first network device.
[0047] After the third network device receives the message carrying the address of the destination device and the first interface identifier from the first network device, it can save the correspondence between the first interface identifier and the address of the destination device. In this case, when the third network device receives a message that needs to be sent to the destination device, it can obtain the first interface identifier from the correspondence according to the destination address in the message (i.e., the address of the destination device), and then add the obtained first interface identifier to the message to obtain the first message, and then send the first message to the first network device.
[0048] In a possible implementation, the first message also includes next hop information, and the next hop information includes the address of the second network device. When the third network device sends the first message to the first network device, the third network device can obtain the next hop information corresponding to the address of the destination device, and the next hop information includes the address of the second network device, and then iterate the tunnel according to the address of the second network device in the next hop information, and determine the tunnel information, and then send the first message to the first network device according to the tunnel information.
[0049] Furthermore, the at least one interface identifier also includes a second interface identifier, and the third network device may also send a second message to the first network device, the destination address of the second message is the address of the destination device, and the second message includes the second interface identifier.
[0050] In the present application, when the third network device sends a message to the first network device, the message may be sent to the first network device according to the at least one interface identifier corresponding to the address of the destination device. For example, when the at least one interface identifier includes a first interface identifier and a second interface identifier, the third network device may send a first message to the first network device according to the first interface identifier, and send a second message to the first network device according to the second interface identifier. The first message and the second message may belong to the same service flow.
[0051] In a possible implementation manner, the first network device is one of the multi-homed network devices of the second network device, and the fourth network device is another multi-homed network device of the second network device.
[0052] In this case, the third network device may also receive a second message from the fourth network device, the second message including the address of the destination device and the third interface identifier for the fourth network device to communicate with the second network device. Afterwards, the third network device sends a third message to the fourth network device. The third message includes the address of the destination device and the third interface identifier. For example, the destination address field of the third message may be the address of the destination device. The third message may also belong to the service flow.
[0053] In the embodiment of the present application, the third network device can forward the message to the first network device and the fourth network device respectively according to the interface identifier sent by the first network device and the interface identifier sent by the fourth network device. Since the number of interface identifiers sent by the first network device can indicate the number of available links between the first network device and the second network device, and the number of interface identifiers sent by the fourth network device can indicate the number of available links between the fourth network device and the second network device, the third network device can load share the message sent to the destination device between the first network device and the fourth network device based on the number of available links between the first network device, the fourth network device and the second network device. And because in most cases, the link bandwidth allocated to a link by the first network device and the fourth network device is the same, the link bandwidth utilization rate can be improved by load sharing based on the number of links, and then the message forwarding efficiency and business efficiency can be improved.
[0054] In a seventh aspect, a third network device is provided, wherein the third network device has the function of implementing the method behavior of receiving an interface identification message in the sixth aspect or any possible implementation of the sixth aspect. The third network device includes at least one module, and the at least one module is used to implement the method for receiving an interface identification message provided in the sixth aspect.
[0055] In a possible implementation, the at least one interface identifier also includes a second interface identifier, and the sending module is further used to: send a second message to the first network device, the destination address of the second message is the address of the destination device, and the second message includes the second interface identifier.
[0056] In one possible implementation, the sending module is used to: save the correspondence between the first interface identifier and the address of the destination device according to the first message; determine the destination address of the first message as the address of the destination device, and determine the first interface identifier in the first message according to the correspondence; and send the first message to the first network device.
[0057] In a possible implementation manner, the at least one interface identifier is a segment identifier SID or a multi-protocol label switching MPLS label.
[0058] In a possible implementation, the message is a Border Gateway Protocol BGP route, and the at least one interface identifier is carried in type-length-value tlv information in the BGP route.
[0059] In a possible implementation manner, the first network device is one of the multi-homed network devices of the second network device.
[0060] In a possible implementation, the receiving module is also used to receive a second message from a fourth network device, the second message including the address of the destination device and a third interface identifier for the fourth network device to communicate with the second network device, and the fourth network device is another multi-home network device of the second network device; the sending module also sends a third message to the fourth network device, the third message including the address of the destination device and the third interface identifier.
[0061] In a possible implementation manner, the first message, the second message, and the third message belong to the same service flow.
[0062] In a possible implementation, the first message also includes next hop information, and the next hop information includes the address of the second network device. The sending module is used to: iterate the tunnel according to the address of the second network device in the next hop information, and determine the tunnel information; and send the first message to the first network device according to the tunnel information.
[0063] In an eighth aspect, a third network device is provided, wherein the structure of the third network device includes a processor and a memory, wherein the memory is used to store a program that supports the third network device to execute the method for receiving an interface identification message provided in the sixth aspect or any possible implementation of the sixth aspect, and to store data involved in the method for receiving an interface identification message described in the sixth aspect. The processor is configured to execute the program stored in the memory to execute the method involved in the sixth aspect or any possible implementation of the sixth aspect. The third network device may also include a transceiver, wherein the transceiver is used to receive and / or send the data involved in the sixth aspect or any possible implementation of the sixth aspect.
[0064] In the ninth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, which, when executed on a computer, enables the computer to execute the method for receiving an interface identification message described in the sixth aspect or any possible implementation of the sixth aspect.
[0065] In the tenth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method for receiving an interface identification message described in the sixth aspect or any possible implementation of the sixth aspect.
[0066] The technical effects obtained in the seventh, eighth, ninth and tenth aspects mentioned above are similar to the technical effects obtained by the corresponding technical means in the sixth aspect mentioned above, and will not be repeated here.
[0067] In an eleventh aspect, a system for sending and receiving interface identification messages is provided. The system includes a first network device and a third network device, wherein the first network device may be the first network device in the second aspect, any possible implementation of the second aspect, the third aspect, or any possible implementation of the third aspect, and the third network device may be the third network device in the seventh aspect, any possible implementation of the seventh aspect, the eighth aspect, or any possible implementation of the eighth aspect.
[0068] In a possible implementation, a first network device is configured to determine the number of at least one interface used to communicate with a second network device, generate at least one interface identifier, the number of the at least one interface identifier is the same as the number of the at least one interface, and send a message to a third network device, the message including an address of a destination device and the at least one interface identifier, the at least one interface identifier including a first interface identifier, and the destination device is the second network device or a device connected to the second network device;
[0069] The third network device is used to receive the message, and send a first message to the first network device according to the message, where the destination address of the first message is the address of the destination device, and the first message includes a first interface identifier.
[0070] Optionally, the at least one interface identifier further includes a second interface identifier;
[0071] In a possible implementation, the third network device is further configured to send a second message to the first network device, the destination address of the second message is the address of the destination device, and the second message includes a second interface identifier.
[0072] The technical effects obtained in the above eleven aspects are similar to the technical effects obtained by the corresponding technical means in the above first and sixth aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 is a schematic diagram of a network system provided in an embodiment of the present application;
[0074] Figure 2 This is a flow chart of a message sending and receiving process provided by an embodiment of the present application;
[0075] Figure 3 This is a flow chart of a message forwarding process provided by an embodiment of the present application;
[0076] Figure 4 It is a flowchart of a method for sending an interface identification message provided by an embodiment of the present application;
[0077] Figure 5 It is a flowchart of a method for receiving an interface identification message provided by an embodiment of the present application;
[0078] Figure 6 It is a structural diagram of a network device provided in an embodiment of the present application;
[0079] Figure 7 is a structural diagram of a first network device provided in an embodiment of the present application;
[0080] Figure 8 It is a structural diagram of a third network device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0081] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0082] It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.
[0083] Before explaining the embodiments of the present application in detail, the application scenarios involved in the embodiments of the present application are described.
[0084] The network system involved in the embodiment of the present application includes a first network device and a fourth network device respectively connected to the destination device. The destination device is a device that receives service traffic through the first network device and the fourth network device. The destination device can be directly connected to the first network device and the fourth network device, and the destination device can be called a second network device. For example, the second network device can be a CE device, and the CE device is dual-homed to the first network device and the fourth network device as a PE device. The destination device can also be indirectly connected to the first network device and the fourth network device. For example, the destination device is a user device connected to the second network device as a CE device, and the traffic sent to the user device can be sent to the CE device through the first network device or the fourth network device, and forwarded to the user device by the CE device. The network system can also include a third network device, which is connected to the first network device and the fourth network device. For example, the third network device can also be a PE device and serves as a Border Gateway Protocol (BGP) neighbor device of the first network device and the fourth network device.
[0085] The first network device, the second network device, and the third network device may all be devices with data forwarding functions, such as switches, routers, etc. The destination device may be a device with data forwarding functions, or may be a user-side network device, a user host, etc. The device types of the destination device, the first network device, the second network device, and the third network device may be the same or different.
[0086] Still Figure 1 The network system schematic diagram shown is taken as an example, and the destination device is a user device connected to the CE1 device, the first network device is a PE1 device, the fourth network device is a PE2 device, and the third network device is a PE3 device. Among them, the PE3 device forwards traffic to the user device through the CE1 device.
[0087] Figure 1 The network system shown can be used as an application scenario of the embodiment of the present application. Figure 1 , the network system includes PE1 and PE2 connected to CE1 respectively. That is, CE1 is dual-homed to PE1 and PE2. PE1 and PE2 are BGP neighbor devices. The network system also includes PE3, which is the remote BGP neighbor device of PE1 and PE2. Other CE devices (such as Figure 1 The CE2 device shown in the figure) can be connected to the PE3 device.
[0088] Currently, in the dual-home dual-active scenario, for the uplink traffic sent from CE1 to CE2, PE1 and PE2 forward the uplink traffic of CE1 to CE2 in a load-sharing manner. For the downlink traffic of user equipment sent from CE2 to CE1, PE3 forwards the downlink traffic of CE2 to CE1 in a load-sharing manner. Specifically, PE3 performs 1:1 equal load balancing on the downlink traffic of CE2 between PE1 and PE2. However, the link bandwidth between PE1 and CE1 and the link bandwidth between PE2 and CE1 may be different, such as Figure 1 As shown in the figure, there are two lines between CE1 and PE1, and one line between CE1 and PE2. At this time, the link bandwidth between CE1 and PE1 is greater than the link bandwidth between CE1 and PE2. In the above situation, although the link bandwidth between CE1 and PE1 is relatively large, the use of equal value mode for load balancing results in a waste of some bandwidth resources, which is not conducive to improving traffic forwarding efficiency.
[0089] To this end, the embodiment of the present application provides a method for sending an interface identification message and a method for receiving an interface identification message, and the corresponding method can be applied to Figure 1 In the network system shown, the problem of inability to flexibly share loads among multiple devices, which results in waste of resources, is solved.
[0090] The message sending and receiving process in the method for sending an interface identification message and the method for receiving an interface identification message are described below:
[0091] Figure 2 is a flow chart of a message sending and receiving process provided by an embodiment of the present application. Figure 2 , the method comprising:
[0092] 201: The PE1 device determines the number of at least one interface used for communicating with the CE1 device.
[0093] The CE1 device is a network device connected to the PE1 device. In a possible case, the PE1 device may be one of the multi-homed network devices of the CE1 device, that is, the CE1 device is multi-homedly connected to the PE1 device and one or more other network devices.
[0094] When the PE1 device is connected to the CE1 device, it has at least one interface for communicating with the CE1 device. The at least one interface may be a physical interface.
[0095] In a Layer 2 access scenario, PE1 can be connected to CE1 through an aggregate interface. Alternatively, in a Layer 3 access scenario, PE1 can be directly connected to CE1 through a physical interface.
[0096] When the PE1 device is connected to the CE1 device in different ways, operation 201 will be different. In a layer 2 access scenario, operation 201 can be implemented in the following first possible implementation manner; in a layer 3 access scenario, operation 201 can be implemented in the following second possible implementation manner.
[0097] A first possible implementation manner: the PE1 device is connected to the CE1 device via an aggregate interface. The PE1 device determines at least one member interface included in the aggregate interface; and the PE1 device determines the number of at least one interface used to communicate with the CE1 device according to the at least one member interface.
[0098] The PE1 device can communicate with the CE1 device through a logical interface formed by aggregating multiple physical interfaces, and the logical interface can be called an aggregate interface or a link aggregation group (LAG). The physical interface in this logical interface can be called a member interface of this logical interface.
[0099] Since the PE1 device is connected to the CE1 device through the aggregate interface, the PE1 device can communicate with the CE1 device through some or all of the member interfaces in the aggregate interface. Therefore, the PE1 device can determine the number of at least one interface used to communicate with the CE1 device according to the number of member interfaces included in the aggregate interface. The specific operation may include the following three methods:
[0100] Mode 1: The PE1 device uses the number of the at least one member interface as the number of at least one interface for communicating with the CE1 device.
[0101] When the service traffic is large and the PE1 device runs at full load, the PE1 device can forward traffic to the CE1 device through all member interfaces in the aggregate interface. Therefore, the PE1 device can use the number of the at least one member interface as the number of at least one interface for communicating with the CE1 device.
[0102] Mode 2: The PE1 device uses the number of the member interfaces selected for use among the at least one member interface as the number of the at least one interface for communicating with the CE1 device.
[0103] Link aggregation can be implemented based on the Link Aggregation Control Protocol (LACP), and each member interface belonging to the aggregated interface can use LACP notification information. The states of the member interfaces in the aggregated interface include selected and standby. The member interface selected for use is the member interface that is currently forwarding traffic. The standby member interface does not forward traffic temporarily, and it can change its state to selected for use and then forward traffic when the member interface selected for use fails. In other words, the member interface selected for use in the aggregated interface is the member interface that the PE1 device currently communicates with the CE1 device, so the PE1 device can use the number of member interfaces selected for use in the at least one member interface as the number of at least one interface communicating with the CE1 device.
[0104] Mode 3: The PE1 device receives multiple Link Layer Discovery Protocol (LLDP) messages from the at least one member interface, and determines the number of at least one interface that communicates with the CE1 device from the at least one member interface according to the multiple LLDP messages.
[0105] The multiple LLDP messages include device information of multiple network devices connected to the PE1 device, and the multiple network devices include the CE1 device. For any one of the at least one member interface, if a certain network device is connected to the PE1 device through this member interface, the network device can send an LLDP message carrying its own device information to the member interface, and the PE1 device can receive the LLDP message through the member interface, and determine whether the member interface is an interface for communicating with the CE1 device according to the LLDP message.
[0106] The device information includes an aggregation port ID and a device ID (chassis ID). The chassis ID is used to identify the network device, and the aggregation port ID is used to identify the aggregation interface of the network device. That is, for a certain network device, the LLDP message sent by the network device to a member interface in the PE1 device includes the chassis ID used to identify the network device and the aggregation port ID used to identify the aggregation interface of the network device.
[0107] In this case, the operation of the PE1 device determining the number of at least one interface that communicates with the CE1 device from the at least one member interface based on the multiple LLDP messages may be: the PE1 device determines the first number of the LLDP messages in which the chassis ID is the identifier of the CE1 device and the aggregation port ID is the identifier of the aggregated interface connecting the CE1 device and the PE1 device based on the multiple chassis IDs and the multiple aggregation port IDs included in the multiple LLDP messages; the PE1 device uses the first number as the number of at least one interface that communicates with the CE1 device.
[0108] For any one of the multiple LLDP messages received by the PE1 device from the at least one member interface, if the chassis ID in the LLDP message is the identifier of the CE1 device and the aggregation port ID is the identifier of the aggregation interface connecting the CE1 device and the PE1 device, it is determined that the network device sending the LLDP message is the CE1 device, and it can also be determined that the member interface receiving the LLDP message is the interface used to communicate with the CE1 device. Therefore, the PE1 device can use the number of LLDP messages whose chassis ID is the identifier of the CE1 device and whose aggregation port ID is the identifier of the aggregation interface connecting the CE1 device and the PE1 device (i.e., the first number) as the number of at least one interface communicating with the CE1 device.
[0109] In some cases, for example, although the aggregation interface connecting the PE1 device and the CE1 device includes two member interfaces, one of the member interfaces is actually misconnected. In this case, if the above method 1 is used to determine the number of at least one interface for communication between the PE1 device and the CE1 device, it may not be accurate enough, because the misconnected member interface may not actually be used to forward CE1 traffic. However, if the above method 3 is used, the Aggregation port ID value in the LLDP message obtained from the misconnected member interface is empty, then the PE1 device can, based on the fact that the Aggregation port ID with a value of empty is not the Aggregation port ID of the aggregation interface connecting the CE1 device and the PE1 device, not include the misconnected member interface in the statistics, thereby improving the accuracy of identification.
[0110] It can be understood that the above-mentioned methods 1 to 3 can also be used in combination with each other in certain situations.
[0111] A second possible implementation manner: the PE1 device determines the number of at least one next hop address from the PE1 device to the destination device; the PE1 device uses the number of the at least one next hop address as the number of at least one interface for communicating with the CE1 device.
[0112] The destination device is a CE1 device. Alternatively, the destination device is a device connected to the CE1 device, such as a user-side network device, a user host, and the like.
[0113] In this case, the next hop address from the PE1 device to the destination device is the address of the outbound interface from the PE1 device to the destination device, such as the Internet Protocol (IP) address of the outbound interface from the PE1 device to the destination device. There are several next hop addresses if there are several outbound interfaces from the PE1 device to the destination device. Since the destination device is a CE1 device or a device connected to the CE1 device, the outbound interface from the PE1 device to the destination device is also the interface for the PE1 device to communicate with the CE1 device. Therefore, the PE1 device can use the number of at least one next hop address from the PE1 device to the destination device as the number of at least one interface for communicating with the CE1 device.
[0114] 202: The PE1 device generates at least one interface identifier, and the number of the at least one interface identifier is the same as the number of the at least one interface.
[0115] Since the interface identifier is mainly used by the remote neighbor PE3 device to determine the load sharing ratio based on the interface identifier, for example, Figure 1 In the system shown, when the PE3 device receives two interface identifiers from the PE1 device and one interface identifier from the PE2 device, the ratio of traffic forwarding from the PE3 device to the PE1 device and the PE2 device is 2:1. At this time, the PE3 device only needs to know the correspondence between each received interface identifier and the destination device address, and then complete the proportional traffic forwarding to the PE device according to the correspondence, without paying attention to whether there is a correspondence between each interface identifier and a specific interface on the PE device.
[0116] Furthermore, in some possible situations, the PE1 device or the PE2 device may not need to pay attention to the one-to-one correspondence between at least one allocated interface identifier and at least one interface. For example, in a manner where the PE1 device allocates interface identifiers according to the number of member interfaces included in the aggregate interface, the PE1 device can save the correspondence between the aggregate interface and the multiple interface identifiers after allocating corresponding multiple interface identifiers to the multiple member interfaces of the aggregate interface, without paying attention to whether there is a one-to-one correspondence between the multiple member interfaces and the multiple interface identifiers. In this way, when receiving a message, the PE1 device can determine that the aggregate interface is used to forward the message based on whether the interface identifier carried in the message belongs to the multiple interface identifiers and the correspondence between the aggregate interface and the multiple interface identifiers.
[0117] Therefore, in a scenario such as a layer 2 access, the at least one interface identifier assigned by the PE1 device may not correspond to the at least one interface, and the number of the at least one interface identifier only needs to be the same as the number of the at least one interface. In a scenario such as a layer 3 access, the at least one interface identifier assigned by the PE1 device may correspond to the at least one interface respectively, that is, the at least one interface identifier may identify the at least one interface one by one, so that when the PE1 device receives a message including one of the at least one interface identifiers, it can directly forward the message through the corresponding interface according to the one-to-one correspondence between the interface identifier and the interface stored locally.
[0118] The type of the at least one interface identifier may be a segment identifier (Segment Identifier, SID), a multi-protocol label switching (Multi-Protocol Label Switching, MPLS) label, etc., and the embodiment of the present application does not make a sole limitation on this.
[0119] 203: The PE1 device sends a message, where the message includes the address of the destination device and the at least one interface identifier.
[0120] The address of the destination device may be an IP address, a media access control (MAC) address, etc. of the destination device. The address of the destination device may be carried in the destination address field of the message. In addition, the message may also include next hop information, and the address of the CE1 device may be carried in the next hop information in the message.
[0121] The message sent by the PE1 device is used to announce the route of the destination device. For example, the message can be a BGP route (such as a MAC route, an Ethernet Auto-Discovery Route, etc.). The at least one interface identifier can be carried in the type length value (tlv) information in the BGP route. Furthermore, the number of the at least one interface identifier can also be carried in the tlv information. Optionally, the at least one interface identifier can also be carried in multiple messages for announcement.
[0122] When PE1 sends a message, it can send the message to PE3. PE3 is connected to PE1 and is a BGP neighbor of PE1.
[0123] 204: PE3 receives the message from PE1.
[0124] After receiving the message from the PE1 device, the PE3 device can save the correspondence between the at least one interface identifier and the address of the destination device according to the message, wherein the at least one interface identifier is allocated by the PE1 device according to the number of interfaces for communication between the PE1 device and the CE1 device, so that the message sent to the destination device can be forwarded according to the correspondence later. In addition, if the message also includes next hop information, and the next hop information includes the address of the CE1 device, the correspondence between the address of the CE1 device and the address of the destination device can also be saved.
[0125] Further, if the PE1 device is one of the multi-homed network devices of the CE1 device, other network devices in the multi-homed network devices of the CE1 device except the PE1 device may also send a message to the PE3 device.
[0126] For example, the PE2 device, as another multi-homed network device of the CE1 device, can send a message to the PE3 device, and the message can carry the identifier of the destination device and at least one interface identifier for communication between the PE2 device and the CE1 device. After receiving the message from the PE2 device, the PE3 device can save the correspondence between the address of the destination device and the at least one interface identifier according to the message, wherein the at least one interface identifier is allocated by the PE2 device according to the number of interfaces for communication between the PE2 device and the CE1 device, so that the message sent to the destination device can be forwarded later according to the correspondence.
[0127] The message forwarding process in the method for sending an interface identification message and the method for receiving an interface identification message is described below:
[0128] Figure 3is a flow chart of a message forwarding process provided by an embodiment of the present application. Figure 3 , the method comprising:
[0129] 301: The PE3 device sends a first message to the PE1 device. The destination address of the first message is the address of the destination device. The first message includes a first interface identifier.
[0130] For the convenience of subsequent explanation, here it is taken that the number of interface identifiers sent by PE1 to PE3 is two, respectively referred to as the first interface identifier and the second interface identifier, and the number of interface identifiers sent by PE2 to PE3 is one, referred to as the third interface identifier.
[0131] After receiving the message carrying the address of the destination device, the first interface identifier and the second interface identifier from the PE1 device, the PE3 device can save the correspondence between the two interface identifiers and the address of the destination device. The correspondence can be saved as the correspondence between the first interface identifier, the second interface identifier and the destination device address, or can be saved separately as the correspondence between the first interface identifier and the destination device address, and the correspondence between the second interface identifier and the destination device address, or saved in other forms that can determine the correspondence.
[0132] In this case, when the PE3 device sends the first message to the PE1 device, when determining that the destination address of the first message is the address of the destination device, the PE3 device can determine the first interface identifier in the first message according to the corresponding relationship, and then send the first message to the PE1 device. The first interface identifier in the first message is used to instruct the PE1 device to forward the first message according to the first interface identifier.
[0133] That is to say, when the PE3 device receives a message that needs to be sent to the destination device, it can obtain the first interface identifier from the corresponding relationship based on the destination address in the message (that is, the address of the destination device), and then add the obtained first interface identifier to the message to obtain the first message, and then send the first message to the PE1 device.
[0134] In one possible scenario, when the PE3 device sends the first message to the PE1 device, the PE3 device can also obtain the next hop information corresponding to the address of the destination device, and the next hop information includes the address of the CE1 device; the PE3 device iterates the tunnel according to the address of the CE1 device in the next hop information, determines the tunnel information, and then sends the first message to the PE1 device according to the tunnel information.
[0135] Furthermore, the PE3 device may also send a second message to the PE1 device, the destination address of the second message is the address of the destination device, and the second message includes a second interface identifier.
[0136] In this case, when the PE3 device sends the second message to the PE1 device, when determining that the destination address of the second message is the address of the destination device, the PE3 device can determine the second interface identifier in the second message according to the corresponding relationship, and then send the second message to the PE1 device. The second interface identifier in the second message is used to instruct the PE1 device to forward the second message according to the second interface identifier.
[0137] That is to say, when the PE3 device receives a message that needs to be sent to the destination device, it can obtain the second interface identifier from the correspondence based on the destination address in the message (that is, the address of the destination device), and then add the obtained second interface identifier to the message to obtain the second message, and then send the second message to the PE1 device.
[0138] The manner in which the PE3 device sends the second message to the PE1 device is similar to the manner in which the PE3 device sends the first message to the PE1 device, and this embodiment of the present application will not be described in detail.
[0139] In the embodiment of the present application, when the PE3 device sends a message to the PE1 device, the message may be sent to the PE1 device according to the at least one interface identifier corresponding to the address of the destination device. For example, when the at least one interface identifier includes a first interface identifier and a second interface identifier, the PE3 device may send a first message to the PE1 device according to the first interface identifier, and send a second message to the PE1 device according to the second interface identifier. The first message and the second message may belong to the same service flow, such as both may belong to Figure 1 Service traffic sent from CE2 to CE1.
[0140] The PE3 device may also send a third message to the PE2 device, where the third message includes the address of the destination device and a third interface identifier. For example, the destination address field of the third message may be the address of the destination device. The third message may also belong to the service flow.
[0141] After receiving the message carrying the address of the destination device and the third interface identifier from the PE2 device, the PE3 device can save the correspondence between the third interface identifier and the address of the destination device. In this case, when the PE3 device sends the third message to the PE2 device, when determining that the destination address of the third message is the address of the destination device, it can determine the third interface identifier in the third message according to the correspondence, and then send the third message to the PE2 device. The third interface identifier in the third message is used to instruct the PE2 device to forward the third message according to the third interface identifier.
[0142] That is to say, when the PE3 device receives a message that needs to be sent to the destination device, it can obtain the third interface identifier from the corresponding relationship based on the destination address in the message (that is, the address of the destination device), and then add the obtained third interface identifier to the message to obtain the third message, and then send the third message to the PE1 device.
[0143] The manner in which the PE3 device sends the third message to the PE2 device is similar to the manner in which the PE3 device sends the first message to the PE1 device, and this embodiment of the present application will not be described in detail.
[0144] In the embodiment of the present application, the PE3 device can forward the message to the PE1 device and the PE2 device respectively according to at least one interface identifier sent by the PE1 device and at least one interface identifier sent by the PE2 device. Since the number of at least one interface identifier sent by the PE1 device can indicate the number of available links between the PE1 device and the CE1 device, and the number of at least one interface identifier sent by the PE2 device can indicate the number of available links between the PE2 device and the CE1 device, the PE3 device can load share the message sent to the destination device between the PE1 device and the PE2 device based on the number of available links between the PE1 device, the PE2 device and the CE1 device. And since in most cases, the link bandwidth allocated to a link by the PE1 device and the PE2 device is the same, the link bandwidth utilization can be improved by load sharing based on the number of links, and then the message forwarding efficiency and business efficiency can be improved.
[0145] 302: When the PE1 device receives the first message sent to the destination device from the PE3 device, the PE1 device forwards the first message to the CE1 device according to the first interface identifier in the first message.
[0146] Specifically, the PE1 device obtains the interface information corresponding to the first interface identifier, and forwards the first message to the CE1 device according to the interface identified by the interface information.
[0147] In the Layer 2 access scenario, the interface information corresponding to the first interface identifier may be aggregate interface information, and operation 302 may be implemented in the following first or second manner. Optionally, for a certain interface identifier, a corresponding interface identifier type may be set for the interface identifier; when the interface identifier type is the first type, the message may be forwarded in the first manner; when the interface identifier type is the second type, the message may be forwarded in the second manner.
[0148] In a layer 3 access scenario, the interface information corresponding to the first interface identifier may be outbound interface information. In this case, operation 302 may be implemented in the following third manner.
[0149] The first way: the PE1 device determines the aggregate interface information corresponding to the first interface identifier, and forwards the first message to the CE1 device through the aggregate interface identified by the aggregate interface information.
[0150] When generating the at least one interface identifier, the PE1 device can save the correspondence between the at least one interface identifier and the information of the aggregate interface connecting the PE1 device and the CE1 device. In this way, when the PE1 device receives the first message carrying the first interface identifier, it can obtain the aggregate interface information corresponding to the first interface identifier from the correspondence.
[0151] When the PE1 device forwards the first message to the CE1 device through the aggregate interface identified by the aggregate interface information, the PE1 device may send the first message to the aggregate interface, and the member interfaces under the aggregate interface forward the first message to the CE1 device.
[0152] In the first manner, the at least one interface identifier may be, for example, a segment identifier of the End.DT2U type.
[0153] Second mode: The PE1 device obtains the first interface information from a mapping relationship table between the interface identifier and the interface information according to the first interface identifier, and forwards the first message to the CE1 device through the first interface identified by the first interface information.
[0154] When generating the at least one interface identifier, the PE1 device may establish a mapping relationship table between the at least one interface identifier and the information of at least one interface used to communicate with the CE1 device. In this way, when the PE1 device receives a first message carrying a first interface identifier, it may obtain the first interface information corresponding to the first interface identifier from the mapping relationship, and then directly forward the first message to the CE1 device through the first interface identified by the first interface information.
[0155] In a possible case, the mapping relationship table may be a table including the at least one interface identifier and the information of the at least one interface, and each interface identifier corresponds to one interface information. For example, the mapping relationship table may be shown in Table 1 below.
[0156] Table 1
[0157] Interface ID Interface Information Interface ID 1 Interface information 1 Interface ID 2 Interface information 2 Interface ID 3 Interface information 3 …… ……
[0158] In the embodiment of the present application, only the mapping relationship table between the interface identifier and the interface information is explained by taking the above Table 1 as an example. The above Table 1 does not constitute the only limitation to the embodiment of the present application.
[0159] In another possible situation, the mapping relationship table may include two tables, one table includes the at least one interface identifier and the at least one interface index, and the other table includes the at least one interface index and the information of the at least one interface. For example, the mapping relationship table may include the following Table 2 and Table 3. According to the interface index corresponding to each interface identifier in Table 2, the corresponding interface information can be found from Table 2. In addition to the interface information, Table 2 may also include, for example, the MAC address of the destination device, the virtual local area network (VLAN) information to which the destination device belongs, etc.
[0160] Table 2
[0161]
[0162] Table 3
[0163]
[0164] In the embodiment of the present application, only Table 2 and Table 3 are used as examples to illustrate the mapping relationship table between the interface identifier and the interface information. Table 2-Table 3 do not constitute the sole limitation on the embodiment of the present application.
[0165] In the second manner, the at least one interface identifier may be defined as a segment identifier type available for layer 2 forwarding, for example.
[0166] The third mode: PE1 forwards the first message to the CE1 device through the outgoing interface identified by the first interface identifier.
[0167] In a layer 3 access scenario, the at least one interface identifier is used to identify at least one outgoing interface, and the multiple outgoing interfaces are outgoing interfaces from the PE1 device to the destination device. Therefore, PE1 can directly forward the first message to the CE1 device through the outgoing interface identified by the first interface identifier.
[0168] Using the third manner, the at least one interface identifier may be, for example, a segment identifier of the END.DX4 type.
[0169] Furthermore, the PE1 device may also receive a second message sent by the PE3 device to the destination device, and forward the second message to the CE1 device according to the second interface identifier in the second message. The specific operation is similar to operation 302, and will not be described in detail in this embodiment of the present application.
[0170] The method for sending an interface identification message and the method for receiving an interface identification message provided in the embodiments of the present application are applied to a network system, which includes a first network device and a fourth network device respectively connected to a second network device, and may include a third network device.
[0171] The process of the first network device sending the interface identification message is described below:
[0172] Figure 4 is a flowchart of a method for sending an interface identification message provided by an embodiment of the present application. The method can be executed by a first network device, and the first network device can be, for example, Figure 1 PE1 device in the Figure 4 , the method comprising:
[0173] 401: A first network device determines the number of at least one interface used for communicating with a second network device.
[0174] The second network device is a network device connected to the first network device. In one possible scenario, the first network device may be one of the multi-homed network devices of the second network device, that is, the second network device is multi-homedly connected to the first network device and one or more other network devices.
[0175] When the first network device is connected to the second network device, the first network device has at least one interface for communicating with the second network device, and the at least one interface may be a physical interface.
[0176] When the first network device is connected to the second network device in different ways, operation 401 will be different. In a layer 2 access scenario, operation 401 can be implemented by the following first possible implementation manner; in a layer 3 access scenario, operation 401 can be implemented by the following second possible implementation manner.
[0177] A first possible implementation manner: a first network device is connected to a second network device via an aggregate interface. The first network device determines at least one member interface included in the aggregate interface; and the first network device determines the number of at least one interface for communicating with the second network device based on the at least one member interface.
[0178] The first network device can communicate with the second network device through a logical interface formed by aggregating multiple physical interfaces, and the logical interface can be called an aggregation interface, also known as a LAG. The physical interface in this logical interface can be called a member interface of this logical interface.
[0179] Since the first network device is connected to the second network device through the aggregate interface, the first network device can communicate with the second network device through some or all of the member interfaces in the aggregate interface. Therefore, the first network device can determine the number of at least one interface used to communicate with the second network device according to the number of member interfaces included in the aggregate interface. The specific operation may include the following three methods:
[0180] Mode 1: The first network device uses the number of the at least one member interface as the number of at least one interface for communicating with the second network device.
[0181] When the business traffic is large and the first network device runs at full load, the first network device can forward traffic to the second network device through all member interfaces in the aggregate interface. Therefore, the first network device can use the number of at least one member interface as the number of at least one interface for communicating with the second network device.
[0182] Mode 2: The first network device uses the number of member interfaces selected for use among the at least one member interface as the number of at least one interface for communicating with the second network device.
[0183] Link aggregation can be implemented based on LACP, and each member interface belonging to the aggregated interface can use LACP notification information. The states of the member interfaces in the aggregated interface include selected for use and standby. The member interface selected for use is the member interface that is currently forwarding traffic. The standby member interface does not forward traffic for the time being, and it can change its state to selected for use and then forward traffic when the member interface selected for use fails. In other words, the member interface selected for use in the aggregated interface is the member interface that the first network device currently communicates with the second network device, and thus the first network device can use the number of member interfaces selected for use in the at least one member interface as the number of at least one interface for communicating with the second network device.
[0184] Mode 3: The first network device receives multiple LLDP messages from the at least one member interface, and determines the number of at least one interface that communicates with the second network device from the at least one member interface according to the multiple LLDP messages.
[0185] The multiple LLDP messages include device information of multiple network devices connected to the first network device, and the multiple network devices include the second network device. For any one of the at least one member interface, if a certain network device is connected to the first network device through this member interface, the network device can send an LLDP message carrying its own device information to this member interface, and the first network device can receive the LLDP message through this member interface, and determine whether this member interface is an interface for communicating with the second network device according to the LLDP message.
[0186] The device information includes an aggregation port ID and a chassis ID, wherein the chassis ID is used to identify the network device, and the aggregation port ID is used to identify the aggregation interface of the network device. That is, for a certain network device, the LLDP message sent by the network device to a member interface in the first network device includes the chassis ID used to identify the network device and the aggregation port ID used to identify the aggregation interface of the network device.
[0187] In this case, the operation for the first network device to determine the number of at least one interface that communicates with the second network device from the at least one member interface based on the multiple LLDP messages may be: the first network device determines the first number of LLDP messages in which the chassis ID is the identifier of the second network device and the aggregation port ID is the identifier of the aggregated interface connecting the second network device and the first network device based on the multiple chassis IDs and the multiple aggregation port IDs included in the multiple LLDP messages; and the first network device uses the first number as the number of at least one interface that communicates with the second network device.
[0188] For any one of the multiple LLDP messages received by the first network device from the at least one member interface, if the chassis ID in the LLDP message is the identifier of the second network device, and the aggregationport ID is the identifier of the aggregation interface connecting the second network device and the first network device, it is determined that the network device sending the LLDP message is the second network device, and it can also be determined that the member interface receiving the LLDP message is the interface for communicating with the second network device. Therefore, the first network device can use the number of LLDP messages whose chassis ID is the identifier of the second network device and whose aggregationport ID is the identifier of the aggregation interface connecting the second network device and the first network device (i.e., the first number) as the number of at least one interface communicating with the second network device.
[0189] In some cases, for example, although the aggregation interface connecting the first network device and the second network device includes two member interfaces, one of the member interfaces is actually misconnected. In this case, if the above method 1 is used to determine the number of at least one interface for communication between the first network device and the second network device, it may not be accurate enough, because the misconnected member interface may not actually be used for forwarding the second network traffic. However, if the above method 3 is used, the Aggregation port ID value in the LLDP message obtained from the misconnected member interface is empty, then the first network device can, based on the fact that the Aggregation port ID with a value of empty is not the Aggregation port ID of the aggregation interface connecting the second network device and the first network device, not count the misconnected member interface, thereby improving the accuracy of identification.
[0190] It can be understood that the above-mentioned methods 1 to 3 can also be used in combination with each other in certain situations.
[0191] A second possible implementation manner: the first network device determines the number of at least one next hop address from the first network device to the destination device; the first network device uses the number of the at least one next hop address as the number of at least one interface for communicating with the second network device.
[0192] The destination device is the second network device. Alternatively, the destination device is a device connected to the second network device, such as a user-side network device, a user host, etc.
[0193] In this case, the next hop address from the first network device to the destination device is the address of the outgoing interface from the first network device to the destination device, such as the IP address of the outgoing interface from the first network device to the destination device. There are several next hop addresses if there are several outgoing interfaces from the first network device to the destination device. Since the destination device is the second network device or a device connected to the second network device, the outgoing interface from the first network device to the destination device is also the interface for the first network device to communicate with the second network device. Therefore, the first network device can use the number of at least one next hop address from the first network device to the destination device as the number of at least one interface for communicating with the second network device.
[0194] 402: The first network device generates at least one interface identifier, where the number of the at least one interface identifier is the same as the number of the at least one interface.
[0195] Since the interface identifier is mainly used by the third network device to determine the load sharing ratio according to the interface identifier, the third network device only needs to know the correspondence between each received interface identifier and the destination device address, and thus complete the proportional traffic forwarding to the first network device and the fourth network device according to the correspondence, without paying attention to whether there is a correspondence between each interface identifier and a specific interface on the first network device or the fourth network device.
[0196] Furthermore, in some possible situations, the first network device or the fourth network device may not need to pay attention to the one-to-one correspondence between at least one assigned interface identifier and at least one interface. For example, in a manner in which the first network device assigns interface identifiers according to the number of member interfaces included in the aggregated interface, the first network device can save the correspondence between the aggregated interface and the multiple interface identifiers after assigning corresponding multiple interface identifiers to the multiple member interfaces of the aggregated interface, without paying attention to whether there is a one-to-one correspondence between the multiple member interfaces and the multiple interface identifiers. In this way, when receiving a message, the first network device can determine that the aggregated interface is used to forward the message based on whether the interface identifier carried in the message belongs to the multiple interface identifiers and the correspondence between the aggregated interface and the multiple interface identifiers.
[0197] Therefore, in a scenario such as a layer 2 access, the at least one interface identifier assigned by the first network device may not correspond to the at least one interface, and the number of the at least one interface identifier only needs to be the same as the number of the at least one interface. In a scenario such as a layer 3 access, the at least one interface identifier assigned by the first network device may correspond to the at least one interface respectively, that is, the at least one interface identifier may identify the at least one interface one by one, so that when the first network device receives a message including one of the at least one interface identifiers, it can directly forward the message through the corresponding interface according to the one-to-one correspondence between the interface identifier and the interface stored locally.
[0198] The type of the at least one interface identifier may be a SID, an MPLS label, etc., and this embodiment of the present application does not impose a sole limitation on this.
[0199] 403: The first network device sends a message, where the message includes an address of a destination device and at least one interface identifier.
[0200] The address of the destination device may be an IP address, a MAC address, etc. of the destination device. The address of the destination device may be carried in the destination address field in the message. In addition, the message may also include next hop information, and the address of the second network device may be carried in the next hop information in the message.
[0201] The message sent by the first network device is used to announce the route of the destination device. For example, the message may be a BGP route. The at least one interface identifier may be carried in the tlv information in the BGP route. Further, the number of the at least one interface identifier may also be carried in the tlv information. Optionally, the at least one interface identifier may also be carried in multiple messages for announcement.
[0202] When the first network device sends a message, the message may be sent to the third network device.
[0203] Furthermore, the first network device may receive a message sent from the third network device to the destination device, the message carrying the first interface identifier of the at least one interface identifier, and the first network device may forward the message to the second network device according to the first interface identifier.
[0204] Specifically, the first network device obtains interface information corresponding to the first interface identifier, and forwards the message to the second network device according to the interface identified by the interface information.
[0205] In the Layer 2 access scenario, the interface information corresponding to the first interface identifier may be aggregated interface information, and operation 403 may be implemented in the following first or second manner. Optionally, for a certain interface identifier, a corresponding interface identifier type may be set for the interface identifier; when the interface identifier type is the first type, the message may be forwarded in the first manner; when the interface identifier type is the second type, the message may be forwarded in the second manner.
[0206] In a layer 3 access scenario, the interface information corresponding to the first interface identifier may be outbound interface information. In this case, operation 403 may be implemented in the following third manner.
[0207] The first way: the first network device determines the aggregation interface information corresponding to the first interface identifier, and forwards the message to the second network device through the aggregation interface identified by the aggregation interface information.
[0208] When the first network device generates the at least one interface identifier, it can save the correspondence between the at least one interface identifier and the information of the aggregate interface connecting the first network device and the second network device. In this way, when the first network device receives the message carrying the first interface identifier, it can obtain the aggregate interface information corresponding to the first interface identifier from the correspondence.
[0209] When the first network device forwards the message to the second network device through the aggregate interface identified by the aggregate interface information, the first network device may send the message to the aggregate interface, and the member interface under the aggregate interface forwards the message to the second network device.
[0210] In the first manner, the at least one interface identifier may be, for example, a segment identifier of the End.DT2U type.
[0211] The second method: the first network device obtains the first interface information from a mapping relationship table between the interface identifier and the interface information according to the first interface identifier, and forwards the message to the second network device through the first interface identified by the first interface information.
[0212] When the first network device generates the at least one interface identifier, it can establish a mapping relationship table between the at least one interface identifier and the information of at least one interface used to communicate with the second network device. In this way, when the first network device receives the message carrying the first interface identifier, it can obtain the first interface information corresponding to the first interface identifier from the mapping relationship, and then directly forward the message to the second network device through the first interface identified by the first interface information.
[0213] In the second manner, the at least one interface identifier may be defined as a segment identifier type available for layer 2 forwarding, for example.
[0214] The third method: the first network forwards the message to the second network device through the outgoing interface identified by the first interface identifier.
[0215] In a three-layer access scenario, the at least one interface identifier is used to identify at least one outgoing interface, and the multiple outgoing interfaces are outgoing interfaces from the first network device to the destination device. Therefore, the first network can directly forward the message to the second network device through the outgoing interface identified by the first interface identifier.
[0216] Using the third manner, the at least one interface identifier may be, for example, a segment identifier of the END.DX4 type.
[0217] The process of the third network device sending the interface identification message is described below:
[0218] Figure 5 is a flowchart of a method for receiving an interface identification message provided by an embodiment of the present application. The method can be executed by a third network device. The third network device can be, for example, Figure 1 PE3 device in. See Figure 5 , the method comprising:
[0219] 501: A third network device receives a first message from a first network device, where the first message includes an address of a destination device and at least one interface identifier.
[0220] The first message is the message sent by the first network device in the above operation 403. After receiving the first message from the first network device, the third network device can save the correspondence between the at least one interface identifier and the address of the destination device according to the first message, wherein the at least one interface identifier is allocated by the first network device according to the number of interfaces for communication between the first network device and the second network device, so that the message sent to the destination device can be forwarded according to the correspondence later. In addition, if the first message also includes next hop information, and the next hop information includes the address of the second network device, the correspondence between the address of the second network device and the address of the destination device can also be saved.
[0221] Further, if the first network device is one of the multi-homed network devices of the second network device, other network devices in the multi-homed network devices of the second network device except the first network device may also send a message to the third network device.
[0222] For example, the fourth network device, as another multi-homed network device of the second network device, can send a second message to the third network device, and the second message can carry the identifier of the destination device and at least one interface identifier for communication between the fourth network device and the second network device. After receiving the second message from the fourth network device, the third network device can save the correspondence between the address of the destination device and the at least one interface identifier according to the second message, wherein the at least one interface identifier is allocated by the fourth network device according to the number of interfaces for communication between the fourth network device and the second network device, so that the message sent to the destination device can be forwarded later according to the correspondence.
[0223] 502: The third network device sends a first message to the first network device. The destination address of the first message is the address of the destination device. The first message includes a first interface identifier.
[0224] To facilitate subsequent explanation, here we take the case where the number of interface identifiers sent by the first network device to the third network device is two, respectively referred to as the first interface identifier and the second interface identifier, and the case where the number of interface identifiers sent by the fourth network device to the third network device is one, referred to as the third interface identifier, as an example.
[0225] After the third network device receives the message carrying the address of the destination device, the first interface identifier and the second interface identifier from the first network device, the correspondence between the two interface identifiers and the address of the destination device can be saved. The correspondence can be saved as the correspondence between the first interface identifier, the second interface identifier and the address of the destination device, or can be saved separately as the correspondence between the first interface identifier and the address of the destination device, and the correspondence between the second interface identifier and the address of the destination device, or saved in other forms that can determine the correspondence.
[0226] In this case, when the third network device sends the first message to the first network device, when determining that the destination address of the first message is the address of the destination device, the third network device can determine the first interface identifier in the first message according to the corresponding relationship, and then send the first message to the first network device. The first interface identifier in the first message is used to instruct the first network device to forward the first message according to the first interface identifier.
[0227] That is to say, when the third network device receives a message that needs to be sent to the destination device, it can obtain the first interface identifier from the correspondence based on the destination address in the message (i.e., the address of the destination device), and then add the obtained first interface identifier to the message to obtain the first message, and then send the first message to the first network device.
[0228] In one possible scenario, when the third network device sends the first message to the first network device, the third network device can also obtain the next hop information corresponding to the address of the destination device, and the next hop information includes the address of the second network device; the third network device iterates the tunnel according to the address of the second network device in the next hop information, and determines the tunnel information, and then sends the first message to the first network device according to the tunnel information.
[0229] Furthermore, the third network device may also send a second message to the first network device, the destination address of the second message is the address of the destination device, and the second message includes a second interface identifier.
[0230] In this case, when the third network device sends the second message to the first network device, when determining that the destination address of the second message is the address of the destination device, the third network device can determine the second interface identifier in the second message according to the corresponding relationship, and then send the second message to the first network device. The second interface identifier in the second message is used to instruct the first network device to forward the second message according to the second interface identifier.
[0231] That is to say, when the third network device receives a message that needs to be sent to the destination device, it can obtain the second interface identifier from the correspondence based on the destination address in the message (i.e., the address of the destination device), and then add the obtained second interface identifier to the message to obtain the second message, and then send the second message to the first network device.
[0232] Among them, the way in which the third network device sends the second message to the first network device is similar to the way in which the third network device sends the first message to the first network device, and the embodiment of the present application will not be repeated here.
[0233] In the embodiment of the present application, when the third network device sends a message to the first network device, the message may be sent to the first network device according to the at least one interface identifier corresponding to the address of the destination device. For example, when the at least one interface identifier includes a first interface identifier and a second interface identifier, the third network device may send a first message to the first network device according to the first interface identifier, and send a second message to the first network device according to the second interface identifier. The first message and the second message may belong to the same service flow.
[0234] The third network device may also send a third message to the fourth network device, the third message including the address of the destination device and the third interface identifier. For example, the destination address field of the third message may be the address of the destination device. The third message may also belong to the service flow.
[0235] After the third network device receives the message carrying the address of the destination device and the third interface identifier from the fourth network device, the correspondence between the third interface identifier and the address of the destination device can be saved. In this case, when the third network device sends the third message to the fourth network device, when it is determined that the destination address of the third message is the address of the destination device, it can determine the third interface identifier in the third message according to the correspondence, and then send the third message to the fourth network device. The third interface identifier in the third message is used to instruct the fourth network device to forward the third message according to the third interface identifier.
[0236] That is to say, when the third network device receives a message that needs to be sent to the destination device, it can obtain the third interface identifier from the correspondence based on the destination address in the message (i.e., the address of the destination device), and then add the obtained third interface identifier to the message to obtain the third message, and then send the third message to the first network device.
[0237] Among them, the way in which the third network device sends the third message to the fourth network device is similar to the way in which the third network device sends the first message to the first network device, and the embodiment of the present application will not be repeated here.
[0238] In the embodiment of the present application, the third network device can forward the message to the first network device and the fourth network device respectively according to at least one interface identifier sent by the first network device and at least one interface identifier sent by the fourth network device. Since the number of at least one interface identifier sent by the first network device can indicate the number of available links between the first network device and the second network device, and the number of at least one interface identifier sent by the fourth network device can indicate the number of available links between the fourth network device and the second network device, the third network device can load share the message sent to the destination device between the first network device and the fourth network device based on the number of available links between the first network device, the fourth network device and the second network device. And since in most cases, the link bandwidth allocated to a link by the first network device and the fourth network device is the same, the link bandwidth utilization rate can be improved by load sharing based on the number of links, and then the message forwarding efficiency and business efficiency can be improved.
[0239] Figure 6 is a schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device may be Figure 1 The PE1 device, PE2 device or PE3 device shown in FIG. 1 may also be the above-mentioned Figure 4-Figure 6 The first network device, the fourth network device or the third network device described in the embodiment. Figure 6 The network device may include at least one processor 601 and at least one communication interface 604. The network device may also include a communication bus 602 and a memory 603.
[0240] The processor 601 may be a microprocessor (including a central processing unit (CPU), etc.), an application-specific integrated circuit (ASIC), or may be one or more integrated circuits for controlling the execution of the program of the present application.
[0241] The communication interface 604 uses any transceiver-like device to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 604 can be used to receive or send data for communication with other devices, such as receiving messages sent by other devices, or sending interface identifiers generated by network devices to other devices.
[0242] The memory 603 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), an optical disc (including a compact disc read-only memory (CD-ROM), a compressed optical disc, a laser disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 603 may exist independently and be connected to the processor 601 via the communication bus 602. The memory 603 may also be integrated with the processor 601.
[0243] Communication bus 602 may include a pathway for transmitting information between the above-mentioned components.
[0244] In a specific implementation, as an embodiment, the processor 601 may include one or more CPUs, such as Figure 6 CPU0 and CPU1 are shown in the figure.
[0245] In a specific implementation, as an embodiment, the network device may include multiple processors, such as Figure 6 601 and processor 605 shown in FIG. Each of these processors may be a single-core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0246] In a specific implementation, as an embodiment, the network device may further include an output device 606 and an input device 607. The output device 606 communicates with the processor 601 and may display information in a variety of ways. For example, the output device 606 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 607 communicates with the processor 601 and may receive user input in a variety of ways. For example, the input device 607 may be a mouse, a keyboard, a touch screen device, or a sensor device.
[0247] The above-mentioned network device can be, for example, a router, a switch, a PE device, a network server, a switch or a desktop computer, or can be other types of communication devices or embedded devices, etc. The embodiment of the present application does not specifically limit the type of network device.
[0248] When the network device includes a memory 603, the memory 603 is used to store a program code 610 for executing the solution of the present application, and the processor 601 is used to execute the program code 610 stored in the memory 603. The network device can implement the operations performed by the first network device, the fourth network device, or the third network device in the above-mentioned embodiment through the processor 601 and the program code 610 in the memory 603. In other implementation forms, the memory can also exist independently of the network device, and the program code stored in the memory can be called when the network device is running to implement the operations performed by the first network device, the fourth network device, or the third network device in the above-mentioned embodiment.
[0249] Figure 7 is a schematic diagram of the structure of a first network device provided in an embodiment of the present application. The first network device can be implemented by software, hardware, or a combination of both. The first network device can be Figure 6 See the network devices shown. Figure 7 The first network device includes: a determination module 701, a generation module 702 and a sending module 703.
[0250] A determination module 701, configured to determine the number of at least one interface used to communicate with a second network device;
[0251] A generating module 702, configured to generate at least one interface identifier, wherein the number of the at least one interface identifier is the same as the number of the at least one interface;
[0252] The sending module 703 is used to send a message, where the message includes an address of a destination device and at least one interface identifier, and the destination device is the second network device or a device connected to the second network device.
[0253] Optionally, the sending module 703 is used to:
[0254] sending a message to a third network device;
[0255] The first network device also includes:
[0256] A receiving module, configured to receive a message sent by a third network device to a destination device, wherein the message carries a first interface identifier among at least one interface identifier;
[0257] The sending module 703 is further configured to forward the message to the second network device according to the first interface identifier.
[0258] Optionally, the sending module 703 is further used for:
[0259] Obtaining interface information corresponding to the first interface identifier;
[0260] The message is forwarded to the second network device according to the interface identified by the interface information.
[0261] Optionally, the sending module 703 is further used for:
[0262] According to the first interface identifier, the first interface information is obtained from a mapping relationship table between the interface identifier and the interface information, and the message is forwarded to the second network device through the first interface identified by the first interface information; or,
[0263] Determine the aggregation interface information corresponding to the first interface identifier, and forward the message to the second network device through the aggregation interface identified by the aggregation interface information.
[0264] Optionally, the first network device is connected to the second network device through an aggregation interface, and the determination module 701 is used to:
[0265] Determine at least one member interface included in the aggregate interface;
[0266] The number of at least one interface used for communicating with the second network device is determined according to the at least one member interface.
[0267] Optionally, the determination module 701 is used to:
[0268] Using the number of at least one member interface as the number of at least one interface for communicating with the second network device; or
[0269] The number of the member interfaces selected for use in the at least one member interface is used as the number of the at least one interface for communicating with the second network device.
[0270] Optionally, the determination module 701 is used to:
[0271] receiving a plurality of LLDP messages from at least one member interface, the plurality of LLDP messages including device information of a plurality of network devices connected to the first network device, the plurality of network devices including the second network device;
[0272] According to the multiple LLDP messages, the number of at least one interface communicating with the second network device is determined from at least one member interface.
[0273] Optionally, the device information includes an aggregation port ID and a chassis ID, where the chassis ID is used to identify the network device, and the aggregation port ID is used to identify the aggregation interface of the network device. The determination module 701 is used to:
[0274] According to the multiple chassis IDs and the multiple aggregation port IDs included in the multiple LLDP messages, determine the first number of the LLDP message in which the chassis ID is an identifier of the second network device and the aggregation port ID is an identifier of the aggregation interface connecting the second network device and the first network device;
[0275] The first number is used as the number of at least one interface for communicating with the second network device.
[0276] Optionally, the determination module 701 is used to:
[0277] Determine the number of at least one next hop address from the first network device to the destination device;
[0278] The number of at least one next hop address is used as the number of at least one interface for communicating with the second network device.
[0279] Optionally, at least one interface identifier is a SID or an MPLS label.
[0280] Optionally, the message is a BGP route, and at least one interface identifier is carried in tlv information in the BGP route.
[0281] In an embodiment of the present application, the first network device sends a message carrying the address of the destination device and at least one interface identifier. Since the number of the at least one interface identifier is the same as the number of at least one interface used by the first network device to communicate with the second network device, the number of the at least one interface identifier can indicate the number of available links between the first network device and the second network device. In this way, other network devices that receive the message can implement load sharing of messages sent to the destination device based on the number of available links between the first network device and the second network device. In addition, since in most cases, the link bandwidth allocated to a link is the same, the link bandwidth utilization rate can be improved by load sharing based on the number of links, and then the message forwarding efficiency and business efficiency can be improved.
[0282] It should be noted that: when the first network device provided in the above embodiment sends an interface identification message, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the first network device provided in the above embodiment and the method embodiment for sending an interface identification message belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0283] Figure 8is a schematic diagram of the structure of a third network device provided in an embodiment of the present application. The third network device can be implemented by software, hardware, or a combination of both. The third network device can be Figure 6 See the network devices shown. Figure 8 , the third network device includes: a receiving module 801 and a sending module 802.
[0284] A receiving module 801 is configured to receive a first message from a first network device, where the first message includes an address of a destination device and at least one interface identifier, the number of the at least one interface identifier is the same as the number of the at least one interface, the at least one interface is an interface used by the first network device to communicate with the second network device, the at least one interface identifier includes a first interface identifier, and the destination device is the second network device or a device connected to the second network device;
[0285] The sending module 802 is used to send a first message to a first network device. The destination address of the first message is the address of the destination device. The first message includes a first interface identifier.
[0286] Optionally, the at least one interface identifier further includes a second interface identifier, and the sending module 802 is further configured to:
[0287] A second message is sent to the first network device, where the destination address of the second message is the address of the destination device, and the second message includes a second interface identifier.
[0288] Optionally, the sending module 802 is used to:
[0289] Save the correspondence between the first interface identifier and the address of the destination device according to the first message;
[0290] Determine that the destination address of the first message is the address of the destination device, and determine the first interface identifier in the first message according to the corresponding relationship;
[0291] A first message is sent to a first network device.
[0292] Optionally, at least one interface identifier is a SID or an MPLS label.
[0293] Optionally, the message is a BGP route, and at least one interface identifier is carried in tlv information in the BGP route.
[0294] Optionally, the first network device is one of the multi-homed network devices of the second network device.
[0295] Optionally,
[0296] The receiving module 801 is further configured to receive a second message from a fourth network device, where the second message includes an address of a destination device and a third interface identifier for communication between the fourth network device and the second network device, and the fourth network device is another multi-homed network device of the second network device;
[0297] The sending module 802 further sends a third message to the fourth network device, where the third message includes an address of a destination device and a third interface identifier.
[0298] Optionally, the first message, the second message and the third message belong to the same service flow.
[0299] Optionally, the first message further includes next hop information, where the next hop information includes an address of the second network device, and the sending module 802 is used to:
[0300] Iterate the tunnel according to the address of the second network device in the next hop information, and determine the tunnel information;
[0301] A first message is sent to the first network device according to the tunnel information.
[0302] In an embodiment of the present application, the third network device receives a first message carrying an address of a destination device and at least one interface identifier from the first network device. Since the number of the at least one interface identifier is the same as the number of at least one interface used by the first network device to communicate with the second network device, the number of the at least one interface identifier can indicate the number of available links between the first network device and the second network device. In this way, the third network device can implement load sharing of messages sent to the destination device based on the number of available links between the first network device and the second network device. In addition, since in most cases, the link bandwidth allocated to a link is the same, the link bandwidth utilization rate can be improved by load sharing based on the number of links, thereby improving the message forwarding efficiency and business efficiency.
[0303] It should be noted that: the third network device provided in the above embodiment only uses the division of the above functional modules as an example when receiving the interface identification message. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the third network device provided in the above embodiment and the method embodiment for receiving the interface identification message belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0304] 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 instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may 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 may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0305] The above-mentioned embodiments are provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for sending an interface identification message, characterized in that: The method comprises: The first network device determines the number of at least one interface for communicating with the second network device; The first network device generates at least one interface identifier, the number of the at least one interface identifier being the same as the number of the at least one interface; The first network device sends a first message to the third network device, the first message including the address of the destination device and the at least one interface identifier, the destination device is the second network device or a device connected to the second network device, and the number of the at least one interface identifier is used to indicate the number of available links between the first network device and the second network device, so that the third network device performs load balancing for messages sent to the destination device based on the number of links.
2. The method according to claim 1, characterized in that After the first network device sends the first message to the third network device, the method further includes: The first network device receives a message sent by the third network device to the destination device, where the message carries a first interface identifier among the at least one interface identifier; The first network device forwards the message to the second network device according to the first interface identifier.
3. The method according to claim 2, characterized in that The first network device forwarding the message to the second network device according to the first interface identifier includes: The first network device obtains interface information corresponding to the first interface identifier; The first network device forwards the message to the second network device according to the interface identified by the interface information.
4. The method according to claim 3, characterized in that The first network device acquires the interface information corresponding to the first interface identifier, including: The first network device acquires the first interface information from a mapping relationship table between the interface identifier and the interface information according to the first interface identifier; The first network device forwards the message to the second network device according to the interface identified by the interface information, including: The first network device forwards the message to the second network device through the first interface identified by the first interface information.
5. The method according to claim 3, characterized in that The first network device acquires the interface information corresponding to the first interface identifier, including: The first network device determines the aggregated interface information corresponding to the first interface identifier; The first network device forwards the message to the second network device according to the interface identified by the interface information, including: The first network device forwards the message to the second network device through the aggregate interface identified by the aggregate interface information.
6. The method according to any one of claims 1 to 5, characterized in that: The first network device is connected to the second network device through an aggregate interface, and the first network device determines the number of at least one interface used for communicating with the second network device, including: The first network device determines at least one member interface included in the aggregate interface; The first network device determines the number of at least one interface used to communicate with the second network device according to the at least one member interface.
7. The method according to claim 6, characterized in that The first network device determines, according to the at least one member interface, the number of at least one interface used to communicate with the second network device, including: The first network device uses the number of the at least one member interface as the number of at least one interface for communicating with the second network device; or, The first network device uses the number of member interfaces selected for use among the at least one member interface as the number of at least one interface for communicating with the second network device.
8. The method according to claim 6, characterized in that The first network device determines, according to the at least one member interface, the number of at least one interface used to communicate with the second network device, including: The first network device receives a plurality of link layer discovery protocol LLDP messages from the at least one member interface, the plurality of LLDP messages including device information of a plurality of network devices connected to the first network device, the plurality of network devices including the second network device; The first network device determines, according to the multiple LLDP messages, the number of at least one interface communicating with the second network device from the at least one member interface.
9. The method according to claim 8, characterized in that The device information includes an aggregation port ID and a chassis ID, where the chassis ID is used to identify a network device, and the aggregation port ID is used to identify an aggregation interface of the network device. The first network device determines the number of at least one interface communicating with the second network device from the at least one member interface according to the multiple LLDP messages, including: The first network device determines, according to the multiple chassis IDs and the multiple aggregation port IDs included in the multiple LLDP messages, a first number of the LLDP messages in which the chassis ID is an identifier of the second network device and the aggregation port ID is an identifier of an aggregation interface connecting the second network device and the first network device; The first network device uses the first number as the number of at least one interface for communicating with the second network device.
10. The method according to any one of claims 1 to 5, characterized in that: The first network device determines the number of at least one interface used for communicating with the second network device, including: The first network device determines the number of at least one next hop address from the first network device to the destination device; The first network device uses the number of the at least one next hop address as the number of at least one interface for communicating with the second network device.
11. The method of claim 1, 2, 3, 4, 5, 7, 8 or 9, wherein: The at least one interface identifier is a segment identifier SID or a multi-protocol label switching MPLS label.
12. The method of claim 1, 2, 3, 4, 5, 7, 8 or 9, wherein: The first message is a Border Gateway Protocol BGP route, and the at least one interface identifier is carried in the type-length-value tlv information in the BGP route.
13. The method of claim 1, 2, 3, 4, 5, 7, 8 or 9, wherein: The first network device is one of the multi-homed network devices of the second network device.
14. A method for receiving an interface identification message, characterized in that: The method comprises: The third network device receives a first message from the first network device, where the first message includes an address of a destination device and at least one interface identifier, the number of the at least one interface identifier is the same as the number of the at least one interface, the at least one interface is an interface used by the first network device to communicate with the second network device, the destination device is the second network device or a device connected to the second network device, and the number of the at least one interface identifier is used to indicate the number of available links between the first network device and the second network device; The third network device sends a first message to the first network device through load sharing based on the number of links. The destination address of the first message is the address of the destination device. The first message includes a first interface identifier, which is included in the at least one interface identifier.
15. The method according to claim 14, characterized in that The at least one interface identifier further includes a second interface identifier, and the method further includes: The third network device sends a second message to the first network device, the destination address of the second message is the address of the destination device, and the second message includes the second interface identifier.
16. The method according to claim 14, characterized in that The third network device sending the first message to the first network device includes: The third network device saves the correspondence between the first interface identifier and the address of the destination device according to the first message; The third network device determines that the destination address of the first message is the address of the destination device, and determines the first interface identifier in the first message according to the corresponding relationship; The third network device sends the first message to the first network device.
17. The method according to any one of claims 14 to 16, characterized in that: The at least one interface identifier is a segment identifier SID or a multi-protocol label switching MPLS label.
18. The method according to any one of claims 14 to 16, characterized in that: The first message is a Border Gateway Protocol BGP route, and the at least one interface identifier is carried in the type-length-value tlv information in the BGP route.
19. The method according to claim 15, characterized in that The first network device is one of the multi-homed network devices of the second network device.
20. The method of claim 19, wherein: The method further comprises: The third network device receives a second message from a fourth network device, where the second message includes an address of the destination device and a third interface identifier for communication between the fourth network device and the second network device, and the fourth network device is another multi-homed network device of the second network device; The third network device sends a third message to the fourth network device, where the third message includes the address of the destination device and the third interface identifier.
21. The method of claim 20, wherein: The first message, the second message and the third message belong to the same service flow.
22. The method according to any one of claims 14 to 16, characterized in that: The first message further includes next hop information, where the next hop information includes an address of the second network device, and the third network device sends the first message to the first network device, including: The third network device iterates the tunnel according to the address of the second network device in the next hop information, and determines the tunnel information; The third network device sends the first message to the first network device according to the tunnel information.
23. A first network device, characterized in that: The first network device includes a processor and a memory, the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory, so that the first network device executes the method according to any one of claims 1 to 13.
24. A third network device, characterized in that: The third network device includes a processor and a memory, the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory, so that the third network device executes the method according to any one of claims 14 to 22.
25. A system for sending and receiving interface identification messages, characterized in that: The system comprises the first network device as claimed in claim 23, and the third network device as claimed in claim 24, wherein: The first network device is configured to determine the number of at least one interface used for communicating with the second network device, generate at least one interface identifier, the number of the at least one interface identifier is the same as the number of the at least one interface, and send a first message to the third network device, the first message including an address of a destination device and the at least one interface identifier, the destination device is the second network device or a device connected to the second network device, and the number of the at least one interface identifier is used to indicate the number of available links between the first network device and the second network device; The third network device is used to receive the first message and send a first message to the first network device by load sharing based on the number of links. The destination address of the first message is the address of the destination device. The first message includes a first interface identifier, which is included in the at least one interface identifier.
26. The system of claim 25, wherein: The at least one interface identifier further includes a second interface identifier; The third network device is further used to send a second message to the first network device, the destination address of the second message is the address of the destination device, and the second message includes the second interface identifier.
27. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the method according to any one of claims 1 to 13, or executes the method according to any one of claims 14 to 22.
Citation Information
Patent Citations
Method and system for sharing data traffic according to bandwidth based on self-defined template
CN109218218A
Forwarding table updating method and device
CN110113260A
