WO2023116580A1 - Path switching method and apparatus, network device, and network system - Google Patents
Path switching method and apparatus, network device, and network system Download PDFInfo
- Publication number
- WO2023116580A1 WO2023116580A1 PCT/CN2022/139756 CN2022139756W WO2023116580A1 WO 2023116580 A1 WO2023116580 A1 WO 2023116580A1 CN 2022139756 W CN2022139756 W CN 2022139756W WO 2023116580 A1 WO2023116580 A1 WO 2023116580A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- path
- network device
- packet
- message
- forwarding
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 88
- 230000002159 abnormal effect Effects 0.000 claims abstract description 103
- 230000005856 abnormality Effects 0.000 claims description 11
- 238000012217 deletion Methods 0.000 claims description 3
- 230000037430 deletion Effects 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 abstract description 47
- 230000006854 communication Effects 0.000 abstract description 37
- 238000004891 communication Methods 0.000 abstract description 35
- 230000006870 function Effects 0.000 description 20
- HRULVFRXEOZUMJ-UHFFFAOYSA-K potassium;disodium;2-(4-chloro-2-methylphenoxy)propanoate;methyl-dioxido-oxo-$l^{5}-arsane Chemical compound [Na+].[Na+].[K+].C[As]([O-])([O-])=O.[O-]C(=O)C(C)OC1=CC=C(Cl)C=C1C HRULVFRXEOZUMJ-UHFFFAOYSA-K 0.000 description 19
- 238000010586 diagram Methods 0.000 description 17
- 238000012545 processing Methods 0.000 description 11
- 230000009286 beneficial effect Effects 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 8
- 238000004458 analytical method Methods 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000004590 computer program Methods 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 230000003190 augmentative effect Effects 0.000 description 2
- 230000033228 biological regulation Effects 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 230000001537 neural effect Effects 0.000 description 2
- 238000011144 upstream manufacturing Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- VIKNJXKGJWUCNN-XGXHKTLJSA-N norethisterone Chemical compound O=C1CC[C@@H]2[C@H]3CC[C@](C)([C@](CC4)(O)C#C)[C@@H]4[C@@H]3CCC2=C1 VIKNJXKGJWUCNN-XGXHKTLJSA-N 0.000 description 1
- 150000003839 salts Chemical class 0.000 description 1
- 230000011664 signaling Effects 0.000 description 1
- 238000001356 surgical procedure Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/22—Alternate routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/24—Multipath
- H04L45/247—Multipath using M:N active or standby paths
Definitions
- the present application relates to the communication field, and in particular to a path switching method, device, network equipment, and network system.
- the equal-cost multi-path (ECMP) path refers to multiple paths with equal value but different intermediate nodes to the same target Internet Protocol (IP) address or target network segment.
- IP Internet Protocol
- the network device supports the ECMP function, data streams sent to the same target IP address or target network segment can be sent through different paths.
- the network device performs traffic load sharing on the service data transmitted by the multiple paths included in the ECMP group.
- the equal-cost forwarding path included in the ECMP group has problems such as congestion or packet loss, the network device cannot perceive the abnormal state of the downstream device in the equal-cost forwarding path, resulting in a longer transmission delay of the equal-cost forwarding path.
- the present application provides a path switching method, device, network equipment, and network system, which solve the problem that when the equivalent forwarding path in the ECMP group is abnormal, the transmission delay of business data in the ECMP group increases and the data transmission efficiency decreases The problem.
- the embodiment of the present application provides a path switching method, which can be applied to a network system including a first network device and a second network device, or a network device that supports the path switching method, such as the network device Including chip or chip system.
- the path switching method is performed by the first network device, and the path switching method includes: the first network device receives the first message, and obtains the corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes Multiple equivalent forwarding paths corresponding to the destination identifier; furthermore, the first network device determines the first path corresponding to the first message from the aforementioned ECMP group; when the first network device determines the first path according to the abnormal information sent by the second network device When the path is in an abnormal state, the first network device forwards the first message through the second path in the ECMP group.
- the first network device forwards the message, since the first network device can determine that the first path corresponding to the first message is in an abnormal state according to the abnormal information sent by the second network device, it is avoided that the first network device cannot perceive The abnormal state (such as congestion or packet loss) of the downstream device (such as the second network device), and the ECMP group also includes other equal-cost forwarding paths consistent with the destination identifier of the first path, such as the second path. Therefore, the first network The device can also forward the aforementioned first message through the second path, avoiding that the first message cannot be forwarded to the device corresponding to the destination identifier, improving the accuracy of data communication, and reducing the transmission caused by the abnormal state of the path The time delay improves the transmission efficiency of the first packet.
- the abnormal state such as congestion or packet loss
- the ECMP group also includes other equal-cost forwarding paths consistent with the destination identifier of the first path, such as the second path. Therefore, the first network The device can also forward the aforementioned first message through the second path, avoiding that
- the abnormal information sent by the second network device indicates that the packet received through the first path affects the forwarding efficiency of the second network device.
- the forwarding efficiency of the second network device may be represented by any one or a combination of several of the following: bandwidth of the first path, transmission delay of the first path, packet loss rate of data packets in the first path, and the like.
- the first path is in an abnormal state, including: the first path is marked as abnormal, such as the first path being marked as unavailable; or the first path is deleted, such as the first
- the network device moves the first path out of the equal-cost forwarding path included in the ECMP group; or the parameters of the first path exceed the set threshold, for example, each equal-cost forwarding path included in the ECMP group corresponds to a path parameter value, in an ECMP In the group, the maximum value and the minimum value of the path parameter value are determined. If the path parameter value corresponding to the first path is set to the path parameter value corresponding to the ECMP group, it is determined that the parameter value of the first path exceeds the set value. threshold, and then determine that the first path is marked as abnormal.
- the network device can determine the equivalent forwarding path in the abnormal state in the ECMP group according to the abnormality information fed back by the downstream device, and furthermore, the network device can use the equivalent forwarding path in the abnormal state to transmit the The message is switched to the normal equal-cost forwarding path (or an idle equal-cost forwarding path), which reduces the transmission delay of the message in the network system and improves the transmission efficiency of the network system.
- the deletion of the first path includes: invalidating the port provided by the first network device to the first path, or the next-hop route of the second network device in the first path been deleted.
- the first network device forwards the first message through the second path in the ECMP group, including: the first network device offsets the first path by a set value to obtain the second path ; Furthermore, the first network device forwards the first message through the second path.
- Network devices can determine the equivalent forwarding path of message forwarding by setting the offset value, which improves the accuracy of path adjustment and realizes precise control of data flow when multiple messages belong to the same data flow .
- the network device or the source device can set an offset value for a specific field, thereby adjusting the internal path selection in the ECMP group, and realizing precise adjustment of the routing path between the source device and the destination device.
- the foregoing path switching method further includes: the first network device receives a second packet, the second packet belongs to the first flow, and the second packet includes an offset value; further, the first A network device forwards the second message through the second path according to the offset value in the second message. Since the first network device quickly adjusts the path in the ECMP group after obtaining the abnormal information, the timeliness of path adjustment in the ECMP group is improved on the basis of improving the data transmission efficiency of the network system.
- the aforementioned offset value is included in the packet header of the second packet.
- the first packet is a fourth-generation Internet protocol (Internet Protocol version 4, IPv4) packet
- the extended option header or the IP ID field included in the IPv4 packet is stored with an offset value .
- the first packet is a sixth-generation Internet Protocol (Internet Protocol version 6, IPv6) packet
- the extended options header or flow label (flow label) field included in the IPv6 packet is biased. transfer value.
- the offset value can also be set in other positions of the packet header, which is not limited.
- the offset value may be set by the first network device, or the offset value may also be set by the source device communicating with the first network device, which is not limited.
- the first packet includes priority information.
- the first network device obtains the corresponding equal-cost path load sharing ECMP group according to the destination identifier of the first message, including: step 1, the first network device obtains multiple ECMP groups according to the destination identifier of the first message, and the multiple ECMP groups corresponding to different priorities.
- Step 2 The first network device determines the ECMP group corresponding to the first message from multiple ECMP groups according to the priority information.
- a network device can provide multiple different ECMP groups for a destination identifier, and these different ECMP groups have different forwarding efficiencies, when the network system needs to serve a large number of users, the network device can give priority to Users with low-latency or large-traffic transmission needs provide ECMP groups with higher forwarding efficiency, so as to realize low-latency and large-traffic transmission of data communication.
- the network device can provide the user with a higher-quality (eg, lower delay and larger bandwidth) ECMP group, which is beneficial to improving the QoE of data communication.
- the priority information is a differentiated services code point (differentiated services code point, DSCP) value.
- the network device can provide ECMP groups with different delays and bandwidths for different service types according to different DSCP values, that is, the network device can provide better communication services for differentiated target groups, thereby avoiding Different types of services share the same ECMP group, resulting in problems such as increased processing delay and low data transmission efficiency of the network system.
- network devices can provide higher-quality communication services for high-priority services and improve QoE.
- a second aspect provides a path switching device, the path switching device is applied to a first network device, and the path switching device includes a path switching method for executing the first aspect or any possible implementation manner of the first aspect individual modules.
- the path switching device includes: a receiving unit, an acquiring unit, a determining unit, and a forwarding unit.
- the receiving unit is used for receiving the first packet, and the first packet belongs to the first stream.
- the acquiring unit is configured to acquire a corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes multiple equivalent forwarding paths corresponding to the aforementioned destination identifier.
- the determining unit is configured to determine the first path corresponding to the first message from the ECMP group, and determine whether the first path is in an abnormal state. Wherein, the determining unit determines that the first path is in an abnormal state according to the abnormal information sent by the second network device.
- the forwarding unit is configured to forward the first message through the second path in the ECMP group when the determining unit determines that the first path is in an abnormal state.
- the path switching device has the function of implementing the behavior in the method example of any implementation manner in the first aspect above.
- the functions described above may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
- the hardware or software includes one or more modules corresponding to the above functions.
- the abnormal information sent by the second network device indicates that the packet received through the first path affects the forwarding efficiency of the second network device.
- the abnormal state of the first path includes: the first path is marked as abnormal, or the first path is deleted, or a parameter of the first path exceeds a set threshold.
- the deletion of the first path includes: invalidating the port provided by the first network device to the first path, or the next-hop route of the second network device in the first path been deleted.
- the forwarding unit is specifically configured to: offset the first path by a set value to obtain the second path; and forward the first packet through the second path.
- the receiving unit is further configured to receive a second packet, the second packet belongs to the first stream, and the second packet includes an offset value.
- the forwarding unit is further configured to forward the second message through the second path according to the offset value in the second message.
- the offset value is included in the packet header of the second packet.
- the extended option header or the IP ID field included in the IPv4 packet stores an offset value.
- the extended options header or flow label field included in the IPv6 packet stores an offset value.
- the first packet includes priority information.
- the obtaining unit is specifically configured to obtain multiple ECMP groups according to the destination identifier of the first message, and the multiple ECMP groups correspond to different priorities.
- the determining unit is further configured to determine the ECMP group corresponding to the first message from multiple ECMP groups according to the priority information.
- the priority information is a DSCP value.
- a network device including a memory and a processor, wherein: the memory is used to store program codes; and the processor is used to call the program codes to implement the operation steps of the method in any implementation manner in the first aspect.
- a network system including: a first network device and a second network device.
- a first network device receives a first packet, and the first packet belongs to a first flow.
- the first network device obtains the corresponding ECMP group according to the destination identifier of the first packet, and the ECMP group includes multiple equivalent forwarding paths corresponding to the destination identifier.
- the first network device determines the first path corresponding to the first packet from the ECMP group.
- the first network device forwards the first message to the second network device through the second path in the ECMP group.
- the first network device determines that the first path is in an abnormal state according to the abnormality information sent by the second network device.
- the network system further includes: a source device.
- the source device sends a second packet to the first network device, the second packet belongs to the first flow, and the second packet includes an offset value.
- the first network device forwards the second packet to the second network through the second path according to the offset value in the second packet.
- the offset value is included in the packet header of the second packet.
- a computer-readable storage medium in which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the operation steps of the method in any implementation manner in the first aspect are implemented.
- the present application provides a computer program product, the computing program product includes instructions, and when the computer program product is run on a processor or a computing device, the processor or computing device executes the instructions, so as to realize the first aspect and The method in any possible implementation manner in the first aspect.
- the present application provides a chip, including: an interface circuit and a control circuit.
- the interface circuit is used to receive data from other devices other than the processor and transmit it to the control circuit, or send data from the control circuit to other devices other than the processor.
- the control circuit is used to implement the logic circuit or execute code instructions The method of any implementation manner in the first aspect. For the beneficial effects, reference may be made to the description of any implementation manner in the first aspect, and details are not repeated here.
- FIG. 1 is a schematic structural diagram of a communication system provided by the present application.
- FIG. 2 is a schematic diagram of the architecture of a leaf-spine network provided by the present application.
- FIG. 3 is a first schematic flow diagram of a path switching method provided by the present application.
- FIG. 4 is a second schematic flow diagram of a path switching method provided by the present application.
- FIG. 5 is a third schematic flow diagram of a path switching method provided by the present application.
- FIG. 6 is a schematic diagram of the path adjustment process in the ECMP group provided by the present application.
- FIG. 7 is a schematic structural diagram of an IPv4 message provided by the present application.
- FIG. 8 is a fourth schematic flowchart of a path switching method provided by the present application.
- FIG. 9 is a schematic structural diagram of a path switching device provided by the present application.
- FIG. 10 is a schematic structural diagram of a network device provided by the present application.
- FIG. 11 is a schematic structural diagram of another network device provided by the present application.
- An embodiment of the present application provides a path switching method, the path switching method includes: the first network device receives the first message, and obtains the corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes the corresponding Multiple equivalent forwarding paths identified by the destination; furthermore, the first network device determines the first path corresponding to the first message from the aforementioned ECMP group; when the first network device determines the first path according to the abnormal information sent by the second network device When in an abnormal state, the first network device forwards the first message through the second path in the ECMP group.
- the first network device forwards the message, since the first network device can determine that the first path corresponding to the first message is in an abnormal state according to the abnormal information sent by the second network device, it is avoided that the first network device cannot perceive The abnormal state (such as congestion or packet loss) of the downstream device (such as the second network device), and the ECMP group also includes other equal-cost forwarding paths consistent with the destination identifier of the first path, such as the second path. Therefore, the first network The device can also forward the aforementioned first message through the second path, avoiding that the first message cannot be forwarded to the device corresponding to the destination identifier, improving the accuracy of data communication, and reducing the transmission caused by the abnormal state of the path The time delay improves the transmission efficiency of the first packet.
- the abnormal state such as congestion or packet loss
- the ECMP group also includes other equal-cost forwarding paths consistent with the destination identifier of the first path, such as the second path. Therefore, the first network The device can also forward the aforementioned first message through the second path, avoiding that
- FIG. 1 is a schematic structural diagram of a communication system provided by the present application.
- the communication system includes a source device 110 and a destination device 130 , and a network system 120 for providing communication services to the source device 110 and the destination device 130 .
- the network system 120 may refer to the Internet, a cellular network, a data center network, or other networks.
- the network system 120 is an Internet service provider (Internet service provider, ISP) network.
- ISP Internet service provider
- An ISP is an operator that provides Internet access services, information services, and value-added services to a large number of users.
- the network system 120 may include at least one network device, such as network device 121 to network device 126 shown in FIG. 1 .
- the network device may be a routing transmission device such as a router or a switch.
- the network device 121 is a wireless access point (access point, AP), such as a wireless router, and the network device 122 may be a switch connected to the wireless router.
- AP access point
- the network device included in the network system 120 may also be other network devices with a data transmission function, such as a server or a base station device with a data transmission function.
- the source device 110 refers to a device that sends data.
- the source device 110 is an application server or a storage device that stores data.
- the source device 110 can use the network system 120 to send data to other devices (such as the The destination device 130) sends the data.
- the data stored by the source device 110 may include, but is not limited to: audio, video, text, or other types of data.
- the source device 110 can transmit these data in a streaming manner, such as a media stream, and the destination device 130 does not download the file before playing.
- the entire streaming media file of the media stream so as to reduce the delay of the destination device 130 playing the streaming media corresponding to the media stream, and improve the user experience quality (quality of experience, QoE).
- the above-mentioned destination device 130 may refer to a device requesting data, such as the destination device 130 refers to a terminal, and the terminal may be a mobile phone, a tablet computer, a computer with a wireless transceiver function, a personal communication service (personal communication service) , PCS) phones, desktop computers, personal digital assistants (personal digital assistant, PDA), wearable devices, virtual reality (virtual reality, VR) terminal equipment, augmented reality (augmented reality, AR) terminal equipment, industrial control (industrial control) ), wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grid, and transportation safety Wireless terminals, wireless terminals in smart cities, wireless terminals in smart homes, etc.
- a personal communication service personal communication service
- PCS personal communication service
- PDA personal digital assistant
- wearable devices virtual reality (virtual reality, VR) terminal equipment, augmented reality (augmented reality, AR) terminal equipment, industrial control (industrial control)
- wireless terminals in self-driving wireless terminals in remote
- source device 110 and destination device 130 are only examples provided by this embodiment, and should not be construed as a limitation to this application. And the quantity is not limited.
- Routing load balancing means that between network nodes (or network devices), there are multiple routing forwarding paths to the same destination, and traffic is shared to multiple routing forwarding paths for forwarding.
- forwarding information base forwarding information base
- FIB forwarding information base
- next-hop route such as IP address
- outgoing interface or tunnel ID (tunnel ID ) attributes corresponding to the routing paths of the table entries
- tunnel ID tunnel ID
- the FIB can also be called a forwarding routing table or a forwarding table.
- the FIB is stored in the data plane of a router (or other network device), and the entries of the FIB are called forwarding table entries. Each forwarding table entry Both specify a certain destination to be reached, the outbound interface to be passed and the next-hop IP address and other information.
- the data in the FIB (such as the aforementioned forwarding table entries) can be stored in an application-specific integrated circuit (ASIC), which allows network devices (such as routers) to perform data queries in the FIB , a fairly high speed can be achieved.
- ASIC application-specific integrated circuit
- the storage space that can be used by FIB is limited. Therefore, in large-scale network systems, attention should be paid to the size of the routing table of network equipment. On the premise of ensuring data accessibility, various mechanisms and means should be used to reduce the size of FIB.
- the network system 120 provides multiple different routing paths for data with the same destination IP address, as shown in Figure 1, the source device 110-network device 121-network device 122-network device 126-destination Device 130, source device 110-network device 121-network device 123-network device 126-destination device 130, source device 110-network device 121-network device 124-network device 125-network device 126-destination device 130, or are other possible routing paths etc.
- the multiple routing paths at least two routing paths with the same cost (cost) but different intermediate nodes may be referred to as mutual equal-cost forwarding paths. Wherein, cost refers to the cost of reaching the destination address indicated by a certain route.
- the multiple equal-cost switching paths can realize routing load sharing in the network system 120 .
- the foregoing multiple equal-cost forwarding paths may also be referred to as an ECMP group reaching one destination address.
- the network system 120 shown in Figure 1 is a spine-leaf network (spine-leaf network) as an example, and the network system is described.
- 200 includes a plurality of switches, such as spine switch 211 to spine switch 214 , and leaf switch 221 to leaf switch 223 .
- a leaf switch can implement the function of an access switch, and is used to connect physical servers communicating with the leaf-spine network 200, such as servers 231 to 233 shown in FIG. 2 .
- the leaf switch 221 is connected to the server 231 to connect the server 231 to the leaf-spine network 200 .
- a spine switch can implement the function of a core router (CR) for forwarding data from leaf switches.
- CR core router
- the servers connected to the two leaf switches need to communicate and need to forward data through the spine switch.
- FIG. 2 when server 231 and server 232 communicate, data needs to be forwarded through leaf switch 221, leaf switch 222, and a spine switch (such as spine switch 212) communicating with leaf switch 221 and leaf switch 222 at the same time.
- data communication can be realized by selecting an equivalent forwarding path based on ECMP between the leaf switch and the spine switch.
- the three routing paths (indicated by dotted lines in Figure 2) from the leaf switch 221 to the spine switch 211, the spine switch 212, and the spine switch 213 are each other from the leaf switch 221 to the device indicated by the target IP address (such as a server) 232) equivalent forwarding path.
- the number of downlink ports of the spine switches determines the number of leaf switches
- the number of uplink ports of the leaf switches determines the number of spine switches.
- the scale of the leaf-spine network is determined by the number of downlink ports of the spine switches. It is determined jointly with the number of uplink ports of the leaf switch.
- a virtual machine (virtual machine, VM) can be deployed in the server shown in FIG. logical computer.
- a physical device running a virtual machine is called a host machine.
- the server 231 is the host machine of VM1 and VM2
- the server 232 is the host machine of VM3 and VM4
- the server 234 is the host machine of VM5 and VM6.
- the computing resource required by the VM comes from a local processor and memory of the server, and the storage resource required by the VM may come from a local hard disk of the server.
- the virtual machine 231A (the aforementioned VM2) includes a virtual processor 231A1, a virtual memory 231A2, and a virtual network card 231A3, the computing resources required by the virtual processor 231A1 are provided by the processor, and the storage resources required by the virtual memory 231A2 are provided by the memory (or hard disk), and the network resources required by the virtual network card 231A3 are provided by the network card included in the server.
- various applications can run in the VM, and users can trigger services such as data access (including reading data, writing data, and migrating data, etc.), streaming media transmission and playback through the applications in the VM.
- the leaf-spine network 200 when the leaf-spine network 200 provides communication services for any two servers, the leaf-spine network 200 can provide multiple equal-cost forwarding paths with equal value and different intermediate routes to forward data.
- the leaf-spine network 200 may also include other routing devices, which are not shown in FIG. 2 .
- the embodiment of the present application does not limit the number of leaf switches and spine switches included in the leaf-spine network 200 .
- FIG. 3 is a schematic flow diagram of a path switching method provided by the present application.
- the path switching method can be applied to the communication system shown in FIG. 1 .
- the path switching method shown in FIG. 3 can be represented by FIG. 2 Any one of the switches included in the illustrated leaf-spine network 200 can be implemented.
- the source device 300 is realized by the server 231 in FIG. 2
- the network device 310 is realized by the leaf switch 221 in FIG. 2
- the network devices 321 to 325 are realized by the spine switch in FIG. 2 as an example.
- the network device 310 may also be called a first network device
- the network device 321 may also be called a second network device.
- the path switching method provided in this embodiment includes steps S310 to S340.
- the source device 300 sends the first packet to the network device 310.
- the network device 310 receives the first packet.
- the first packet belongs to the first stream.
- the first stream refers to the data stream sent by the source device 300 according to the service request.
- the service request is a video playback request
- the data stream refers to the video stream
- the first message refers to an image frame data in the video stream.
- the service request may also be an audio playback request, a text data migration request, or other requests, which are not limited.
- the destination identifiers of multiple packets belonging to the first flow are the same. If the first stream further includes a second packet, the destination identifier of the second packet is consistent with the destination identifier of the first packet.
- the destination identifier refers to the destination IP address or destination MAC address included in the first packet, or the target network segment to which the first packet is to be sent, and the like.
- the network device 310 acquires a corresponding ECMP group according to the destination identifier of the first packet.
- the ECMP group includes multiple equal-cost forwarding paths corresponding to the destination identifier.
- the ECMP group corresponding to the destination identifier of the first message is ECMP group 1, and this ECMP group 1 provides multiple equal-cost forwarding paths to the destination identifier, as shown in Figure 3.
- path 1 to path 3 may refer to different equivalent forwarding paths included in the ECMP group, and their examples in FIG. 3 should not be construed as limiting the present application.
- path 1 may also be called a first path
- path 2 may also be called a second path.
- the network device 310 may provide multiple ECMP groups for the destination identifier of the first packet, such as ECMP group 1 and ECMP group 2 shown in FIG. 3 .
- the forwarding efficiency of an ECMP group can be represented by any one or a combination of several of the following: the bandwidth of the equal-cost forwarding path included in the ECMP group, the transmission delay of the equal-cost forwarding path, the packet loss rate of data in the equal-cost forwarding path, etc. .
- the bandwidth of the equivalent forwarding path included in ECMP group 1 is different from the bandwidth of the equivalent forwarding path included in ECMP group 2.
- the bandwidth of the equivalent forwarding path (such as path 2) included in ECMP group 1 is greater than that The bandwidth of the equal-cost forwarding path (such as path 4).
- ECMP group 1 may be called a high-priority ECMP group
- ECMP group 2 may be called a normal ECMP group or a default ECMP group.
- FIG. 3 is only an example provided by this embodiment, and should not be construed as a limitation to this application.
- a network device can provide multiple different ECMP groups for a destination identifier, and these different ECMP groups have different forwarding efficiencies, when the network system needs to serve a large number of users, the network device can give priority to Users with low-latency or large-traffic transmission needs provide ECMP groups with higher forwarding efficiency, so as to realize low-latency and large-traffic transmission of data communication.
- the network device can provide the user with a higher-quality (eg, lower delay and larger bandwidth) ECMP group, which is beneficial to improving the QoE of data communication.
- the above-mentioned first packet includes priority information.
- the priority information is used to indicate the type of the service corresponding to the first packet.
- different types of services require different ECMP groups for transmitting packets of the services.
- the priority information included in the first packet is a DSCP value.
- the DSCP value can be set in the service type (type of service) identification field.
- the DSCP uses the used 6 bits and the unused 2 bits in the service type identification field to determine a coding value, and uses the coding value to distinguish service priorities.
- the DSCP uses 6 bits, and the range of DSCP values is 0 to 63. It is worth noting that each DSCP code value is mapped to a defined hop-by-hop behavior (per hop behavior, PHB) identification code, and the PHB identification code indicates the type of service.
- PHB hop-by-hop behavior
- the DSCP value included in the foregoing first packet may be determined by the source device 300 .
- the source device 300 enters the DSCP value in the first message, and the intermediate devices (such as terminal devices such as telephones and Windows clients and servers) in the communication process can also input the DSCP value contained in the first message.
- the data flow of the text (such as the aforementioned first flow) is identified, so as to perform traffic load sharing on the data flow.
- the network device can provide ECMP groups with different delays and bandwidths for different service types according to different priority information, that is, the network device can provide better communication services for differentiated target groups, thereby Avoid different types of services sharing the same ECMP group, resulting in problems such as increased network system processing delay and low data transmission efficiency.
- network devices can provide higher-quality communication services for high-priority services and improve QoE.
- the acquisition of the corresponding ECMP group by the network device 310 according to the destination identifier of the first packet will be described.
- the network device 310 may acquire multiple ECMP groups according to the destination identifier of the first packet.
- multiple ECMP groups correspond to different priorities. For example, the priority of ECMP group 1 shown in FIG. 3 is higher than the priority of ECMP group 2 .
- the network device 310 determines the ECMP group 1 corresponding to the first packet from multiple ECMP groups according to the priority information of the first packet.
- the network device 310 may determine the service type corresponding to the first message according to the priority information of the first message, and query the service type corresponding to the service type in an access control list (access control list, ACL). One or more forwarding ports, and then, the network device 310 uses the path corresponding to the one or more forwarding ports as the aforementioned equal-cost forwarding path, and uses the equivalent forwarding path corresponding to the one or more forwarding ports as the ECMP Group 1.
- the network device 310 queries the ACL based on the DSCP value to determine the outbound interface for forwarding the first message, such as One DSCP value corresponds to one or more outgoing interfaces, and the outgoing interface refers to a forwarding port provided by the network device 310 to the service corresponding to the DSCP value. Furthermore, the network device 310 determines the aforementioned equal-cost forwarding paths through the outgoing interfaces corresponding to the DSCP values, and uses the equal-cost forwarding paths corresponding to all the outgoing interfaces as the aforementioned EMCP group 1 .
- FIG. 3 only shows the two ECMP groups provided by the network device 310 for the destination identifier of the first packet, but when the network scale of the network system to which the network device 310 belongs is large enough, for the second
- the network device 310 may also provide more ECMP groups according to the destination identifier of the message, which is not limited in this application. Conversely, when the network scale of the network system to which the network device 310 belongs is small, the network device 310 may only provide ECMP group 1 or ECMP group 2 shown in FIG. 3 for the destination identifier of the first packet.
- the path switching method provided by the embodiment of the present application further includes steps S330 and S340.
- the network device 310 determines the first path corresponding to the first packet from the ECMP group 1.
- ECMP group 1 includes three equal-cost forwarding paths, and the first path may refer to path 1 shown in FIG. 3 .
- the manner in which the network device 310 determines the initial path of the first packet may be: the network device 310 randomly selects an equal-cost forwarding path from ECMP group 1 as the first path of the first packet.
- the way the network device 310 determines the initial path of the first packet may be: the network device 310 sorts the multiple equal-cost forwarding paths in ECMP group 1 after numbering, and according to the multiple equal-cost forwarding paths The sequence of paths and the sequence of packets in the data stream match the first path corresponding to the first packet.
- the manner in which the network device 310 determines the initial path of the first packet may be: the network device 310 randomly selects an equal-cost forwarding path from ECMP group 1 as the first path of the first packet.
- the manner in which the network device 310 determines the initial path of the first packet may be: the network device 310 parses the information in the packet header of the first packet, and determines that the first packet is in the ECMP Equivalent forwarding paths in group 1.
- the network device 310 parses the information in the packet header of the first packet, and determines that the first packet is in the ECMP Equivalent forwarding paths in group 1.
- the network device 310 forwards the first packet through the path 2 included in the ECMP group 1.
- the network device 310 determines that the path 1 is in an abnormal state according to the abnormality information sent by the network device 321 .
- the abnormal information sent by the network device 321 indicates that: the packet received through path 1 affects the forwarding efficiency of the network device 321 .
- the forwarding efficiency of the network device 321 may be represented by any one or a combination of several of the following: bandwidth of path 1, transmission delay of path 1, packet loss rate of data packets in path 1, and the like.
- the first network device such as the above-mentioned network device 310
- the first network device since the first network device can ) to determine that the first path corresponding to the first message is in an abnormal state, thus avoiding the problem that the first network device cannot perceive the abnormal state (such as congestion or packet loss) of the downstream device.
- the first network device can also forward the aforementioned first message through other equivalent forwarding paths in the ECMP group that are consistent with the destination identifier of the first path, such as the second path, so as to avoid that the first message cannot be forwarded to
- the device corresponding to the destination identifier improves the accuracy of data communication, reduces the transmission delay caused by the abnormal state of the path, and improves the transmission efficiency of the first message.
- the embodiment of the present application provides a possible implementation method for the network device to determine that the equivalent forwarding path is in an abnormal state, as shown in FIG. 4, which is Flowchart 2 of a path switching method provided in this application, port 1 to port 3 are the ports of the equivalent forwarding path provided by ECMP group 1 for the destination identifier of the first message, for example, network device 310 through port 1 A path 1 for transmitting the first packet is established with the network device 321 .
- FIG. 4 only shows path 1 included in ECMP group 1, but network device 310 may also establish other equivalent forwarding paths consistent with the destination identifier of path 1 with other network devices.
- the network device 310 establishes a path 2 for transmitting packets with the aforementioned network device 322 through port 2;
- An analysis engine for detecting the forwarding efficiency of the network device 321 may be deployed in the network device 321.
- the analysis engine may refer to a processor included in the network device 321, or may refer to a virtual machine or a container provided by the network device 321 using virtualization technology. (container) or management node (manage node), and the forwarding efficiency of the network device 321 is detected by the virtual machine, container or management node.
- the path switching method provided by the embodiment of the present application includes steps S410 to S450.
- the network device 310 sends the first packet to the network device 321.
- the network device 321 determines whether the forwarding efficiency of the network device 321 is abnormal.
- the network device 321 judges whether the port connected to the port 1 in the network device 321 is valid, and if the port connected to the port 1 is valid, it indicates that the forwarding efficiency of the network device 321 is normal; if the port connected to the port 1 is invalid, it indicates The forwarding efficiency of the network device 321 is abnormal.
- the network device 321 determines whether the message queue to be processed in the network device 321 is congested.
- the message queue includes a group of queue pairs (queue pair, QP), and QP includes a sending queue (send queue, SQ) and a receiving queue (receive queue, RQ).
- QP includes a sending queue (send queue, SQ) and a receiving queue (receive queue, RQ).
- the message queue used to send data in a network device is a sending Queue
- the message queue used to receive data in the network device is the receive queue.
- the network device 321 judges the packet loss rate in the historical statistics period.
- the packet loss rate refers to the ratio of the number of lost data packets in data communication to the total number of sent data packets.
- network device 321 can judge whether the forwarding efficiency of network device 321 is abnormal according to whether the packet loss rate of path 1 is greater than a threshold within 10 seconds. If the packet loss rate is greater than or equal to 1 ⁇ , then determine the forwarding efficiency of network device 321 An exception occurs.
- the network device 321 may also detect the forwarding efficiency of the network device 321 according to the data flow in the path 1, or the transmission delay of the path 1.
- the forwarding efficiency of the network device 321 is abnormal; if the data flow in the path 1 is smaller than the first threshold, then it is determined that the forwarding efficiency of the network device 321 is in a normal state .
- the second threshold is 10 milliseconds (milli second, ms), 15 ms, or other time.
- the above-mentioned threshold of packet loss rate, the first threshold corresponding to the data flow, and the second threshold corresponding to the transmission delay can be preset, or can be based on the processing capability of the network equipment and the network provided by the network system. If the resource size or other information is determined, it will not be limited.
- step S430 is executed.
- the network device 321 forwards the first packet to other devices.
- the other device may refer to the device indicated by the next routing address after the network device 321 in path 1 .
- the other device may be the destination device indicated by the destination identifier of the first packet, or may be another network device in path 1 that forwards the first packet.
- step S440 is executed.
- the network device 321 sends abnormality information to the network device 310.
- the network device 321 after determining that the forwarding efficiency of the network device 321 is abnormal, the network device 321 generates an abnormality information, and sends the abnormality information to the network device 310 .
- the network device 321 For the specific content of the abnormal information, reference may be made to the relevant description of S340 above, and details are not repeated here.
- the network device 310 determines that the path 1 is in an abnormal state according to the abnormality information sent by the network device 321.
- path 1 is in an abnormal state, which may include, but is not limited to: path 1 is marked as abnormal, or path 1 is deleted, or a parameter of path 1 exceeds a set threshold.
- an abnormal state which may include, but is not limited to: path 1 is marked as abnormal, or path 1 is deleted, or a parameter of path 1 exceeds a set threshold.
- path 1 is marked as abnormal means: path 1 is marked as abnormal.
- the path 1 is marked as unavailable.
- path 1 is marked as abnormal means: path 1 is deleted.
- the network device 310 moves the path 1 out of the equal-cost forwarding paths included in the ECMP group 1 .
- the port 1 provided by the network device 310 to the path 1 is disabled, or the next-hop route (or IP address) of the network device 321 in the path 1 is deleted or cancelled, and so on.
- the marking of path 1 as abnormal means that the parameter of path 1 exceeds a set threshold.
- each equivalent forwarding path included in ECMP group 1 corresponds to a path parameter value.
- the maximum value and minimum value of the path parameter value are determined. If the path parameter value corresponding to path 1 is set to If it does not belong to the path parameter value corresponding to ECMP group 1, it is determined that the parameter of path 1 exceeds the set threshold, and then it is determined that path 1 is marked as abnormal.
- the network device can determine the equivalent forwarding path in the abnormal state in the ECMP group according to the abnormal information fed back by the downstream device (such as the network device 321 ). Furthermore, the network device can switch the packets that need to be transmitted by the equal-cost forwarding path in the abnormal state to the normal equal-cost forwarding path (or an idle equal-cost forwarding path), which reduces the transmission of packets in the network system.
- the time delay improves the transmission efficiency of the network system.
- the network device 310 determines path 1, and forwards packets through path 2 when path 1 is in an abnormal state.
- FIG. 5 is the third schematic flow diagram of a path switching method provided in this application.
- the path switching method can be executed by the above-mentioned network device 310.
- the determination process of the equivalent forwarding path in the path switching method includes the following steps 1 to 5.
- step 1 the network device 310 selects a hash factor according to the configuration information of ECMP group 1, and extracts data in fields related to path selection in the message as input information for the path calculation process.
- the configuration information of the ECMP group 1 may include but not limited to: source IP address, destination IP address, source MAC address, virtual MAC address, virtual local area network (virtual local area network, VLAN), transport layer source port, transport layer destination port, One or more information in IP protocol, flow label and physical source port.
- Step 2 the network device 310 selects the corresponding algorithm, the scrambling item (salt value), and the effective bit selection according to the processing capability of the processor included in the network device 310 (the general calculation value selects the required bits, 8bit), and outputs the corresponding The hash calculation result.
- the algorithm is a cyclic redundancy check (cyclic redundancy check, CRC) algorithm, specifically, the CRC32 algorithm.
- Step 3 the network device 310 takes the modulus of the available path N to obtain the initial path modulo result according to the hash calculation result, selects the equivalent forwarding path (such as path 1) corresponding to the initial path modulo result in ECMP group 1, and forwards the message arts.
- N refers to the number of equal-cost forwarding paths included in the ECMP group 1.
- Step 4 when the path determined in step 3 is in an abnormal state, the network device 310 adds an offset factor to the path calculation result of the message to adjust the path modulo result of the message.
- the offset factor can also be called an offset value.
- step 5 the network device 310 determines the packet forwarding path (such as the aforementioned path 2) according to the adjusted path modulo result.
- FIG. 6 is a schematic diagram of the path adjustment process in the ECMP group provided by this application
- the destination device 330 can be implemented by the destination device 130 shown in Figure 1, or by any server shown in Figure 2 accomplish.
- Path 1 to path 3 shown in FIG. 6 are three equivalent forwarding paths for communication between network device 310 and destination device 330. If network device 310 determines that the path (such as path 1) of the message from source device 300 is abnormal state, the network device 310 adds an offset factor to the modulo result of the initial path of the message. For example, if the value corresponding to the offset factor is 2, the network device 310 switches the equivalent forwarding path of the message from path 1 to path 3.
- the network device 310 may also offset the first path (path 1 shown in FIG. 6 ) corresponding to the packet (such as the first packet in the foregoing embodiment) by a set value , to obtain a second path (path 2 shown in FIG. 6 ); furthermore, the network device 310 forwards the message through the second path.
- each path corresponds to a set path value
- the network device 310 offsets the set path value of path 1, so that the offset path value corresponds to the path value of path 2, and then, the network device 310
- the path 2 is searched according to the path value corresponding to the path 2, and the first packet is sent through the path 2.
- the path value of path 1 is "0001”
- the path value of path 2 is "0002”. If the first message needs to be switched from path 1 to path 2, the above offset factor (or offset value) can be "0001", the network device 310 obtains the path value of the path 2 according to the offset factor and the path value of the path 1, and then, the network device 310 forwards the first message through the path 2.
- the network device may add an offset factor to the path modulo result when the equivalent forwarding path corresponding to the path modulo result is in an abnormal state according to the path modulo result obtained by path calculation, so that Realize the value set by offsetting the equivalent forwarding path (such as the first path) corresponding to the path modulo result to obtain the second path.
- the network device can also use the offset path modulo result to forward the message corresponding to the second path, so as to realize the forwarding of the message and improve the forwarding efficiency of the network system.
- the network device in the process of path calculation, no matter whether the equal-cost forwarding path included in the ECMP group is abnormal, the network device does not need to renumber the equal-cost forwarding path.
- the network device When the path is in an abnormal state, the network device will offset the abnormal path by the set value, so as to determine that the path for forwarding the message is another normal path, and forward the message through the normal path, avoiding the time-lapse of message transmission. The problem of high delay is solved, and the data transmission efficiency of the network system is improved.
- Fig. 7 is the structural representation of a kind of IPv4 message that the present application provides, IPv4 message comprises message header (header) and For the data part, in combination with the IPv4 message shown in FIG. 7 , Table 1 below provides descriptions of some fields included in the message header of the IPv4 message.
- the service type field may also be referred to as a differentiated service field.
- the service type field can be used to store the priority information provided by the foregoing embodiments, such as the DSCP value.
- the identification field in the message header of the IPv4 message may also be referred to as the IP ID field of the IPv4 message.
- the IP ID field can be used to store the offset value provided by the foregoing embodiments. For example, since the length of the IP ID field is 8 bits, you can select the head 4 bits or tail 4 bits of the IP ID field, or any continuous 4 bits in the middle to set the offset value.
- the header 4bit of the IP ID field of the message is set to "0x02"
- the equivalent forwarding path corresponding to the path calculation result of the message is path 1 (in an abnormal state)
- the offset value is "0x02”
- the actual forwarding routing path of the packet will be shifted to path 3, which prevents the packet from being forwarded through an abnormal path and improves the efficiency of packet forwarding.
- option field is also called the extended option header of the packet header, and the extended option header can also be used to store the offset value provided by the foregoing embodiments.
- FIG. 8 is a fourth schematic flowchart of a path switching method provided in the present application.
- the path switching method provided in the embodiment of the present application further includes the following steps S810 and S820 .
- the source device 300 sends the second packet to the network device 310.
- the network device 310 receives the second packet.
- the second packet and the first packet in the foregoing embodiment both belong to the first flow, and the second packet includes an offset value.
- the destination identifiers of multiple packets belonging to the same data flow are the same, for example, the destination identifier of the first packet and the destination identifier of the second packet are the same.
- the offset value is included in the packet header of the second packet.
- the offset value can be set in the IP ID field or option field included in the packet header.
- the offset value may be set in a flow label (flow label) field or an option field included in a packet header of the IPv6 packet.
- the offset value can also be set in other positions of the packet header, which is not limited.
- the offset value included in the second packet is set by the source device 300 .
- the source device 300 obtains the abnormality information that the path 1 is in an abnormal state, and sends other packets of the first flow (such as the above-mentioned During the transmission of the second packet), offset values are added to other packets of the first stream.
- each path included in the ECMP group has its own path value (or serial number, serial number, path flag, etc.), such as the path value of path 1 is "0001", and the path value of path 2 is "0002 ", if the second message needs to be switched from path 1 to path 2, the above-mentioned offset value can be determined by the difference between the path value of path 2 and the path value of path 1, such as the offset value is " 0001".
- the offset value may also be determined by the difference between the path value of any other normal path (such as path 3 ) included in ECMP group 1 and the path value of path 1 .
- this example uses decimal as an example to illustrate the path value of the path, but in other optional situations, the path value and offset value of the path can also be in binary, octal, hexadecimal system or other bases are not limited.
- the offset value included in the second packet is set by the network device 310 .
- the network device 310 determines that path 1 for transmitting the first packet is in an abnormal state, the network device 310 sets offset values for packets of all data flows that path 1 needs to transmit.
- a data flow includes many packets, and different offset values can be added to multiple packets so that the multiple packets can be allocated to different equal-cost forwarding paths for transmission, reducing the cost of the data flow. Transmission delay, improve the overall transmission efficiency of data flow.
- the network device 310 forwards the second packet through path 2 according to the offset value in the second packet.
- the source device 300 (or the network device 310) adds an offset value indicating an equivalent forwarding path to other packets (such as the second packet) belonging to the first flow. For example, if the offset value between path 2 and path 1 is 1, and the offset value between path 3 and path 1 is 2, then if the second packet is about to be forwarded through path 2, the network device 310 will The offset value added to the message is 1; if the second message is about to be forwarded through path 3, the network device 310 adds an offset value of 2 to the second message. It should be understood that the above-mentioned specific value of the offset value is only an example provided by this embodiment, and the offset value between any two equivalent forwarding paths may also be 2, 3 or other values, etc., which is not limited.
- the first network device such as the above-mentioned network device 310 determines that one or more equivalent forwarding paths included in the ECMP group are in an abnormal state
- the packet forwarded by the path is switched to the normal equal-cost forwarding path in the ECMP group for forwarding, which improves the transmission efficiency of the data flow in the ECMP group.
- the equivalent forwarding path of message forwarding can be determined by setting the offset value, the accuracy of path adjustment is improved, and the accuracy of data flow is realized when multiple messages belong to the same data flow. regulation.
- the network device or the source device can set an offset value for a specific field, thereby adjusting the internal path selection in the ECMP group, and realizing precise adjustment of the routing path between the source device and the destination device.
- the network device can use the minimum cost (such as the aforementioned overhead value) ) solves the problem of path abnormality (such as congestion, packet loss or high delay) in the ECMP group, and improves the data transmission efficiency of the network system.
- the minimum cost such as the aforementioned overhead value
- the network device quickly adjusts the path in the ECMP group after obtaining the abnormal information
- the timeliness of path adjustment in the ECMP group is also improved on the basis of improving the data transmission efficiency of the network system.
- the network device includes hardware structures and/or software modules corresponding to each function.
- the present application can be implemented in the form of hardware or a combination of hardware and computer software with reference to the units and method steps of the examples described in the embodiments disclosed in the present application. Whether a certain function is executed by hardware or computer software drives the hardware depends on the specific application scenario and design constraints of the technical solution.
- FIG. 9 is a schematic structural diagram of a path switching device provided by the present application.
- the path switching device 900 can be used to implement the functions of the network device in the above method embodiment, so it can also implement the above method embodiment. have beneficial effects.
- the path switching device 900 may be a network device, such as any network device, the source device 110 or the destination device 130 shown in FIG. 1 above, or any switch shown in FIG. 2 Or the server, or the source device 300 shown in FIG. 3 or any network device, such as the network device 310 or the network device 321, etc., may also be a module (such as a chip) applied to the network device.
- the path switching apparatus 900 includes: a receiving unit 910 , an acquiring unit 920 , a determining unit 930 and a forwarding unit 940 .
- the path switching apparatus 900 is used to implement the functions of the network equipment in the method embodiments shown in the above figures.
- the path switching device 900 is used to implement the above path switching method, and the functions of components of the path switching device 900 will be described in detail below.
- the receiving unit 910 is configured to receive a first packet, where the first packet belongs to the first flow.
- the acquiring unit 920 is configured to acquire a corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes multiple equivalent forwarding paths corresponding to the aforementioned destination identifier.
- the determining unit 930 is configured to determine the first path corresponding to the first packet from the ECMP group, and determine whether the first path is in an abnormal state. Wherein, the determining unit 930 determines that the first path is in an abnormal state according to the abnormal information sent by the second network device.
- the forwarding unit 940 is configured to forward the first message through the second path in the ECMP group when the determining unit 930 determines that the first path is in an abnormal state.
- path switching device 900 When the path switching device 900 is used to realize the function of the network device 310 in the method embodiment shown in FIG. 940 is used to execute S340.
- the receiving unit 910 the acquiring unit 920 , the determining unit 930 and the forwarding unit 940 are used to coordinately execute steps 1 to 5 shown in FIG. 5 .
- the path switching apparatus 900 When the path switching apparatus 900 is used to implement the function of the network device 310 in the method embodiment shown in FIG. 8 , the receiving unit 910 is used to perform S810, and the forwarding unit 940 is used to perform S820.
- the path switching device 900 and its modules may also be software modules.
- the above-mentioned path switching method is realized by calling the software module by the processor.
- the processor can be a central processing unit (central processing unit, CPU), a specific application integrated circuit (application-specific integrated circuit, ASIC) implementation, or a programmable logic device (programmable logic device, PLD), and the above-mentioned PLD can be a complex program Logic device (complex programmable logical device, CPLD), field programmable gate array (field programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof.
- CPU central processing unit
- ASIC application-specific integrated circuit
- PLD programmable logic device
- PLD programmable logic device
- the above-mentioned PLD can be a complex program Logic device (complex programmable logical device, CPLD), field programmable gate array (field programmable gate array, FPGA), general array logic (generic array logic, G
- the hardware may be implemented by a processor or a chip.
- the chip includes an interface circuit and a control circuit.
- the interface circuit is used to receive data from devices other than the processor and transmit it to the control circuit, or send data from the control circuit to devices other than the processor.
- control circuit implements the method in any possible implementation manner in the foregoing embodiments through a logic circuit or by executing code instructions.
- code instructions for the beneficial effects, reference may be made to the description in any of the foregoing embodiments, and details are not repeated here.
- the path switching apparatus 900 may also be implemented by a network device, as shown in FIG. 10 , which is a schematic structural diagram of a network device provided in this application.
- the network device 1000 includes a communication interface 1010 and a processor 1020 .
- the communication interface 1010 may be a transceiver or an input/output (input/output, I/O) interface.
- the network device 1000 may further include a memory 1030 for storing instructions executed by the processor 1020 or storing input data required by the processor 1020 to execute the instructions, or storing data generated by the processor 1020 after executing the instructions.
- the network device 1000 may refer to the network device 310 in the foregoing embodiments.
- the processor 1020, the communication interface 1010 and the memory 1030 can also cooperate to implement various operations in the path switching method performed by each network device and source device in the network system step.
- the network device 1000 may also perform the functions of the path switching apparatus 900 shown in FIG. 9 , which will not be described in detail here.
- the specific connection manner among the communication interface 1010, the processor 1020, and the memory 1030 is not limited.
- the memory 1030 can be used to store software programs and modules, such as program instructions/modules corresponding to the path switching method provided in the embodiment of the present application, and the processor 1020 executes various functional applications by executing the software programs and modules stored in the memory 1030 and data processing.
- the communication interface 1010 can be used for signaling or data communication with other devices. In this application, the network device 1000 may have multiple communication interfaces 1010 .
- the communication interface 1010 can be used to provide the forwarding ports of multiple equal-cost forwarding paths included in the ECMP group 1, such as port 1 to port 3 shown in FIG. port 2 is the forwarding port provided by the network device 310 for path 2 in the foregoing embodiment, and port 3 is the forwarding port provided by the network device 310 for path 3 in the foregoing embodiment.
- the present application also provides another possible network device, as shown in FIG. 11 , which is a schematic structural diagram of another network device provided by the present application.
- the network device 1100 includes: a processor 1110, a processor 1120 and an I/O O interface 1130.
- the network device 1100 may refer to the network device 321 or the network device 322 in the foregoing embodiments, or other downstream devices of the network device 310 .
- the I/O interface 1130 can be used to receive messages from other devices.
- the network device 1100 may include one or more I/O interfaces 1130, which is not limited.
- An analysis engine may be provided in the processor 1120.
- the analysis engine refers to a virtual machine, container (container) or management node (management node) provided by the network device 1100 using virtualization technology, and is detected by the virtual machine, container or management node. The forwarding efficiency of the network device 1100.
- one of the processors 1120 is used to detect the forwarding efficiency of the network device 1100, which is beneficial to quickly obtain the abnormal information of the network device 1100, so that the processor 1110 takes the abnormal information Forward to the upstream device of network device 1100.
- the upstream device of the network device 1100 may be the network device 310.
- the network device 310 obtains the abnormal information fed back by the network device 1100, the network device 310 and Flows between network devices 1100 are switched from one equal-cost forwarding path to other equal-cost forwarding paths.
- processor 1120 in the embodiment of the present application may be a CPU, a neural processing unit (neural processing unit, NPU) or a graphics processing unit (graphic processing unit, GPU), and may also be other general-purpose processors, digital Signal processor (digital signal processor, DSP), ASIC, FPGA or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
- a general-purpose processor can be a microprocessor, or any conventional processor.
- the method steps in the embodiments of the present application may be implemented by means of hardware, or may be implemented by means of a processor executing software instructions.
- Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (random access memory, RAM), flash memory, read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM) , PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or known in the art any other form of storage medium.
- An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium.
- the storage medium may also be a component of the processor.
- the processor and storage medium can be located in the ASIC.
- the ASIC can be located in a network device or a terminal device.
- the processor and the storage medium may also exist in the network device or the terminal device as discrete components.
- “at least one” means one or more, and “multiple” means two or more.
- “And/or” describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
- the character “/” generally indicates that the contextual objects are an “or” relationship; in the formulas of this application, the character “/” indicates that the contextual objects are a "division” Relationship.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
A path switching method and apparatus, a network device, and a network system, which relate to the field of communications. The switching method comprises: during the process of a first network device forwarding a message, according to abnormal information sent by a second network device, the first network device can determine that a first path corresponding to the message is in an abnormal state, thereby avoiding the first network device being unable to sense the abnormal state (e.g. congestion or packet loss) of a downstream device. Moreover, an ECMP group determined by the first network device further comprises other equal-cost forwarding paths consistent with a destination identifier of the first path, such as a second path. Therefore, the first network device can also forward the foregoing message by means of the second path, thereby avoiding the message being unable to be forwarded to a device corresponding to the destination identifier, improving the accuracy of data communication, and reducing a transmission delay caused by the state of the path being the abnormal state, thus improving the transmission efficiency of the message.
Description
本申请要求于2021年12月21日提交国家知识产权局、申请号为202111572470.1、申请名称为“一种路径调整方法和相关装置”的中国专利申请的优先权,本申请还要求于2022年2月15日提交国家知识产权局、申请号为202210139157.7、申请名称为“路径切换方法、装置、网络设备、以及网络系统”的中国专利申请的优先权,这些申请的全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111572470.1 and the application name "A Path Adjustment Method and Related Device" submitted to the State Intellectual Property Office on December 21, 2021. The priority of the Chinese patent application with the application number 202210139157.7 and the application name "Path Switching Method, Device, Network Equipment, and Network System" filed with the State Intellectual Property Office on April 15, the entire contents of these applications are incorporated by reference in this application middle.
本申请涉及通信领域,尤其涉及一种路径切换方法、装置、网络设备、以及网络系统。The present application relates to the communication field, and in particular to a path switching method, device, network equipment, and network system.
等价路径负载分担(equal-cost multi-path,ECMP)路径是指到达同一个目标互联网协议(Internet Protocol,IP)地址或者目标网段存在多条价值相等、但中间节点不同的路径。当网络设备支持ECMP功能时,发往同一目标IP地址或者目标网段的数据流就可以通过不同的路径发送。通常,网络设备基于目标IP地址和预设的流量模型,对ECMP组包括的多条路径所传输的业务数据进行流量负载分担。然而,若该ECMP组包括的等价转发路径发生拥塞或丢包等问题时,网络设备无法感知该等价转发路径中的下游设备发生的异常状态,导致该等价转发路径的传输时延较高,也无法将报文的路由路径切换到ECMP组包括的其他等价转发路径,从而,业务数据在ECMP组中的传输时延增大,数据传输效率降低。因此,如何在ECMP组中的转发路径异常的情况下提供一种高效的路径切换方法成为目前亟需解决的问题。The equal-cost multi-path (ECMP) path refers to multiple paths with equal value but different intermediate nodes to the same target Internet Protocol (IP) address or target network segment. When the network device supports the ECMP function, data streams sent to the same target IP address or target network segment can be sent through different paths. Usually, based on the destination IP address and a preset traffic model, the network device performs traffic load sharing on the service data transmitted by the multiple paths included in the ECMP group. However, if the equal-cost forwarding path included in the ECMP group has problems such as congestion or packet loss, the network device cannot perceive the abnormal state of the downstream device in the equal-cost forwarding path, resulting in a longer transmission delay of the equal-cost forwarding path. High, and the routing path of the message cannot be switched to other equal-cost forwarding paths included in the ECMP group. As a result, the transmission delay of service data in the ECMP group increases and the data transmission efficiency decreases. Therefore, how to provide an efficient path switching method when the forwarding path in the ECMP group is abnormal has become an urgent problem to be solved at present.
发明内容Contents of the invention
本申请提供一种路径切换方法、装置、网络设备、以及网络系统,解决了当ECMP组中的等价转发路径发生异常时,业务数据在ECMP组中的传输时延增大,数据传输效率降低的问题。The present application provides a path switching method, device, network equipment, and network system, which solve the problem that when the equivalent forwarding path in the ECMP group is abnormal, the transmission delay of business data in the ECMP group increases and the data transmission efficiency decreases The problem.
本申请采用如下技术方案。This application adopts the following technical solutions.
第一方面,本申请的实施例提供一种路径切换方法,该方法可应用于包括第一网络设备和第二网络设备的网络系统,或者支持实现该路径切换方法的网络设备,例如该网络设备包括芯片或者芯片系统。示例的,该路径切换方法由第一网络设备执行,该路径切换方法包括:第一网络设备接收第一报文,并根据该第一报文的目的标识获取对应的ECMP组,该ECMP组包括对应目的标识的多条等价转发路径;进而,第一网络设备从前述ECMP组中确定第一报文对应的第一路径;当第一网络设备根据第二网络设备发送的异常信息确定第一路径处于异常状态时,第一网络设备通过ECMP组中的第二路径转发第一报文。In the first aspect, the embodiment of the present application provides a path switching method, which can be applied to a network system including a first network device and a second network device, or a network device that supports the path switching method, such as the network device Including chip or chip system. For example, the path switching method is performed by the first network device, and the path switching method includes: the first network device receives the first message, and obtains the corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes Multiple equivalent forwarding paths corresponding to the destination identifier; furthermore, the first network device determines the first path corresponding to the first message from the aforementioned ECMP group; when the first network device determines the first path according to the abnormal information sent by the second network device When the path is in an abnormal state, the first network device forwards the first message through the second path in the ECMP group.
在第一网络设备转发报文的过程中,由于第一网络设备可以根据第二网络设备发送的异常信息确定第一报文所对应的第一路径为异常状态,避免了第一网络设备无法感知下游设备(如第二网络设备)的异常状态(如拥塞或丢包),而且ECMP组还包括与第一路径的目的标识一致的其他等价转发路径,如第二路径,因此,第一网络设备还可以通过第二路径转发前述的第一报文,避免了第一报文无法被转发至目的标识对应的设备,提高了数 据通信的准确率,降低了路径的状态处于异常状态导致的传输时延,提高了第一报文的传输效率。In the process of the first network device forwarding the message, since the first network device can determine that the first path corresponding to the first message is in an abnormal state according to the abnormal information sent by the second network device, it is avoided that the first network device cannot perceive The abnormal state (such as congestion or packet loss) of the downstream device (such as the second network device), and the ECMP group also includes other equal-cost forwarding paths consistent with the destination identifier of the first path, such as the second path. Therefore, the first network The device can also forward the aforementioned first message through the second path, avoiding that the first message cannot be forwarded to the device corresponding to the destination identifier, improving the accuracy of data communication, and reducing the transmission caused by the abnormal state of the path The time delay improves the transmission efficiency of the first packet.
在一种可选的示例中,第二网络设备发送的异常信息指示通过第一路径接收的报文影响了第二网络设备的转发效率。第二网络设备的转发效率可以由以下任意一种或几种的组合来表示:第一路径的带宽、第一路径的传输时延、第一路径中数据报文的丢包率等。在第一网络设备确定ECMP组包括的一条或多条等价转发路径处于异常状态时,可将原来由异常等价转发路径转发的报文切换到ECMP组中的正常等价转发路径进行转发,解决了第一网络设备无法感知下游设备的异常状态的问题,提高了数据流在ECMP组中的传输效率。In an optional example, the abnormal information sent by the second network device indicates that the packet received through the first path affects the forwarding efficiency of the second network device. The forwarding efficiency of the second network device may be represented by any one or a combination of several of the following: bandwidth of the first path, transmission delay of the first path, packet loss rate of data packets in the first path, and the like. When the first network device determines that one or more equal-cost forwarding paths included in the ECMP group are in an abnormal state, it may switch the message originally forwarded by the abnormal equal-cost forwarding path to a normal equal-cost forwarding path in the ECMP group for forwarding, The problem that the first network device cannot perceive the abnormal state of the downstream device is solved, and the transmission efficiency of the data flow in the ECMP group is improved.
在另一种可选的示例中,第一路径处于异常状态,包括:第一路径被标记为异常,如该第一路径被标记为不可用的状态;或第一路径被删除,如第一网络设备将第一路径移出ECMP组包括的等价转发路径;或第一路径的参数超过设定的阈值,例如,ECMP组所包括的每条等价转发路径对应一个路径参数值,在一个ECMP组中,路径参数值的最大值和最小值是确定的,若第一路径对应的路径参数值被设置为不属于ECMP组所对应的路径参数值,则确定第一路径的参数超过设定的阈值,进而确定第一路径被标记为异常。在本实施例中,由于网络设备可根据下游设备反馈的异常信息,确定ECMP组中处于异常状态的等价转发路径,进而,网络设备可将该处于异常状态的等价转发路径所需传输的报文切换到正常的等价转发路径(或是空闲的等价转发路径),降低了报文在网络系统中的传输时延,提高了网络系统的传输效率。In another optional example, the first path is in an abnormal state, including: the first path is marked as abnormal, such as the first path being marked as unavailable; or the first path is deleted, such as the first The network device moves the first path out of the equal-cost forwarding path included in the ECMP group; or the parameters of the first path exceed the set threshold, for example, each equal-cost forwarding path included in the ECMP group corresponds to a path parameter value, in an ECMP In the group, the maximum value and the minimum value of the path parameter value are determined. If the path parameter value corresponding to the first path is set to the path parameter value corresponding to the ECMP group, it is determined that the parameter value of the first path exceeds the set value. threshold, and then determine that the first path is marked as abnormal. In this embodiment, because the network device can determine the equivalent forwarding path in the abnormal state in the ECMP group according to the abnormality information fed back by the downstream device, and furthermore, the network device can use the equivalent forwarding path in the abnormal state to transmit the The message is switched to the normal equal-cost forwarding path (or an idle equal-cost forwarding path), which reduces the transmission delay of the message in the network system and improves the transmission efficiency of the network system.
在又一种可选的示例中,第一路径被删除,包括:第一网络设备提供给第一路径的端口被置为无效,或者,第二网络设备在第一路径中的下一跳路由被删除。In yet another optional example, the deletion of the first path includes: invalidating the port provided by the first network device to the first path, or the next-hop route of the second network device in the first path been deleted.
在一种可选的实现方式中,第一网络设备通过ECMP组中的第二路径转发第一报文,包括:第一网络设备将第一路径偏移设定的值,以得到第二路径;进而,第一网络设备通过第二路径转发第一报文。网络设备可通过设定偏移值的方式来确定报文转发的等价转发路径,提高了路径调整的精准性,在多个报文属于同一数据流的情况下,实现了数据流的精准调控。示例的,网络设备或者源端设备可针对特定的字段设置偏移值,从而调整ECMP组中内部的路径选择,实现了源端设备到目的设备之间的路由路径的精准调整。In an optional implementation manner, the first network device forwards the first message through the second path in the ECMP group, including: the first network device offsets the first path by a set value to obtain the second path ; Furthermore, the first network device forwards the first message through the second path. Network devices can determine the equivalent forwarding path of message forwarding by setting the offset value, which improves the accuracy of path adjustment and realizes precise control of data flow when multiple messages belong to the same data flow . For example, the network device or the source device can set an offset value for a specific field, thereby adjusting the internal path selection in the ECMP group, and realizing precise adjustment of the routing path between the source device and the destination device.
在另一种可选的实现方式中,前述的路径切换方法还包括:第一网络设备接收第二报文,第二报文属于第一流,第二报文中包括偏移值;进而,第一网络设备根据第二报文中的偏移值,通过第二路径转发第二报文。由于第一网络设备是在获取到异常信息后迅速对ECMP组中的路径进行调整,因此,在提高网络系统的数据传输效率的基础上,提高了ECMP组中路径调整的及时性。In another optional implementation manner, the foregoing path switching method further includes: the first network device receives a second packet, the second packet belongs to the first flow, and the second packet includes an offset value; further, the first A network device forwards the second message through the second path according to the offset value in the second message. Since the first network device quickly adjusts the path in the ECMP group after obtaining the abnormal information, the timeliness of path adjustment in the ECMP group is improved on the basis of improving the data transmission efficiency of the network system.
在一种可能的情形中,前述的偏移值包括在第二报文的报文头中。In a possible situation, the aforementioned offset value is included in the packet header of the second packet.
在一种可行的示例中,若第一报文为第四代互联网协议(Internet Protocol version 4,IPv4)报文,IPv4报文包括的扩展选项头或互联网协议标识IP ID字段存储有偏移值。或者,In a feasible example, if the first packet is a fourth-generation Internet protocol (Internet Protocol version 4, IPv4) packet, the extended option header or the IP ID field included in the IPv4 packet is stored with an offset value . or,
在另一种可行的示例中,若第一报文为第六代互联网协议(Internet Protocol version 6,IPv6)报文,IPv6报文包括的扩展选项头或流标签(flow label)字段存储有偏移值。In another feasible example, if the first packet is a sixth-generation Internet Protocol (Internet Protocol version 6, IPv6) packet, the extended options header or flow label (flow label) field included in the IPv6 packet is biased. transfer value.
值得注意的是,当前述的第一报文和第二报文为基于其他协议的数据报文时,偏移值也可以设置在报文头的其他位置,不予限定。另外,偏移值可以是第一网络设备设置的, 或者,偏移值也可以是与第一网络设备通信的源端设备设置的,不予限定。It should be noted that when the aforementioned first packet and second packet are data packets based on other protocols, the offset value can also be set in other positions of the packet header, which is not limited. In addition, the offset value may be set by the first network device, or the offset value may also be set by the source device communicating with the first network device, which is not limited.
在另一种可选的实现方式中,第一报文包括优先级信息。第一网络设备根据第一报文的目的标识获取对应的等价路径负载分担ECMP组,包括:步骤1,第一网络设备根据第一报文的目的标识获取多个ECMP组,多个ECMP组对应不同的优先级。步骤2,第一网络设备根据优先级信息从多个ECMP组中确定第一报文对应的ECMP组。由于网络设备可为一个目的标识提供多个不同的ECMP组,且这多个不同的ECMP组具有不同的转发效率,在网络系统所需服务的用户量较大的情况下,网络设备可优先为有低时延、或大流量传输等的需求的用户提供转发效率更高的ECMP组,从而实现数据通信的低时延与大流量传输。另外,针对于一个用户而言,网络设备可以为该用户提供更优质(如时延更低、带宽更大)的ECMP组,有利于提高数据通信的QoE。In another optional implementation manner, the first packet includes priority information. The first network device obtains the corresponding equal-cost path load sharing ECMP group according to the destination identifier of the first message, including: step 1, the first network device obtains multiple ECMP groups according to the destination identifier of the first message, and the multiple ECMP groups corresponding to different priorities. Step 2: The first network device determines the ECMP group corresponding to the first message from multiple ECMP groups according to the priority information. Since a network device can provide multiple different ECMP groups for a destination identifier, and these different ECMP groups have different forwarding efficiencies, when the network system needs to serve a large number of users, the network device can give priority to Users with low-latency or large-traffic transmission needs provide ECMP groups with higher forwarding efficiency, so as to realize low-latency and large-traffic transmission of data communication. In addition, for a user, the network device can provide the user with a higher-quality (eg, lower delay and larger bandwidth) ECMP group, which is beneficial to improving the QoE of data communication.
在一种可能的情形中,优先级信息为差分服务代码点(differentiated services code point,DSCP)值。在本实施例中,网络设备可根据DSCP值的不同,为不同的业务类型提供时延和带宽存在差异的ECMP组,即网络设备可针对差异化的目标群体提供更优质的通信服务,从而避免不同类型的业务共用相同的ECMP组,导致网络系统的处理时延提高和数据传输效率较低等问题。例如,网络设备可以向高优先级业务提供更优质的通信服务,提高QoE。In a possible situation, the priority information is a differentiated services code point (differentiated services code point, DSCP) value. In this embodiment, the network device can provide ECMP groups with different delays and bandwidths for different service types according to different DSCP values, that is, the network device can provide better communication services for differentiated target groups, thereby avoiding Different types of services share the same ECMP group, resulting in problems such as increased processing delay and low data transmission efficiency of the network system. For example, network devices can provide higher-quality communication services for high-priority services and improve QoE.
第二方面,提供了一种路径切换装置,该路径切换装置应用于第一网络设备,该路径切换装置包括用于执行第一方面或第一方面任一种可能实现方式中的路径切换方法的各个模块。示例的,路径切换装置包括:接收单元、获取单元、确定单元和转发单元。A second aspect provides a path switching device, the path switching device is applied to a first network device, and the path switching device includes a path switching method for executing the first aspect or any possible implementation manner of the first aspect individual modules. Exemplarily, the path switching device includes: a receiving unit, an acquiring unit, a determining unit, and a forwarding unit.
接收单元用于接收第一报文,该第一报文属于第一流。获取单元用于根据第一报文的目的标识获取对应的ECMP组,该ECMP组包括对应前述目的标识的多条等价转发路径。确定单元用于从ECMP组中确定第一报文对应的第一路径,以及,确定第一路径是否处于异常状态。其中,确定单元根据第二网络设备发送的异常信息确定第一路径处于异常状态。转发单元用于当确定单元确定第一路径处于异常状态时,通过ECMP组中的第二路径转发第一报文。The receiving unit is used for receiving the first packet, and the first packet belongs to the first stream. The acquiring unit is configured to acquire a corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes multiple equivalent forwarding paths corresponding to the aforementioned destination identifier. The determining unit is configured to determine the first path corresponding to the first message from the ECMP group, and determine whether the first path is in an abnormal state. Wherein, the determining unit determines that the first path is in an abnormal state according to the abnormal information sent by the second network device. The forwarding unit is configured to forward the first message through the second path in the ECMP group when the determining unit determines that the first path is in an abnormal state.
有益效果可以参见第一方面中任一实现方式的描述,此处不再赘述。所述路径切换装置具有实现上述第一方面中任一实现方式的方法实例中行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。For the beneficial effects, reference may be made to the description of any implementation manner in the first aspect, and details are not repeated here. The path switching device has the function of implementing the behavior in the method example of any implementation manner in the first aspect above. The functions described above may be implemented by hardware, or may be implemented by executing corresponding software on the hardware. The hardware or software includes one or more modules corresponding to the above functions.
在一种可选的示例中,第二网络设备发送的异常信息指示通过第一路径接收的报文影响了第二网络设备的转发效率。In an optional example, the abnormal information sent by the second network device indicates that the packet received through the first path affects the forwarding efficiency of the second network device.
在另一种可选的示例中,第一路径处于异常状态,包括:第一路径被标记为异常,或第一路径被删除,或第一路径的参数超过设定的阈值。In another optional example, the abnormal state of the first path includes: the first path is marked as abnormal, or the first path is deleted, or a parameter of the first path exceeds a set threshold.
在又一种可选的示例中,第一路径被删除,包括:第一网络设备提供给第一路径的端口被置为无效,或者,第二网络设备在第一路径中的下一跳路由被删除。In yet another optional example, the deletion of the first path includes: invalidating the port provided by the first network device to the first path, or the next-hop route of the second network device in the first path been deleted.
在一种可选的实现方式中,转发单元具体用于:将第一路径偏移设定的值,以得到第二路径;以及,通过第二路径转发第一报文。In an optional implementation manner, the forwarding unit is specifically configured to: offset the first path by a set value to obtain the second path; and forward the first packet through the second path.
在一种可选的实现方式中,接收单元,还用于接收第二报文,该第二报文属于第一流,该第二报文中包括偏移值。此外,转发单元,还用于根据第二报文中的偏移值,通过第二 路径转发第二报文。In an optional implementation manner, the receiving unit is further configured to receive a second packet, the second packet belongs to the first stream, and the second packet includes an offset value. In addition, the forwarding unit is further configured to forward the second message through the second path according to the offset value in the second message.
在一种可能的情形中,偏移值包括在第二报文的报文头中。In a possible situation, the offset value is included in the packet header of the second packet.
在一种可行的示例中,若第一报文为IPv4报文,IPv4报文包括的扩展选项头或互联网协议标识IP ID字段存储有偏移值。In a feasible example, if the first packet is an IPv4 packet, the extended option header or the IP ID field included in the IPv4 packet stores an offset value.
在另一种可行的示例中,若第一报文为IPv6报文,IPv6报文包括的扩展选项头或流标签字段存储有偏移值。In another feasible example, if the first packet is an IPv6 packet, the extended options header or flow label field included in the IPv6 packet stores an offset value.
在另一种可选的实现方式中,第一报文包括优先级信息。获取单元,具体用于根据第一报文的目的标识获取多个ECMP组,多个ECMP组对应不同的优先级。确定单元,还用于根据优先级信息从多个ECMP组中确定第一报文对应的ECMP组。在一种可能的情形中,优先级信息为DSCP值。In another optional implementation manner, the first packet includes priority information. The obtaining unit is specifically configured to obtain multiple ECMP groups according to the destination identifier of the first message, and the multiple ECMP groups correspond to different priorities. The determining unit is further configured to determine the ECMP group corresponding to the first message from multiple ECMP groups according to the priority information. In one possible situation, the priority information is a DSCP value.
第三方面,提供了一种网络设备,包括存储器和处理器,其中:存储器用于存储程序代码;处理器用于调用程序代码实现第一方面中任一实现方式的方法的操作步骤。In a third aspect, a network device is provided, including a memory and a processor, wherein: the memory is used to store program codes; and the processor is used to call the program codes to implement the operation steps of the method in any implementation manner in the first aspect.
第四方面,提供了一种网络系统,包括:第一网络设备和第二网络设备。在该网络系统中,第一网络设备接收第一报文,第一报文属于第一流。其次,第一网络设备根据第一报文的目的标识获取对应的ECMP组,该ECMP组包括对应目的标识的多条等价转发路径。之后,第一网络设备从ECMP组中确定第一报文对应的第一路径。最后,当第一路径处于异常状态时,第一网络设备通过ECMP组中的第二路径,向第二网络设备转发第一报文。其中,第一网络设备根据第二网络设备发送的异常信息确定第一路径处于异常状态。In a fourth aspect, a network system is provided, including: a first network device and a second network device. In the network system, a first network device receives a first packet, and the first packet belongs to a first flow. Secondly, the first network device obtains the corresponding ECMP group according to the destination identifier of the first packet, and the ECMP group includes multiple equivalent forwarding paths corresponding to the destination identifier. Afterwards, the first network device determines the first path corresponding to the first packet from the ECMP group. Finally, when the first path is in an abnormal state, the first network device forwards the first message to the second network device through the second path in the ECMP group. Wherein, the first network device determines that the first path is in an abnormal state according to the abnormality information sent by the second network device.
在一种可选的实现方式中,网络系统还包括:源端设备。该源端设备向第一网络设备发送第二报文,该第二报文属于第一流,该第二报文中包括偏移值。进而,第一网络设备根据第二报文中的偏移值,通过第二路径向第二网络转发第二报文。在一种可能的情形中,偏移值包括在第二报文的报文头中。有益效果可以参见第一方面中任一实现方式的描述,此处不再赘述。In an optional implementation manner, the network system further includes: a source device. The source device sends a second packet to the first network device, the second packet belongs to the first flow, and the second packet includes an offset value. Furthermore, the first network device forwards the second packet to the second network through the second path according to the offset value in the second packet. In a possible situation, the offset value is included in the packet header of the second packet. For the beneficial effects, reference may be made to the description of any implementation manner in the first aspect, and details are not repeated here.
第五方面,提供了一种计算机可读存储介质,存储介质中存储有计算机程序或指令,当计算机程序或指令被处理器执行时,实现第一方面中任一实现方式的方法的操作步骤。In a fifth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the operation steps of the method in any implementation manner in the first aspect are implemented.
第六方面,本申请提供一种计算机程序产品,该计算程序产品包括指令,当计算机程序产品在处理器或计算设备上运行时,使得处理器或计算设备执行该指令,以实现第一方面和第一方面中任一种可能实现方式中的方法。In a sixth aspect, the present application provides a computer program product, the computing program product includes instructions, and when the computer program product is run on a processor or a computing device, the processor or computing device executes the instructions, so as to realize the first aspect and The method in any possible implementation manner in the first aspect.
第七方面,本申请提供一种芯片,包括:接口电路和控制电路。接口电路用于接收来自处理器之外的其它设备的数据并传输至控制电路,或将来自控制电路的数据发送给处理器之外的其它设备,控制电路通过逻辑电路或执行代码指令用于实现第一方面中任一实现方式的方法。有益效果可以参见第一方面中任一实现方式的描述,此处不再赘述。In a seventh aspect, the present application provides a chip, including: an interface circuit and a control circuit. The interface circuit is used to receive data from other devices other than the processor and transmit it to the control circuit, or send data from the control circuit to other devices other than the processor. The control circuit is used to implement the logic circuit or execute code instructions The method of any implementation manner in the first aspect. For the beneficial effects, reference may be made to the description of any implementation manner in the first aspect, and details are not repeated here.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided in the foregoing aspects, the present application may further be combined to provide more implementation manners.
图1为本申请提供的一种通信系统的架构示意图;FIG. 1 is a schematic structural diagram of a communication system provided by the present application;
图2为本申请提供的一种叶脊网络的架构示意图;FIG. 2 is a schematic diagram of the architecture of a leaf-spine network provided by the present application;
图3为本申请提供的一种路径切换方法的流程示意图一;FIG. 3 is a first schematic flow diagram of a path switching method provided by the present application;
图4为本申请提供的一种路径切换方法的流程示意图二;FIG. 4 is a second schematic flow diagram of a path switching method provided by the present application;
图5为本申请提供的一种路径切换方法的流程示意图三;FIG. 5 is a third schematic flow diagram of a path switching method provided by the present application;
图6为本申请提供的ECMP组中的路径调整过程示意图;FIG. 6 is a schematic diagram of the path adjustment process in the ECMP group provided by the present application;
图7为本申请提供的一种IPv4报文的结构示意图;FIG. 7 is a schematic structural diagram of an IPv4 message provided by the present application;
图8为本申请提供的一种路径切换方法的流程示意图四;FIG. 8 is a fourth schematic flowchart of a path switching method provided by the present application;
图9为本申请提供的一种路径切换装置的结构示意图;FIG. 9 is a schematic structural diagram of a path switching device provided by the present application;
图10为本申请提供的一种网络设备的结构示意图;FIG. 10 is a schematic structural diagram of a network device provided by the present application;
图11为本申请提供的另一种网络设备的结构示意图。FIG. 11 is a schematic structural diagram of another network device provided by the present application.
本申请的实施例提供了一种路径切换方法,该路径切换方法包括:第一网络设备接收第一报文,并根据该第一报文的目的标识获取对应的ECMP组,该ECMP组包括对应目的标识的多条等价转发路径;进而,第一网络设备从前述ECMP组中确定第一报文对应的第一路径;当第一网络设备根据第二网络设备发送的异常信息确定第一路径处于异常状态时,第一网络设备通过ECMP组中的第二路径转发第一报文。在第一网络设备转发报文的过程中,由于第一网络设备可以根据第二网络设备发送的异常信息确定第一报文所对应的第一路径为异常状态,避免了第一网络设备无法感知下游设备(如第二网络设备)的异常状态(如拥塞或丢包),而且ECMP组还包括与第一路径的目的标识一致的其他等价转发路径,如第二路径,因此,第一网络设备还可以通过第二路径转发前述的第一报文,避免了第一报文无法被转发至目的标识对应的设备,提高了数据通信的准确率,降低了路径的状态处于异常状态导致的传输时延,提高了第一报文的传输效率。An embodiment of the present application provides a path switching method, the path switching method includes: the first network device receives the first message, and obtains the corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes the corresponding Multiple equivalent forwarding paths identified by the destination; furthermore, the first network device determines the first path corresponding to the first message from the aforementioned ECMP group; when the first network device determines the first path according to the abnormal information sent by the second network device When in an abnormal state, the first network device forwards the first message through the second path in the ECMP group. In the process of the first network device forwarding the message, since the first network device can determine that the first path corresponding to the first message is in an abnormal state according to the abnormal information sent by the second network device, it is avoided that the first network device cannot perceive The abnormal state (such as congestion or packet loss) of the downstream device (such as the second network device), and the ECMP group also includes other equal-cost forwarding paths consistent with the destination identifier of the first path, such as the second path. Therefore, the first network The device can also forward the aforementioned first message through the second path, avoiding that the first message cannot be forwarded to the device corresponding to the destination identifier, improving the accuracy of data communication, and reducing the transmission caused by the abnormal state of the path The time delay improves the transmission efficiency of the first packet.
为了下述各实施例的描述清楚简洁,首先给出相关技术的简要介绍。In order to make the description of the following embodiments clear and concise, a brief introduction of related technologies is given first.
图1为本申请提供的一种通信系统的架构示意图。如图1所示,该通信系统包括源端设备110和目的设备130,以及用于向源端设备110和目的设备130提供通信服务的网络系统120。该网络系统120可以是指因特网、蜂窝网络、数据中心网络,或其他网络等。例如,该网络系统120是互联网服务提供商(Internet service provider,ISP)网络。ISP是指向广大用户提供互联网接入业务、信息业务和增值业务的运营商。FIG. 1 is a schematic structural diagram of a communication system provided by the present application. As shown in FIG. 1 , the communication system includes a source device 110 and a destination device 130 , and a network system 120 for providing communication services to the source device 110 and the destination device 130 . The network system 120 may refer to the Internet, a cellular network, a data center network, or other networks. For example, the network system 120 is an Internet service provider (Internet service provider, ISP) network. An ISP is an operator that provides Internet access services, information services, and value-added services to a large number of users.
该网络系统120可以包括至少一个网络设备,如图1中所示的网络设备121至网络设备126。示例的,该网络设备可以是路由器或交换机等路由传输设备,如网络设备121是无线接入点(access point,AP),如无线路由器,网络设备122可以是与无线路由器连接的交换机。在一些可能的其他情形中,该网络系统120包括的网络设备也可以是具有数据传输功能的其他网络设备,例如服务器或者具有数据传输功能的基站设备等。The network system 120 may include at least one network device, such as network device 121 to network device 126 shown in FIG. 1 . Exemplarily, the network device may be a routing transmission device such as a router or a switch. For example, the network device 121 is a wireless access point (access point, AP), such as a wireless router, and the network device 122 may be a switch connected to the wireless router. In some possible other situations, the network device included in the network system 120 may also be other network devices with a data transmission function, such as a server or a base station device with a data transmission function.
源端设备110是指发送数据的设备,如该源端设备110为存储有数据的应用服务器或存储设备等,该源端设备110可以利用网络系统120向其他设备(如图1所示出的目的设备130)发送数据。源端设备110存储的数据可以包括,但不限于:音频、视频、文本或其他类型的数据。当源端设备110发送的数据为视频、音频或者其他多媒体文件时,源端设备110可以利用流式传输的方式来传输这些数据,如媒体流(media stream),目的设备130播放前并不下载媒体流的整个流媒体文件,以减少目的设备130播放该媒体流所对应的流媒体的时延,提高用户体验质量(quality of experience,QoE)。The source device 110 refers to a device that sends data. For example, the source device 110 is an application server or a storage device that stores data. The source device 110 can use the network system 120 to send data to other devices (such as the The destination device 130) sends the data. The data stored by the source device 110 may include, but is not limited to: audio, video, text, or other types of data. When the data sent by the source device 110 is video, audio or other multimedia files, the source device 110 can transmit these data in a streaming manner, such as a media stream, and the destination device 130 does not download the file before playing. The entire streaming media file of the media stream, so as to reduce the delay of the destination device 130 playing the streaming media corresponding to the media stream, and improve the user experience quality (quality of experience, QoE).
请继续参见图1,上述的目的设备130可以是指请求数据的设备,如该目的设备130是指终端,终端可以是手机、平板电脑、带无线收发功能的电脑、个人通信业务(personal communication service,PCS)电话、台式计算机、个人数字助手(personal digital assistant,PDA)、可穿戴设备、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self-driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等等。Please continue to refer to FIG. 1, the above-mentioned destination device 130 may refer to a device requesting data, such as the destination device 130 refers to a terminal, and the terminal may be a mobile phone, a tablet computer, a computer with a wireless transceiver function, a personal communication service (personal communication service) , PCS) phones, desktop computers, personal digital assistants (personal digital assistant, PDA), wearable devices, virtual reality (virtual reality, VR) terminal equipment, augmented reality (augmented reality, AR) terminal equipment, industrial control (industrial control) ), wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grid, and transportation safety Wireless terminals, wireless terminals in smart cities, wireless terminals in smart homes, etc.
值得注意的是,上述的源端设备110和目的设备130仅为本实施例提供的示例,不应理解为对本申请的限定,本申请对通信系统中源端设备110、目的设备130的具体形态和数量不做限定。It should be noted that the above-mentioned source device 110 and destination device 130 are only examples provided by this embodiment, and should not be construed as a limitation to this application. And the quantity is not limited.
在数据传输过程中,若源端设备110发送的多个报文的目的IP地址相同,为提高网络系统120的传输效率,一般采用路由负载分担技术来转发该多个报文。路由负载分担是指在网络节点(或网络设备)之间,去往同一个目的地存在多条路由转发路径,流量被分担到多条路由转发路径上进行转发。示例的,在网络设备的转发信息库(forwarding information base,FIB)中,如果存在多条目的地址和掩码相同,但下一跳路由(如IP地址)、出接口、或隧道标识(tunnel ID)的属性不同的表项所对应的路由路径,网络设备可基于该多条路由路径实现流量在网络系统中的路由负载分担。During the data transmission process, if the destination IP addresses of multiple packets sent by the source device 110 are the same, in order to improve the transmission efficiency of the network system 120, the routing load sharing technology is generally used to forward the multiple packets. Routing load balancing means that between network nodes (or network devices), there are multiple routing forwarding paths to the same destination, and traffic is shared to multiple routing forwarding paths for forwarding. For example, in the forwarding information base (forwarding information base, FIB) of the network device, if there are multiple entries with the same address and mask, but the next-hop route (such as IP address), outgoing interface, or tunnel ID (tunnel ID ) attributes corresponding to the routing paths of the table entries, and the network device can implement routing load sharing of traffic in the network system based on the multiple routing paths.
在一些可选的情况中,FIB也可称为转发路由表或转发表,FIB存储于路由器(或其他网络设备)的数据平面,FIB的表项被称为转发表项,每条转发表项都指定要到达的某个目的地,所需要通过的出接口及下一跳IP地址等信息。在硬件实现上,FIB中数据(如前述的转发表项)可以被存储在一个专用集成电路(application-specific integrated circuit,ASIC)中,这使得网络设备(如路由器)在FIB中进行数据查询时,可以实现相当高的速度。当然,FIB所能使用的存储空间是有限的,因此,大型网络系统中要关注网络设备的路由表规模,在保证数据可达的前提下,通过各种机制及手段来减小FIB的规模。In some optional cases, the FIB can also be called a forwarding routing table or a forwarding table. The FIB is stored in the data plane of a router (or other network device), and the entries of the FIB are called forwarding table entries. Each forwarding table entry Both specify a certain destination to be reached, the outbound interface to be passed and the next-hop IP address and other information. In terms of hardware implementation, the data in the FIB (such as the aforementioned forwarding table entries) can be stored in an application-specific integrated circuit (ASIC), which allows network devices (such as routers) to perform data queries in the FIB , a fairly high speed can be achieved. Of course, the storage space that can be used by FIB is limited. Therefore, in large-scale network systems, attention should be paid to the size of the routing table of network equipment. On the premise of ensuring data accessibility, various mechanisms and means should be used to reduce the size of FIB.
如图1所示,网络系统120为目的IP地址相同的数据提供了多条不同的路由路径,如图1所示出的源端设备110-网络设备121-网络设备122-网络设备126-目的设备130,源端设备110-网络设备121-网络设备123-网络设备126-目的设备130,源端设备110-网络设备121-网络设备124-网络设备125-网络设备126-目的设备130,或者是其他可能的路由路径等。在这多条路由路径中,开销(cost)相等、但中间节点不同的至少两条路由路径可以称为互相的等价转发路径。其中,开销是指到达某个路由所指的目的地址的代价。由于多条等价换发路径的目的地址相同,且这多条等价换发路径的开销相同、转发路由不同,因此,该多条等价换发路径可以实现网络系统120中的路由负载分担。另外,前述多条等价转发路径也可以称为到达一个目的地址的ECMP组。As shown in Figure 1, the network system 120 provides multiple different routing paths for data with the same destination IP address, as shown in Figure 1, the source device 110-network device 121-network device 122-network device 126-destination Device 130, source device 110-network device 121-network device 123-network device 126-destination device 130, source device 110-network device 121-network device 124-network device 125-network device 126-destination device 130, or are other possible routing paths etc. Among the multiple routing paths, at least two routing paths with the same cost (cost) but different intermediate nodes may be referred to as mutual equal-cost forwarding paths. Wherein, cost refers to the cost of reaching the destination address indicated by a certain route. Since the destination addresses of multiple equal-cost switching paths are the same, and the costs of these multiple equal-cost switching paths are the same, and the forwarding routes are different, the multiple equal-cost switching paths can realize routing load sharing in the network system 120 . In addition, the foregoing multiple equal-cost forwarding paths may also be referred to as an ECMP group reaching one destination address.
下面以图1所示出的网络系统120是叶脊网络(spine-leaf network)为例,对网络系统进行说明,图2为本申请提供的一种叶脊网络的架构示意图,该叶脊网络200包括多个交换机,如脊交换机211至脊交换机214,以及叶交换机221至叶交换机223。Below, the network system 120 shown in Figure 1 is a spine-leaf network (spine-leaf network) as an example, and the network system is described. 200 includes a plurality of switches, such as spine switch 211 to spine switch 214 , and leaf switch 221 to leaf switch 223 .
叶交换机(leaf switch)可以实现接入交换机的功能,用于连接与叶脊网络200通信的物理服务器,如图2所示出的服务器231至服务器233。例如,叶交换机221与服务器231连接,以将服务器231接入叶脊网络200。A leaf switch (leaf switch) can implement the function of an access switch, and is used to connect physical servers communicating with the leaf-spine network 200, such as servers 231 to 233 shown in FIG. 2 . For example, the leaf switch 221 is connected to the server 231 to connect the server 231 to the leaf-spine network 200 .
脊交换机(spine switch)可以实现核心路由器(core router,CR)的功能,用于转发 来自叶交换机的数据。示例的,两个叶交换机所连接的服务器需要通信,需要经由脊交换机转发数据。如图2所示,服务器231和服务器232在通信时,数据需经过叶交换机221、叶交换机222,以及同时与叶交换机221、叶交换机222通信的脊交换机(如脊交换机212)的转发。A spine switch can implement the function of a core router (CR) for forwarding data from leaf switches. For example, the servers connected to the two leaf switches need to communicate and need to forward data through the spine switch. As shown in FIG. 2, when server 231 and server 232 communicate, data needs to be forwarded through leaf switch 221, leaf switch 222, and a spine switch (such as spine switch 212) communicating with leaf switch 221 and leaf switch 222 at the same time.
在叶脊网络200中,数据的通信可以由叶交换机和脊交换机之间基于ECMP选择等价转发路径来实现。如图2所示,叶交换机221至脊交换机211、脊交换机212、脊交换机213的3条路由路径(图2中以虚线表示),互为叶交换机221至目标IP地址指示的设备(如服务器232)的等价转发路径。In the leaf-spine network 200, data communication can be realized by selecting an equivalent forwarding path based on ECMP between the leaf switch and the spine switch. As shown in Figure 2, the three routing paths (indicated by dotted lines in Figure 2) from the leaf switch 221 to the spine switch 211, the spine switch 212, and the spine switch 213 are each other from the leaf switch 221 to the device indicated by the target IP address (such as a server) 232) equivalent forwarding path.
值得注意的是,在叶脊网络中,脊交换机的下行端口数量决定了叶交换机的数量,而叶交换机的上行端口数量决定了脊交换机的数量,叶脊网络的规模由脊交换机的下行端口数量和叶交换机的上行端口数量共同决定。关于叶脊网络的更多内容可以参考通常技术的相关阐述,在此不予赘述。It is worth noting that in a leaf-spine network, the number of downlink ports of the spine switches determines the number of leaf switches, and the number of uplink ports of the leaf switches determines the number of spine switches. The scale of the leaf-spine network is determined by the number of downlink ports of the spine switches. It is determined jointly with the number of uplink ports of the leaf switch. For more information about the leaf-spine network, reference may be made to related descriptions of common technologies, and details are not repeated here.
可以理解的是,规模化、虚拟化、云计算已成为网络的发展方向,来整合信息技术(information technology,IT)资源、提升资源利用效率、降低维护成本。因此,图2所示出的服务器中可以部署有虚拟机(virtual machine,VM),VM是指通过虚拟化技术将物理的计算资源、存储资源和网络资源进行虚拟获得的虚拟设备,亦称为逻辑计算机。运行虚拟机的物理设备称为宿主机,如服务器231是VM1和VM2的宿主机,服务器232是VM3和VM4的宿主机,服务器234是VM5和VM6的宿主机。It is understandable that scale, virtualization, and cloud computing have become the development direction of the network to integrate information technology (information technology, IT) resources, improve resource utilization efficiency, and reduce maintenance costs. Therefore, a virtual machine (virtual machine, VM) can be deployed in the server shown in FIG. logical computer. A physical device running a virtual machine is called a host machine. For example, the server 231 is the host machine of VM1 and VM2, the server 232 is the host machine of VM3 and VM4, and the server 234 is the host machine of VM5 and VM6.
在一种可能的示例中,VM所需的计算资源来源于服务器本地的处理器和内存,而VM所需的存储资源既可以来源于服务器本地的硬盘。例如,虚拟机231A(上述的VM2)包括虚拟处理器231A1、虚拟内存231A2和虚拟网卡231A3,虚拟处理器231A1所需的计算资源由处理器提供、虚拟内存231A2所需的存储资源由内存(或硬盘)提供,虚拟网卡231A3所需的网络资源由服务器包括的网卡提供。此外,VM中可运行各种应用程序,用户可通过VM中的应用程序触发数据访问(包括读数据、写数据,以及迁移数据等)、流媒体传输与播放等业务。In a possible example, the computing resource required by the VM comes from a local processor and memory of the server, and the storage resource required by the VM may come from a local hard disk of the server. For example, the virtual machine 231A (the aforementioned VM2) includes a virtual processor 231A1, a virtual memory 231A2, and a virtual network card 231A3, the computing resources required by the virtual processor 231A1 are provided by the processor, and the storage resources required by the virtual memory 231A2 are provided by the memory (or hard disk), and the network resources required by the virtual network card 231A3 are provided by the network card included in the server. In addition, various applications can run in the VM, and users can trigger services such as data access (including reading data, writing data, and migrating data, etc.), streaming media transmission and playback through the applications in the VM.
请继续参见图2,在叶脊网络200为任意两个服务器提供通信服务的过程中,叶脊网络200可以提供多条价值相等、中间路由不同的等价转发路径来转发数据。另外,该叶脊网络200中还可以包括其它路由设备,在图2中未画出。本申请的实施例对该叶脊网络200中包括的叶交换机和脊交换机的数量不做限定。Please continue to refer to FIG. 2 , when the leaf-spine network 200 provides communication services for any two servers, the leaf-spine network 200 can provide multiple equal-cost forwarding paths with equal value and different intermediate routes to forward data. In addition, the leaf-spine network 200 may also include other routing devices, which are not shown in FIG. 2 . The embodiment of the present application does not limit the number of leaf switches and spine switches included in the leaf-spine network 200 .
下面将结合附图对本实施例提供的路径切换方法的具体实现方式进行详细描述。The specific implementation manner of the path switching method provided in this embodiment will be described in detail below with reference to the accompanying drawings.
图3为本申请提供的一种路径切换方法的流程示意图一,该路径切换方法可以应用于图1所示出的通信系统,示例的,图3所示出的路径切换方法可以由图2所示出的叶脊网络200包括的任一个交换机来实现。这里以源端设备300由图2中服务器231实现,网络设备310由图2中的叶交换机221实现,网络设备321至网络设备325由图2中的脊交换机实现为例进行说明,在本申请的实施例中,网络设备310也可以称为第一网络设备,网络设备321也可以称为第二网络设备。FIG. 3 is a schematic flow diagram of a path switching method provided by the present application. The path switching method can be applied to the communication system shown in FIG. 1 . For example, the path switching method shown in FIG. 3 can be represented by FIG. 2 Any one of the switches included in the illustrated leaf-spine network 200 can be implemented. Here, the source device 300 is realized by the server 231 in FIG. 2 , the network device 310 is realized by the leaf switch 221 in FIG. 2 , and the network devices 321 to 325 are realized by the spine switch in FIG. 2 as an example. In this embodiment, the network device 310 may also be called a first network device, and the network device 321 may also be called a second network device.
如图3所示,本实施例提供的路径切换方法包括步骤S310至S340。As shown in FIG. 3 , the path switching method provided in this embodiment includes steps S310 to S340.
S310,源端设备300向网络设备310发送第一报文。S310. The source device 300 sends the first packet to the network device 310.
对应的,网络设备310接收该第一报文。Correspondingly, the network device 310 receives the first packet.
其中,第一报文属于第一流。第一流是指源端设备300依据业务请求发送的数据流,示例的,若业务请求为视频播放请求,则该数据流是指视频流,第一报文是指视频流中的一个图像帧数据。另外,业务请求也可以是音频播放请求、文本资料迁移请求或者其他请求等,不予限定。Wherein, the first packet belongs to the first stream. The first stream refers to the data stream sent by the source device 300 according to the service request. For example, if the service request is a video playback request, the data stream refers to the video stream, and the first message refers to an image frame data in the video stream. . In addition, the service request may also be an audio playback request, a text data migration request, or other requests, which are not limited.
在一些情形中,同属于第一流的多个报文的目的标识相同。如第一流还包括第二报文,该第二报文的目的标识和第一报文的目的标识一致。示例的,目的标识是指第一报文包括的目的IP地址或目的MAC地址,或者第一报文所要发送到的目标网段等。In some cases, the destination identifiers of multiple packets belonging to the first flow are the same. If the first stream further includes a second packet, the destination identifier of the second packet is consistent with the destination identifier of the first packet. Exemplarily, the destination identifier refers to the destination IP address or destination MAC address included in the first packet, or the target network segment to which the first packet is to be sent, and the like.
S320,网络设备310根据第一报文的目的标识获取对应的ECMP组。S320, the network device 310 acquires a corresponding ECMP group according to the destination identifier of the first packet.
ECMP组包括对应目的标识的多条等价转发路径。如图3所示,第一报文的目的标识所对应的ECMP组为ECMP组1,该ECMP组1提供了到达目的标识的多条等价转发路径,如图3所示出的路径1至路径3。值得注意的是,路径1至路径3可以是指ECMP组包括的不同的等价转发路径,其在图3中的示例不应理解为对本申请的限定。在本申请的实施例中,路径1也可以称为第一路径,路径2也可以称为第二路径。The ECMP group includes multiple equal-cost forwarding paths corresponding to the destination identifier. As shown in Figure 3, the ECMP group corresponding to the destination identifier of the first message is ECMP group 1, and this ECMP group 1 provides multiple equal-cost forwarding paths to the destination identifier, as shown in Figure 3. Path 1 to Path 3. It should be noted that path 1 to path 3 may refer to different equivalent forwarding paths included in the ECMP group, and their examples in FIG. 3 should not be construed as limiting the present application. In the embodiment of the present application, path 1 may also be called a first path, and path 2 may also be called a second path.
可选的,网络设备310可以为第一报文的目的标识提供多个ECMP组,如图3所示出的ECMP组1和ECMP组2。Optionally, the network device 310 may provide multiple ECMP groups for the destination identifier of the first packet, such as ECMP group 1 and ECMP group 2 shown in FIG. 3 .
在一种可能的情形中,ECMP组1和ECMP组2的转发效率不同。ECMP组的转发效率可以由以下任意一种或几种的组合来表示:ECMP组包括的等价转发路径的带宽、等价转发路径的传输时延、等价转发路径中数据的丢包率等。In a possible situation, the forwarding efficiencies of ECMP group 1 and ECMP group 2 are different. The forwarding efficiency of an ECMP group can be represented by any one or a combination of several of the following: the bandwidth of the equal-cost forwarding path included in the ECMP group, the transmission delay of the equal-cost forwarding path, the packet loss rate of data in the equal-cost forwarding path, etc. .
示例的,ECMP组1包括的等价转发路径的带宽和ECMP组2包括的等价转发路径的带宽不同,如ECMP组1包括的等价转发路径(如路径2)的带宽大于ECMP组2包括的等价转发路径(如路径4)的带宽。在一些情形中,ECMP组1可以称为高优先级ECMP组、ECMP组2可以称为普通ECMP组或者默认ECMP组。值得注意的是,图3仅为本实施例提供的示例,不应理解为对本申请的限定。For example, the bandwidth of the equivalent forwarding path included in ECMP group 1 is different from the bandwidth of the equivalent forwarding path included in ECMP group 2. For example, the bandwidth of the equivalent forwarding path (such as path 2) included in ECMP group 1 is greater than that The bandwidth of the equal-cost forwarding path (such as path 4). In some cases, ECMP group 1 may be called a high-priority ECMP group, and ECMP group 2 may be called a normal ECMP group or a default ECMP group. It should be noted that FIG. 3 is only an example provided by this embodiment, and should not be construed as a limitation to this application.
由于网络设备可为一个目的标识提供多个不同的ECMP组,且这多个不同的ECMP组具有不同的转发效率,在网络系统所需服务的用户量较大的情况下,网络设备可优先为有低时延、或大流量传输等的需求的用户提供转发效率更高的ECMP组,从而实现数据通信的低时延与大流量传输。另外,针对于一个用户而言,网络设备可以为该用户提供更优质(如时延更低、带宽更大)的ECMP组,有利于提高数据通信的QoE。Since a network device can provide multiple different ECMP groups for a destination identifier, and these different ECMP groups have different forwarding efficiencies, when the network system needs to serve a large number of users, the network device can give priority to Users with low-latency or large-traffic transmission needs provide ECMP groups with higher forwarding efficiency, so as to realize low-latency and large-traffic transmission of data communication. In addition, for a user, the network device can provide the user with a higher-quality (eg, lower delay and larger bandwidth) ECMP group, which is beneficial to improving the QoE of data communication.
可选的,上述的第一报文包括优先级信息。该优先级信息用于指示第一报文所对应的业务的类型。在一些可行的实现方式中,业务的类型不同,传输该业务的报文所需的ECMP组也不同。Optionally, the above-mentioned first packet includes priority information. The priority information is used to indicate the type of the service corresponding to the first packet. In some feasible implementation manners, different types of services require different ECMP groups for transmitting packets of the services.
在一种可能的示例中,第一报文包括的优先级信息为DSCP值。举例来说,若第一报文是基于第四版互联网协议(internet protocol version 4,IPv4)的数据报文(IPv4报文),则DSCP值可以设置在IP报文头的服务类型(type of service)标识字段。例如,DSCP利用服务类型标识字段中已使用的6位(bit)和未使用的2bit确定编码值,并通过该编码值来区分业务的优先级。In a possible example, the priority information included in the first packet is a DSCP value. For example, if the first message is a data message (IPv4 message) based on the fourth version of the Internet protocol (internet protocol version 4, IPv4), then the DSCP value can be set in the service type (type of service) identification field. For example, the DSCP uses the used 6 bits and the unused 2 bits in the service type identification field to determine a coding value, and uses the coding value to distinguish service priorities.
在一种可行的具体示例中,DSCP使用6个bit,DSCP值的取值范围为0至63。值得注意的是,每一个DSCP编码值都被映射到一个已定义的逐跳行为(per hop behavior,PHB)标识码,该PHB标识码指示了业务的类型。In a feasible specific example, the DSCP uses 6 bits, and the range of DSCP values is 0 to 63. It is worth noting that each DSCP code value is mapped to a defined hop-by-hop behavior (per hop behavior, PHB) identification code, and the PHB identification code indicates the type of service.
前述的第一报文包括的DSCP值可以是由源端设备300确定的。在第一报文的通信过程中,源端设备300通过在第一报文中键入DSCP值,通信过程中的中间设备(如电话、Windows客户和服务器等终端设备)也可对包含第一报文的数据流(如前述的第一流)进行标识,从而对该数据流进行流量负载分担。The DSCP value included in the foregoing first packet may be determined by the source device 300 . During the communication process of the first message, the source device 300 enters the DSCP value in the first message, and the intermediate devices (such as terminal devices such as telephones and Windows clients and servers) in the communication process can also input the DSCP value contained in the first message. The data flow of the text (such as the aforementioned first flow) is identified, so as to perform traffic load sharing on the data flow.
在本实施例中,网络设备可根据优先级信息的不同,为不同的业务类型提供时延和带宽存在差异的ECMP组,即网络设备可针对差异化的目标群体提供更优质的通信服务,从而避免不同类型的业务共用相同的ECMP组,导致网络系统的处理时延提高和数据传输效率较低等问题。例如,网络设备可以向高优先级业务提供更优质的通信服务,提高QoE。In this embodiment, the network device can provide ECMP groups with different delays and bandwidths for different service types according to different priority information, that is, the network device can provide better communication services for differentiated target groups, thereby Avoid different types of services sharing the same ECMP group, resulting in problems such as increased network system processing delay and low data transmission efficiency. For example, network devices can provide higher-quality communication services for high-priority services and improve QoE.
下面以第一报文包括优先级信息为例,对网络设备310根据第一报文的目的标识获取对应的ECMP组进行说明。Taking the priority information included in the first packet as an example below, the acquisition of the corresponding ECMP group by the network device 310 according to the destination identifier of the first packet will be described.
第一,网络设备310可以根据第一报文的目的标识获取多个ECMP组。其中,多个ECMP组对应不同的优先级。例如,图3所示出的ECMP组1的优先级高于ECMP组2的优先级。First, the network device 310 may acquire multiple ECMP groups according to the destination identifier of the first packet. Wherein, multiple ECMP groups correspond to different priorities. For example, the priority of ECMP group 1 shown in FIG. 3 is higher than the priority of ECMP group 2 .
第二,网络设备310根据第一报文的优先级信息从多个ECMP组中确定第一报文对应的ECMP组1。Second, the network device 310 determines the ECMP group 1 corresponding to the first packet from multiple ECMP groups according to the priority information of the first packet.
在一种可能的示例中,网络设备310可以依据第一报文的优先级信息确定第一报文所对应的业务类型,并查询访问控制列表(access control list,ACL)中该业务类型所对应的一个或多个转发端口,进而,网络设备310将该一个或多个转发端口所对应的路径作为前述的等价转发路径,并将这一个或多个转发端口对应的等价转发路径作为ECMP组1。In a possible example, the network device 310 may determine the service type corresponding to the first message according to the priority information of the first message, and query the service type corresponding to the service type in an access control list (access control list, ACL). One or more forwarding ports, and then, the network device 310 uses the path corresponding to the one or more forwarding ports as the aforementioned equal-cost forwarding path, and uses the equivalent forwarding path corresponding to the one or more forwarding ports as the ECMP Group 1.
在一种可能的具体情形中,若该优先级信息为DSCP值,在携带DSCP值的报文到达网络设备310后,网络设备310基于DSCP值查询ACL确定转发第一报文的出接口,如一个DSCP值对应一个或多个出接口,该出接口是指网络设备310提供给DSCP值所对应的业务的转发端口。进而,网络设备310通过DSCP值对应的出接口确定前述的等价转发路径,并将所有的出接口对应的等价转发路径作为前述的EMCP组1。In a possible specific situation, if the priority information is a DSCP value, after the message carrying the DSCP value arrives at the network device 310, the network device 310 queries the ACL based on the DSCP value to determine the outbound interface for forwarding the first message, such as One DSCP value corresponds to one or more outgoing interfaces, and the outgoing interface refers to a forwarding port provided by the network device 310 to the service corresponding to the DSCP value. Furthermore, the network device 310 determines the aforementioned equal-cost forwarding paths through the outgoing interfaces corresponding to the DSCP values, and uses the equal-cost forwarding paths corresponding to all the outgoing interfaces as the aforementioned EMCP group 1 .
值得注意的是,图3仅示出了网络设备310为第一报文的目的标识提供的2个ECMP组,但是在网络设备310所属的网络系统的网络规模足够大的情况下,针对于第一报文的目的标识,网络设备310还可以提供更多的ECMP组,本申请对此不予限定。反之,在网络设备310所属的网络系统的网络规模较小的情况下,针对于第一报文的目的标识,网络设备310也可以仅提供图3所示出的ECMP组1或ECMP组2。It should be noted that FIG. 3 only shows the two ECMP groups provided by the network device 310 for the destination identifier of the first packet, but when the network scale of the network system to which the network device 310 belongs is large enough, for the second The network device 310 may also provide more ECMP groups according to the destination identifier of the message, which is not limited in this application. Conversely, when the network scale of the network system to which the network device 310 belongs is small, the network device 310 may only provide ECMP group 1 or ECMP group 2 shown in FIG. 3 for the destination identifier of the first packet.
请继续参见图3,本申请的实施例提供的路径切换方法还包括步骤S330和S340。Please continue to refer to FIG. 3 , the path switching method provided by the embodiment of the present application further includes steps S330 and S340.
S330,网络设备310从ECMP组1中确定第一报文对应的第一路径。S330. The network device 310 determines the first path corresponding to the first packet from the ECMP group 1.
如图3所示,ECMP组1包括3条等价转发路径,该第一路径可以是指图3所示出的路径1。As shown in FIG. 3 , ECMP group 1 includes three equal-cost forwarding paths, and the first path may refer to path 1 shown in FIG. 3 .
在第一种可能的示例中,网络设备310确定第一报文的初始路径的方式可以是:网络设备310从ECMP组1中随机选择一条等价转发路径作为第一报文的第一路径。In a first possible example, the manner in which the network device 310 determines the initial path of the first packet may be: the network device 310 randomly selects an equal-cost forwarding path from ECMP group 1 as the first path of the first packet.
在第二种可能的示例中,网络设备310确定第一报文的初始路径的方式可以是:网络设备310对ECMP组1中多条等价转发路径进行编号后排序,依据多条等价转发路径的排列顺序、以及数据流中报文的先后顺序,匹配第一报文对应的第一路径。In the second possible example, the way the network device 310 determines the initial path of the first packet may be: the network device 310 sorts the multiple equal-cost forwarding paths in ECMP group 1 after numbering, and according to the multiple equal-cost forwarding paths The sequence of paths and the sequence of packets in the data stream match the first path corresponding to the first packet.
在第三种可能的示例中,网络设备310确定第一报文的初始路径的方式可以是:网络 设备310从ECMP组1中随机选择一条等价转发路径作为第一报文的第一路径。In a third possible example, the manner in which the network device 310 determines the initial path of the first packet may be: the network device 310 randomly selects an equal-cost forwarding path from ECMP group 1 as the first path of the first packet.
在第四种可能的示例中,网络设备310确定第一报文的初始路径的方式可以是:网络设备310解析第一报文的报文头中的信息,并确定该第一报文在ECMP组1中的等价转发路径。关于第四种可能的示例的具体实现方式可以参考下述图5的描述,在此不予赘述。In a fourth possible example, the manner in which the network device 310 determines the initial path of the first packet may be: the network device 310 parses the information in the packet header of the first packet, and determines that the first packet is in the ECMP Equivalent forwarding paths in group 1. For a specific implementation manner of the fourth possible example, reference may be made to the description of FIG. 5 below, and details are not repeated here.
S340,当路径1处于异常状态时,网络设备310通过ECMP组1包括的路径2转发第一报文。S340. When the path 1 is in an abnormal state, the network device 310 forwards the first packet through the path 2 included in the ECMP group 1.
其中,网络设备310根据网络设备321发送的异常信息确定路径1处于异常状态。Wherein, the network device 310 determines that the path 1 is in an abnormal state according to the abnormality information sent by the network device 321 .
示例的,网络设备321发送的异常信息指示:通过路径1接收的报文影响了网络设备321的转发效率。网络设备321的转发效率可以由以下任意一种或几种的组合来表示:路径1的带宽、路径1的传输时延、路径1中数据报文的丢包率等。For example, the abnormal information sent by the network device 321 indicates that: the packet received through path 1 affects the forwarding efficiency of the network device 321 . The forwarding efficiency of the network device 321 may be represented by any one or a combination of several of the following: bandwidth of path 1, transmission delay of path 1, packet loss rate of data packets in path 1, and the like.
本申请的实施例所提供的路径切换方法,在第一网络设备(如上述的网络设备310)转发报文的过程中,由于第一网络设备可以根据第二网络设备(如上述的网络设备321)发送的异常信息确定第一报文所对应的第一路径为异常状态,因此,避免了第一网络设备无法感知下游设备的异常状态(如拥塞或丢包)等问题。而且,第一网络设备还可以通过ECMP组中与第一路径的目的标识一致的其他等价转发路径,如第二路径,转发前述的第一报文,避免了第一报文无法被转发至目的标识对应的设备,提高了数据通信的准确率,降低了路径的状态处于异常状态导致的传输时延,提高了第一报文的传输效率。In the path switching method provided by the embodiments of the present application, during the process of forwarding packets by the first network device (such as the above-mentioned network device 310), since the first network device can ) to determine that the first path corresponding to the first message is in an abnormal state, thus avoiding the problem that the first network device cannot perceive the abnormal state (such as congestion or packet loss) of the downstream device. Moreover, the first network device can also forward the aforementioned first message through other equivalent forwarding paths in the ECMP group that are consistent with the destination identifier of the first path, such as the second path, so as to avoid that the first message cannot be forwarded to The device corresponding to the destination identifier improves the accuracy of data communication, reduces the transmission delay caused by the abnormal state of the path, and improves the transmission efficiency of the first message.
下面在图3给出的网络设备310和网络设备321的基础上,本申请的实施例提供一种网络设备确定等价转发路径为异常状态的可能实现方式,如图4所示,图4为本申请提供的一种路径切换方法的流程示意图二,端口1至端口3是ECMP组1提供的针对于第一报文的目的标识的等价转发路径的端口,例如,网络设备310通过端口1与网络设备321建立有用于传输第一报文的路径1。On the basis of the network device 310 and the network device 321 shown in FIG. 3, the embodiment of the present application provides a possible implementation method for the network device to determine that the equivalent forwarding path is in an abnormal state, as shown in FIG. 4, which is Flowchart 2 of a path switching method provided in this application, port 1 to port 3 are the ports of the equivalent forwarding path provided by ECMP group 1 for the destination identifier of the first message, for example, network device 310 through port 1 A path 1 for transmitting the first packet is established with the network device 321 .
值得注意的是,图4仅示出了ECMP组1所包括的路径1,但网络设备310还可以与其他网络设备建立有与路径1的目的标识一致的其他等价转发路径。如网络设备310通过端口2与前述的网络设备322建立有用于传输报文的路径2;又如网络设备310通过端口3与前述的网络设备323建立有用于传输报文的路径3。It should be noted that FIG. 4 only shows path 1 included in ECMP group 1, but network device 310 may also establish other equivalent forwarding paths consistent with the destination identifier of path 1 with other network devices. For example, the network device 310 establishes a path 2 for transmitting packets with the aforementioned network device 322 through port 2;
网络设备321中可以部署有用于检测网络设备321的转发效率的分析引擎,该分析引擎可以是指网络设备321包括的处理器,也可以是指网络设备321利用虚拟化技术提供的虚拟机、容器(container)或管理节点(manage node),并由虚拟机、容器或管理节点检测网络设备321的转发效率。An analysis engine for detecting the forwarding efficiency of the network device 321 may be deployed in the network device 321. The analysis engine may refer to a processor included in the network device 321, or may refer to a virtual machine or a container provided by the network device 321 using virtualization technology. (container) or management node (manage node), and the forwarding efficiency of the network device 321 is detected by the virtual machine, container or management node.
如图4所示,本申请的实施例提供的路径切换方法包括步骤S410至S450。As shown in FIG. 4, the path switching method provided by the embodiment of the present application includes steps S410 to S450.
S410,网络设备310向网络设备321发送第一报文。S410, the network device 310 sends the first packet to the network device 321.
S420,网络设备321判断网络设备321的转发效率是否异常。S420, the network device 321 determines whether the forwarding efficiency of the network device 321 is abnormal.
例如,网络设备321判断网络设备321中与端口1连接的端口是否有效,若与端口1连接的端口有效,则指示该网络设备321的转发效率正常;若与端口1连接的端口无效,则指示该网络设备321的转发效率发生异常。For example, the network device 321 judges whether the port connected to the port 1 in the network device 321 is valid, and if the port connected to the port 1 is valid, it indicates that the forwarding efficiency of the network device 321 is normal; if the port connected to the port 1 is invalid, it indicates The forwarding efficiency of the network device 321 is abnormal.
又如,网络设备321判断网络设备321中待处理的消息队列是否拥塞。其中,消息队列包括一组队列对(queue pair,QP),QP包括发送队列(send queue,SQ)和接收队列(receive queue,RQ),如网络设备中用于发送数据的消息队列是发送队列,网络设备中用于接收数 据的消息队列是接收队列。关于消息队列更多的内容可以参考通常技术的相关描述,在此不予赘述。In another example, the network device 321 determines whether the message queue to be processed in the network device 321 is congested. Among them, the message queue includes a group of queue pairs (queue pair, QP), and QP includes a sending queue (send queue, SQ) and a receiving queue (receive queue, RQ). For example, the message queue used to send data in a network device is a sending Queue, the message queue used to receive data in the network device is the receive queue. For more information about the message queue, reference may be made to related descriptions of common technologies, which will not be repeated here.
还如,网络设备321判断在历史统计周期内的丢包率。丢包率是指数据通信中丢失数据报文的数量占总发送数据报文的数量的比例。如网络设备321可以依据路径1在10秒内的丢包率是否大于阈值,来判断网络设备321的转发效率是否发生异常,如丢包率大于或等于1‰,则确定网络设备321的转发效率发生异常。For another example, the network device 321 judges the packet loss rate in the historical statistics period. The packet loss rate refers to the ratio of the number of lost data packets in data communication to the total number of sent data packets. For example, network device 321 can judge whether the forwarding efficiency of network device 321 is abnormal according to whether the packet loss rate of path 1 is greater than a threshold within 10 seconds. If the packet loss rate is greater than or equal to 1‰, then determine the forwarding efficiency of network device 321 An exception occurs.
另外,网络设备321还可以根据路径1中的数据流,或者,路径1的传输时延来检测网络设备321的转发效率。In addition, the network device 321 may also detect the forwarding efficiency of the network device 321 according to the data flow in the path 1, or the transmission delay of the path 1.
例如,若路径1中的数据流大于或等于第一阈值,则确定网络设备321的转发效率发生异常;若路径1中的数据流小于第一阈值,则确定网络设备321的转发效率处于正常状态。For example, if the data flow in the path 1 is greater than or equal to the first threshold, it is determined that the forwarding efficiency of the network device 321 is abnormal; if the data flow in the path 1 is smaller than the first threshold, then it is determined that the forwarding efficiency of the network device 321 is in a normal state .
又如,若路径1的传输时延大于或等于第二阈值,则确定网络设备321的转发效率发生异常;若路径1的传输时延小于第二阈值,则确定网络设备321的转发效率处于正常状态。如该第二阈值为10毫秒(milli second,ms)、15ms或其他时间等。As another example, if the transmission delay of path 1 is greater than or equal to the second threshold, it is determined that the forwarding efficiency of the network device 321 is abnormal; if the transmission delay of path 1 is less than the second threshold, it is determined that the forwarding efficiency of the network device 321 is normal state. For example, the second threshold is 10 milliseconds (milli second, ms), 15 ms, or other time.
值的注意的是,上述丢包率的阈值、数据流对应的第一阈值、传输时延对应的第二阈值可以是预设的,也可以是根据网络设备的处理能力、网络系统提供的网络资源大小或者其他信息确定的,不予限定。It should be noted that the above-mentioned threshold of packet loss rate, the first threshold corresponding to the data flow, and the second threshold corresponding to the transmission delay can be preset, or can be based on the processing capability of the network equipment and the network provided by the network system. If the resource size or other information is determined, it will not be limited.
若网络设备321的转发效率未发生异常,则执行步骤S430。If the forwarding efficiency of the network device 321 is not abnormal, step S430 is executed.
S430,网络设备321向其他设备转发第一报文。S430. The network device 321 forwards the first packet to other devices.
该其他设备可以是指路径1中,在网络设备321之后的下一条路由地址所指示的设备。该其他设备可以是第一报文的目的标识指示的目的设备,也可以是路径1中转发该第一报文的其他网络设备。The other device may refer to the device indicated by the next routing address after the network device 321 in path 1 . The other device may be the destination device indicated by the destination identifier of the first packet, or may be another network device in path 1 that forwards the first packet.
若网络设备321的转发效率发生异常,则执行步骤S440。If the forwarding efficiency of the network device 321 is abnormal, step S440 is executed.
S440,网络设备321向网络设备310发送异常信息。S440, the network device 321 sends abnormality information to the network device 310.
示例性的,网络设备321在确定网络设备321的转发效率发生异常后,生成一个异常信息,并将该异常信息发送至网络设备310。关于异常信息的具体内容可以参考上述S340的相关描述,在此不予赘述。Exemplarily, after determining that the forwarding efficiency of the network device 321 is abnormal, the network device 321 generates an abnormality information, and sends the abnormality information to the network device 310 . For the specific content of the abnormal information, reference may be made to the relevant description of S340 above, and details are not repeated here.
S450,网络设备310根据网络设备321发送的异常信息确定路径1处于异常状态。S450, the network device 310 determines that the path 1 is in an abnormal state according to the abnormality information sent by the network device 321.
可选的,路径1处于异常状态,可以包括,但不限于:路径1被标记为异常,或路径1被删除,或路径1的参数超过设定的阈值等。下面对前述的异常状态进行示例性的说明。Optionally, path 1 is in an abnormal state, which may include, but is not limited to: path 1 is marked as abnormal, or path 1 is deleted, or a parameter of path 1 exceeds a set threshold. The foregoing abnormal state will be described as an example below.
在第一种可能的情形中,路径1被标记为异常是指:路径1被标记为异常。如该路径1被标记为不可用的状态。In the first possible situation, path 1 is marked as abnormal means: path 1 is marked as abnormal. For example, the path 1 is marked as unavailable.
在第二种可能的情形中,路径1被标记为异常是指:路径1被删除。示例的,网络设备310将路径1移出ECMP组1包括的等价转发路径。如网络设备310提供给路径1的端口1被置为无效,或者,网络设备321在路径1中的下一跳路由(或者IP地址)被删除或取消等等。In the second possible situation, path 1 is marked as abnormal means: path 1 is deleted. Exemplarily, the network device 310 moves the path 1 out of the equal-cost forwarding paths included in the ECMP group 1 . For example, the port 1 provided by the network device 310 to the path 1 is disabled, or the next-hop route (or IP address) of the network device 321 in the path 1 is deleted or cancelled, and so on.
在第三种可能的情形中,路径1被标记为异常是指:路径1的参数超过设定的阈值。例如,ECMP组1所包括的每条等价转发路径对应一个路径参数值,在一个ECMP组中,路径参数值的最大值和最小值是确定的,若路径1对应的路径参数值被设置为不属于 ECMP组1所对应的路径参数值,则确定路径1的参数超过设定的阈值,进而确定路径1被标记为异常。In the third possible situation, the marking of path 1 as abnormal means that the parameter of path 1 exceeds a set threshold. For example, each equivalent forwarding path included in ECMP group 1 corresponds to a path parameter value. In an ECMP group, the maximum value and minimum value of the path parameter value are determined. If the path parameter value corresponding to path 1 is set to If it does not belong to the path parameter value corresponding to ECMP group 1, it is determined that the parameter of path 1 exceeds the set threshold, and then it is determined that path 1 is marked as abnormal.
在本实施例中,由于网络设备可根据下游设备(如网络设备321)反馈的异常信息,确定ECMP组中处于异常状态的等价转发路径。进而,网络设备可将该处于异常状态的等价转发路径所需传输的报文切换到正常的等价转发路径(或是空闲的等价转发路径),降低了报文在网络系统中的传输时延,提高了网络系统的传输效率。In this embodiment, because the network device can determine the equivalent forwarding path in the abnormal state in the ECMP group according to the abnormal information fed back by the downstream device (such as the network device 321 ). Furthermore, the network device can switch the packets that need to be transmitted by the equal-cost forwarding path in the abnormal state to the normal equal-cost forwarding path (or an idle equal-cost forwarding path), which reduces the transmission of packets in the network system. The time delay improves the transmission efficiency of the network system.
值得注意的是,以上三种可能的情形仅为本实施例提供的示例,不应理解为对本申请的限定。It should be noted that the above three possible situations are only examples provided by this embodiment, and should not be construed as limiting the present application.
上述实施例所提供的路径切换方法中,网络设备310确定路径1,以及在路径1处于异常状态时通过路径2转发报文,这里提供了一种可能的实现方式,如图5所示,图5为本申请提供的一种路径切换方法的流程示意图三,该路径切换方法可以由上述的网络设备310执行,该路径切换方法中等价转发路径的确定过程包括以下步骤1至步骤5。In the path switching method provided in the above embodiments, the network device 310 determines path 1, and forwards packets through path 2 when path 1 is in an abnormal state. Here, a possible implementation is provided, as shown in FIG. 5 . 5 is the third schematic flow diagram of a path switching method provided in this application. The path switching method can be executed by the above-mentioned network device 310. The determination process of the equivalent forwarding path in the path switching method includes the following steps 1 to 5.
步骤1,网络设备310根据ECMP组1的配置信息选择的哈希(hash)因子,并提取报文中的与路径选择相关的字段中的数据作为路径计算过程的输入信息。In step 1, the network device 310 selects a hash factor according to the configuration information of ECMP group 1, and extracts data in fields related to path selection in the message as input information for the path calculation process.
该ECMP组1的配置信息可以包括但不限于:源IP地址、目的IP地址、源MAC地址、虚拟MAC地址、虚拟局域网(virtual local area network,VLAN)、传输层源端口、传输层目的端口、IP协议、流标签和物理源端口中一种或几种信息。The configuration information of the ECMP group 1 may include but not limited to: source IP address, destination IP address, source MAC address, virtual MAC address, virtual local area network (virtual local area network, VLAN), transport layer source port, transport layer destination port, One or more information in IP protocol, flow label and physical source port.
步骤2,网络设备310根据网络设备310包括的处理器的处理能力,选择相应算法、加扰项(盐值)、有效位选择(通用的计算值选出需要的若干位,8bit),输出对应的hash计算结果。例如,该算法为循环冗余码校验(cyclic redundancy check,CRC)算法,具体的,如CRC32算法。Step 2, the network device 310 selects the corresponding algorithm, the scrambling item (salt value), and the effective bit selection according to the processing capability of the processor included in the network device 310 (the general calculation value selects the required bits, 8bit), and outputs the corresponding The hash calculation result. For example, the algorithm is a cyclic redundancy check (cyclic redundancy check, CRC) algorithm, specifically, the CRC32 algorithm.
步骤3,网络设备310根据hash计算结果,对可用路径N取模得到初始路径取模结果,选择ECMP组1中与该初始路径取模结果对应的等价转发路径(如路径1),转发报文。其中,N是指ECMP组1包括的等价转发路径的数量。Step 3, the network device 310 takes the modulus of the available path N to obtain the initial path modulo result according to the hash calculation result, selects the equivalent forwarding path (such as path 1) corresponding to the initial path modulo result in ECMP group 1, and forwards the message arts. Wherein, N refers to the number of equal-cost forwarding paths included in the ECMP group 1.
步骤4,在步骤3中确定的路径处于异常状态时,网络设备310在报文的路径计算结果中添加偏移因子,以调整报文的路径取模结果。该偏移因子也可以称为偏移值。 Step 4, when the path determined in step 3 is in an abnormal state, the network device 310 adds an offset factor to the path calculation result of the message to adjust the path modulo result of the message. The offset factor can also be called an offset value.
步骤5,网络设备310根据调整后的路径取模结果,确定报文的转发路径(如前述的路径2)。In step 5, the network device 310 determines the packet forwarding path (such as the aforementioned path 2) according to the adjusted path modulo result.
如图6所示,图6为本申请提供的ECMP组中的路径调整过程示意图,该目的设备330可以由图1所示出的目的设备130实现,或者由图2所示出的任意一个服务器实现。图6所示出的路径1至路径3是网络设备310与目的设备330通信的3条等价转发路径,若网络设备310确定来自源端设备300的报文的路径(如路径1)处于异常状态时,网络设备310在报文的初始路径取模结果中添加偏移因子,如偏移因子对应的值为2,网络设备310将报文的等价转发路径从路径1切换为路径3。As shown in Figure 6, Figure 6 is a schematic diagram of the path adjustment process in the ECMP group provided by this application, the destination device 330 can be implemented by the destination device 130 shown in Figure 1, or by any server shown in Figure 2 accomplish. Path 1 to path 3 shown in FIG. 6 are three equivalent forwarding paths for communication between network device 310 and destination device 330. If network device 310 determines that the path (such as path 1) of the message from source device 300 is abnormal state, the network device 310 adds an offset factor to the modulo result of the initial path of the message. For example, if the value corresponding to the offset factor is 2, the network device 310 switches the equivalent forwarding path of the message from path 1 to path 3.
在一种可能的情形中,网络设备310也可以对报文(如前述实施例中的第一报文)对应的第一路径(如图6所示出的路径1)偏移设定的值,获得第二路径(如图6所示出的路径2);进而,网络设备310通过第二路径转发报文。In a possible situation, the network device 310 may also offset the first path (path 1 shown in FIG. 6 ) corresponding to the packet (such as the first packet in the foregoing embodiment) by a set value , to obtain a second path (path 2 shown in FIG. 6 ); furthermore, the network device 310 forwards the message through the second path.
示例的,每个路径对应一个设定的路径值,网络设备310对路径1设定的路径值进行偏移,使得偏移后的路径值为路径2所对应的路径值,进而,网络设备310依据该路径2 所对应的路径值查找路径2,并通过路径2发送第一报文。如路径1的路径值为“0001”,路径2的路径值为“0002”,若第一报文需由路径1切换到路径2,则上述的偏移因子(或称偏移值)可以是“0001”,则网络设备310依据偏移因子和路径1的路径值获得路径2的路径值,进而,网络设备310通过路径2转发第一报文。For example, each path corresponds to a set path value, and the network device 310 offsets the set path value of path 1, so that the offset path value corresponds to the path value of path 2, and then, the network device 310 The path 2 is searched according to the path value corresponding to the path 2, and the first packet is sent through the path 2. For example, the path value of path 1 is "0001", and the path value of path 2 is "0002". If the first message needs to be switched from path 1 to path 2, the above offset factor (or offset value) can be "0001", the network device 310 obtains the path value of the path 2 according to the offset factor and the path value of the path 1, and then, the network device 310 forwards the first message through the path 2.
在本实施例中,网络设备可以根据路径计算获得的路径取模结果,在该路径取模结果对应的等价转发路径处于异常状态时,网络设备对该路径取模结果添加偏移因子,从而实现对路径取模结果对应的等价转发路径(如第一路径)偏移设定的值,得到第二路径。另外,网络设备还可以利用偏移后的路径取模结果对应第二路径转发报文,从而实现报文的转发,提高了网络系统的转发效率。In this embodiment, the network device may add an offset factor to the path modulo result when the equivalent forwarding path corresponding to the path modulo result is in an abnormal state according to the path modulo result obtained by path calculation, so that Realize the value set by offsetting the equivalent forwarding path (such as the first path) corresponding to the path modulo result to obtain the second path. In addition, the network device can also use the offset path modulo result to forward the message corresponding to the second path, so as to realize the forwarding of the message and improve the forwarding efficiency of the network system.
本申请的实施例提供的路径切换方法,由于在路径计算的过程中,无论ECMP组包括的等价转发路径是否出现异常,网络设备无需对等价转发路径重新编号,仅需在路径计算确定的路径处于异常状态时,网络设备将该异常的路径偏移设定的值,从而确定转发报文的路径为另一正常的路径,并通过正常的路径转发报文,避免了报文的传输时延较高的问题,提高了网络系统的数据传输效率。In the path switching method provided by the embodiments of the present application, in the process of path calculation, no matter whether the equal-cost forwarding path included in the ECMP group is abnormal, the network device does not need to renumber the equal-cost forwarding path. When the path is in an abnormal state, the network device will offset the abnormal path by the set value, so as to determine that the path for forwarding the message is another normal path, and forward the message through the normal path, avoiding the time-lapse of message transmission. The problem of high delay is solved, and the data transmission efficiency of the network system is improved.
下面针对于上述的报文,提供了一种可行的实现方式,如图7所示,图7为本申请提供的一种IPv4报文的结构示意图,IPv4报文包括报文头(首部)和数据部分,结合图7所示出的IPv4报文,以下表1给出了IPv4报文的报文头所包括的部分字段的说明。For above-mentioned message below, a kind of feasible implementation mode is provided, as shown in Figure 7, Fig. 7 is the structural representation of a kind of IPv4 message that the present application provides, IPv4 message comprises message header (header) and For the data part, in combination with the IPv4 message shown in FIG. 7 , Table 1 below provides descriptions of some fields included in the message header of the IPv4 message.
表1Table 1
其中,服务类型字段也可以称为区分服务字段。服务类型字段可用于存储前述实施例提供的优先级信息,如DSCP值。Wherein, the service type field may also be referred to as a differentiated service field. The service type field can be used to store the priority information provided by the foregoing embodiments, such as the DSCP value.
IPv4报文的报文头中的标识字段也可以称为该IPv4报文的IP ID字段。IP ID字段可用于存储前述实施例提供的偏移值。示例的,由于IP ID字段的长度为8bit,可选择该IP ID字段的头部4bit或者尾部4bit,或者中间任意连续的4bit来设置偏移值。例如,报文的IP ID字段的头部4bit被设置为“0x02”,则在该报文的路径计算结果对应的等价转发路径为路径1(处于异常状态)时,由于该偏移值为“0x02”,该报文的实际转发路由路径会被偏移到路径3,避免了报文被通过异常的路径转发,提高了报文转发的效率。The identification field in the message header of the IPv4 message may also be referred to as the IP ID field of the IPv4 message. The IP ID field can be used to store the offset value provided by the foregoing embodiments. For example, since the length of the IP ID field is 8 bits, you can select the head 4 bits or tail 4 bits of the IP ID field, or any continuous 4 bits in the middle to set the offset value. For example, if the header 4bit of the IP ID field of the message is set to "0x02", then when the equivalent forwarding path corresponding to the path calculation result of the message is path 1 (in an abnormal state), since the offset value is "0x02", the actual forwarding routing path of the packet will be shifted to path 3, which prevents the packet from being forwarded through an abnormal path and improves the efficiency of packet forwarding.
另外,选项字段也称为报文头的扩展选项头,扩展选项头也可用于存储前述实施例提供的偏移值。In addition, the option field is also called the extended option header of the packet header, and the extended option header can also be used to store the offset value provided by the foregoing embodiments.
在数据通信过程中,若网络系统所需传输的数据量较大,属于同一数据流的报文可从异常路径调整到ECMP组包括的正常路径中,实现了ECMP组中路径调整的及时性。另外,由于网络设备可通过设定偏移值的方式来确定报文转发的等价转发路径,提高了路径调整的精准性,在多个报文属于同一数据流的情况下,实现了数据流的精准调控。In the process of data communication, if the network system needs to transmit a large amount of data, messages belonging to the same data flow can be adjusted from the abnormal path to the normal path included in the ECMP group, realizing the timeliness of path adjustment in the ECMP group. In addition, because the network device can determine the equivalent forwarding path of message forwarding by setting the offset value, the accuracy of path adjustment is improved, and when multiple messages belong to the same data flow, the data flow is realized. precise regulation.
如图8所示,图8为本申请提供的一种路径切换方法的流程示意图四,本申请的实施例提供的路径切换方法还包括以下步骤S810和S820。As shown in FIG. 8 , FIG. 8 is a fourth schematic flowchart of a path switching method provided in the present application. The path switching method provided in the embodiment of the present application further includes the following steps S810 and S820 .
S810,源端设备300向网络设备310发送第二报文。S810. The source device 300 sends the second packet to the network device 310.
对应的,网络设备310接收第二报文。Correspondingly, the network device 310 receives the second packet.
其中,第二报文和前述实施例中的第一报文同属于第一流,且第二报文中包括偏移值。属于同一数据流的多个报文的目的标识相同,如上述第一报文的目的标识和第二报文的目的标识相同。Wherein, the second packet and the first packet in the foregoing embodiment both belong to the first flow, and the second packet includes an offset value. The destination identifiers of multiple packets belonging to the same data flow are the same, for example, the destination identifier of the first packet and the destination identifier of the second packet are the same.
在一种可行的实现方式中,该偏移值包括在第二报文的报文头中。In a feasible implementation manner, the offset value is included in the packet header of the second packet.
在一种示例中,若该第二报文为IPv4报文,该偏移值可以设置在报文头所包括的IP ID字段、或者选项字段。In an example, if the second packet is an IPv4 packet, the offset value can be set in the IP ID field or option field included in the packet header.
在另一种示例中,若该第二报文为IPv6报文,该偏移值可以设置在IPv6报文的报文头所包括的流标签(flow label)字段、或者选项字段。In another example, if the second packet is an IPv6 packet, the offset value may be set in a flow label (flow label) field or an option field included in a packet header of the IPv6 packet.
值得注意的是,当前述的第一报文和第二报文为基于其他协议的数据报文时,偏移值也可以设置在报文头的其他位置,不予限定。It should be noted that when the aforementioned first packet and second packet are data packets based on other protocols, the offset value can also be set in other positions of the packet header, which is not limited.
在第一种可选的实现方式中,第二报文包括的偏移值是由源端设备300设置的。示例的,在网络设备310确定传输第一报文的路径1处于异常状态时,源端设备300获取到该路径1处于异常状态的异常信息,并在第一流的其他报文(如上述的第二报文)的传输过程中,为第一流的其他报文添加偏移值。In a first optional implementation manner, the offset value included in the second packet is set by the source device 300 . For example, when the network device 310 determines that the path 1 for transmitting the first packet is in an abnormal state, the source device 300 obtains the abnormality information that the path 1 is in an abnormal state, and sends other packets of the first flow (such as the above-mentioned During the transmission of the second packet), offset values are added to other packets of the first stream.
在一些可选的情形中,ECMP组包括的每条路径具有各自的路径值(或序号、编号、路径标志等),如路径1的路径值为“0001”,路径2的路径值为“0002”,若第二报文需由路径1切换到路径2,则上述的偏移值可以是由路径2的路径值和路径1的路径值之间的差值确定的,如偏移值为“0001”。另外,偏移值也可以是由ECMP组1包括的任一条其他正常路径(如路径3)的路径值和路径1的路径值之间的差值确定的。需要说明的是,本示例是以十进制为例对路径的路径值进行说明的,但在另一些可选的情形中,路径的路径值和偏移值也可以是以二进制、八进制、十六进制或者其他进制来表示的,不予限定。In some optional situations, each path included in the ECMP group has its own path value (or serial number, serial number, path flag, etc.), such as the path value of path 1 is "0001", and the path value of path 2 is "0002 ", if the second message needs to be switched from path 1 to path 2, the above-mentioned offset value can be determined by the difference between the path value of path 2 and the path value of path 1, such as the offset value is " 0001". In addition, the offset value may also be determined by the difference between the path value of any other normal path (such as path 3 ) included in ECMP group 1 and the path value of path 1 . It should be noted that this example uses decimal as an example to illustrate the path value of the path, but in other optional situations, the path value and offset value of the path can also be in binary, octal, hexadecimal system or other bases are not limited.
在第二种可选的实现方式中,第二报文包括的偏移值是由网络设备310设置的。示例的,在网络设备310确定传输第一报文的路径1处于异常状态时,网络设备310对路径1所需传输的所有数据流的报文均设置偏移值。In a second optional implementation manner, the offset value included in the second packet is set by the network device 310 . For example, when the network device 310 determines that path 1 for transmitting the first packet is in an abnormal state, the network device 310 sets offset values for packets of all data flows that path 1 needs to transmit.
值得注意的是,一个数据流包括的报文较多,多个报文可以添加不同的偏移值,以便将该多个报文分配到不同的等价转发路径上进行传输,降低数据流的传输时延,提高数据流的整体传输效率。It is worth noting that a data flow includes many packets, and different offset values can be added to multiple packets so that the multiple packets can be allocated to different equal-cost forwarding paths for transmission, reducing the cost of the data flow. Transmission delay, improve the overall transmission efficiency of data flow.
S820,网络设备310根据第二报文中的偏移值,通过路径2转发第二报文。S820. The network device 310 forwards the second packet through path 2 according to the offset value in the second packet.
示例的,假设在预设的流量负载分担策略中,同属于第一流的多个报文均由ECMP组1包括的路径1进行转发,在网络设备310确定路径1处于异常状态后,源端设备300(或者网络设备310)为属于第一流的其他报文(如第二报文)添加指示等价转发路径的偏移 值。如路径2和路径1之间的偏移值为1、路径3和路径1之间的偏移值为2,则若第二报文即将通过路径2转发时,网络设备310为该第二报文添加的偏移值为1;若第二报文即将通过路径3转发时,网络设备310为该第二报文添加的偏移值为2。应理解,上述的偏移值的具体值仅为本实施例提供的示例,任意两条等价转发路径之间的偏移值也可以是2、3或其他数值等,不予限定。As an example, assume that in the preset traffic load sharing policy, multiple packets belonging to the first flow are all forwarded by path 1 included in ECMP group 1. After the network device 310 determines that path 1 is in an abnormal state, the source device 300 (or the network device 310) adds an offset value indicating an equivalent forwarding path to other packets (such as the second packet) belonging to the first flow. For example, if the offset value between path 2 and path 1 is 1, and the offset value between path 3 and path 1 is 2, then if the second packet is about to be forwarded through path 2, the network device 310 will The offset value added to the message is 1; if the second message is about to be forwarded through path 3, the network device 310 adds an offset value of 2 to the second message. It should be understood that the above-mentioned specific value of the offset value is only an example provided by this embodiment, and the offset value between any two equivalent forwarding paths may also be 2, 3 or other values, etc., which is not limited.
本申请的实施例提供的路径切换方法,在第一网络设备(如上述的网络设备310)确定ECMP组包括的一条或多条等价转发路径处于异常状态时,可将原来由异常等价转发路径转发的报文切换到ECMP组中的正常等价转发路径进行转发,提高了数据流在ECMP组中的传输效率。In the path switching method provided by the embodiment of this application, when the first network device (such as the above-mentioned network device 310) determines that one or more equivalent forwarding paths included in the ECMP group are in an abnormal state, The packet forwarded by the path is switched to the normal equal-cost forwarding path in the ECMP group for forwarding, which improves the transmission efficiency of the data flow in the ECMP group.
另外,由于可通过设定偏移值的方式来确定报文转发的等价转发路径,提高了路径调整的精准性,在多个报文属于同一数据流的情况下,实现了数据流的精准调控。示例的,网络设备或者源端设备可针对特定的字段设置偏移值,从而调整ECMP组中内部的路径选择,实现了源端设备到目的设备之间的路由路径的精准调整。In addition, because the equivalent forwarding path of message forwarding can be determined by setting the offset value, the accuracy of path adjustment is improved, and the accuracy of data flow is realized when multiple messages belong to the same data flow. regulation. For example, the network device or the source device can set an offset value for a specific field, thereby adjusting the internal path selection in the ECMP group, and realizing precise adjustment of the routing path between the source device and the destination device.
在网络设备不需要修改ECMP组中取模的路径数量的情况下,或者说在网络设备无需调整ECMP组中所有的等价转发路径的情况下,网络设备可以最小的代价(如前述的开销值)解决ECMP组中路径发生异常(如拥塞、丢包或者时延较高)的问题,提高了网络系统的数据传输效率。In the case that the network device does not need to modify the number of paths taken modulo in the ECMP group, or in the case that the network device does not need to adjust all the equal-cost forwarding paths in the ECMP group, the network device can use the minimum cost (such as the aforementioned overhead value) ) solves the problem of path abnormality (such as congestion, packet loss or high delay) in the ECMP group, and improves the data transmission efficiency of the network system.
最后,由于网络设备是在获取到异常信息后迅速对ECMP组中的路径进行调整,因此,在提高网络系统的数据传输效率的基础上,还提高了ECMP组中路径调整的及时性。Finally, since the network device quickly adjusts the path in the ECMP group after obtaining the abnormal information, the timeliness of path adjustment in the ECMP group is also improved on the basis of improving the data transmission efficiency of the network system.
本申请的上述实施例提供的路径切换方法中,是以ECMP组包括的多条等价转发路径为例进行说明的,但本申请提供的路径切换方法还可以应用在与路由负载分担相近的其他场景,如多个网络设备基于Trunk接口实现的路径通信场景中,在此不予赘述。In the path switching method provided by the above-mentioned embodiments of the present application, multiple equal-cost forwarding paths included in the ECMP group are used as an example for illustration, but the path switching method provided by the present application can also be applied to other routes that are similar to routing load sharing. Scenarios, such as the path communication scenario implemented by multiple network devices based on the Trunk interface, will not be described in detail here.
可以理解的是,为了实现上述实施例中功能,网络设备包括了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请中所公开的实施例描述的各示例的单元及方法步骤,本申请能够以硬件或硬件和计算机软件相结合的形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用场景和设计约束条件。It can be understood that, in order to implement the functions in the foregoing embodiments, the network device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software with reference to the units and method steps of the examples described in the embodiments disclosed in the present application. Whether a certain function is executed by hardware or computer software drives the hardware depends on the specific application scenario and design constraints of the technical solution.
如图9所示,图9为本申请提供的一种路径切换装置的结构示意图,该路径切换装置900可以用于实现上述方法实施例中网络设备的功能,因此也能实现上述方法实施例所具备的有益效果。在本申请的实施例中,该路径切换装置900可以是网络设备,如上述图1所示出的任一网络设备、源端设备110或目的设备130,或者图2所示出的任一交换机或服务器,或者图3所示出的源端设备300或任一网络设备,如网络设备310或网络设备321等,还可以是应用于网络设备的模块(如芯片)。As shown in FIG. 9, FIG. 9 is a schematic structural diagram of a path switching device provided by the present application. The path switching device 900 can be used to implement the functions of the network device in the above method embodiment, so it can also implement the above method embodiment. have beneficial effects. In the embodiment of the present application, the path switching device 900 may be a network device, such as any network device, the source device 110 or the destination device 130 shown in FIG. 1 above, or any switch shown in FIG. 2 Or the server, or the source device 300 shown in FIG. 3 or any network device, such as the network device 310 or the network device 321, etc., may also be a module (such as a chip) applied to the network device.
如图9所示,该路径切换装置900包括:接收单元910、获取单元920、确定单元930和转发单元940。该路径切换装置900用于实现上述附图中所示的方法实施例中网络设备的功能。在一种可能的示例中,该路径切换装置900用于实现上述路径切换方法,下面具体说明路径切换装置900的各组成部分的功能。As shown in FIG. 9 , the path switching apparatus 900 includes: a receiving unit 910 , an acquiring unit 920 , a determining unit 930 and a forwarding unit 940 . The path switching apparatus 900 is used to implement the functions of the network equipment in the method embodiments shown in the above figures. In a possible example, the path switching device 900 is used to implement the above path switching method, and the functions of components of the path switching device 900 will be described in detail below.
接收单元910用于接收第一报文,该第一报文属于第一流。The receiving unit 910 is configured to receive a first packet, where the first packet belongs to the first flow.
获取单元920用于根据第一报文的目的标识获取对应的ECMP组,该ECMP组包括对 应前述目的标识的多条等价转发路径。The acquiring unit 920 is configured to acquire a corresponding ECMP group according to the destination identifier of the first message, and the ECMP group includes multiple equivalent forwarding paths corresponding to the aforementioned destination identifier.
确定单元930用于从ECMP组中确定第一报文对应的第一路径,以及,确定第一路径是否处于异常状态。其中,确定单元930根据第二网络设备发送的异常信息确定第一路径处于异常状态。The determining unit 930 is configured to determine the first path corresponding to the first packet from the ECMP group, and determine whether the first path is in an abnormal state. Wherein, the determining unit 930 determines that the first path is in an abnormal state according to the abnormal information sent by the second network device.
转发单元940用于当确定单元930确定第一路径处于异常状态时,通过ECMP组中的第二路径转发第一报文。The forwarding unit 940 is configured to forward the first message through the second path in the ECMP group when the determining unit 930 determines that the first path is in an abnormal state.
当路径切换装置900用于实现图3所示的方法实施例中网络设备310的功能时,接收单元910用于执行S310,获取单元920用于执行S320,确定单元930用于执行S330,转发单元940用于执行S340。When the path switching device 900 is used to realize the function of the network device 310 in the method embodiment shown in FIG. 940 is used to execute S340.
当路径切换装置900用于实现图4所示的方法实施例中网络设备310的功能时,接收单元910用于执行S410,确定单元930用于执行S420、S440和S450,转发单元940用于执行S430。When the path switching device 900 is used to realize the function of the network device 310 in the method embodiment shown in FIG. S430.
当路径切换装置900用于实现图5所示的方法实施例时:接收单元910、获取单元920、确定单元930和转发单元940用于协同执行图5所示出的步骤1至步骤5。When the path switching device 900 is used to implement the method embodiment shown in FIG. 5 : the receiving unit 910 , the acquiring unit 920 , the determining unit 930 and the forwarding unit 940 are used to coordinately execute steps 1 to 5 shown in FIG. 5 .
当路径切换装置900用于实现图8所示的方法实施例中网络设备310的功能时,接收单元910用于执行S810,转发单元940用于执行S820。When the path switching apparatus 900 is used to implement the function of the network device 310 in the method embodiment shown in FIG. 8 , the receiving unit 910 is used to perform S810, and the forwarding unit 940 is used to perform S820.
关于上述路径切换装置900执行前述附图提供的实施例中方法的操作步骤时,有益效果可以参见前述实施例的描述,此处不再赘述。Regarding the beneficial effect when the path switching device 900 executes the operation steps of the method in the embodiment provided in the preceding figures, reference may be made to the description of the foregoing embodiment, and details are not repeated here.
路径切换装置900通过软件实现前述附图中任一所示的路径切换方法时,路径切换装置900及其各个模块也可以为软件模块。通过处理器调用该软件模块实现上述的路径切换方法。该处理器可以是中央处理单元(central processing unit,CPU),特定应用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD),上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD)、现场可编程门阵列(field programmable gate array,FPGA)、通用阵列逻辑(generic array logic,GAL)或其任意组合。When the path switching device 900 implements any of the path switching methods shown in the preceding figures through software, the path switching device 900 and its modules may also be software modules. The above-mentioned path switching method is realized by calling the software module by the processor. The processor can be a central processing unit (central processing unit, CPU), a specific application integrated circuit (application-specific integrated circuit, ASIC) implementation, or a programmable logic device (programmable logic device, PLD), and the above-mentioned PLD can be a complex program Logic device (complex programmable logical device, CPLD), field programmable gate array (field programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof.
有关上述路径切换装置900更详细的描述可以参考前述附图所示的实施例中相关描述,这里不加赘述。For a more detailed description of the above-mentioned path switching apparatus 900, reference may be made to relevant descriptions in the embodiments shown in the preceding figures, and details are not repeated here.
当路径切换装置900通过硬件实现时,该硬件可以通过处理器或芯片实现。芯片包括接口电路和控制电路。接口电路用于接收来自处理器之外的其它设备的数据并传输至控制电路,或将来自控制电路的数据发送给处理器之外的其它设备。When the path switching device 900 is implemented by hardware, the hardware may be implemented by a processor or a chip. The chip includes an interface circuit and a control circuit. The interface circuit is used to receive data from devices other than the processor and transmit it to the control circuit, or send data from the control circuit to devices other than the processor.
控制电路通过逻辑电路或执行代码指令用于实现上述实施例中任一种可能实现方式的方法。有益效果可以参见上述任一实施例中的描述,此处不再赘述。The control circuit implements the method in any possible implementation manner in the foregoing embodiments through a logic circuit or by executing code instructions. For the beneficial effects, reference may be made to the description in any of the foregoing embodiments, and details are not repeated here.
可选的,当路径切换装置900还可以通过网络设备实现,如图10所示,图10为本申请提供的一种网络设备的结构示意图,该网络设备1000包括通信接口1010以及处理器1020。可以理解的是,通信接口1010可以为收发器或输入输出(input/output,I/O)接口。可选的,网络设备1000还可以包括存储器1030,用于存储处理器1020执行的指令或存储处理器1020运行指令所需要的输入数据,或存储处理器1020运行指令后产生的数据。该网络设备1000可以是指前述实施例中的网络设备310。Optionally, the path switching apparatus 900 may also be implemented by a network device, as shown in FIG. 10 , which is a schematic structural diagram of a network device provided in this application. The network device 1000 includes a communication interface 1010 and a processor 1020 . It can be understood that the communication interface 1010 may be a transceiver or an input/output (input/output, I/O) interface. Optionally, the network device 1000 may further include a memory 1030 for storing instructions executed by the processor 1020 or storing input data required by the processor 1020 to execute the instructions, or storing data generated by the processor 1020 after executing the instructions. The network device 1000 may refer to the network device 310 in the foregoing embodiments.
当网络设备1000用于实现前述附图所示的实施例时,处理器1020、通信接口1010和 存储器1030还可以协同实现网络系统中各网络设备、源端设备执行的路径切换方法中的各个操作步骤。网络设备1000还可以执行图9所示出的路径切换装置900的功能,此处不予赘述。When the network device 1000 is used to implement the embodiments shown in the foregoing figures, the processor 1020, the communication interface 1010 and the memory 1030 can also cooperate to implement various operations in the path switching method performed by each network device and source device in the network system step. The network device 1000 may also perform the functions of the path switching apparatus 900 shown in FIG. 9 , which will not be described in detail here.
本申请实施例中不限定上述通信接口1010、处理器1020以及存储器1030之间的具体连接方式。In the embodiment of the present application, the specific connection manner among the communication interface 1010, the processor 1020, and the memory 1030 is not limited.
存储器1030可用于存储软件程序及模块,如本申请实施例所提供的路径切换方法对应的程序指令/模块,处理器1020通过执行存储在存储器1030内的软件程序及模块,从而执行各种功能应用以及数据处理。该通信接口1010可用于与其他设备进行信令或数据的通信。在本申请中该网络设备1000可以具有多个通信接口1010。The memory 1030 can be used to store software programs and modules, such as program instructions/modules corresponding to the path switching method provided in the embodiment of the present application, and the processor 1020 executes various functional applications by executing the software programs and modules stored in the memory 1030 and data processing. The communication interface 1010 can be used for signaling or data communication with other devices. In this application, the network device 1000 may have multiple communication interfaces 1010 .
通信接口1010可用于提供ECMP组1包括的多条等价转发路径的转发端口,如图10所示出的端口1至端口3,如该端口1为前述实施例中网络设备310为路径1提供的转发端口,端口2为前述实施例中网络设备310为路径2提供的转发端口,端口3为前述实施例中网络设备310为路径3提供的转发端口。The communication interface 1010 can be used to provide the forwarding ports of multiple equal-cost forwarding paths included in the ECMP group 1, such as port 1 to port 3 shown in FIG. port 2 is the forwarding port provided by the network device 310 for path 2 in the foregoing embodiment, and port 3 is the forwarding port provided by the network device 310 for path 3 in the foregoing embodiment.
本申请还提供另一种可能的网络设备,如图11所示,图11为本申请提供的另一种网络设备的结构示意图,该网络设备1100包括:处理器1110、处理器1120和I/O接口1130。如该网络设备1100可以是指前述实施例中的网络设备321或者网络设备322,亦或是网络设备310的其他下游设备等。The present application also provides another possible network device, as shown in FIG. 11 , which is a schematic structural diagram of another network device provided by the present application. The network device 1100 includes: a processor 1110, a processor 1120 and an I/O O interface 1130. For example, the network device 1100 may refer to the network device 321 or the network device 322 in the foregoing embodiments, or other downstream devices of the network device 310 .
I/O接口1130可用于接收来自于其他设备的报文。网络设备1100可包括一个或多个I/O接口1130,不予限定。The I/O interface 1130 can be used to receive messages from other devices. The network device 1100 may include one or more I/O interfaces 1130, which is not limited.
处理器1120中可以设置有分析引擎,如该分析引擎是指网络设备1100利用虚拟化技术提供的虚拟机、容器(container)或管理节点(management node),并由虚拟机、容器或管理节点检测网络设备1100的转发效率。An analysis engine may be provided in the processor 1120. For example, the analysis engine refers to a virtual machine, container (container) or management node (management node) provided by the network device 1100 using virtualization technology, and is detected by the virtual machine, container or management node. The forwarding efficiency of the network device 1100.
通过在网络设备1100中设置2个不同的处理器,其中一个处理器1120用于检测网络设备1100的转发效率,有利于快速获取到网络设备1100的异常信息,从而,处理器1110将该异常信息转发至网络设备1100的上游设备。示例性的,当网络设备1100是指上述的网络设备321时,该网络设备1100的上游设备可以是网络设备310,网络设备310在获取到网络设备1100反馈的异常信息时,将网络设备310和网络设备1100之间的流从一条等价转发路径切换到其他等价转发路径。By arranging two different processors in the network device 1100, one of the processors 1120 is used to detect the forwarding efficiency of the network device 1100, which is beneficial to quickly obtain the abnormal information of the network device 1100, so that the processor 1110 takes the abnormal information Forward to the upstream device of network device 1100. Exemplarily, when the network device 1100 refers to the above-mentioned network device 321, the upstream device of the network device 1100 may be the network device 310. When the network device 310 obtains the abnormal information fed back by the network device 1100, the network device 310 and Flows between network devices 1100 are switched from one equal-cost forwarding path to other equal-cost forwarding paths.
可以理解的是,本申请的实施例中的处理器1120可以是CPU、神经处理器(neural processing unit,NPU)或图形处理器(graphic processing unit,GPU),还可以是其它通用处理器、数字信号处理器(digital signal processor,DSP)、ASIC、FPGA或者其它可编程逻辑器件、晶体管逻辑器件,硬件部件或者其任意组合。通用处理器可以是微处理器,也可以是任何常规的处理器。It can be understood that the processor 1120 in the embodiment of the present application may be a CPU, a neural processing unit (neural processing unit, NPU) or a graphics processing unit (graphic processing unit, GPU), and may also be other general-purpose processors, digital Signal processor (digital signal processor, DSP), ASIC, FPGA or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor can be a microprocessor, or any conventional processor.
本申请的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的 存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于网络设备或终端设备中。当然,处理器和存储介质也可以作为分立组件存在于网络设备或终端设备中。The method steps in the embodiments of the present application may be implemented by means of hardware, or may be implemented by means of a processor executing software instructions. Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (random access memory, RAM), flash memory, read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM) , PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM or known in the art any other form of storage medium. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and storage medium can be located in the ASIC. In addition, the ASIC can be located in a network device or a terminal device. Certainly, the processor and the storage medium may also exist in the network device or the terminal device as discrete components.
在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。In each embodiment of the present application, if there is no special explanation and logical conflict, the terms and/or descriptions between different embodiments are consistent and can be referred to each other, and the technical features in different embodiments are based on their inherent Logical relationships can be combined to form new embodiments.
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。在本申请的文字描述中,字符“/”,一般表示前后关联对象是一种“或”的关系;在本申请的公式中,字符“/”,表示前后关联对象是一种“相除”的关系。In this application, "at least one" means one or more, and "multiple" means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. In the text description of this application, the character "/" generally indicates that the contextual objects are an "or" relationship; in the formulas of this application, the character "/" indicates that the contextual objects are a "division" Relationship.
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定。It can be understood that the various numbers involved in the embodiments of the present application are only for convenience of description, and are not used to limit the scope of the embodiments of the present application. The size of the serial numbers of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic.
Claims (24)
- 一种路径切换方法,其特征在于,所述方法由第一网络设备执行,所述方法包括:A path switching method, characterized in that the method is performed by a first network device, and the method includes:接收第一报文,所述第一报文属于第一流;receiving a first packet, where the first packet belongs to the first flow;根据所述第一报文的目的标识获取对应的等价路径负载分担ECMP组,所述ECMP组包括对应所述目的标识的多条等价转发路径;Obtaining a corresponding equal-cost path load sharing ECMP group according to the destination identifier of the first message, where the ECMP group includes multiple equal-cost forwarding paths corresponding to the destination identifier;从所述ECMP组中确定所述第一报文对应的第一路径;determining a first path corresponding to the first packet from the ECMP group;当所述第一路径处于异常状态时,通过所述ECMP组中的第二路径转发所述第一报文;When the first path is in an abnormal state, forward the first message through a second path in the ECMP group;其中,所述第一网络设备根据第二网络设备发送的异常信息确定所述第一路径处于异常状态。Wherein, the first network device determines that the first path is in an abnormal state according to the abnormality information sent by the second network device.
- 根据权利要求1所述的方法,其特征在于,所述第二网络设备发送的异常信息指示通过所述第一路径接收的报文影响了所述第二网络设备的转发效率。The method according to claim 1, wherein the abnormal information sent by the second network device indicates that the packet received through the first path affects the forwarding efficiency of the second network device.
- 根据权利要求1或2所述的方法,其特征在于,所述第一路径处于异常状态,包括:所述第一路径被标记为异常,或所述第一路径被删除,或所述第一路径的参数超过设定的阈值。The method according to claim 1 or 2, wherein the abnormal state of the first path includes: the first path is marked as abnormal, or the first path is deleted, or the first The parameter of the path exceeds the set threshold.
- 根据权利要求3所述的方法,其特征在于,所述第一路径被删除,包括:所述第一网络设备提供给所述第一路径的端口被置为无效,或者,所述第二网络设备在所述第一路径中的下一跳路由被删除。The method according to claim 3, wherein the deleting of the first path comprises: invalidating the port provided by the first network device to the first path, or, the second network The next-hop route of the device in the first path is deleted.
- 根据权利要求1至4中任意一项所述的方法,其特征在于,The method according to any one of claims 1 to 4, characterized in that,所述通过所述ECMP组中的第二路径转发所述第一报文,包括:The forwarding of the first message through the second path in the ECMP group includes:将所述第一路径偏移设定的值,以得到所述第二路径;offsetting the first path by a set value to obtain the second path;通过所述第二路径转发所述第一报文。Forwarding the first packet through the second path.
- 根据权利要求1至4中任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:接收第二报文,所述第二报文属于所述第一流,所述第二报文中包括偏移值;receiving a second packet, where the second packet belongs to the first flow, and the second packet includes an offset value;根据所述第二报文中的所述偏移值,通过所述第二路径转发所述第二报文。Forwarding the second packet through the second path according to the offset value in the second packet.
- 根据权利要求6所述的方法,其特征在于,所述偏移值包括在所述第二报文的报文头中。The method according to claim 6, wherein the offset value is included in a header of the second packet.
- 根据权利要求7所述的方法,其特征在于,The method according to claim 7, characterized in that,若所述第一报文为第四代互联网协议IPv4报文,所述IPv4报文包括的扩展选项头或互联网协议标识IP ID字段存储有所述偏移值;或者,If the first message is a fourth-generation Internet Protocol IPv4 message, the extended option header or the Internet Protocol Identification IP ID field included in the IPv4 message stores the offset value; or,若所述第一报文为第六代互联网协议IPv6报文,所述IPv6报文包括的扩展选项头或流标签字段存储有所述偏移值。If the first packet is a sixth-generation Internet protocol IPv6 packet, the offset value is stored in an extended option header or a flow label field included in the IPv6 packet.
- 根据权利要求1至8中任意一项所述的方法,其特征在于,所述第一报文包括优先级信息;The method according to any one of claims 1 to 8, wherein the first message includes priority information;所述根据所述第一报文的目的标识获取对应的等价路径负载分担ECMP组,包括:The obtaining the corresponding equal-cost path load sharing ECMP group according to the destination identifier of the first message includes:根据所述第一报文的目的标识获取多个ECMP组,所述多个ECMP组对应不同的优先级;Acquire multiple ECMP groups according to the destination identifier of the first message, and the multiple ECMP groups correspond to different priorities;根据所述优先级信息从所述多个ECMP组中确定所述第一报文对应的ECMP组。Determining an ECMP group corresponding to the first packet from the plurality of ECMP groups according to the priority information.
- 根据权利要求9所述的方法,其特征在于,所述优先级信息为差分服务代码点DSCP值。The method according to claim 9, wherein the priority information is a Differentiated Services Code Point (DSCP) value.
- 一种路径切换装置,其特征在于,所述装置应用于第一网络设备,所述装置包括:A path switching device, characterized in that the device is applied to a first network device, and the device includes:接收单元,用于接收第一报文,所述第一报文属于第一流;a receiving unit, configured to receive a first packet, where the first packet belongs to the first stream;获取单元,用于根据所述第一报文的目的标识获取对应的ECMP组,所述ECMP组包括对应所述目的标识的多条等价转发路径;An acquiring unit, configured to acquire a corresponding ECMP group according to the destination identifier of the first message, where the ECMP group includes multiple equivalent forwarding paths corresponding to the destination identifier;确定单元,用于从所述ECMP组中确定所述第一报文对应的第一路径,以及,确定所述第一路径是否处于异常状态;A determining unit, configured to determine a first path corresponding to the first message from the ECMP group, and determine whether the first path is in an abnormal state;转发单元,用于当所述确定单元确定所述第一路径处于异常状态时,通过所述ECMP组中的第二路径转发所述第一报文;A forwarding unit, configured to forward the first message through a second path in the ECMP group when the determining unit determines that the first path is in an abnormal state;其中,所述确定单元根据第二网络设备发送的异常信息确定所述第一路径处于异常状态。Wherein, the determining unit determines that the first path is in an abnormal state according to the abnormal information sent by the second network device.
- 根据权利要求11所述的装置,其特征在于,所述第二网络设备发送的异常信息指示通过所述第一路径接收的报文影响了所述第二网络设备的转发效率。The apparatus according to claim 11, wherein the abnormal information sent by the second network device indicates that the packet received through the first path affects the forwarding efficiency of the second network device.
- 根据权利要求11或12所述的装置,其特征在于,所述第一路径处于异常状态,包括:所述第一路径被标记为异常,或所述第一路径被删除,或所述第一路径的参数超过设定的阈值。The device according to claim 11 or 12, wherein the abnormal state of the first path includes: the first path is marked as abnormal, or the first path is deleted, or the first The parameter of the path exceeds the set threshold.
- 根据权利要求13所述的装置,其特征在于,所述第一路径被删除,包括:所述第一网络设备提供给所述第一路径的端口被置为无效,或者,所述第二网络设备在所述第一路径中的下一跳路由被删除。The apparatus according to claim 13, wherein the deletion of the first path comprises: invalidating the port provided by the first network device to the first path, or the second network The next-hop route of the device in the first path is deleted.
- 根据权利要求11至14中任意一项所述的装置,其特征在于,所述转发单元具体用于:The device according to any one of claims 11 to 14, wherein the forwarding unit is specifically used for:将所述第一路径偏移设定的值,以得到所述第二路径;offsetting the first path by a set value to obtain the second path;通过所述第二路径转发所述第一报文。Forwarding the first packet through the second path.
- 根据权利要求11至14中任意一项所述的装置,其特征在于,Apparatus according to any one of claims 11 to 14, characterized in that所述接收单元,还用于接收第二报文,所述第二报文属于所述第一流,所述第二报文中包括偏移值;The receiving unit is further configured to receive a second message, the second message belongs to the first flow, and the second message includes an offset value;所述转发单元,还用于根据所述第二报文中的所述偏移值,通过所述第二路径转发所述第二报文。The forwarding unit is further configured to forward the second message through the second path according to the offset value in the second message.
- 根据权利要求16所述的装置,其特征在于,所述偏移值包括在所述第二报文的报文头中。The device according to claim 16, wherein the offset value is included in a packet header of the second packet.
- 根据权利要求17所述的装置,其特征在于,若所述第一报文为第四代互联网协议IPv4报文,所述IPv4报文包括的扩展选项头或互联网协议标识IP ID字段存储有所述偏移值;或者,The device according to claim 17, wherein, if the first message is a fourth-generation Internet protocol IPv4 message, the extended option header or the Internet protocol identifier IP ID field included in the IPv4 message is stored the above offset value; or,若所述第一报文为第六代互联网协议IPv6报文,所述IPv6报文包括的扩展选项头或流标签字段存储有所述偏移值。If the first packet is a sixth-generation Internet protocol IPv6 packet, the offset value is stored in an extended option header or a flow label field included in the IPv6 packet.
- 根据权利要求11至18中任意一项所述的装置,其特征在于,所述第一报文包括优先级信息;The device according to any one of claims 11 to 18, wherein the first message includes priority information;所述获取单元,具体用于根据所述第一报文的目的标识获取多个ECMP组,所述多个ECMP组对应不同的优先级;The acquiring unit is specifically configured to acquire multiple ECMP groups according to the destination identifier of the first message, and the multiple ECMP groups correspond to different priorities;所述确定单元,还用于根据所述优先级信息从所述多个ECMP组中确定所述第一报文 对应的ECMP组。The determining unit is further configured to determine the ECMP group corresponding to the first message from the plurality of ECMP groups according to the priority information.
- 根据权利要求19所述的装置,其特征在于,所述优先级信息为差分服务代码点DSCP值。The device according to claim 19, wherein the priority information is a Differentiated Services Code Point (DSCP) value.
- 一种网络设备,其特征在于,包括存储器和处理器,其中:A network device, characterized in that it includes a memory and a processor, wherein:所述存储器用于存储程序代码;The memory is used to store program codes;所述处理器用于调用所述程序代码实现权利要求1-10中任意一项所述的方法。The processor is configured to invoke the program code to implement the method described in any one of claims 1-10.
- 一种网络系统,其特征在于,包括:第一网络设备和第二网络设备;A network system, characterized by comprising: a first network device and a second network device;所述第一网络设备接收第一报文,所述第一报文属于第一流;The first network device receives a first packet, and the first packet belongs to a first flow;所述第一网络设备根据所述第一报文的目的标识获取对应的等价路径负载分担ECMP组,所述ECMP组包括对应所述目的标识的多条等价转发路径;The first network device obtains a corresponding equal-cost path load sharing ECMP group according to the destination identifier of the first message, and the ECMP group includes a plurality of equal-cost forwarding paths corresponding to the destination identifier;所述第一网络设备从所述ECMP组中确定所述第一报文对应的第一路径;The first network device determines a first path corresponding to the first message from the ECMP group;当所述第一路径处于异常状态时,所述第一网络设备通过所述ECMP组中的第二路径,向所述第二网络设备转发所述第一报文;When the first path is in an abnormal state, the first network device forwards the first message to the second network device through a second path in the ECMP group;其中,所述第一网络设备根据所述第二网络设备发送的异常信息确定所述第一路径处于异常状态。Wherein, the first network device determines that the first path is in an abnormal state according to the abnormality information sent by the second network device.
- 根据权利要求22所述的系统,其特征在于,还包括:源端设备;The system according to claim 22, further comprising: a source device;所述源端设备向所述第一网络设备发送第二报文,所述第二报文属于所述第一流,所述第二报文中包括偏移值;The source device sends a second packet to the first network device, the second packet belongs to the first flow, and the second packet includes an offset value;所述第一网络设备根据所述第二报文中的所述偏移值,通过所述第二路径向所述第二网络转发所述第二报文。The first network device forwards the second packet to the second network through the second path according to the offset value in the second packet.
- 根据权利要求23所述的系统,其特征在于,所述偏移值包括在所述第二报文的报文头中。The system according to claim 23, wherein the offset value is included in a packet header of the second packet.
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111572470.1 | 2021-12-21 | ||
CN202111572470 | 2021-12-21 | ||
CN202210139157.7 | 2022-02-15 | ||
CN202210139157.7A CN116319535A (en) | 2021-12-21 | 2022-02-15 | Path switching method, path switching device, network equipment and network system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023116580A1 true WO2023116580A1 (en) | 2023-06-29 |
Family
ID=86782042
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/139756 WO2023116580A1 (en) | 2021-12-21 | 2022-12-16 | Path switching method and apparatus, network device, and network system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116319535A (en) |
WO (1) | WO2023116580A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117041140A (en) * | 2023-10-10 | 2023-11-10 | 腾讯科技(深圳)有限公司 | Data message transmission method, related device, equipment and storage medium |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118101606B (en) * | 2024-04-24 | 2024-06-28 | 腾讯科技(深圳)有限公司 | Data processing method, device, computer equipment and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101018203A (en) * | 2007-01-18 | 2007-08-15 | 北京航空航天大学 | Dynamic load allocation method of the aviation telecom network |
US20080267078A1 (en) * | 2007-04-26 | 2008-10-30 | Cisco Technology, Inc. | Multicast fast reroute |
CN101420383A (en) * | 2008-12-12 | 2009-04-29 | 北京邮电大学 | ECMP path soft resuming method in MPLS-TP packet transmission network |
CN101425879A (en) * | 2008-12-12 | 2009-05-06 | 北京邮电大学 | TDM/PW space time diversity method based on T-MPLS packet transmission network |
-
2022
- 2022-02-15 CN CN202210139157.7A patent/CN116319535A/en active Pending
- 2022-12-16 WO PCT/CN2022/139756 patent/WO2023116580A1/en unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101018203A (en) * | 2007-01-18 | 2007-08-15 | 北京航空航天大学 | Dynamic load allocation method of the aviation telecom network |
US20080267078A1 (en) * | 2007-04-26 | 2008-10-30 | Cisco Technology, Inc. | Multicast fast reroute |
CN101420383A (en) * | 2008-12-12 | 2009-04-29 | 北京邮电大学 | ECMP path soft resuming method in MPLS-TP packet transmission network |
CN101425879A (en) * | 2008-12-12 | 2009-05-06 | 北京邮电大学 | TDM/PW space time diversity method based on T-MPLS packet transmission network |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117041140A (en) * | 2023-10-10 | 2023-11-10 | 腾讯科技(深圳)有限公司 | Data message transmission method, related device, equipment and storage medium |
CN117041140B (en) * | 2023-10-10 | 2024-01-30 | 腾讯科技(深圳)有限公司 | Data message transmission method, related device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116319535A (en) | 2023-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9319303B2 (en) | Scalable IP-services enabled multicast forwarding with efficient resource utilization | |
CN108307434B (en) | Method and apparatus for flow control | |
WO2023116580A1 (en) | Path switching method and apparatus, network device, and network system | |
CN114915585A (en) | Message processing method, device, equipment and system | |
US12132663B2 (en) | Technologies for protocol-agnostic network packet segmentation | |
US20220174004A1 (en) | Methods and apparatus for encoding local processing metadata in network headers | |
WO2016029345A1 (en) | Network flow information statistics method and apparatus | |
WO2022007550A1 (en) | Load balancing method, apparatus, network device, and system | |
WO2015039616A1 (en) | Method and device for packet processing | |
US8467311B2 (en) | Method and system for avoiding flooding of packets in switches | |
US20240267324A1 (en) | Packet forwarding method and apparatus | |
CN113612698A (en) | Data packet sending method and device | |
WO2024001701A1 (en) | Data processing method, apparatus and system | |
WO2023040782A1 (en) | Message processing method and system, and device and storage medium | |
US20220166721A1 (en) | Traffic balancing method, network device, and electronic device | |
CN105471817A (en) | Method, device and system for unloading service flow | |
WO2024055682A1 (en) | Message processing method and apparatus | |
WO2024152938A1 (en) | Method for forwarding in-network computing message, forwarding node and computer storage medium | |
CN118055518A (en) | Network access to residential gateway | |
CN118677833A (en) | Data communication method and device | |
CN116938666A (en) | Data processing method and related equipment | |
CN117793027A (en) | Method, apparatus, device and storage medium for data transmission | |
WO2022119943A1 (en) | Methods and apparatus for encoding local processing metadata in network headers | |
CN117714378A (en) | Data transmission method, device, node and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22909893 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |