CN109067657B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN109067657B
CN109067657B CN201810971891.3A CN201810971891A CN109067657B CN 109067657 B CN109067657 B CN 109067657B CN 201810971891 A CN201810971891 A CN 201810971891A CN 109067657 B CN109067657 B CN 109067657B
Authority
CN
China
Prior art keywords
label
lsr
ldp
message
network prefix
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
CN201810971891.3A
Other languages
Chinese (zh)
Other versions
CN109067657A (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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201810971891.3A priority Critical patent/CN109067657B/en
Publication of CN109067657A publication Critical patent/CN109067657A/en
Application granted granted Critical
Publication of CN109067657B publication Critical patent/CN109067657B/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
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a message processing method and a message processing device, which are applied to a first LSR in a target network, a first SR label is generated according to a first LDP label message carrying a first network prefix and a first SR label message carrying the first network prefix, and a second LDP label message carrying a corresponding relation between the first network prefix and the first SR label is sent to a second LSR which does not support SR label forwarding in upstream LSRs, so that when the second LSR receives a first service message matched with the first network prefix, a label in the first service message is modified into the first SR label. Therefore, even if the second LSR does not support SR label forwarding, the label of the first service packet may be modified to be an SR label, so that the egress LSR may receive the service packet carrying the SR label, and further may perform service analysis related to the SR label.

Description

Message processing method and device
Technical Field
The present application relates to the field of computer network technologies, and in particular, to a method and an apparatus for processing a packet.
Background
Currently, a Multiprotocol Label Switching (MPLS) network is one of the more widely used networks. The basic building block of an MPLS network is a Label Switching Router (LSR), which may be specifically divided into an ingress LSR, an interior LSR, and an egress LSR. The ingress LSR may receive the traffic packet and forward the traffic packet to the interior LSR, which may then forward the traffic packet to the egress LSR.
After the MPLS network is established, each LSR needs to generate a label forwarding table first, so as to forward the received service packet according to the label forwarding table in the following. Each LSR in the MPLS network supports a Label Distribution Protocol (LDP), and may generate an LDP Label forwarding table, which specifically includes the following steps: the egress LSR may allocate a corresponding first LDP label for a certain network prefix, use the first LDP label as its own LDP entry label, and then send to the internal LSR a first LDP label packet carrying a correspondence between the network prefix and the first LDP label. And meanwhile, the internal LSR can also generate a second LDP label message according to the received first LDP label message and send the second LDP label message to the upstream LSR.
Each device can also support a multi-protocol label switching Segment Routing (MPLS, MPLS SR) technology, and generate an SR label forwarding table, which specifically includes the following steps: the egress LSR may generate an SR label according to a preset index value corresponding to a certain network prefix and a Segment Routing Global Block (SRGB) base value of the egress LSR, use the SR label as an SR ingress label of the egress LSR, and send an SR label packet carrying an SRGB of the egress LSR to the internal LSR. And the internal LSR generates an SR in label and an SR out label of the internal LSR according to the received SR label message, and obtains an SR label forwarding table corresponding to the network prefix.
In practice, some LSRs (which may be referred to as second LSRs) that do not support SR label forwarding may exist in the MPLS network, and when receiving the traffic packet, the second LSR modifies the label of the traffic packet into an LDP outgoing label according to the LDP label forwarding table, and sends the LDP outgoing label to the first LSR downstream of the second LSR. The first LSR will continue to forward the service message according to the LDP label forwarding table, so that the export LSR can only receive the service message carrying the LDP label. Some network services need to be analyzed according to the service packet with the SR label received by the egress LSR. Therefore, if an LSR that does not support SR label forwarding exists in the MPLS network, the egress LSR may only receive the service packet carrying the LDP label, which may result in that service analysis cannot be performed.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for processing a packet, so that an egress LSR may receive a service packet carrying an SR label, and further may perform service analysis related to the SR label. 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 processing a packet, where the method is applied to a first LSR in a target network, where the target network further includes other LSRs, and the method includes:
after receiving a first Label Distribution Protocol (LDP) label message carrying a first network prefix and a first Segment Routing (SR) label message carrying the first network prefix, generating a first SR entry label corresponding to the first network prefix according to the first SR label message;
if a second LSR which does not support SR label forwarding exists in the upstream LSR, sending a second LDP label message carrying the corresponding relation between the first network prefix and the first SR label to the second LSR according to the first LDP label message, so that the second LSR stores an LDP label forwarding table containing the first SR label, and modifying a label in the first service message into the first SR label when receiving a first service message matched with the first network prefix.
Optionally, the method further includes:
generating a first SR output label according to the first SR label message;
correspondingly adding the first SR in label and the first SR out label into an SR label forwarding table;
and when a second service message carrying the first SR entry label is received, modifying the first SR label in the second service message into the first SR exit label according to the SR label forwarding table.
Optionally, the method further includes:
acquiring the equipment identifier of the LSR which sends the first SR label message;
and adding the obtained equipment identifier into the SR label forwarding table as the next hop equipment identifier corresponding to the first SR in label and the first SR out label.
Optionally, the method further includes:
acquiring target next hop equipment identifiers corresponding to the first SR incoming label and the first SR outgoing label from the SR label forwarding table;
and sending the second service packet carrying the first SR-out label to the target equipment corresponding to the target next hop equipment identifier.
Optionally, the generating a first SR entry tag corresponding to the first network prefix according to the first SR tag packet further includes:
acquiring the preset index value;
and taking the sum of the preset segment routing global label segment base value and the preset index value as a first SR entry label corresponding to the first network prefix.
In a second aspect, in order to achieve the above object, an embodiment of the present application discloses a packet processing apparatus, where the apparatus is applied to a first LSR in a target network, where the target network further includes other LSRs, and the apparatus includes:
the generating module is used for generating a first SR entry label corresponding to a first network prefix according to a first SR label message after receiving the first Label Distribution Protocol (LDP) label message carrying the first network prefix and the first Segment Routing (SR) label message carrying the first network prefix;
a sending module, configured to send, according to the first LDP label packet, a second LDP label packet carrying a correspondence between the first network prefix and the first SR ingress label to a second LSR if the second LSR that does not support SR label forwarding exists in an upstream LSR, so that the second LSR stores an LDP label forwarding table including the first SR ingress label, and modifies a label in the first service packet into the first SR ingress label when receiving a first service packet matching the first network prefix.
Optionally, the apparatus further comprises:
the processing module is used for generating a first SR output label according to the first SR label message;
correspondingly adding the first SR in label and the first SR out label into an SR label forwarding table;
and when a second service message carrying the first SR entry label is received, modifying the first SR label in the second service message into the first SR exit label according to the SR label forwarding table.
Optionally, the processing module is further configured to obtain a device identifier of an LSR that sends the first SR label packet;
and adding the obtained equipment identifier into the SR label forwarding table as the next hop equipment identifier corresponding to the first SR in label and the first SR out label.
Optionally, the processing module is further configured to obtain, from the SR tag forwarding table, a target next hop device identifier corresponding to the first SR incoming tag and the first SR outgoing tag;
and sending the second service packet carrying the first SR-out label to the target equipment corresponding to the target next hop equipment identifier.
Optionally, the first SR tag message further carries a preset index value corresponding to the first network prefix, and the generating module is specifically configured to obtain the preset index value;
and taking the sum of the preset segment routing global label segment base value and the preset index value as a first SR entry label corresponding to the first network prefix.
In a third aspect, 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.
In a fourth aspect, to achieve the above object, embodiments of the present application provide 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 a fifth aspect, to achieve the above object, embodiments of the present application provide a computer program product containing instructions, which when executed on a computer, cause the computer to perform the method steps of the first aspect.
The embodiment of the application provides a message processing method and device, which are applied to a first Label Switching Router (LSR) in a target network, wherein the target network further comprises other LSRs, after receiving a first LDP label message carrying a first network prefix and a first SR label message carrying the first network prefix, a first SR label corresponding to the first network prefix is generated according to the first SR label message, if a second LSR which does not support SR label forwarding exists in an upstream LSR, a second LDP label message carrying a corresponding relation between the first network prefix and the first SR label is sent to the second LSR, so that the second LSR stores an LDP forwarding table containing the first SR label, and when receiving the first service message matched with the first network prefix, the label in the first service message is modified into the first SR label. Based on the above processing, even if the second LSR does not support SR label forwarding, the label of the first service packet may be modified to be an SR label, so that the egress LSR may receive the service packet carrying the SR label, and further may perform service analysis related to the SR label.
Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
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 architecture according to an embodiment of the present application;
fig. 2 is a flowchart of a message processing method according to an embodiment of the present application;
fig. 3 is a flowchart of an example of a message processing method according to an embodiment of the present application;
fig. 4 is a structural diagram of a message processing apparatus according to an embodiment of the present application;
fig. 5 is a structural 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.
The embodiment of the application provides a message processing method and a message processing device, which can be applied to a first LSR in a target network, wherein the target network also comprises other LSRs. An LSR in the target network that does not support SR label forwarding may be referred to as a second LSR, the first LSR being a downstream LSR of the second LSR.
Referring to fig. 1, fig. 1 is a framework diagram of a networking architecture provided in the embodiment of the present application, which is a possible application scenario. The networking includes a plurality of LSRs: LSR1, LSR2, LSR3, LSR4 and LSR5, the SRGB base values are all 16000. Wherein the first LSR is LSR4, the second LSR is LSR3, LSR1 is ingress LSR, LSR5 is egress LSR. The LSR5 may obtain an SR label corresponding to a certain network prefix, specifically, the network prefix may be a local Loopback address of the LSR5 itself, and then, the LSR5 may obtain a preset index value corresponding to the network prefix, where the preset index value may be set by a technician according to a service requirement. For example, the Loopback address of the LSR5 is 1.1.1.1/32, and the corresponding preset index value is 201. The LSR5 can obtain the SR label corresponding to the address 1.1.1.1/32 as 16000+201 ═ 16201 according to its SRGB base value 16000, and use it as its SR entry label. In addition, LSR5 may also assign LDP label 1600 to address 1.1.1.1/32 as its own SR in-label. Then, the LSR5 may send an SR label packet carrying the corresponding relationship between its SRGB base value and address 1.1.1.1/32 and the index value 201 to the LSR 4. After receiving the SR label packet sent by the LSR5, the LSR4 generates its own SR outgoing label 16000+201 16201 according to the SRGB base value and index value of the LSR5, and at the same time, the LSR4 generates its own SR incoming label 16000+201 16201 according to its own SRGB base value and index value. In addition, LSR5 may also send to LSR4 an LDP label packet carrying the correspondence between address 1.1.1.1/32 and LDP label 1600. LSR4 may generate its own LDP in label 1500 corresponding to address 1.1.1.1/32, and take 1600 as its own LDP out label.
In the prior art, LSR4 may send an LDP label packet carrying the correspondence between address 1.1.1.1/32 and LDP label 1500 to LSR 3. After receiving the label message, LSR3 may generate LDP in label 1000 and LDP out label 1500 corresponding to address 1.1.1.1/32. In addition, LSR2 may generate SR inbound label 16201 corresponding to address 1.1.1.1/32. Because the LSR3 does not support SR label forwarding, when the LSR2 receives the service packet carrying the SR label 16201, the LSR2 modifies the SR label 16201 in the service packet into the LDP label 1000 of the LSR3 according to the label gluing rule, and sends the modified service packet to the LSR 3. After receiving the service packet, the LSR3 modifies the LDP label 1000 in the service packet into its own LDP outgoing label 1500, and sends the modified service packet to the LSR 4. After receiving the service packet, the LSR4 modifies the LDP label 1500 in the service packet into its own LDP outgoing label 1600, and sends the modified service packet to the LSR5, so far, the label in the service packet received by the egress LSR5 is its own LDP incoming label 1600. It can be seen that, because LSR3 that does not support SR label forwarding exists before LSR2 and LSR5, even though the SR label is carried in the traffic packet received by LSR2, the label in the traffic packet received by LSR5 is modified to be an LDP label.
Based on the method in the embodiment of the present application, after receiving the LDP label packet and SR label packet carrying the address 1.1.1.1/32 by the LSR4, the LSR4 sends the LDP label packet carrying the corresponding relationship between the address 1.1.1.1/32 and its own SR label 16201 to the LSR3, that is, notifies the LSR3 that its own LDP label is 16201. When receiving the LDP label message of LSR4, LSR3 generates LDP label 1000 corresponding to address 1.1.1.1/32, and uses 16201 as the corresponding LDP label. Because the LSR3 does not support SR label forwarding, when the LSR2 receives the service packet carrying the SR label 16201, the LSR2 modifies the SR label 16201 in the service packet into the LDP label 1000 of the LSR3 according to the label gluing rule, and sends the modified service packet to the LSR 3. After receiving the service packet, the LSR3 modifies the LDP label 1000 in the service packet into its own LDP outgoing label 16201, and sends the modified service packet to the LSR 4. After receiving the service packet, the LSR4 modifies the SR label 16201 in the service packet into its own SR outgoing label 16201, and sends the modified service packet to the LSR5, so far, the label carried in the service packet received by the egress LSR5 is its own SR incoming label 16201, and further, service analysis related to the SR label, for example, traffic statistics and other services, can be performed according to the service packet received by the LSR 5.
Referring to fig. 2, fig. 2 is a flowchart of a message processing method provided in this embodiment, where the method may be applied to a first LSR in a target network, where the target network further includes other LSRs, and the method may include the following steps:
s201: and after receiving a first Label Distribution Protocol (LDP) label message carrying a first network prefix and a first Segment Routing (SR) label message carrying the first network prefix, generating a first SR entry label corresponding to the first network prefix according to the first SR label message.
In implementation, in order to implement forwarding processing on a service packet whose destination address matches a certain network prefix (i.e., a first network prefix), in an operation process of the MPLS network, a first LSR receives an LDP label packet (a first LDP label packet) that is sent by a downstream LSR and carries the first network prefix, where the first LDP label packet may also carry an LDP label of the downstream LSR. Correspondingly, the first LSR generates an LDP label corresponding to the first network prefix according to the received first LDP label message, the LDP label is used as a self LDP in-label, the LDP in-label of the downstream LSR is used as a self LDP out-label, an LDP label forwarding table is generated, and then the service message carrying the LDP label can be forwarded according to the LDP label forwarding table.
In addition, if the first LSR is an ingress LSR of the MPLS network, the first LSR may further generate a Forwarding Information Base (FIB) table corresponding to the first network prefix, and the FIB table may refer to table (1).
Watch (1)
Dest Out label Nexthop Out interface
10.1.0.0 40 X A1
The table (1) records the corresponding relationship between Dest (destination address), Out label, Nexthop (identifier of next hop device) and Out interface of the service message. When the first LSR receives the traffic packet with destination address 10.1.0.0, the label 40 is added to the traffic packet and sent to the next hop device X, i.e. the downstream LSR of the first LSR, through the outgoing interface a 1.
The first LSR may also receive an SR label packet (i.e., a first SR label packet) that carries the first network prefix and is sent by a downstream LSR. After receiving the first LDP label packet and the first SR label packet, the first LSR may generate a first SR incoming label corresponding to the first network prefix according to the first SR label packet.
Optionally, the first SR tag message may carry a preset index value corresponding to the first network prefix. Accordingly, the first LSR generating the first SR in-label corresponding to the first network prefix may include the following processing steps:
step one, acquiring a preset index value.
In implementation, if the first SR label packet carries a preset index value corresponding to the first network prefix, the first LSR may parse the first SR label packet to obtain the preset index value.
And step two, taking the sum of the preset segment routing global label segment base value and the preset index value as a first SR entry label corresponding to the first network prefix.
In implementation, after obtaining the preset index value corresponding to the first network prefix, the first LSR may obtain a base value of the segment routing global label segment of itself, and use a sum value of the base value of the segment routing global label segment of itself and the preset index value as an SR entry label (i.e., a first SR entry label) corresponding to the first network prefix.
S202: if a second LSR which does not support SR label forwarding exists in the upstream LSR, sending a second LDP label message carrying the corresponding relation between the first network prefix and the first SR label to the second LSR according to the first LDP label message, so that the second LSR stores an LDP label forwarding table containing the first SR label, and modifying a label in the first service message into the first SR label when receiving a first service message matched with the first network prefix.
When establishing the neighbor relation of the MPLS network, the first LSR may determine an LSR (i.e., the second LSR) that does not support SR label forwarding in the upstream LSR.
In implementation, if a second LSR exists in the upstream LSR, the first LSR may send, according to the first LDP label packet, a second LDP label packet carrying a correspondence between the first network prefix and the first SR incoming label to the second LSR. Specifically, the first LSR obtains a first network prefix, and generates an LDP label packet (i.e., a second LDP label packet) carrying a correspondence between the first network prefix and a first SR incoming label. The first LSR may then send a second LDP label packet to the second LSR.
Based on the above processing, after receiving the second LDP label packet sent by the first LSR, the second LSR may generate an LDP label corresponding to the first network prefix, as its own LDP incoming label, and use the first SR incoming label carried in the second LDP label packet as its own LDP outgoing label, so as to generate its own LDP label forwarding table, which is referred to in table (2).
Watch (2)
In label Out label
LDP in-label of second LSR First SR in tag
When the second LSR receives a service packet (i.e. a first service packet) matched with the first network prefix, where a label in the first service packet is an LDP in label of the second LSR, the second LSR modifies the label in the first service packet (i.e. its LDP in label) into its LDP out label (i.e. a first SR in label) according to its own LDP label forwarding table.
Therefore, even if the second LSR does not support SR label forwarding, the label in the received service packet may be modified to be the SR incoming label of the downstream LSR, so that the egress LSR of the MPLS network may receive the service packet carrying the SR label.
Optionally, the first LSR may further process the received service packet according to its own SR label forwarding table. Specifically, the method may further include the steps of:
step one, generating a first SR outgoing label according to the first SR label message.
In implementation, the first LSR may generate its SR outgoing label (i.e., the first SR outgoing label) according to the first SR label packet.
For example, the first SR label message may carry a preset index value corresponding to the first network prefix and an SRGB base value of the downstream LSR. The first LSR may parse the first SR label packet to obtain a preset index value corresponding to the first network prefix. The first LSR may use the sum of the SRGB base value of the downstream LSR and the preset index value (i.e., the SR in-label of the downstream LSR) as its SR out-label (i.e., the first SR out-label).
And step two, correspondingly adding the first SR in label and the first SR out label into the SR label forwarding table.
In implementation, the first LSR may correspondingly add the first SR in label and the first SR out label to its own SR label forwarding table, so as to forward the service packet according to the SR label forwarding table.
And step three, when a second service message carrying the first SR entry label is received, modifying the first SR entry label in the second service message into a first SR exit label according to the SR label forwarding table.
In implementation, when the first LSR receives a service packet sent by an upstream LSR, the service packet may be parsed to obtain a label carried by the service packet. When the first LSR receives a service packet (i.e., a second service packet) carrying a first SR ingress label, the first LSR may modify a label (i.e., a first SR ingress label) in the second service packet into a first SR egress label according to its own SR label forwarding table.
Optionally, the first LSR may further add a corresponding next hop device identifier in the SR label forwarding table. Specifically, the method can further comprise the following processing steps:
acquiring a device identifier of an LSR (Label switching equipment) sending a first SR (Security request) label message; and adding the obtained equipment identifier into an SR label forwarding table as a next hop equipment identifier corresponding to the first SR in label and the first SR out label.
In implementation, after receiving the first SR label packet, the first LSR may obtain an equipment identifier of a downstream LSR (which may be referred to as a third LSR) that sends the first SR label packet, and add the equipment identifier of the third LSR, as a next hop equipment identifier corresponding to the first SR in-label and the first SR out-label, to the SR label forwarding table, see table (3).
Watch (3)
In label Out label Nexthop
First SR in tag First SR out label Third LSR
Correspondingly, the first LSR may further forward the received service packet according to the SR label forwarding table recorded with the next hop device identifier.
Specifically, the method can further comprise the following processing steps:
step one, acquiring target next hop equipment identifications corresponding to a first SR in label and a first SR out label from an SR label forwarding table.
In implementation, after the first LSR modifies the first SR ingress label in the second service packet to the first SR egress label, the first LSR may further obtain a next hop device identifier (i.e., a target next hop device identifier) corresponding to the first SR ingress label and the first SR egress label in the SR label forwarding table.
And step two, sending the second service message carrying the first SR-out label to the target equipment corresponding to the target next hop equipment identifier.
In implementation, after obtaining the target next hop device identifier, the first LSR may send the second service packet carrying the first SR output label to the target device (i.e., the third LSR) corresponding to the target next hop device identifier, thereby completing forwarding processing of the second service packet.
Referring to fig. 3, fig. 3 is a flowchart of an example of a message processing method according to an embodiment of the present application, where the method is described by taking the networking in fig. 1 as an example, the first LSR is LSR4, the second LSR is LSR3, and the second LSR does not support SR label forwarding. The SRGB base value of the LSR1 is 16000, the SRGB base value of the LSR2 is 17000, the SRGB base value of the LSR3 is 18000, the SRGB base value of the LSR4 is 19000, the SRGB base value of the LSR5 is 20000, the first network prefix may be a Loopback address 4.4.4.4/32 of the LSR5, and the preset index value corresponding to the first network prefix is 0, and the method may include the following processing steps:
s301: when receiving a first LDP label packet carrying a first network prefix 4.4.4.4/32 and a first SR label packet carrying a first network prefix 4.4.4/32 sent by the LSR5, the LSR4 generates a first SR in label corresponding to the first network prefix 4.4.4/32 according to the first SR label packet (i.e., 19000+0 is 19000), uses the SR in label of the LSR5 as the first SR out label corresponding to the first network prefix 4.4.4.4/32 (i.e., 20000+0 is 20000), and sets a corresponding next-hop device identifier as a device identifier of the LSR5, thereby obtaining the SR label forwarding table. The SR label forwarding table of LSR4 may be seen in table (4).
Watch (4)
In label Out label Nexthop
First SR IN-tag 19000 First SR tag 20000 LSR5
S302: the LSR4 sends the second LDP label packet carrying the correspondence between the first network prefix 4.4.4.4/32 and the first SR in label 19000 to the LSR 3.
S303: the LSR3 generates an LDP incoming label 1500 corresponding to the first network prefix 4.4.4.4/32 according to the second LDP label packet, and uses the first SR incoming label 19000 as an LDP outgoing label corresponding to the LDP incoming label 1500, sets the corresponding next hop device identifier as the device identifier of the LSR4, obtains an LDP label forwarding table, and modifies the label in the second service packet into the first SR incoming label 19000 according to the LDP label forwarding table when the LSR receives the second service packet carrying the LDP incoming label 1500.
The LDP label forwarding table of LSR3 may be seen in table (5).
Watch (5)
In label Out label Nexthop
LDP Label 1500 First SR IN-tag 19000 LSR4
S304: the LSR3 sends the second traffic packet carrying the first SR in label 19000 to the LSR 4.
S305: the LSR4 modifies the label of the second service packet into the first SR outgoing label 20000 according to the SR label forwarding table, and sends the modified second service packet to the LSR 5.
As can be seen from the above, according to the message processing method of the embodiment of the present application, after receiving a first LDP label message carrying a first network prefix and a first SR label message carrying the first network prefix, a first SR incoming label corresponding to the first network prefix is generated according to the first SR label message, if a second LSR that does not support SR label forwarding exists in an upstream LSR, a second LDP label message carrying a correspondence between the first network prefix and the first SR incoming label is sent to the second LSR, so that the second LSR stores an LDP label forwarding table including the first SR incoming label, and when receiving the first service message matching the first network prefix, a label in the first service message is modified into the first SR incoming label. Based on the above processing, even if the second LSR does not support SR label forwarding, the label of the first service packet may be modified to be an SR label, so that the egress LSR may receive the service packet carrying the SR label, and further may perform service analysis related to the SR label.
Corresponding to the above method embodiment of fig. 2, referring to fig. 4, fig. 4 is a structural diagram of a packet processing apparatus provided in the embodiment of the present application, where the apparatus is applied to a first LSR in a target network, where the target network further includes other LSRs, and the apparatus includes:
a generating module 401, configured to generate a first SR entry label corresponding to a first network prefix according to a first SR label packet after receiving the first label distribution protocol LDP label packet carrying the first network prefix and the first segment routing SR label packet carrying the first network prefix;
a sending module 402, configured to send, according to the first LDP label packet, a second LDP label packet carrying a correspondence between the first network prefix and the first SR ingress label to a second LSR if the second LSR that does not support SR label forwarding exists in an upstream LSR, so that the second LSR stores an LDP label forwarding table including the first SR ingress label, and modifies a label in the first service packet into the first SR ingress label when receiving a first service packet matching the first network prefix.
Optionally, the apparatus further comprises:
the processing module is used for generating a first SR output label according to the first SR label message;
correspondingly adding the first SR in label and the first SR out label into an SR label forwarding table;
and when a second service message carrying the first SR entry label is received, modifying the first SR label in the second service message into the first SR exit label according to the SR label forwarding table.
Optionally, the processing module is further configured to obtain a device identifier of an LSR that sends the first SR label packet;
and adding the obtained equipment identifier into the SR label forwarding table as the next hop equipment identifier corresponding to the first SR in label and the first SR out label.
Optionally, the processing module is further configured to obtain, from the SR tag forwarding table, a target next hop device identifier corresponding to the first SR incoming tag and the first SR outgoing tag;
and sending the second service packet carrying the first SR-out label to the target equipment corresponding to the target next hop equipment identifier.
Optionally, the first SR tag message further carries a preset index value corresponding to the first network prefix, and the generating module 401 is specifically configured to obtain the preset index value;
and taking the sum of the preset segment routing global label segment base value and the preset index value as a first SR entry label corresponding to the first network prefix.
As can be seen from the above, according to the packet processing apparatus in the embodiment of the present application, after receiving a first LDP label packet carrying a first network prefix and a first SR label packet carrying the first network prefix, a first SR incoming label corresponding to the first network prefix is generated according to the first SR label packet, if a second LSR that does not support SR label forwarding exists in an upstream LSR, a second LDP label packet carrying a correspondence between the first network prefix and the first SR incoming label is sent to the second LSR according to the first LDP label packet, so that the second LSR stores an LDP label forwarding table including the first SR incoming label, and when receiving a first service packet matching the first network prefix, a label in the first service packet is modified into the first SR incoming label. Based on the above processing, even if the second LSR does not support SR label forwarding, the label of the first service packet may be modified to be an SR label, so that the egress LSR may receive the service packet carrying the SR label, and further may perform service analysis related to the SR label.
The embodiment of the present application further provides an electronic device, as shown in fig. 5, which includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
a processor 501, configured to execute the program stored in the memory 503 to enable the electronic device to execute the steps of the message processing method, where the method includes:
after receiving a first Label Distribution Protocol (LDP) label message carrying a first network prefix and a first Segment Routing (SR) label message carrying the first network prefix, generating a first SR entry label corresponding to the first network prefix according to the first SR label message;
if a second LSR which does not support SR label forwarding exists in the upstream LSR, sending a second LDP label message carrying the corresponding relation between the first network prefix and the first SR label to the second LSR according to the first LDP label message, so that the second LSR stores an LDP label forwarding table containing the first SR label, and modifying a label in the first service message into the first SR label when receiving a first service message matched with the first network prefix.
Optionally, the method further includes:
generating a first SR output label according to the first SR label message;
correspondingly adding the first SR in label and the first SR out label into an SR label forwarding table;
and when a second service message carrying the first SR entry label is received, modifying the first SR label in the second service message into the first SR exit label according to the SR label forwarding table.
Optionally, the method further includes:
acquiring the equipment identifier of the LSR which sends the first SR label message;
and adding the obtained equipment identifier into the SR label forwarding table as the next hop equipment identifier corresponding to the first SR in label and the first SR out label.
Optionally, the method further includes:
acquiring target next hop equipment identifiers corresponding to the first SR incoming label and the first SR outgoing label from the SR label forwarding table;
and sending the second service packet carrying the first SR-out label to the target equipment corresponding to the target next hop equipment identifier.
Optionally, the generating a first SR entry tag corresponding to the first network prefix according to the first SR tag packet further includes:
acquiring the preset index value;
and taking the sum of the preset segment routing global label segment base value and the preset index value as a first SR entry label corresponding to the first network prefix.
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 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 message processing methods described above.
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 message processing methods of the above embodiments.
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 machine-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to them, 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 (10)

1. A method for packet processing, the method being applied to a first label switching router LSR in a target network, the target network further including other LSRs, the method comprising:
after receiving a first Label Distribution Protocol (LDP) label message carrying a first network prefix and a first Segment Routing (SR) label message carrying the first network prefix, generating a first SR entry label corresponding to the first network prefix according to the first SR label message; the first SR label message is sent by a downstream LSR supporting SR label forwarding;
if a second LSR which does not support SR label forwarding exists in an upstream LSR, sending a second LDP label message carrying a corresponding relation between the first network prefix and the first SR label entry to the second LSR according to the first LDP label message, so that the second LSR stores an LDP label forwarding table containing the first SR label entry, and modifying a label in a first service message into the first SR label entry when the second LSR receives the first service message matched with the first network prefix; wherein, the LDP label forwarding table is: and after receiving the second LDP label message, the second LSR generates an LDP label corresponding to the first network prefix, and the LDP label is used as an LDP in-label of the second LSR, and the second LSR takes the first SR in-label carried in the second LDP label message as an LDP out-label of the second LSR.
2. The method of claim 1, further comprising:
generating a first SR output label according to the first SR label message;
correspondingly adding the first SR in label and the first SR out label into an SR label forwarding table;
and when a second service message carrying the first SR entry label is received, modifying the first SR label in the second service message into the first SR exit label according to the SR label forwarding table.
3. The method of claim 2, further comprising:
acquiring the equipment identifier of the LSR which sends the first SR label message;
and adding the obtained equipment identifier into the SR label forwarding table as the next hop equipment identifier corresponding to the first SR in label and the first SR out label.
4. The method of claim 3, further comprising:
acquiring target next hop equipment identifiers corresponding to the first SR incoming label and the first SR outgoing label from the SR label forwarding table;
and sending the second service packet carrying the first SR-out label to the target equipment corresponding to the target next hop equipment identifier.
5. The method according to claim 1, wherein the first SR tag packet further carries a preset index value corresponding to the first network prefix, and the generating a first SR entry tag corresponding to the first network prefix according to the first SR tag packet includes:
acquiring the preset index value;
and taking the sum of the preset segment routing global label segment base value and the preset index value as a first SR entry label corresponding to the first network prefix.
6. A packet processing apparatus, applied to a first label switching router LSR in a target network, the target network further including other LSRs, the apparatus comprising:
the generating module is used for generating a first SR entry label corresponding to a first network prefix according to a first SR label message after receiving the first Label Distribution Protocol (LDP) label message carrying the first network prefix and the first Segment Routing (SR) label message carrying the first network prefix; the first SR label message is sent by a downstream LSR supporting SR label forwarding;
a sending module, configured to send, according to the first LDP label packet, a second LDP label packet carrying a correspondence between the first network prefix and the first SR ingress label to a second LSR if the second LSR that does not support SR label forwarding exists in an upstream LSR, so that the second LSR stores a LDP label forwarding table including the first SR ingress label, and when receiving a first service packet matching the first network prefix, the second LSR modifies a label in the first service packet to the first SR ingress label; wherein, the LDP label forwarding table is: and after receiving the second LDP label message, the second LSR generates an LDP label corresponding to the first network prefix, and the LDP label is used as an LDP in-label of the second LSR, and the second LSR takes the first SR in-label carried in the second LDP label message as an LDP out-label of the second LSR.
7. The apparatus of claim 6, further comprising:
the processing module is used for generating a first SR output label according to the first SR label message;
correspondingly adding the first SR in label and the first SR out label into an SR label forwarding table;
and when a second service message carrying the first SR entry label is received, modifying the first SR label in the second service message into the first SR exit label according to the SR label forwarding table.
8. The apparatus of claim 7, wherein the processing module is further configured to obtain a device identifier of an LSR that sends the first SR label packet;
and adding the obtained equipment identifier into the SR label forwarding table as the next hop equipment identifier corresponding to the first SR in label and the first SR out label.
9. The apparatus of claim 8, wherein the processing module is further configured to obtain, from the SR label forwarding table, a target next hop device identifier corresponding to the first SR in-label and the first SR out-label;
and sending the second service packet carrying the first SR-out label to the target equipment corresponding to the target next hop equipment identifier.
10. The apparatus according to claim 6, wherein the first SR tag packet further carries a preset index value corresponding to the first network prefix, and the generating module is specifically configured to obtain the preset index value;
and taking the sum of the preset segment routing global label segment base value and the preset index value as a first SR entry label corresponding to the first network prefix.
CN201810971891.3A 2018-08-24 2018-08-24 Message processing method and device Active CN109067657B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810971891.3A CN109067657B (en) 2018-08-24 2018-08-24 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810971891.3A CN109067657B (en) 2018-08-24 2018-08-24 Message processing method and device

Publications (2)

Publication Number Publication Date
CN109067657A CN109067657A (en) 2018-12-21
CN109067657B true CN109067657B (en) 2021-03-26

Family

ID=64755969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810971891.3A Active CN109067657B (en) 2018-08-24 2018-08-24 Message processing method and device

Country Status (1)

Country Link
CN (1) CN109067657B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111669422B (en) * 2019-03-08 2022-03-11 华为技术有限公司 Message transmission method and device
CN110808924B (en) * 2019-11-12 2021-05-18 迈普通信技术股份有限公司 Chip loopback message processing method, device and storage medium
CN112134801B (en) * 2020-08-11 2022-02-15 中盈优创资讯科技有限公司 Method and device for processing segment identification SID and each node

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980350A (en) * 2014-04-02 2015-10-14 华为技术有限公司 Message processing method and label switching router
CN106487686A (en) * 2015-08-28 2017-03-08 中兴通讯股份有限公司 SR forwarding entry generation method and device
WO2017141080A1 (en) * 2016-02-15 2017-08-24 Telefonaktiebolaget Lm Ericsson (Publ) Techniques for exposing maximum node and/or link segment identifier depth utilizing ospf
US9807001B2 (en) * 2014-07-17 2017-10-31 Cisco Technology, Inc. Segment routing using a remote forwarding adjacency identifier

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9537718B2 (en) * 2013-03-15 2017-01-03 Cisco Technology, Inc. Segment routing over label distribution protocol
CN104243311B (en) * 2013-06-08 2018-05-25 华为技术有限公司 The method and router of Message processing
US9253084B2 (en) * 2014-02-24 2016-02-02 Juniper Networks, Inc. Neighbor-label distribution with label distribution protocol
CN105871722B (en) * 2015-01-19 2020-02-14 中兴通讯股份有限公司 Label structure and label message forwarding method and device
US10505846B2 (en) * 2015-07-22 2019-12-10 Cisco Technology, Inc. Resilient segment routing service hunting with TCP session stickiness
CN107666438B (en) * 2016-07-27 2021-10-22 中兴通讯股份有限公司 Message forwarding method and device
CN108023815B (en) * 2016-11-03 2020-10-30 中兴通讯股份有限公司 Information transmission method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980350A (en) * 2014-04-02 2015-10-14 华为技术有限公司 Message processing method and label switching router
US9807001B2 (en) * 2014-07-17 2017-10-31 Cisco Technology, Inc. Segment routing using a remote forwarding adjacency identifier
CN106487686A (en) * 2015-08-28 2017-03-08 中兴通讯股份有限公司 SR forwarding entry generation method and device
WO2017141080A1 (en) * 2016-02-15 2017-08-24 Telefonaktiebolaget Lm Ericsson (Publ) Techniques for exposing maximum node and/or link segment identifier depth utilizing ospf

Also Published As

Publication number Publication date
CN109067657A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
US10148573B2 (en) Packet processing method, node, and system
CN110661711B (en) Method for generating label forwarding table, message sending method, device and equipment
CN107483345B (en) Service processing method, device and system
WO2017050085A1 (en) Method, device and system for processing packet
CN109067657B (en) Message processing method and device
CN111600797B (en) Data transmission method, node and system
CN110703817A (en) Control method, device and system for statistical flow
CN108965137B (en) Message processing method and device
CN110430135B (en) Message processing method and device
CN109525501B (en) Method and device for adjusting forwarding path
WO2016197689A1 (en) Method, apparatus and system for processing packet
CN111181855B (en) Multicast method and routing equipment
CN109041086B (en) Configuration method and device of OpenFlow instance
CN103986654A (en) LSP generating method and device
CN113726652B (en) Notification information processing method and device and storage medium
US20200336385A1 (en) BGP Logical Topology Generation Method, and Device
CN106230730B (en) Multicast transmission method and device
US20190334814A1 (en) Path establishment method and device, and network node
CN109831378B (en) Message timeout response method and device
CN108768861B (en) Method and device for sending service message
WO2022068484A1 (en) Service chain address pool slicing method, device and system
CN111865805B (en) Multicast GRE message processing method and system
CN104702505A (en) Message transmission method and node
CN112311668B (en) Method, network device and system for processing BIER message
WO2020244372A1 (en) Method and apparatus for implementing multicasting

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