Disclosure of Invention
The embodiment of the invention provides a method for realizing explicit congestion notification, which effectively relieves the congestion of network equipment in an MPLS network.
A method for realizing explicit congestion notification is applied to service provider edge equipment (PE); the method comprises the following steps:
PE equipment receives a message which is forwarded by user edge equipment and contains an IP header, wherein the IP header contains an identifier supporting Explicit Congestion Notification (ECN);
and if the PE equipment determines that the equipment is in a congestion state, the received message is packaged into a multi-protocol label switching (MPLS) message, and an ECN label with a network congestion identifier is arranged at the bottom of a label stack of the MPLS message.
The embodiment of the invention also provides a method for realizing the explicit congestion notification, which effectively relieves the congestion of network equipment in the MPLS network.
A method for realizing explicit congestion notification is applied to service provider equipment P; the method comprises the following steps:
the P equipment receives a multi-protocol label switching (MPLS) message forwarded by service provider edge equipment (PE);
and the P equipment determines that the equipment is in a congestion state, and the ECN label at the bottom of the MPLS message label stack is provided with a network non-congestion identifier, sets the ECN label at the bottom of the received MPLS message label stack with a network congestion identifier, and performs public network label switching processing.
The embodiment of the invention also provides the service provider edge equipment PE and the service provider equipment P for realizing the explicit congestion notification, and the congestion of the network equipment is effectively relieved in the MPLS network.
A service provider edge device, PE, implementing explicit congestion notification, the device comprising:
a first receiving unit, configured to receive a packet that is forwarded by a user edge device and includes an IP header, where the IP header includes an identifier that supports an explicit congestion notification ECN;
the first detection unit is used for detecting whether the first detection unit is in a congestion state and sending a detection result to the encapsulation processing unit;
the encapsulation processing unit is used for encapsulating the message which contains the IP header and is received by the first receiving unit into a multi-protocol label switching (MPLS) message of which the bottom of a label stack is added with an ECN label according to the congestion detection result and sending the message to the forwarding unit;
and the first forwarding unit is used for forwarding the MPLS message to service provider equipment P or other PEs.
A service provider device P implementing explicit congestion notification, the device comprising:
a receiving unit, configured to receive a multi-protocol label switching MPLS packet with an explicit congestion notification ECN label added to the bottom of a label stack;
the detection unit is used for detecting whether the mobile terminal is in a congestion state and sending a detection result to the processing unit;
the processing unit is used for processing an ECN label and switching a public network label of the MPLS message according to the congestion detection result and then sending the MPLS message to the forwarding unit;
and the forwarding unit is used for forwarding the processed MPLS message to the PE.
The embodiment of the invention realizes ECN in the MPLS network, the source end PE supports ECN through the encapsulated stack bottom label, when the far end PE is de-encapsulated, the ECN identification of the stack bottom label is mapped to the head of the original IP message and forwarded to the receiving end, therefore, when any network equipment in the MPLS network is congested, the receiving end can inform the congestion to the sending end, and the sending end reduces the sending rate before the network equipment starts to lose the packet.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and examples.
In the MPLS network, a packet is sent based on an IP packet by adding a packet header of MPLS to form an MPLS packet and transmitting the MPLS packet in the MPLS network, that is, the packet is labeled and forwarded according to the label. When transmitting the MPLS packet in the MPLS network, the source PE and the remote PE need to encapsulate the data packet into the MPLS packet and decapsulate the MPLS packet into the data packet, respectively. Further, on the basis of the MPLS network, a private network is constructed, and a plurality of private lans having different geographical locations are interconnected to form a private network: a multi-protocol label switching-virtual private network (MPLS VPN), is an IP-VPN based on MPLS technology, where different VPNs are connected together through a service provider network, each VPN connected to a PE in the service provider network through a customer edge device, where P devices may exist between different PE devices. According to the type division of the bearer message, the VPNs are divided into a two-layer VPN (L2 VPN) and a three-layer VPN (L3 VPN), the VPN carrying the two-layer link message belongs to a L2 VPN, and the VPN carrying the three-layer IP message belongs to a L3 VPN.
The present invention will be described below with respect to a scheme for implementing explicit network congestion in an MPLS network, by taking, as an example, an encapsulation transmission process of an IP packet in an MPLS L2 VPN and an MPLS L3VPN network.
Example one
This embodiment takes the encapsulation transmission process of the IP packet in the MPLS L2 VPN network as an example.
In this embodiment, a service provider edge (PE, ProviderEdge) serving as a source end of an MPLS tunnel encapsulates a received IP packet with an MPLS packet, and then, after a P label switching of a service provider device in the tunnel, a PE at a far end of the tunnel decapsulates the MPLS packet that has undergone the label switching to obtain an original IP packet and sends the original IP packet to a receiving end. There may be a plurality of P devices as forwarding paths in tunnels in the service provider network system.
Fig. 2 shows the format of the MPLS L2 VPN packet after encapsulating the original IP packet. The MPLS label message header consists of 32 bits and is positioned between the user layer 2 header and the network layer 2 header. MPLS supports a layered structure of labels, i.e., multiple labels, which is implemented by aggregating labels into a label stack. In theory, the label stacks can be nested indefinitely, providing unlimited business support capabilities, typically 2 to 3 layers. Only one MPLS label header is shown in the above figures. In the prior art, if the label is an MPLS network, the MPLS label is a public network label if only one MPLS label is encapsulated; in the case of an MPLS L2 VPN network, there are two layers of labels, an outer public network label and an inner private network label.
The MPLS label packet header structure includes 4 fields: a Label value (Label), a test bit (EXP), a bottom of stack identification bit (S), and a TTL field.
The tag value (20 bits) is used to identify the forwarding behavior of a group of packets. Wherein the label value is 4-15 reserved label value.
The test bits (occupying 3 bits of the MPLS packet) are used to mark the priority of the MPLS packet, so that the network device can perform differentiated treatment according to the priority flag when forwarding the MPLS packet.
And a stack bottom identification bit S (1 bit therein) for identifying whether the label is the bottom label. The first label in the label stack is called the top label and the last label is called the bottom label. When the S value is 1, the label is the label at the bottom layer, and when the S value is 0, the label is not at the stack bottom and is also the MPLS label message header.
The survivability field (8 bits) is used to prevent loops during message transmission.
In the prior art, when congestion occurs in equipment in an MPLS network, a user cannot perceive the congestion in the MPLS network due to no ECN mechanism, so that packet loss occurs, which affects user services and reduces the utilization rate of bandwidth. Therefore, the embodiment of the invention forwards the MPLS message carrying the ECN label, wherein the ECN label is positioned at the bottom of the label stack, namely the S value of the label is 1; the label value is a value between 4 and 15; the EXP field is used for indicating whether the MPLS network is congested, EXP is set to 111 to indicate that the MPLS network is congested, which is called a network congestion flag, and EXP is set to 0 to indicate that the MPLS network is not congested, which is called a network non-congestion flag. In the MPLS L2 VPN network, the label stack is sequentially a top public network label, a private network label, and a bottom ECN label.
The process that the source end PE encapsulates the received IP message into an MPLS message and sends the MPLS message to the service provider equipment P comprises the following steps:
the source end PE receives an IP message containing an IP header, detects whether the source end PE is in a congestion state, and encapsulates the IP message to form an MPLS message added with an MPLS label message header;
the IP header comprises an ECN (0) or ECN (1) identifier, namely an identifier supporting the ECN, when the source end PE detects that the source end PE is in a non-congestion state, the EXP value in an ECN label at the bottom of the stack of the MPLS label message header is 0, and the S value is 1; when the source end PE detects that it is in a congestion state, the EXP value in the ECN label of the MPLS label header is 111, and the S value is 1. In the embodiment of the invention, the label value of the ECN label is preferably 6, and can be a certain value between 4 and 15.
The process that the P equipment sends the MPLS message to the far-end PE equipment comprises the following steps:
the P equipment forwards the MPLS message carrying the ECN label at the stack bottom to the far-end PE after carrying out public network label switching according to the congestion condition of the P equipment;
the specific method comprises the following steps: the P device receives the MPLS message, then performs label switching, detects whether the P device is in a congestion state and forwards the congestion state to the far-end PE;
when the P device detects that the P device is in a non-congestion state, forwarding an MPLS message carrying an ECN label at the stack bottom received from a source end PE to a far end PE after public network label switching; when the P device detects that the P device is in a congestion state, and an EXP value in an ECN label in an MPLS message received from the source end PE is 0, the EXP value is modified to 111, public network label switching is carried out, and the public network label switching is carried out and then the public network label switching is forwarded to the far end PE; or, when the P device detects that it is in a congestion state and the EXP value in the ECN label in the MPLS packet received from the source PE is 111, forwarding the MPLS packet carrying the ECN label at the stack bottom received from the source PE after performing public network label switching.
The process that the far-end PE equipment de-encapsulates the MPLS message and sends the MPLS message to the TCP receiving end forwarded by the user edge equipment comprises the following steps:
de-encapsulating the MPLS message according to the self congestion condition to form a de-encapsulated IP message carrying an ECN mark in an IP message header, and then sending the de-encapsulated IP message to a TCP receiving end; according to different network architectures, the MPLS message can be received from a P device or a source end PE;
the specific method comprises the following steps: the far-end PE receives the MPLS message, and de-encapsulates the MPLS message to remove an MPLS label message header to form a de-encapsulated IP message after detecting whether the far-end PE is in a congestion state;
when the far-end PE detects that the far-end PE is in a non-congestion state and the EXP value in the ECN label in the received MPLS message is 0, the IP message after being unpacked is forwarded; the IP message header of the IP message after decapsulation carries an ECN (0) or ECN (1) identifier;
when the far-end PE detects that the far-end PE is in a congestion state or detects that the far-end PE is in a non-congestion state, but the EXP value in the ECN label in the received MPLS message is 111, the ECN (0) or ECN (1) mark in the IP message header contained in the IP message after being unpacked is changed into a network congestion mark and then the network congestion mark is transmitted.
Finally, as in the prior art, after receiving the decapsulated IP message carrying the identifier subjected to network congestion, the TCP receiving end sets the ECE value to 1 in the message sent to the TCP sending end; the TCP sending end finds that the ECE value is 1, the CWR is set to 1 when the next message is sent, and the message sending rate to the TCP receiving end is reduced.
According to the above description, the source end PE supports the ECN through the encapsulated stack bottom label, and when the far end PE is decapsulated, the ECN identifier of the stack bottom label is mapped to the original IP packet header and forwarded to the receiving end, so that when any network device in the MPLS network is congested, the receiving end can notify the sending end of the congestion, and the sending end can reduce the sending rate before the network device starts to lose packets.
Example two
This embodiment takes the encapsulation transmission process of the IP packet in the MPLS L3VPN network as an example.
Fig. 3 shows the format of the MPLS L3VPN packet after encapsulating the original IP packet. Wherein, the MPLS label message header is positioned between the 3 layer IP header and the 2 layer network header. Only one MPLS label header is shown in the above figures. In the prior art, if the label is an MPLS network, the MPLS label is a public network label if only one MPLS label is encapsulated; in the case of an MPLS L3VPN network, there are two layers of labels, an outer public network label and an inner private network label. The MPLS label packet header structure includes 4 fields: a Label value (Label), a test bit (EXP), a bottom of stack identification bit (S), and a TTL field. Therefore, in the embodiment of the present invention, the MPLS packet carries the ECN label to be forwarded, the ECN label is located at the bottom of the label stack, and in the MPLS L3VPN network, the label stack sequentially includes the top public network label, the private network label, and the bottom ECN label.
As shown in fig. 4A, after receiving an IP packet forwarded by a user edge device, an ingress PE device encapsulates the IP packet into an MPLS packet and forwards the IP packet to a P device:
receiving a user message of the VPN from the user edge equipment on the PE, and sending the message to the far-end user edge equipment;
checking the content of the user message received from the user edge equipment on the input PE;
if the entering PE equipment determines that the message forwarded by the user edge equipment is an IP/TCP message, the ECT identifier in the IP header is 1, and the CE (congestion experienced) identifier is 0; or the entering PE equipment determines that the message forwarded by the user edge equipment is an IP/TCP message, ECT is equal to 0, and CE is equal to 1; the process of encapsulating the packet by the incoming PE device is as follows:
adding a label head with a label value of 6 to the last of the original MPLS label stack, and setting a stack bottom mark S to be 1;
if the incoming PE equipment is congested, setting EXP as 111; if the incoming PE device is not congested, setting EXP to be 0;
setting the stack bottom mark S of the last label value (the upper diagram is label B) of the original label stack to 0;
and the other devices send the message to the P device without modification.
In the embodiment of the invention, the label value of the ECN label is preferably 6, and can be a certain value between 4 and 15. As shown in the above diagram, the MPLS packet in this embodiment is a three-layer label stack, a public network label, and is used to indicate a Label Switched Path (LSP) from a PE to an opposite PE, and is switched in a service provider network internal device; the private network label is used for indicating the opposite end PE to send the message to which user edge equipment according to the label when the MPLS message reaches the opposite end PE; the ECN label is located at the bottom of the MPLS label stack so that the S value of label B is known to be 0. In the prior art, the MPLS message encapsulated by PE only has a public network label and a private network label, and the ECN label is added at the bottom of a label stack and is used for supporting the ECN function in the MPLS network.
As shown in fig. 4B, the process of forwarding the MPLS packet to the egress PE device by the P device:
under normal conditions, performing label switching operation on the P equipment, modifying the public network label into a public network label', and forwarding the public network label;
if the P equipment is not congested, the EXP of the ECN label is not modified and forwarded out;
if congestion occurs on the P device, the EXP of the ECN label is modified to 111 and then forwarded out.
As shown in fig. 4C, the process of the PE device decapsulating the MPLS packet and forwarding the decapsulated IP packet to the user device through the user edge device is shown:
receiving MPLS message from P device on PE, stripping label stack, changing message into user message and transmitting to user edge device;
if the PE finds that the stack bottom of the received MPLS message has an ECN label and EXP is equal to 111, the congestion in the MPLS network is considered to occur;
setting the ECT and CE (connectivity expert) identifiers of the IP header to be 1 in the user message, and forwarding the identifiers;
if the stack bottom has ECN labels and EXP is not equal to 111, only popping the label stack, and forwarding the user message without modification;
the forwarding process from the customer edge device to the customer is the same as the ECN process of IP/TCP.
Therefore, when any equipment in the MPLS network is congested, the congestion can be transferred to the user message, and the function of displaying the congestion notification end to end in the MPLS network is realized.
It should be noted that, in the art, a source PE and a far-end PE are defined based on a trend of traffic, and generally, a source PE device receives traffic from a user side and sends the traffic to a network side, which is also referred to as an ingress PE; the far-end PE device receives traffic from the network and sends the traffic to the user side, which is also called an outgoing PE. The embodiment of the invention is not only suitable for the MPLS network, but also suitable for the MPLS-VPN network.
It can be seen from the above that, in the embodiment, any original data packet has an IP header, and the present invention focuses more on the processing of the PE device and the P device when the network is congested:
PE equipment receives a message which is forwarded by user edge equipment and contains an IP header, wherein the IP header contains an identifier supporting Explicit Congestion Notification (ECN);
and if the PE equipment determines that the equipment is in a congestion state, the received message is packaged into a multi-protocol label switching (MPLS) message, and an ECN label with a network congestion identifier is arranged at the bottom of a label stack of the MPLS message.
The P equipment receives a multi-protocol label switching (MPLS) message forwarded by service provider edge equipment (PE);
and the P equipment determines that the equipment is in a congestion state, and the ECN label at the bottom of the MPLS message label stack sets a network non-congestion identifier, sets the ECN label at the bottom of the received MPLS message label stack with a network congestion identifier, and performs public network label switching processing.
Corresponding to the foregoing embodiment, the embodiment of the present invention further provides a PE device and a P device.
Fig. 5 shows a schematic structural diagram of the PE device, where the PE device executes functions of a source PE, and the functions include:
a first receiving unit 501, configured to receive a packet that is forwarded by a user edge device and includes an IP header, where the IP header includes an identifier that supports an explicit congestion notification ECN;
a first detecting unit 502, configured to detect whether the device is in a congestion state, and send a detection result to the encapsulation processing unit;
an encapsulating processing unit 503, configured to encapsulate, according to the congestion detection result, the packet including the IP header received by the first receiving unit into a multiprotocol label switching MPLS packet in which an ECN label is added to the bottom of the label stack, and send the packet to the forwarding unit;
a first forwarding unit 504, configured to forward the MPLS packet to a service provider device P or another PE.
In addition, the PE device may further perform the function of a far-end PE, that is, on the basis of the structure in fig. 5, a second receiving unit 51, a second detecting unit 52, a decapsulation processing unit 53, and a second forwarding unit 54 are added to decapsulate the received MPLS packet, as shown in fig. 6. Wherein,
a second receiving unit 51, configured to receive an MPLS packet;
the second detection unit 52 is configured to detect whether the mobile terminal is in a congestion state, and send a detection result to the decapsulation processing unit;
a decapsulation processing unit 53, configured to decapsulate the MPLS packet received by the second receiving unit according to the congestion detection result, and remove the label stack to form a decapsulated IP packet carrying the ECN label; the ECN marking comprises an experience network congestion identification CE (congestion experienced) or an identification of ECN support;
and a second forwarding unit 54, configured to forward the decapsulated IP packet to the user edge device.
Fig. 7 shows a schematic structural diagram of a P device, which includes:
a receiving unit 701, configured to receive a multi-protocol label switching MPLS packet with an explicit congestion notification ECN label added to the bottom of a label stack;
a detecting unit 702, configured to detect whether the mobile terminal is in a congestion state, and send a detection result to the processing unit;
the processing unit 703 is configured to perform ECN label processing and public network label switching processing on the MPLS packet according to the congestion detection result, and then send the MPLS packet to the forwarding unit;
a forwarding unit 704, configured to forward the processed MPLS packet to the PE.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.