CN109525501B - Method and device for adjusting forwarding path - Google Patents

Method and device for adjusting forwarding path Download PDF

Info

Publication number
CN109525501B
CN109525501B CN201811611323.9A CN201811611323A CN109525501B CN 109525501 B CN109525501 B CN 109525501B CN 201811611323 A CN201811611323 A CN 201811611323A CN 109525501 B CN109525501 B CN 109525501B
Authority
CN
China
Prior art keywords
interface
forwarding
target
characteristic information
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811611323.9A
Other languages
Chinese (zh)
Other versions
CN109525501A (en
Inventor
赵昌峰
吴玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201811611323.9A priority Critical patent/CN109525501B/en
Publication of CN109525501A publication Critical patent/CN109525501A/en
Application granted granted Critical
Publication of CN109525501B publication Critical patent/CN109525501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/122Avoiding congestion; Recovering from congestion by diverting traffic away from congested entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Abstract

The embodiment of the application provides a method and a device for adjusting a forwarding path, wherein the method is applied to network equipment and comprises the following steps: receiving characteristic information of a first message, wherein the first message is a message which is determined by downstream equipment of network equipment and causes link congestion, the characteristic information comprises outer layer characteristic information when the first message is subjected to outer layer encapsulation, determining a target message matched with the characteristic information, and modifying an interface for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs if the current interface for forwarding the target message is an aggregation interface. Based on the above processing, the network device may forward the target packet through other interfaces in the aggregation group to which the current interface belongs, so that the target packet no longer passes through the originally congested link, and the probability of network service interruption may be reduced.

Description

Method and device for adjusting forwarding path
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method and an apparatus for adjusting a forwarding path.
Background
With the rapid development of internet technology, the demand of users for accessing the network is increasing, which may cause the traffic in the network to exceed the load of the network, so that congestion may occur in the network. Congestion in the network may cause message loss, increase message processing delay, and even network breakdown.
In the prior art, network devices usually adopt a mode of controlling a rate of forwarding packets to avoid congestion in a network. Referring to fig. 1, the networking shown in fig. 1 includes a Core Router (CR) 1, a CR2, a Service Router (SR) 1, an SR2, an SW (Switch) 1, an SW2, an SW3, a VM (Virtual Machine) 1, a VM2, and a VM 3. VM1 accesses SW1, VM2 accesses SW2, and VM3 accesses SW 3. SW1 is connected to SR1 via link L11, SW1 is connected to SR2 via link L12, and CR2 is connected to SR2 via link L22. CR1 and CR2 may have access to the core network such that VM1, VM2, and VM3 may access the core network through CR1 or CR 2.
When SR2 detects that link L22 is congested, SR2 may drop packets that cause link L22 to be congested, which may result in network traffic disruption.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for adjusting a forwarding path, which can reduce the probability of network service interruption. The specific technical scheme is as follows:
in a first aspect, to achieve the above object, an embodiment of the present application discloses a method for adjusting a forwarding path, where the method is applied to a network device, and the method includes:
receiving feature information of a first message, wherein the first message is a message which is determined by downstream equipment of the network equipment and causes link congestion, and the feature information comprises outer layer feature information when the first message is subjected to outer layer encapsulation;
determining a target message matched with the characteristic information;
judging whether the current interface for forwarding the target message is an aggregation interface;
and if the current interface for forwarding the target message is an aggregation interface, modifying the interface for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs.
Optionally, the determining whether the interface currently used for forwarding the target packet is an aggregation interface includes:
and under the condition that the source Media Access Control (MAC) address in the outer characteristic information is not the MAC address of the source Media Access Control (MAC) address, determining an output interface in an MAC forwarding table matched with the destination MAC address and the Virtual Local Area Network (VLAN) identification in the outer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
Optionally, the determining whether the interface currently used for forwarding the target packet is an aggregation interface includes:
if the source IP address in the outer layer characteristic information is not the IP address of the source MAC address and the encapsulation format information in the outer layer characteristic information represents the IP encapsulation of the internet protocol, determining an outlet interface in a fast forwarding table matched with a quintuple in the outer layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface;
and if the source IP address in the outer layer characteristic information is the IP address of the source IP address, and the characteristic information comprises inner layer characteristic information when the first message is subjected to inner layer encapsulation, judging whether an interface currently used for forwarding the target message is an aggregation interface or not according to the inner layer characteristic information.
Optionally, the determining whether the interface currently used for forwarding the target packet is an aggregation interface includes:
and under the condition that the source MAC address in the outer layer characteristic information is the MAC address of the source MAC address, if the encapsulation format information in the outer layer characteristic information represents multi-protocol label switching (MPLS) encapsulation, determining an outgoing interface in an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the outer layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
Optionally, the determining, according to the inner layer feature information, whether an interface currently used for forwarding the target packet is an aggregation interface includes:
and under the condition that the source MAC address in the inner layer characteristic information is not the MAC address of the source MAC address, determining an output interface in an MAC forwarding table matched with a destination MAC address and a Virtual Private Network (VPN) identifier in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
Optionally, the determining, according to the inner layer feature information, whether an interface currently used for forwarding the target packet is an aggregation interface includes:
under the condition that the source MAC address in the inner layer characteristic information is the MAC address of the source MAC address, if the packaging format information in the inner layer characteristic information represents IP packaging, determining an output interface in a fast forwarding table item matched with a quintuple in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not;
if the packaging format information in the inner layer characteristic information indicates MPLS packaging, determining an outgoing interface of an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
In a second aspect, in order to achieve the above object, an embodiment of the present application discloses a method for adjusting a forwarding path, where the method is applied to a downstream device, and the method includes:
determining a first message which is received from an upstream device and causes link congestion;
extracting feature information from the first message, wherein the feature information comprises outer layer feature information when the first message is subjected to outer layer packaging;
and sending the characteristic information to the upstream equipment through an interface for receiving the first message, so that the upstream equipment determines a target message matched with the characteristic information according to the characteristic information, and modifies an interface for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs.
In a third aspect, to achieve the above object, an embodiment of the present application discloses an apparatus for adjusting a forwarding path, where the apparatus is applied to a network device, and the apparatus includes:
a receiving module, configured to receive feature information of a first packet, where the first packet is a packet that causes link congestion and is determined by a downstream device of the network device, and the feature information includes outer layer feature information when the first packet is subjected to outer layer encapsulation;
the determining module is used for determining the target message matched with the characteristic information;
the judging module is used for judging whether the interface currently used for forwarding the target message is an aggregation interface;
and the adjusting module is used for modifying the interface for forwarding the target message into other interfaces in the aggregation group to which the current interface belongs if the current interface for forwarding the target message is the aggregation interface.
Optionally, the determining module is specifically configured to, when the source MAC address in the outer layer characteristic information is not the MAC address of the source MAC address, determine an outgoing interface in an MAC forwarding table matched with the destination MAC address and the VLAN id in the outer layer characteristic information as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
Optionally, the determining module is specifically configured to, when the source MAC address in the outer layer feature information is an own MAC address and the encapsulation format information in the outer layer feature information indicates IP encapsulation, determine, if the source IP address in the outer layer feature information is not an own IP address, an outgoing interface in the fast forwarding table entry that matches a quintuple in the outer layer feature information as an interface currently used for forwarding the target packet, and determine whether an interface currently used for forwarding the target packet is an aggregation interface;
and if the source IP address in the outer layer characteristic information is the IP address of the source IP address, and the characteristic information comprises inner layer characteristic information when the first message is subjected to inner layer encapsulation, judging whether an interface currently used for forwarding the target message is an aggregation interface or not according to the inner layer characteristic information.
Optionally, the determining module is specifically configured to, when the source MAC address in the outer layer feature information is the MAC address of the source MAC address, determine, if the encapsulation format information in the outer layer feature information indicates multi-protocol label switching MPLS encapsulation, an outgoing interface in an MPLS forwarding entry that matches the destination MAC address and the MPLS outgoing label in the outer layer feature information as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
Optionally, the determining module is specifically configured to determine, when the source MAC address in the inner layer feature information is not the MAC address of the source MAC address, an outgoing interface in an MAC forwarding table entry that matches the destination MAC address in the inner layer feature information and the VPN identifier, as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
Optionally, the determining module is specifically configured to, when a source MAC address in the inner layer feature information is an own MAC address, determine, if encapsulation format information in the inner layer feature information indicates IP encapsulation, an outgoing interface in a fast forwarding table entry that matches a quintuple in the inner layer feature information as an interface currently used for forwarding the target packet, and determine whether an interface currently used for forwarding the target packet is an aggregation interface;
if the packaging format information in the inner layer characteristic information indicates MPLS packaging, determining an outgoing interface of an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
In a fourth aspect, in order to achieve the above object, an embodiment of the present application discloses an apparatus for adjusting a forwarding path, where the apparatus is applied to a downstream device, and the apparatus includes:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a first message which is received from upstream equipment and causes link congestion;
an extraction module, configured to extract feature information from the first packet, where the feature information includes outer layer feature information when the first packet is subjected to outer layer encapsulation;
and the sending module is used for sending the characteristic information to the upstream equipment through the interface for receiving the first message, so that the upstream equipment determines a target message matched with the characteristic information according to the characteristic information, and modifies the interface for forwarding the target message into other interfaces in the aggregation group to which the current interface belongs.
On the other hand, in order to achieve the above object, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
On the other hand, in order to achieve the above object, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the second aspect when executing the program stored in the memory.
In another aspect, to achieve the above object, the present application provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the method steps of the first aspect are implemented.
In another aspect, to achieve the above object, the present application provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the method steps according to the second aspect are implemented.
In another aspect, to achieve the above object, the present application provides a computer program product containing instructions, which when executed on a computer, causes the computer to perform the method steps of the first aspect.
In another aspect, to achieve the above object, the present application provides a computer program product containing instructions, which when executed on a computer, causes the computer to perform the method steps of the second aspect.
The embodiment of the application provides a method and a device for adjusting a forwarding path, which are applied to a network device, wherein the network device can receive feature information of a first message, the first message is a message which is determined by a downstream device of the network device and causes link congestion, the feature information comprises outer layer feature information when the first message is subjected to outer layer encapsulation, a target message matched with the feature information is determined, and if an interface which is currently used for forwarding the target message is an aggregation interface, the network device can modify the interface which is used for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs. Based on the above processing, the network device may forward the target packet through other interfaces in the aggregation group to which the current interface belongs, so that the target packet no longer passes through the originally congested link, and the probability of network service interruption may be reduced.
Of course, not all of the above advantages need be achieved in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a framework diagram of a networking provided in an embodiment of the present application;
fig. 2 is a flowchart of a method for adjusting a forwarding path according to an embodiment of the present application;
fig. 3 is a flowchart of a method for adjusting a forwarding path according to an embodiment of the present application;
fig. 4 is a flowchart of an example of a method for adjusting a forwarding path according to an embodiment of the present application;
fig. 5 is a structural diagram of an apparatus for adjusting a forwarding path according to an embodiment of the present application;
fig. 6 is a structural diagram of an apparatus for adjusting a forwarding path according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 8 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, the embodiment of the present application illustrates an example in which the method is applied to SW1 and SR 2.
In the prior art, when SR2 detects that link L22 is congested, SR2 may drop a packet (i.e., a first packet) causing the congestion of link L22, which may further cause interruption of network traffic.
By applying the method of the present application, the SR2 may extract feature information of the first packet, where the feature information of the first packet may include outer layer feature information when the first packet is subjected to outer layer encapsulation. Then, the SR2 may transmit the feature information of the first packet to the SW1 through the interface that receives the first packet. After receiving the feature information of the first packet, the SW1 may determine a packet (i.e., a target packet) matching the feature information, and if the current interface for forwarding the target packet is an aggregation interface, the SW1 may modify the interface for forwarding the target packet to be another interface in an aggregation group to which the current interface belongs, so that the target packet may not pass through the link L22 any more, and the packet may be prevented from being discarded.
For example, for a certain packet, an interface currently used for forwarding the packet is an interface corresponding to the link L12, the aggregation group to which the interface belongs further includes an interface corresponding to the link L11, and the SW1 may send the packet to the SR1 through the interface corresponding to the link L11, so that the SR1 forwards the packet, so that the packet no longer passes through the link L22, which may prevent the packet from being discarded by the SR2, and further may reduce the probability of network service interruption.
Referring to fig. 2, a flowchart of a method for adjusting a forwarding path provided in an embodiment of the present application, where the method may be applied to a network device (may be referred to as a first device) in a networking, and the method may include the following steps:
s201: and receiving the characteristic information of the first message.
The first message is a message causing link congestion determined by a downstream device (which may be referred to as a second device) of the first device, and the characteristic information may include outer layer characteristic information obtained when the first message is subjected to outer layer encapsulation.
In the embodiment of the application, when the second device detects that a certain link between the second device and its own downstream device is congested, the second device may determine a packet (i.e., a first packet) that causes the congestion of the link, and then the second device may extract feature information of the first packet and send the feature information to the first device. Accordingly, the first device may receive the feature information of the first packet, so as to perform subsequent processing.
S202: and determining the target message matched with the characteristic information.
In the application embodiment, after obtaining the feature information, the first device may determine a packet (i.e., a target packet) matched with the feature information, that is, the feature information carried in the target packet is matched with the feature information received by the first device from the second device, and the target packet is a packet of the forwarding path to be adjusted.
S203: and judging whether the current interface for forwarding the target message is an aggregation interface, and if so, executing S204.
In the embodiment of the application, after determining the target packet, the first device may determine an interface (which may be referred to as a target interface) currently used for forwarding the target packet, and determine whether the target interface is an aggregation interface. Specifically, it will be described in detail in the following examples.
S204: and modifying the interface for forwarding the target message into other interfaces in the aggregation group to which the current interface belongs.
In the application embodiment, when the first device determines that the current interface for forwarding the target packet is the aggregation interface, the first device may modify the interface for forwarding the target packet to another interface in the aggregation group to which the current interface belongs. The first device can forward the target message through other interfaces in the aggregation group to which the current interface belongs, so that the target message does not pass through an originally congested link any more, and the probability of network service interruption can be reduced
Because the first device may have various forwarding modes for the target packet, the first device may determine the target interface in different modes, and further determine whether the target interface is an aggregation interface.
Optionally, the outer layer feature information may include a Virtual Local Area Network (VLAN) identifier. Accordingly, in the case where the source MAC (Media Access C control) address (which may be referred to as an outer layer source MAC address) in the outer layer characteristic information is not the MAC address of itself, S203 may include the steps of:
and determining the output interface in the MAC forwarding table matched with the target MAC address and the VLAN identification in the outer layer characteristic information as the interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface.
In the application embodiment, after the outer layer feature information is obtained, the first device may obtain an outer layer source MAC address from the outer layer feature information, and then, the first device may determine whether the outer layer source MAC address is a MAC address of the first device.
When the first device determines that the outer-layer source MAC address is not the MAC address of the first device, the first device may determine that the target packet is forwarded by the two-layer network, and at this time, the first device may obtain a VLAN identifier (which may be referred to as an outer-layer VLAN identifier) in the outer-layer feature information, and may further determine an MAC forwarding table (which may be referred to as a first MAC forwarding table) that matches the destination MAC address (which may be referred to as an outer-layer destination MAC address) and the outer-layer VLAN identifier in the outer-layer feature information, and determine an outgoing interface in the first MAC forwarding table as the target interface, and may further determine whether the target interface is an aggregation interface.
The VLAN id may be a VLAN Tag (Tag) for identifying different VLANs.
Correspondingly, when the first device determines that the target interface is the aggregation interface, the first device may modify the outgoing interface in the first MAC forwarding table entry to another interface in the aggregation group to which the target interface belongs.
For example, the current first MAC forwarding table entry may be referred to in table (1).
Watch (1)
Destination MAC address VLAN identification Forwarding labels Outlet interface
MAC1 VLAN1 \ Polymerization group 1
In table (1), the aggregation group to which the outgoing interface corresponding to the MAC address of the outer layer destination being MAC1 and the identification of the outer layer VLAN being VLAN1 belongs is aggregation group 1, and since the current forwarding flag is "\", that is, for the packet with the MAC address of the outer layer destination being MAC1 and the identification of the outer layer VLAN being VLAN1, the first device may forward the packet through any outgoing interface in the aggregation group 1.
If the target interface is an interface corresponding to the link L12 in fig. 1, and the aggregation group 1 to which the target interface belongs further includes other interfaces, the first device may modify the first MAC forwarding table entry of the table (1) to obtain the table (2).
Watch (2)
Destination MAC address VLAN identification Forwarding labels Outlet interface
MAC1 VLAN1 Disable L12 Polymerization group 1
Based on table (2), for the packet whose outer layer destination MAC address is MAC1 and whose outer layer VLAN identifier is VLAN1, the first device does not forward the packet through the interface corresponding to link L12, and the first device may forward the packet through other interfaces in aggregation group 1, so as to avoid the second device discarding the packet due to link congestion, and further reduce the probability of network service interruption.
In addition, if the outer layer encapsulation information does not include the VLAN identifier, the first device may determine that a message sent on the ingress interface of the feature information is an untagged message, and determine the first MAC forwarding table entry according to the VLAN identifier corresponding to the message.
When the first device determines that the target interface is not the aggregation interface, the first device may modify an MAC forwarding entry for forwarding a packet matching the outer-layer destination MAC address and the outer-layer VLAN id to an equivalent entry or a backup entry of the current MAC forwarding entry (i.e., the first MAC forwarding entry).
It can be understood that, even if the target interface is an aggregation interface, but the aggregation group to which the target interface belongs does not include any other interface that is allowed to be used, that is, all the interfaces except the target interface in the aggregation group to which the target interface belongs are prohibited to be used, the first device may modify the MAC forwarding table entry for forwarding the packet matching the outer destination MAC address and the outer VLAN identifier into an equivalent table entry or a backup table entry of the first MAC forwarding table entry.
Specifically, if the target interface is not an aggregation interface, or if the target interface is an aggregation interface but the aggregation group to which the target interface belongs does not include other interfaces allowed to be used, the first device may determine whether the first MAC forwarding table entry has an equivalent table entry.
When the first device determines that the first MAC forwarding table has the equivalent table, the first device may determine the equivalent table of the first MAC forwarding table as the MAC forwarding table currently used for forwarding the packet matching the outer-layer destination MAC address and the outer-layer VLAN identifier.
When the first device determines that the first MAC forwarding entry does not have an equivalent entry, the first device may determine the backup entry of the first MAC forwarding entry as the MAC forwarding entry currently used for forwarding the packet matching the outer-layer destination MAC address and the outer-layer VLAN identifier.
In addition, the outer layer feature information may include package format information (which may be referred to as outer layer package format information), and the first device may determine whether the target interface is an aggregation interface according to the outer layer package format information.
Optionally, in the case that the source MAC address in the outer layer feature information is the MAC address of the source MAC address, S203 may include the following steps:
step one, if the encapsulation format information in the outer layer characteristic information indicates Internet Protocol (IP) encapsulation and the source IP address in the outer layer characteristic information is not the own IP address, determining an outgoing interface in the fast forwarding table item matched with the quintuple in the outer layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface.
In the embodiment of the application, when the first device determines that the outer layer source MAC address is the MAC address of the first device, the first device may obtain the outer layer encapsulation format information to determine the outer layer encapsulation format. If the outer layer characteristic information contains a destination IP address and a source IP address (which may be called an outer layer source IP address), the first device may determine that the outer layer encapsulation format is an IP encapsulation.
If the outer layer source IP address is not the own IP address, the first device may determine the outgoing interface in the fast forwarding table entry matched with the quintuple in the outer layer feature information as the target interface, and may further determine whether the target interface is the aggregation interface.
Correspondingly, when the first device determines that the target interface is the aggregation interface, the first device may modify the outgoing interface in the fast forwarding table entry matched with the quintuple in the outer layer feature information to be the other interface in the aggregation group to which the target interface belongs.
The fast forwarding table entry matched with the quintuple in the outer layer feature information is a fast forwarding table entry matched with the source IP address, the destination IP address, the source port number, the destination port number and the protocol type in the outer layer feature information.
In addition, when the first device determines that the target interface is not the aggregation interface, the first device may modify a routing table entry used for forwarding a packet matching the destination IP address (which may be referred to as an outer layer destination IP address) in the outer layer feature information to an equivalent table entry or a backup table entry of the current routing table entry (which may be referred to as a first routing table entry).
It may be understood that, even if the target interface is an aggregation interface, but the aggregation group to which the target interface belongs does not include any other interface that is allowed to be used, that is, all the interfaces except the target interface in the aggregation group to which the target interface belongs are prohibited to be used, the first device may modify the routing table entry for forwarding the packet matching with the outer-layer destination IP address into an equivalent table entry or a backup table entry of the first routing table entry.
Or, when the first device determines that there is no fast forwarding entry matching with the quintuple in the outer layer feature information, the first device may modify the routing entry for forwarding the packet matching with the outer layer destination IP address to be an equivalent entry or a backup entry of the first routing entry.
In this step, after determining the first routing table entry, the first device may determine whether the first routing table entry has an equivalent table entry.
When the first device determines that the first routing table entry has the equivalent table entry, the first device may determine the equivalent table entry of the first routing table entry as a routing table entry currently used for forwarding a message matched with the outer-layer destination IP address.
When the first device determines that the first routing table entry does not have an equivalent table entry, the first device may determine the backup table entry of the first routing table entry as a routing table entry currently used for forwarding a message matched with the outer-layer destination IP address.
And step two, if the source IP address in the outer layer characteristic information is the IP address of the source IP address, and the characteristic information comprises inner layer characteristic information when the first message is subjected to inner layer encapsulation, judging whether the interface currently used for forwarding the target message is an aggregation interface or not according to the inner layer characteristic information.
In the application embodiment, if the outer layer source IP address is the IP address of the first device, the first device may determine whether the feature information includes inner layer feature information when performing inner layer encapsulation on the first packet. When the first device determines that the feature information includes the inner layer feature information, the first device may determine, according to the inner layer feature information, whether an interface currently used for forwarding the target packet is an aggregation interface. Specifically, it will be described in detail in the following examples.
Optionally, in a case that the outer layer source MAC address is the MAC address of the source MAC address, S203 may include the following steps:
if the encapsulation format information in the outer layer feature information indicates Multi-Protocol Label Switching (MPLS) encapsulation, determining an outgoing interface in an MPLS forwarding table item matched with a destination MAC address and an MPLS outgoing Label in the outer layer feature information as an interface currently used for forwarding a target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface.
In the embodiment of the application, if the outer layer source MAC address is the own MAC address and the outer layer characteristic information includes an MPLS outgoing label (which may be referred to as an outer MPLS outgoing label), the first device may determine that the outer layer encapsulation format is MPLS encapsulation. The first device may determine an MPLS forwarding entry (which may be referred to as a first MPLS forwarding entry) that matches the outer MPLS outgoing label and the outer destination MAC address. The first device may determine an outgoing interface in the first MPLS forwarding entry as a target interface, and may further determine whether the target interface is an aggregation interface.
Correspondingly, if the target interface is an aggregation interface, the first MPLS forwarding entry has an equivalent entry and/or a backup entry. The first device may modify an MPLS forwarding entry used for forwarding a packet matching the outer MPLS outgoing label and the outer destination MAC address into an equivalent entry or a backup entry of the first MPLS forwarding entry.
In this step, after determining the first MPLS forwarding entry, the first device may determine whether the first MPLS forwarding entry has an equivalent entry.
When the first device determines that the first MPLS forwarding entry has an equivalent entry, the first device may determine the equivalent entry of the first MPLS forwarding entry as an MPLS forwarding entry currently used for forwarding a packet matching the outer MPLS outgoing label and the outer destination MAC address.
When the first device determines that the first MPLS forwarding entry does not have an equivalent entry, the first device may determine the backup entry of the first MPLS forwarding entry as an MPLS forwarding entry currently used for forwarding a packet matching the outer MPLS outgoing label and the outer destination MAC address.
Optionally, the inner layer feature information may include a VPN (Virtual Private Network) identifier.
When a source MAC address (which may be referred to as an inner layer source MAC address) in the inner layer feature information is not an own MAC address, the first device determines, according to the inner layer feature information, whether an interface currently used for forwarding the target packet is an aggregation interface, which may include the following steps:
and determining an outgoing interface in the MAC forwarding table matched with the destination MAC address and the VPN identification in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface.
The VPN identifier may be a VPN ID, and if VXLAN encapsulation exists in the inner layer, that is, VXLAN ID is carried in the inner layer feature information, the first device may determine the VPN identifier according to the VXLAN ID; if the inner layer has a GRE (Generic Routing Encapsulation protocol) Encapsulation, that is, the inner layer feature information carries a GRE Key, the first device may determine the VPN identifier according to the GRE Key.
In the application embodiment, after acquiring the inner layer feature information, the first device may acquire the inner layer source MAC address, and then the first device may determine whether the inner layer source MAC address is its own MAC address.
When the first device determines that the inner layer source MAC address is not the MAC address of the first device, the first device may obtain the VPN identifier, determine an outgoing interface in an MAC forwarding table (which may be referred to as a second MAC forwarding table) that matches the destination MAC address (which may be referred to as an inner layer destination MAC address) and the VPN identifier in the inner layer feature information as a target interface, and may further determine whether the target interface is an aggregation interface.
Correspondingly, when the first device determines that the target interface is the aggregation interface, the first device may modify the outgoing interface in the second MAC forwarding table entry to another interface in the aggregation group to which the target interface belongs.
In addition, when the first device determines that the target interface is not the aggregation interface, the first device may modify an MAC forwarding entry for forwarding a packet matching the inner-layer destination MAC address and the VPN identifier to an equivalent entry or a backup entry of the current MAC forwarding entry (i.e., a second MAC forwarding entry).
It can be understood that, even if the target interface is an aggregation interface, but the aggregation group to which the target interface belongs does not include any other interface that is allowed to be used, that is, all the interfaces except the target interface in the aggregation group to which the target interface belongs are prohibited to be used, the first device may modify the MAC forwarding table entry for forwarding the packet matching the inner-layer destination MAC address and the VPN identifier to an equivalent table entry or a backup table entry of the second MAC forwarding table entry.
Specifically, if the target interface is not an aggregation interface, or if the target interface is an aggregation interface but the aggregation group to which the target interface belongs does not include other interfaces allowed to be used, the first device may determine whether an equivalent entry exists in the second MAC forwarding entry.
When the first device determines that the second MAC forwarding table has the equivalent table, the first device may determine the equivalent table of the second MAC forwarding table as the MAC forwarding table currently used for forwarding the packet matching the inner-layer destination MAC address and the VPN identifier.
When the first device determines that the second MAC forwarding table does not have an equivalent table, the first device may determine the backup table of the second MAC forwarding table as the MAC forwarding table currently used for forwarding the packet matching the inner-layer destination MAC address and the VPN identifier.
Optionally, the inner layer feature information may include package format information (which may be referred to as inner layer package format information), and the first device may determine whether the target interface is an aggregation interface according to the inner layer package format information.
When the inner-layer source MAC address is the MAC address of the first device, the first device determines whether the interface currently used for forwarding the target packet is an aggregation interface according to the inner-layer feature information, which may include the following two cases:
in case one, when the encapsulation format information in the inner layer feature information indicates IP encapsulation, the output interface in the fast forwarding table entry that matches the quintuple in the inner layer feature information is determined as the interface currently used for forwarding the target packet, and it is determined whether the interface currently used for forwarding the target packet is an aggregation interface.
In the embodiment of the application, if the inner layer source MAC address is the MAC address of the inner layer source MAC address, and the inner layer characteristic information includes the destination IP address and the source IP address, that is, the inner layer encapsulation format information indicates IP encapsulation. The first device may determine the outgoing interface in the fast forwarding table entry matched with the quintuple in the inner layer feature information as the target interface, and may further determine whether the target interface is the aggregation interface.
Correspondingly, when the first device determines that the target interface is the aggregation interface, the first device may modify the outgoing interface in the fast forwarding table entry matched with the quintuple in the inner layer feature information to be the other interface in the aggregation group to which the target interface belongs.
The fast forwarding table entry matched with the quintuple in the inner layer feature information is a fast forwarding table entry matched with the source IP address, the destination IP address, the source port number, the destination port number and the protocol type in the inner layer feature information.
In addition, when the first device determines that the target interface is not the aggregation interface, the first device may modify a routing table entry used for forwarding a packet matching the destination IP address (may be referred to as an inner-layer destination IP address) in the inner-layer feature information to an equivalent table entry or a backup table entry of the current routing table entry (may be referred to as a second routing table entry).
It may be understood that, even if the target interface is an aggregation interface, but the aggregation group to which the target interface belongs does not include any other interface that is allowed to be used, that is, all the interfaces except the target interface in the aggregation group to which the target interface belongs are prohibited to be used, the first device may modify the routing table entry for forwarding the packet matching with the inner layer destination IP address to be an equivalent table entry or a backup table entry of the second routing table entry.
Or, when the first device determines that there is no fast forwarding entry matching with the quintuple in the inner layer feature information, the first device may modify the routing entry for forwarding the packet matching with the inner layer destination IP address to an equivalent entry or a backup entry of the second routing entry.
In this step, after determining the second routing table entry, the first device may determine whether the second routing table entry has an equivalent table entry.
When the first device determines that the second routing table entry has the equivalent table entry, the first device may determine the equivalent table entry of the second routing table entry as the current routing table entry for forwarding the packet matching with the inner-layer destination IP address.
When the first device determines that the second routing table entry does not have an equivalent table entry, the first device may determine the backup table entry of the second routing table entry as the current routing table entry for forwarding the packet matching with the inner-layer destination IP address.
And in the second case, when the encapsulation format information in the inner layer characteristic information indicates the MPLS encapsulation, determining the outgoing interface of the MPLS forwarding table item matched with the destination MAC address and the MPLS outgoing label in the inner layer characteristic information as the current interface for forwarding the target message, and judging whether the current interface for forwarding the target message is an aggregation interface.
In the embodiment of the application, if the inner layer feature information includes an MPLS out label (which may be referred to as an inner layer MPLS out label), the first device may determine that the inner layer encapsulation format is an MPLS encapsulation. The first device may determine an MPLS forwarding entry (which may be referred to as a second MPLS forwarding entry) that matches the inner MPLS outgoing label and the inner destination MAC address. The first device may determine the outgoing interface in the second MPLS forwarding entry as the target interface, and may further determine whether the target interface is an aggregation interface.
Correspondingly, if the target interface is an aggregation interface, the second MPLS forwarding entry has an equivalent entry and/or a backup entry. The first device may modify an MPLS forwarding entry used for forwarding a packet matching the inner MPLS outgoing label and the inner destination MAC address into an equivalent entry or a backup entry of the second MPLS forwarding entry.
In this step, after determining the second MPLS forwarding entry, the first device may determine whether the second MPLS forwarding entry has an equivalent entry.
When the first device determines that the second MPLS forwarding entry has the equivalent entry, the first device may determine the equivalent entry of the second MPLS forwarding entry as the MPLS forwarding entry currently used for forwarding the packet matching the inner-layer MPLS outgoing label and the inner-layer destination MAC address.
When the first device determines that the second MPLS forwarding entry does not have an equivalent entry, the first device may determine the backup entry of the second MPLS forwarding entry as the MPLS forwarding entry currently used for forwarding the packet matching the inner MPLS outgoing label and the inner destination MAC address.
In addition, when the outer source IP address is the IP address of the first device and the feature information does not include the inner feature information, the first device may modify the tunnel used for forwarding the packet matching with the outer feature information into a backup tunnel of the current tunnel.
In this step, if the outer layer source IP address is the own IP address and the characteristic information does not include the inner layer characteristic information, the first device may determine a tunnel (i.e., a target tunnel) that matches the outer layer source IP address and the outer layer destination IP address. If the target tunnel has a backup tunnel, the first device may determine the backup tunnel of the target tunnel as a tunnel currently used for forwarding a packet matching the outer-layer destination IP address.
Referring to fig. 3, fig. 3 is a method for adjusting a forwarding path according to an embodiment of the present application, where the method may be applied to a downstream device, and the method may include the following steps:
s301: a first message received from an upstream device that causes a link to be congested is determined.
The downstream device may be the second device in the above embodiment, and the upstream device of the second device may be the first device.
In the application embodiment, the second device may receive the packet forwarded by the first device, and perform forwarding processing on the received packet. When the second device detects that the link between the second device and the downstream device of the second device is congested, the second device may determine a packet (i.e., the first packet) causing the link congestion.
S302: feature information is extracted from the first message.
In the embodiment of the application, after determining the first packet causing the link congestion, the second device may extract, from the first packet, the feature information when encapsulating the first packet.
The characteristic information may include outer layer encapsulation information when performing outer layer encapsulation, and may also include inner layer encapsulation information when performing inner layer encapsulation.
S303: and sending the characteristic information to the upstream equipment through the interface for receiving the first message, so that the upstream equipment determines a target message matched with the characteristic information according to the characteristic information, and modifies the interface for forwarding the target message into other interfaces in the aggregation group to which the current interface belongs.
In the application embodiment, after extracting the feature information of the first packet, the second device may send the feature information to the first device through the interface that receives the first packet.
In this step, the second device may add the characteristic information to the protocol packet and send the protocol packet carrying the characteristic information to the first device, or the second device may also directly generate a packet carrying the characteristic information and send the packet to the first device.
Accordingly, after the first device receives the feature information of the first packet, the first device may determine a packet (i.e., a target packet) matched with the feature information, and modify an interface for forwarding the target packet to another interface in an aggregation group to which the current interface belongs, which may specifically refer to the detailed description of the foregoing embodiment.
In addition, before transmitting the feature information to the first device, the method may further include the steps of:
step one, determining a forwarding table entry for forwarding the first message as a target forwarding table entry.
In the embodiment of the application, after determining the first packet, the second device may determine a forwarding table (i.e., a target forwarding table) for forwarding the first packet, where the target forwarding table may be an MAC forwarding table, an MPLS forwarding table, or a routing table.
And step two, if the target forwarding table item does not have an equivalent table item and a backup table item, sending the characteristic information to the first equipment through an interface for receiving the first message.
In the application embodiment, if the target forwarding table entry does not have an equivalent table entry nor a backup table entry, the second device may send the feature information to the first device through the interface for receiving the first packet, so that the first device adjusts the forwarding path for forwarding the target packet according to the feature information.
And step three, if the target forwarding table item has an equivalent table item and/or a backup table item, modifying the forwarding table item used for forwarding the message matched with the characteristic information into the equivalent table item or the backup table item of the target forwarding table item.
In the embodiment of the application, if the target forwarding table entry has the equivalent table entry and/or the backup table entry, the second device may modify the forwarding table entry for forwarding the message matched with the feature information into the equivalent table entry or the backup table entry of the target forwarding table entry, and then the second device may forward the message matched with the feature information according to the modified forwarding table entry, so that the message may be prevented from passing through an originally congested link, and the probability of network service interruption is reduced.
In this step, the second device may determine whether the target forwarding table has an equivalent table.
When the second device determines that the equivalent table exists in the target forwarding table, the second device may determine the equivalent table of the target forwarding table as a forwarding table currently used for forwarding the packet matching with the feature information.
When the second device determines that the equivalent table does not exist in the target forwarding table, the second device may determine the backup table of the target forwarding table as the forwarding table currently used for forwarding the message matched with the feature information.
Based on the method of the embodiment of the present application, the upstream device may receive the feature information of the first packet that causes link congestion, determine the target packet that matches the feature information, and if the current interface used for forwarding the target packet is an aggregation interface, the upstream device may modify the interface used for forwarding the target packet to another interface in an aggregation group to which the current interface belongs. Based on the above processing, the upstream device may forward the target packet through other interfaces in the aggregation group to which the current interface belongs, so that the target packet no longer passes through the originally congested link, and the probability of network service interruption may be reduced.
Referring to fig. 4, fig. 4 is a flowchart of an example of a method for adjusting a forwarding path according to an embodiment of the present application, where the method is described by taking SW1 applied to fig. 1 as an example, and the method may include the following steps:
s401: the characteristic information of the first packet transmitted by the SR2 is received through L12.
The first message is the message causing the link congestion determined by SR 2.
The characteristic information can be referred to table (3).
Watch (3)
Figure BDA0001924813520000191
Figure BDA0001924813520000201
S402: determines the outer source MAC address (i.e., MAC-SW1) to be its own MAC address and determines the outer encapsulation format to be IP encapsulation.
S403: determines that the outer layer source IP address (i.e., IP-SW1) is its own IP address and determines that the characteristic information includes inner layer characteristic information.
S404: and judging that the inner layer source MAC address (namely the MAC-user1) is not the MAC address of the inner layer source MAC address, and determining a target MAC forwarding table entry corresponding to the inner layer destination MAC address (namely the MAC-user2) and VXLAN ID.
The target MAC forwarding table entry corresponding to the inner layer destination MAC address and VXLAN ID may be referred to in table (4).
Watch (4)
Destination MAC address VXLAN ID Forwarding labels Outlet interface
MAC-user2 3 \ Polymerization group 1
S405: the aggregation group (i.e., aggregation group 1) to which the outgoing interface in the target MAC forwarding table entry belongs is determined to further include other allowed interfaces.
S406: and modifying the forwarding mark in the target MAC forwarding table entry into a forbidden L12 so as to complete the adjustment of the forwarding path of the message matched with the characteristic information.
Based on the same inventive concept, referring to fig. 5, fig. 5 is a device for adjusting a forwarding path provided in an embodiment of the present application, where the device is applied to a network device, and the device includes:
a receiving module 501, configured to receive feature information of a first packet, where the first packet is a packet that causes link congestion and is determined by a downstream device of the network device, and the feature information includes outer layer feature information when the first packet is subjected to outer layer encapsulation;
a determining module 502, configured to determine a target packet matched with the feature information;
a determining module 503, configured to determine whether an interface currently used for forwarding the target packet is an aggregation interface;
an adjusting module 504, configured to modify, if the current interface for forwarding the target packet is an aggregation interface, the interface for forwarding the target packet to another interface in an aggregation group to which the current interface belongs.
Optionally, the determining module 503 is specifically configured to determine, when the source MAC address in the outer layer characteristic information is not the MAC address of the source MAC address, an outgoing interface in an MAC forwarding table matched with the destination MAC address and the VLAN id in the outer layer characteristic information as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
Optionally, the determining module 503 is specifically configured to, when the source MAC address in the outer layer feature information is the MAC address of the source MAC address, and the encapsulation format information in the outer layer feature information indicates IP encapsulation, determine, if the source IP address in the outer layer feature information is not the IP address of the source MAC address, an outgoing interface in the fast forwarding table entry that matches the quintuple in the outer layer feature information as an interface currently used for forwarding the target packet, and determine whether an interface currently used for forwarding the target packet is an aggregation interface;
and if the source IP address in the outer layer characteristic information is the IP address of the source IP address, and the characteristic information comprises inner layer characteristic information when the first message is subjected to inner layer encapsulation, judging whether an interface currently used for forwarding the target message is an aggregation interface or not according to the inner layer characteristic information.
Optionally, the determining module 503 is specifically configured to, when the source MAC address in the outer layer feature information is the MAC address of the source MAC address, determine, if the encapsulation format information in the outer layer feature information indicates multi-protocol label switching MPLS encapsulation, an outgoing interface in an MPLS forwarding table matched with the destination MAC address and the MPLS outgoing label in the outer layer feature information as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
Optionally, the determining module 503 is specifically configured to determine, when the source MAC address in the inner layer feature information is not the MAC address of the source MAC address, an outgoing interface in an MAC forwarding table entry that matches the destination MAC address in the inner layer feature information and the virtual private network VPN identifier as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
Optionally, the determining module 503 is specifically configured to, in a case that a source MAC address in the inner layer feature information is an own MAC address, determine, if encapsulation format information in the inner layer feature information indicates IP encapsulation, an outgoing interface in a fast forwarding table entry that matches a quintuple in the inner layer feature information as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface;
if the packaging format information in the inner layer characteristic information indicates MPLS packaging, determining an outgoing interface of an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
Referring to fig. 6, fig. 6 is a device for adjusting a forwarding path, which is provided in an embodiment of the present application and is applied to a downstream device, where the device includes:
a determining module 601, configured to determine a first packet received from an upstream device and causing link congestion;
an extracting module 602, configured to extract feature information from the first packet, where the feature information includes outer layer feature information when the first packet is subjected to outer layer encapsulation;
a sending module 603, configured to send the feature information to the upstream device through the interface that receives the first packet, so that the upstream device determines, according to the feature information, a target packet that matches the feature information, and modifies the interface that is used for forwarding the target packet to another interface in the aggregation group to which the current interface belongs.
The embodiment of the present application further provides an electronic device, as shown in fig. 7, which includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 1002, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
a processor 701, configured to, when executing the program stored in the memory 703, cause the electronic device to perform the steps of a method for adjusting a forwarding path, the method including:
receiving feature information of a first message, wherein the first message is a message which is determined by downstream equipment of the network equipment and causes link congestion, and the feature information comprises outer layer feature information when the first message is subjected to outer layer encapsulation;
determining a target message matched with the characteristic information;
judging whether the current interface for forwarding the target message is an aggregation interface;
and if the current interface for forwarding the target message is an aggregation interface, modifying the interface for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs.
Optionally, the determining whether the interface currently used for forwarding the target packet is an aggregation interface includes:
and under the condition that the source Media Access Control (MAC) address in the outer characteristic information is not the MAC address of the source Media Access Control (MAC) address, determining an outgoing interface in an MAC forwarding table matched with a target MAC address and a Virtual Local Area Network (VLAN) identifier in the outer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
Optionally, the determining whether the interface currently used for forwarding the target packet is an aggregation interface includes:
if the source IP address in the outer layer characteristic information is not the IP address of the source MAC address and the encapsulation format information in the outer layer characteristic information represents the IP encapsulation of the internet protocol, determining an outlet interface in a fast forwarding table matched with a quintuple in the outer layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface;
and if the source IP address in the outer layer characteristic information is the IP address of the source IP address, and the characteristic information comprises inner layer characteristic information when the first message is subjected to inner layer encapsulation, judging whether an interface currently used for forwarding the target message is an aggregation interface or not according to the inner layer characteristic information.
Optionally, the determining whether the interface currently used for forwarding the target packet is an aggregation interface includes:
and under the condition that the source MAC address in the outer layer characteristic information is the MAC address of the source MAC address, if the encapsulation format information in the outer layer characteristic information represents multi-protocol label switching (MPLS) encapsulation, determining an outgoing interface in an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the outer layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
Optionally, the determining, according to the inner layer feature information, whether an interface currently used for forwarding the target packet is an aggregation interface includes:
and under the condition that the source MAC address in the inner layer characteristic information is not the MAC address of the source MAC address, determining an output interface in an MAC forwarding table matched with a destination MAC address and a Virtual Private Network (VPN) identifier in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
Optionally, the determining, according to the inner layer feature information, whether an interface currently used for forwarding the target packet is an aggregation interface includes:
under the condition that the source MAC address in the inner layer characteristic information is the MAC address of the source MAC address, if the packaging format information in the inner layer characteristic information represents IP packaging, determining an output interface in a fast forwarding table item matched with a quintuple in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not;
if the packaging format information in the inner layer characteristic information indicates MPLS packaging, determining an outgoing interface of an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
The embodiment of the present application further provides an electronic device, as shown in fig. 8, which includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete mutual communication through the communication bus 804,
a memory 803 for storing a computer program;
a processor 801, configured to execute the program stored in the memory 803, so as to enable the electronic device to perform the steps of the method for adjusting the forwarding path, the method includes:
determining a first message received from an upstream device and causing link congestion;
extracting feature information from the first message, wherein the feature information comprises outer layer feature information when the first message is subjected to outer layer packaging;
and sending the characteristic information to the upstream equipment through an interface for receiving the first message, so that the upstream equipment determines a target message matched with the characteristic information according to the characteristic information, and modifies an interface for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above methods for adjusting a forwarding path.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described methods of adjusting forwarding paths.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (16)

1. A method for adjusting forwarding paths, the method being applied to a network device, the method comprising:
receiving feature information of a first message, wherein the first message is a message which is determined by downstream equipment of the network equipment and causes link congestion, and the feature information comprises outer layer feature information when the first message is subjected to outer layer encapsulation;
determining a target message matched with the characteristic information;
judging whether the current interface for forwarding the target message is an aggregation interface;
and if the current interface for forwarding the target message is an aggregation interface, modifying the interface for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs.
2. The method of claim 1, wherein the determining whether the interface currently used for forwarding the target packet is an aggregation interface comprises:
and under the condition that the source Media Access Control (MAC) address in the outer characteristic information is not the MAC address of the source Media Access Control (MAC) address, determining an outgoing interface in an MAC forwarding table matched with a target MAC address and a Virtual Local Area Network (VLAN) identifier in the outer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
3. The method of claim 1, wherein the determining whether the interface currently used for forwarding the target packet is an aggregation interface comprises:
if the source IP address in the outer layer characteristic information is not the IP address of the source MAC address and the encapsulation format information in the outer layer characteristic information represents the IP encapsulation of the internet protocol, determining an outlet interface in a fast forwarding table matched with a quintuple in the outer layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface;
and if the source IP address in the outer layer characteristic information is the IP address of the source IP address, and the characteristic information comprises inner layer characteristic information when the first message is subjected to inner layer encapsulation, judging whether an interface currently used for forwarding the target message is an aggregation interface or not according to the inner layer characteristic information.
4. The method of claim 1, wherein the determining whether the interface currently used for forwarding the target packet is an aggregation interface comprises:
and under the condition that the source MAC address in the outer layer characteristic information is the MAC address of the source MAC address, if the encapsulation format information in the outer layer characteristic information represents multi-protocol label switching (MPLS) encapsulation, determining an outgoing interface in an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the outer layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
5. The method according to claim 3, wherein the determining whether the interface currently used for forwarding the target packet is an aggregation interface according to the inner layer feature information includes:
and under the condition that the source MAC address in the inner layer characteristic information is not the MAC address of the source MAC address, determining an output interface in an MAC forwarding table matched with a destination MAC address and a Virtual Private Network (VPN) identifier in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
6. The method according to claim 3, wherein said determining, according to the inner layer feature information, whether an interface currently used for forwarding the target packet is an aggregation interface comprises:
under the condition that the source MAC address in the inner layer characteristic information is the MAC address of the source MAC address, if the packaging format information in the inner layer characteristic information represents IP packaging, determining an output interface in a fast forwarding table item matched with a quintuple in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not;
if the packaging format information in the inner layer characteristic information indicates MPLS packaging, determining an outgoing interface of an MPLS forwarding table item matched with a target MAC address and an MPLS outgoing label in the inner layer characteristic information as an interface currently used for forwarding the target message, and judging whether the interface currently used for forwarding the target message is an aggregation interface or not.
7. A method for adjusting forwarding paths, the method being applied to a downstream device, the method comprising:
determining a first message received from an upstream device and causing link congestion;
extracting feature information from the first message, wherein the feature information comprises outer layer feature information when the first message is subjected to outer layer packaging;
and sending the characteristic information to the upstream equipment through an interface for receiving the first message, so that the upstream equipment determines a target message matched with the characteristic information according to the characteristic information, and modifies an interface for forwarding the target message into other interfaces in an aggregation group to which the current interface belongs.
8. An apparatus for adjusting forwarding paths, the apparatus being applied to a network device, the apparatus comprising:
a receiving module, configured to receive feature information of a first packet, where the first packet is a packet that causes link congestion and is determined by a downstream device of the network device, and the feature information includes outer layer feature information when the first packet is subjected to outer layer encapsulation;
the determining module is used for determining the target message matched with the characteristic information;
the judging module is used for judging whether the interface currently used for forwarding the target message is an aggregation interface;
and the adjusting module is used for modifying the interface for forwarding the target message into other interfaces in the aggregation group to which the current interface belongs if the current interface for forwarding the target message is the aggregation interface.
9. The apparatus according to claim 8, wherein the determining module is specifically configured to determine, when the source MAC address in the outer layer characteristic information is not the MAC address of the source MAC address, an outgoing interface in the MAC forwarding table entry that matches the destination MAC address and the VLAN id in the outer layer characteristic information as an interface currently used for forwarding the target packet, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
10. The apparatus according to claim 8, wherein the determining module is specifically configured to, if the source MAC address in the outer layer feature information is a self MAC address and the encapsulation format information in the outer layer feature information indicates IP encapsulation, determine an outgoing interface in the fast forwarding table entry that matches the quintuple in the outer layer feature information as an interface currently used for forwarding the target packet and determine whether the interface currently used for forwarding the target packet is an aggregation interface if the source IP address in the outer layer feature information is not a self IP address;
and if the source IP address in the outer layer characteristic information is the IP address of the source IP address, and the characteristic information comprises inner layer characteristic information when the first message is subjected to inner layer encapsulation, judging whether an interface currently used for forwarding the target message is an aggregation interface or not according to the inner layer characteristic information.
11. The apparatus according to claim 8, wherein the determining module is specifically configured to, if the source MAC address in the outer layer characteristic information is the own MAC address, determine, as the interface currently used for forwarding the target packet, an outgoing interface in an MPLS forwarding table entry that matches the destination MAC address and the MPLS outgoing label in the outer layer characteristic information if the encapsulation format information in the outer layer characteristic information indicates MPLS encapsulation, and determine whether the interface currently used for forwarding the target packet is an aggregation interface.
12. An apparatus for adjusting forwarding paths, the apparatus being applied to a downstream device, the apparatus comprising:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a first message which is received from upstream equipment and causes link congestion;
an extraction module, configured to extract feature information from the first packet, where the feature information includes outer layer feature information when the first packet is subjected to outer layer encapsulation;
and the sending module is used for sending the characteristic information to the upstream equipment through the interface for receiving the first message, so that the upstream equipment determines a target message matched with the characteristic information according to the characteristic information, and modifies the interface for forwarding the target message into other interfaces in the aggregation group to which the current interface belongs.
13. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, implementing the method steps of any of claims 1-6.
14. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, performs the method steps of claim 7.
15. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 6.
16. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implementing the method steps of claim 7.
CN201811611323.9A 2018-12-27 2018-12-27 Method and device for adjusting forwarding path Active CN109525501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811611323.9A CN109525501B (en) 2018-12-27 2018-12-27 Method and device for adjusting forwarding path

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811611323.9A CN109525501B (en) 2018-12-27 2018-12-27 Method and device for adjusting forwarding path

Publications (2)

Publication Number Publication Date
CN109525501A CN109525501A (en) 2019-03-26
CN109525501B true CN109525501B (en) 2022-05-24

Family

ID=65797042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811611323.9A Active CN109525501B (en) 2018-12-27 2018-12-27 Method and device for adjusting forwarding path

Country Status (1)

Country Link
CN (1) CN109525501B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113260B (en) * 2019-04-28 2021-07-06 新华三技术有限公司 Forwarding table updating method and device
CN110365578B (en) * 2019-08-01 2021-12-24 新华三大数据技术有限公司 Network interface control and link switching method, device, network equipment and medium
CN111865795B (en) * 2020-06-10 2022-11-18 新华三技术有限公司 Control method and device
CN113965462A (en) * 2020-06-29 2022-01-21 中兴通讯股份有限公司 Service transmission method, device, network equipment and storage medium
CN116192777A (en) * 2022-12-30 2023-05-30 中国联合网络通信集团有限公司 Path learning method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102263697A (en) * 2011-08-03 2011-11-30 杭州华三通信技术有限公司 Method and device for sharing aggregated link traffic
CN102394814A (en) * 2011-10-27 2012-03-28 福建星网锐捷网络有限公司 Method and equipment for processing congestion notification message
CN103428103A (en) * 2013-08-08 2013-12-04 杭州华三通信技术有限公司 Link load control method and stacking device
CN104092604A (en) * 2014-07-02 2014-10-08 杭州华三通信技术有限公司 Message transmission control method and device
CN105827495A (en) * 2016-01-05 2016-08-03 杭州华三通信技术有限公司 Message forwarding method and device for VXLAN gateway

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012130264A1 (en) * 2011-03-29 2012-10-04 Nec Europe Ltd. User traffic accountability under congestion in flow-based multi-layer switches
US8995277B2 (en) * 2012-10-30 2015-03-31 Telefonaktiebolaget L M Ericsson (Publ) Method for dynamic load balancing of network flows on LAG interfaces
US10715446B2 (en) * 2016-09-12 2020-07-14 Huawei Technologies Co., Ltd. Methods and systems for data center load balancing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102263697A (en) * 2011-08-03 2011-11-30 杭州华三通信技术有限公司 Method and device for sharing aggregated link traffic
CN102394814A (en) * 2011-10-27 2012-03-28 福建星网锐捷网络有限公司 Method and equipment for processing congestion notification message
CN103428103A (en) * 2013-08-08 2013-12-04 杭州华三通信技术有限公司 Link load control method and stacking device
CN104092604A (en) * 2014-07-02 2014-10-08 杭州华三通信技术有限公司 Message transmission control method and device
CN105827495A (en) * 2016-01-05 2016-08-03 杭州华三通信技术有限公司 Message forwarding method and device for VXLAN gateway

Also Published As

Publication number Publication date
CN109525501A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN109525501B (en) Method and device for adjusting forwarding path
US11374848B2 (en) Explicit routing with network function encoding
US9923815B2 (en) Network based service function chaining on top of rack switches
US9391906B2 (en) Overlay network priority inheritance
CN110022264B (en) Method for controlling network congestion, access device and computer readable storage medium
CN109218200B (en) Message processing method and device
US10212095B2 (en) Maximum transmission unit installation for switches in a software-defined network
US10187290B2 (en) Method, system, and apparatus for preventing tromboning in inter-subnet traffic within data center architectures
US20210328860A1 (en) Operation, Administration, and Maintenance IOAM Packet Transmission Method and Related Apparatus
WO2018149338A1 (en) Sdn-based remote stream mirroring control method, implementation method, and related device
CN113452594B (en) Inner layer message matching method and device of tunnel message
US11805049B2 (en) Communication method and communications device
CN110768884B (en) VXLAN message encapsulation and policy execution method, equipment and system
EP3534571B1 (en) Service packet transmission method, and node apparatus
US10243884B2 (en) Packet transmission method and apparatus
US8422504B2 (en) Network switch port aggregation
CN109067657B (en) Message processing method and device
WO2022028342A1 (en) Method for processing congestion flow and device
WO2020155941A1 (en) Message scheduling method, related device, and computer storage medium
CN109831378B (en) Message timeout response method and device
US20220400408A1 (en) Application identification and path selection at a wireless access point for local network traffic breakout
CN113507414B (en) Message processing method and device
US11606719B2 (en) Application identification and path selection at a wireless access point for local network traffic breakout
CN104702505A (en) Message transmission method and node
CN116668375B (en) Message distribution method, device, network equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230612

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.