CN109450792B - Data message packaging method and device - Google Patents

Data message packaging method and device Download PDF

Info

Publication number
CN109450792B
CN109450792B CN201811170767.3A CN201811170767A CN109450792B CN 109450792 B CN109450792 B CN 109450792B CN 201811170767 A CN201811170767 A CN 201811170767A CN 109450792 B CN109450792 B CN 109450792B
Authority
CN
China
Prior art keywords
label
entry
node
auxiliary
loopback interface
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
CN201811170767.3A
Other languages
Chinese (zh)
Other versions
CN109450792A (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 CN201811170767.3A priority Critical patent/CN109450792B/en
Publication of CN109450792A publication Critical patent/CN109450792A/en
Application granted granted Critical
Publication of CN109450792B publication Critical patent/CN109450792B/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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • 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
    • H04L45/745Address table lookup; Address filtering

Abstract

The application provides a data message encapsulation method and a device, wherein the method comprises the following steps: based on the destination address of the data message to be forwarded, finding an exit table item; the exit table entry comprises an exit auxiliary label, a middle node label, an exit node label and a loopback port; an outlet auxiliary label, an intermediate node label and an outlet node label of an outlet table item are packaged for the data message, an outer layer Ethernet header of a loopback port is packaged according to the loopback port, and the MPLS data message with the outlet auxiliary label is sent through the loopback port; receiving an MPLS data message with an outlet auxiliary label through a loopback interface; stripping the outlet auxiliary label when the inlet table entry is found according to the outlet auxiliary label; and encapsulating an inlet node label and a middle node label of the inlet table entry, encapsulating an output port outer layer Ethernet head according to an output port of the inlet node in the inlet table entry on a forwarding path, and sending the output port outer layer Ethernet head through the output port. The cost of the multilayer label packaging can be effectively reduced.

Description

Data message packaging method and device
Technical Field
The present application relates to the field of packet encapsulation technologies, and in particular, to a data packet encapsulation method and apparatus.
Background
Segment Routing (SR) uses a source path selection mechanism, and encapsulates Segment Identifiers (SID) of segments to be passed by a packet path at an ingress node in advance, so that when a packet is transmitted to an SR node, the SR node forwards the received packet according to the SID of the packet. Therefore, in the process of message forwarding, except for the entrance node, other switching nodes do not need to maintain the path state, and the forwarding efficiency can be effectively improved.
Multi-Protocol Label Switching (MPLS) Segment Routing with MPLS refers to forwarding a packet using a Label (Label) as an SID when using an SR in an MPLS network. In MPLS networks, the path that a packet (e.g., an IP packet) traverses is referred to as a Segment Routing based Label Switched path (SRLSP). When an IP message enters an inlet node in the MPLS network, the inlet node acquires a label of a path through which the IP message passes according to a pre-learned routing table, encapsulates the acquired label and the IP message layer by layer to form the MPLS message for forwarding, and in the MPLS message forwarding process, each switching node in the MPLS network decapsulates the received MPLS message layer by layer and forwards the MPLS message according to the decapsulated label.
At present, with the development of MPLS networks, the amount of IP packets that an ingress node needs to encapsulate is increasing, and in order to ensure encapsulation efficiency, the ingress node employs a hardware encapsulation method, that is, a forwarding engine is used to encapsulate received IP packets layer by layer. As the number of forwarding nodes in the MPLS network increases, the number of label layers to be encapsulated by the forwarding engine increases, which increases the performance requirement on the forwarding engine, resulting in an increase in the cost of encapsulating the MPLS packet by the forwarding engine.
Disclosure of Invention
In view of the above, an object of the present application is to provide a method and an apparatus for encapsulating a data packet, so as to solve the problem of increased cost caused when a forwarding engine performs multi-layer label encapsulation in the prior art.
In a first aspect, an embodiment of the present application provides a data packet encapsulation method, which is applied to an ingress node of a multi-protocol label switching network, and the method includes:
based on the destination address of the data message to be forwarded, finding an exit table item; the exit table entry comprises an exit auxiliary label, a middle node label, an exit node label and a loopback port;
the export auxiliary label, the intermediate node label and the export node label of the export table item are packaged for the data message, and the MPLS data message with the export auxiliary label is sent through the loopback interface according to the Ethernet header on the outer layer of the loopback interface packaged by the loopback interface;
receiving the MPLS data message with the export auxiliary label through the loopback interface;
stripping the outlet auxiliary label when finding the inlet table item according to the outlet auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating an egress port outer-layer Ethernet header according to an egress port of the entry node on a forwarding path in the entry, and sending the egress port outer-layer Ethernet header through the egress port.
Optionally, the method further comprises the following method: stripping the outlet auxiliary label when the intermediate table item is found according to the outlet auxiliary label; encapsulating the intermediate node label of the intermediate table entry, encapsulating the Ethernet header on the outer layer of the loopback interface according to the loopback interface in the intermediate table entry, and sending the MPLS message with the intermediate auxiliary label through the loopback interface;
receiving the MPLS data message with the intermediate auxiliary label through the loopback interface;
stripping the middle auxiliary label when the entry table item is found according to the middle auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating the egress port outer layer Ethernet header according to the egress port of the entry node on the forwarding path in the entry, and sending the egress port outer layer Ethernet header through the egress port.
Optionally, the method further comprises:
stripping the middle auxiliary label when finding out a secondary middle table item according to the middle auxiliary label of the MPLS data message with the middle auxiliary label; and packaging a secondary intermediate auxiliary label and an intermediate node label of the secondary intermediate table entry, packaging the outer Ethernet header of the loopback interface according to the loopback interface in the secondary intermediate table entry, and sending the MPLS message with the secondary intermediate auxiliary label through the loopback interface.
Optionally, the method further comprises:
receiving the MPLS data message with the secondary intermediate auxiliary label through the loopback interface;
stripping the middle auxiliary label when the entry table item is found according to the secondary middle auxiliary label; and encapsulating the inlet node label and the intermediate node label of the inlet table entry, encapsulating the output port outer layer Ethernet head according to the output port in the inlet table entry, and sending the output port outer layer Ethernet head through the output port.
In a second aspect, an embodiment of the present application provides a data packet encapsulation apparatus, including:
the exit table item searching module is used for searching the exit table item based on the destination address of the data message to be forwarded; the exit table entry comprises an exit auxiliary label, a middle node label, an exit node label and a loopback port;
a loopback interface message encapsulation module, configured to encapsulate the export auxiliary label, the intermediate node label, and the export node label of the export entry for the data message, and according to the loopback interface, encapsulate an ethernet header on an outer layer of the loopback interface, and send an MPLS data message with the export auxiliary label through the loopback interface;
a loopback interface message receiving module, configured to receive, through the loopback interface, the MPLS data message with the export auxiliary label;
the output port message encapsulation module is used for stripping the outlet auxiliary label when finding the inlet table entry according to the outlet auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating an egress port outer-layer Ethernet header according to an egress port of the entry node on a forwarding path in the entry, and sending the egress port outer-layer Ethernet header through the egress port.
Optionally, the loopback interface message encapsulation module is further configured to strip the outlet auxiliary tag when the intermediate entry is found according to the outlet auxiliary tag; encapsulating the intermediate node label of the intermediate table entry, encapsulating the Ethernet header on the outer layer of the loopback interface according to the loopback interface in the intermediate table entry, and sending the MPLS message with the intermediate auxiliary label through the loopback interface;
the loopback interface message receiving module is further used for receiving the MPLS data message with the intermediate auxiliary label through the loopback interface;
the output port message encapsulation module is also used for stripping the middle auxiliary label when the entry table item is found according to the middle auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating the egress port outer layer Ethernet header according to the egress port of the entry node on the forwarding path in the entry, and sending the egress port outer layer Ethernet header through the egress port.
Optionally, the loopback interface message encapsulation module is further configured to strip the middle auxiliary label when finding a secondary middle entry according to the middle auxiliary label of the MPLS data message with the middle auxiliary label; and packaging a secondary intermediate auxiliary label and an intermediate node label of the secondary intermediate table entry, packaging the outer Ethernet header of the loopback interface according to the loopback interface in the secondary intermediate table entry, and sending the MPLS message with the secondary intermediate auxiliary label through the loopback interface.
Optionally, the loopback interface message receiving module is further configured to receive, through the loopback interface, the MPLS data message with the secondary intermediate auxiliary label;
the output port message encapsulation module is also used for stripping the middle auxiliary label when the entry table item is found according to the secondary middle auxiliary label; and encapsulating the inlet node label and the intermediate node label of the inlet table entry, encapsulating the output port outer layer Ethernet head according to the output port in the inlet table entry, and sending the output port outer layer Ethernet head through the output port.
In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, performs the steps of the method described above.
According to the data message encapsulation method provided by the embodiment of the application, the exit table entry is found based on the destination address of the data message to be forwarded; the exit table entry comprises an exit auxiliary label, a middle node label, an exit node label and a loopback port; the export auxiliary label, the intermediate node label and the export node label of the export table item are packaged for the data message, and the MPLS data message with the export auxiliary label is sent through the loopback interface according to the Ethernet header on the outer layer of the loopback interface packaged by the loopback interface; receiving the MPLS data message with the export auxiliary label through the loopback interface; stripping the outlet auxiliary label when finding the inlet table item according to the outlet auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating an egress port outer-layer Ethernet header according to an egress port of the entry node on a forwarding path in the entry, and sending the egress port outer-layer Ethernet header through the egress port. Therefore, the requirement of one-time encapsulation of multi-layer labels on the high performance of the forwarding engine can be avoided by repeatedly encapsulating the labels, and the cost of encapsulating the MPLS message by the forwarding engine is reduced.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flow chart of a data packet encapsulation method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of label switched paths in the second embodiment of the present application;
fig. 3 is a schematic diagram of an encapsulated data packet according to the second embodiment;
fig. 4 is a schematic diagram of a label switched path in the third embodiment of the present application;
fig. 5 is a schematic diagram of an encapsulated data packet according to the third embodiment;
fig. 6 is a schematic diagram of label switched paths in the fourth embodiment of the present application;
fig. 7 is a schematic structural diagram of a data packet encapsulation apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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.
Example one
Fig. 1 is a flowchart illustrating a method for providing data packet encapsulation according to an embodiment, where the method is applicable to a device serving as an ingress node, and the method includes the following steps
Step 101, based on the destination address of the data message to be forwarded, finding out an exit table entry. The egress entry includes an egress auxiliary label, a middle node label, an egress node label, and a loopback port.
And 102, encapsulating an export auxiliary label, an intermediate node label and an export node label of the export table entry for the data message, and transmitting the MPLS data message with the export auxiliary label through the loopback interface according to the Ethernet header on the outer layer of the loopback interface encapsulated by the loopback interface.
Step 103, receiving the MPLS data packet with the egress auxiliary label through the loopback interface.
104, stripping the auxiliary outlet label when the inlet table entry is found according to the auxiliary outlet label; and encapsulating an inlet node label and a middle node label of the inlet table entry, encapsulating an output port outer layer Ethernet head according to an output port of the inlet node in the inlet table entry on a forwarding path, and sending the output port outer layer Ethernet head through the output port.
The embodiment of fig. 1 has the beneficial effects that a plurality of layers of labels are encapsulated for the data message to be forwarded in a loopback manner, so as to ensure that the equipment can encapsulate the labels to be encapsulated which exceed the label encapsulation capability in the outer layer of the data message, and ensure that the data message can be forwarded through a label switching path.
Example two
When receiving the MPLS data packet through the MPLS network, the node 221 generates a forwarding entry according to the label 206 of the ingress node 22 of the MPLS data packet and the source IP address of the inner IP data packet of the received MPLS data packet. And generating a forwarding table entry according to the MPLS data message inlet node label 401 and the source IP address of the received MPLS data message inner layer IP data message. The node 221 may determine, according to the network topology, a Label Switched Path (LSP) to reach the node 226 corresponding to the ingress Label (ingress) 206, as shown in fig. 2, where a Label Switched device on the LSP20 sequentially includes: an ingress node 221, a transit node 222 and 225, and an egress node 226.
When the node 221 determines that the number of the labels that the LSP needs to encapsulate is greater than the label encapsulation capability of the forwarding chip, it may generate an exit entry and an entry according to the label encapsulation capability of the forwarding chip. The egress table entry contains an egress auxiliary label 213, intermediate node labels 204, 205, an egress node label 206, and a loopback port; the ingress entry includes ingress node label 201 and as intermediate node labels 202, 203, and node 221 ports as egress ports on the LSP shown in fig. 2.
The node 221 sets the index of the exit table entry as the exit interface index corresponding to the IP address in the forwarding table entry; the index of the entry is recorded as the outgoing interface index of the outgoing auxiliary tag 213.
When the node 221 receives the ethernet data packet to be forwarded and determines that three-layer forwarding is required, the ethernet header is stripped off, and the destination IP address is found to match the generated forwarding table entry. The node 221 serves as an ingress node, finds an egress entry according to an egress interface index of a forwarding entry, encapsulates an egress auxiliary tag, an intermediate node tag, and an egress node tag of the egress entry for the IP data packet, encapsulates an outer ethernet header of a loopback interface according to the loopback interface, and sends an MPLS data packet 231 having the egress auxiliary tag through the loopback interface, as shown in fig. 3.
When the ingress node 221 receives the MPLS data packet 21 of the egress auxiliary label 213 through the loopback interface, and finds the ingress entry according to the egress auxiliary label 213, the egress auxiliary label 213 is stripped, the ingress node label 201 and the intermediate node labels 202 and 203 in the ingress entry are encapsulated, and the outer ethernet header is encapsulated according to the egress port of the ingress node 221 on the LSP in the ingress entry, so as to obtain the MPLS data packet 22. Ingress node 221 sends MPLS data packets 232 through egress ports as shown in fig. 3.
In the second embodiment, when the label to be encapsulated exceeds the label encapsulation capability of the forwarding chip, the ingress node 221 may encapsulate all labels exchanged on the LSP in the outer layer of the data packet to be forwarded, so as to avoid a forwarding failure caused by too many nodes on the LSP and the label encapsulation capability of the forwarding chip being smaller than the label to be encapsulated, increase the reliability of data packet transmission in the MPLS network, and also meet the requirement of the MPLS network for large capacity.
EXAMPLE III
When receiving the MPLS data packet through the MPLS network, the node 421 generates a forwarding entry according to the entry node label 401 of the MPLS data packet and the source IP address of the inner layer IP data packet of the received MPLS data packet. The ingress node 421 may determine, according to the network topology, an LSP reaching the node 429 corresponding to the ingress label 409, as shown in fig. 4, where the label switching device on the LSP 30 sequentially includes: an ingress node 421, an intermediate (transit) node 422 and 428, and an egress node 429.
When the node 421 determines that the number of the labels that the LSP needs to encapsulate is greater than the label encapsulation capability of the forwarding chip, the node may generate an exit entry, an intermediate entry, and an entry according to the label encapsulation capability of the forwarding chip. The egress table entry includes an egress auxiliary label 413, intermediate node labels 407, 408, an egress node label 409, and a loopback port; the intermediate entry contains an intermediate auxiliary label 414, intermediate node labels 404, 405, 406, and a loopback port; the ingress entry includes ingress node label 401 and intermediate node labels 402, 403, and node 421 serves as an egress port on the LSP shown in fig. 4.
The node 421 sets the index of the exit table entry as the exit interface index corresponding to the IP address in the forwarding table entry; recording the index of the middle table entry as the output interface index of the output auxiliary label 413; the index of the entry is recorded as the outgoing interface index of the middle auxiliary tag 414.
When the node 421 receives the ethernet data packet to be forwarded and determines that three-layer forwarding needs to be performed, the ethernet header is stripped off, and the destination IP address is found to match the generated forwarding table entry.
The node 421 serves as an ingress node, finds an egress entry according to an egress interface index of a forwarding entry, encapsulates an egress auxiliary label 413, intermediate node labels 407 and 408, and an egress node label 409 of the egress entry for the IP data packet, encapsulates an outer ethernet header of a loopback interface according to the loopback interface, and sends an MPLS data packet 431 with the egress auxiliary label through the loopback interface, as shown in fig. 5.
When the ingress node 421 receives the MPLS data packet of the egress auxiliary label 413 through the loopback interface, and finds the intermediate entry according to the egress auxiliary label 413, the egress auxiliary label 413 is stripped off, the intermediate auxiliary label 414, the intermediate node labels 404, 405, and 406 in the intermediate entry are encapsulated, an outer ethernet header of the loopback interface is encapsulated according to the loopback interface, and the MPLS data packet 432 with the intermediate auxiliary label is sent through the loopback interface, as shown in fig. 5.
When the ingress node 421 receives the MPLS data packet of the middle auxiliary label 414 through the loopback interface, and finds the ingress entry according to the middle auxiliary label 414, the middle auxiliary label 414 is stripped, the ingress node label 401 and the middle node labels 402 and 403 in the ingress entry are encapsulated, and an outer ethernet header is encapsulated according to an egress port of the ingress node 421 in the ingress entry on the LSP, so as to obtain an MPLS data packet 433, as shown in fig. 5. Ingress node 421 sends MPLS data message 433 through an egress port.
Example four
When receiving the MPLS data packet through the MPLS network, the node 621 generates a forwarding entry according to the entry node label 601 of the MPLS data packet and the source IP address of the inner layer IP data packet of the received MPLS data packet. The ingress node 621 may determine, according to the network topology, an LSP reaching the egress node 632 corresponding to the ingress label 612 as shown in fig. 6, where the label switching device on the LSP 50 sequentially includes: an ingress node 621, an intermediate (transit) node 622 and 631, and an egress node 632.
When determining that the number of labels to be encapsulated by the LSP is greater than the label encapsulation capability of the forwarding chip, node 621 may generate an exit entry, an intermediate entry, a secondary intermediate entry, and an entry according to the label encapsulation capability of the forwarding chip. The egress table entry contains an egress auxiliary label, intermediate node labels 610, 611, an egress node label 612, and a loopback port; the intermediate table entry contains an intermediate auxiliary tag, intermediate node tags 607, 608, 609 and a loopback port; the secondary intermediate table entry contains secondary intermediate secondary labels, intermediate node labels 604, 605, 606, and a loopback port; the ingress entry includes ingress node label 601 and intermediate node labels 602, 603, and node 621 serves as an egress port on the LSP shown in fig. 6.
The node 621 sets the index of the exit table entry as the exit interface index corresponding to the IP address in the forwarding table entry; recording the index of the intermediate entry as the egress interface index of the egress auxiliary tag 613; recording the index of the secondary intermediate table entry as the output interface index of the intermediate auxiliary label; and recording the index of the entry table item as the output interface index of the secondary middle auxiliary label.
Node 621 receives the ethernet data packet to be forwarded, and when determining that three-layer forwarding needs to be performed, strips off the ethernet header, and finds out that the destination IP address matches the generated forwarding table entry.
Node 621, as an ingress node, finds an egress entry according to an egress index of the forwarding entry, encapsulates an egress auxiliary tag (not shown), an intermediate node tag, and an egress node tag of the egress entry for the IP data packet, encapsulates an ethernet header on an outer layer of a loopback interface according to the loopback interface, and sends the MPLS data packet with the egress auxiliary tag through the loopback interface.
When the ingress node 621 receives the MPLS data packet of the egress auxiliary label through the loopback interface, and finds the middle table entry according to the egress auxiliary label, the egress auxiliary label is stripped, a middle auxiliary label (not shown) in the middle table entry and middle node labels 607, 608, and 609 are encapsulated, an outer ethernet header of the loopback interface is encapsulated according to the loopback interface, and the MPLS data packet with the middle auxiliary label is sent through the loopback interface.
When the ingress node 621 receives the MPLS data packet of the middle auxiliary label 614 through the loopback interface, and finds a secondary middle entry according to the middle auxiliary label 614, the middle auxiliary label 614 is stripped, a secondary middle auxiliary label (not shown) in the secondary middle entry, the middle node labels 604, 605, and 606 are encapsulated, an outer ethernet header of the loopback interface is encapsulated according to the loopback interface, and the MPLS data packet with the secondary middle auxiliary label is sent through the loopback interface.
When the ingress node 621 receives the MPLS data packet of the secondary intermediate auxiliary label through the loopback port, and finds the ingress entry according to the secondary intermediate auxiliary label, the secondary intermediate auxiliary label is stripped, the ingress node label 601 and the intermediate node labels 602 and 603 in the ingress entry are encapsulated, and the outer ethernet header is encapsulated according to the egress port of the ingress node 621 on the LSP in the ingress entry, so as to obtain the MPLS data packet encapsulated with the label 601 and the label 612. Ingress node 621 sends an MPLS datagram with labels of all nodes on the LSP shown in fig. 6 through the egress port.
In the fourth embodiment, the ingress node 621 can encapsulate all the labels exchanged on the LSP for multiple times when the labels to be encapsulated exceed the label encapsulation capability of the forwarding chip, and sequentially encapsulate the labels on the outer layer of the data packet to be forwarded, so that the forwarding failure caused by that the label encapsulation capability of the forwarding chip is smaller than that of the label to be encapsulated due to too many nodes on the LSP can be avoided, the reliability of data packet transmission in the MPLS network is increased, and the requirement of the MPLS network for large capacity can be met.
As can be seen from the third and fourth embodiments, the auxiliary labels set in the exit entry, the intermediate entry, and the secondary intermediate entry of one LSP of the device are different, so that multiple label packages can be implemented when the device is used as an entry node, and a forwarding failure possibly caused by insufficient label packaging capability of a forwarding chip is solved. In the fourth embodiment, the secondary intermediate table entries may be set to more than one according to the LSP forwarding requirement.
In the embodiment of the present application, it should be noted that the embodiment of the present application can be extended according to actual needs. For example, a plurality of corresponding intermediate auxiliary labels may be set according to the number of intermediate node labels included in the label switched path, and according to the exit entry found according to the currently received ethernet data packet, the exit auxiliary label and the intermediate node label are encapsulated according to the exit entry, and then, according to the loopback interface, the outer layer ethernet header of the loopback interface is encapsulated, and is sent through the loopback interface. And repeating the steps until the output port outer layer Ethernet head is encapsulated according to the found inlet table item and the output port of the inlet node on the forwarding path in the inlet table item and the Ethernet head is sent through the output port, so that the personnel in the field can realize the label encapsulation of a plurality of layers beyond the protocol regulation according to the invention.
In this embodiment, as another optional embodiment, the data packet encapsulation method provided in this embodiment may also be used in a label switching network that implements a two-layer VPN, so as to reduce the cost of encapsulating an MPLS packet by an ingress node. After receiving the ethernet packet, the ingress node finds the encapsulation label according to the destination MAC address (inner DMAC) of the received ethernet packet, and performs data packet encapsulation processing according to the found encapsulation label. The flow of performing the data packet encapsulation processing according to the found encapsulation label and performing the data packet encapsulation processing according to the found exit entry is similar to the forwarding encapsulation method of the three-layer VPN, and is not described herein again.
EXAMPLE five
Fig. 7 is a schematic structural diagram of a data packet encapsulation apparatus according to an embodiment of the present application. As shown in fig. 7, the apparatus includes:
an exit table item searching module 71, configured to search an exit table item based on a destination address of the data packet that needs to be forwarded; the exit table entry comprises an exit auxiliary label, a middle node label, an exit node label and a loopback port;
in this embodiment, as an optional embodiment, the destination address includes but is not limited to: a destination IP address, and/or a destination MAC address.
A loopback port message encapsulation module 72, configured to encapsulate an egress auxiliary tag, an intermediate node tag, and an egress node tag of an egress entry for the data message, encapsulate an ethernet header on an outer layer of a loopback port according to the loopback port, and send an MPLS data message with the egress auxiliary tag through the loopback port;
in the embodiment of the application, the found outlet auxiliary label, intermediate node label and outlet node label in the outlet table entry are encapsulated into the data message, and then the outer ethernet header of the loopback interface is encapsulated according to the loopback interface to form the MPLS data message.
A loopback interface message receiving module 73, configured to receive, through a loopback interface, an MPLS data message with an egress auxiliary label;
in this embodiment of the present application, the loopback interface provided in the ingress node is used to transmit the packet sent through the loopback interface back to the ingress node. Therefore, for the situation of having multilayer labels, the encapsulated message can be transmitted back to the entry node again by setting the loopback port, so that multiple times of encapsulation can be performed at the entry node to meet the requirement of multi-label forwarding in the MPLS network, the requirement of one-time encapsulation of the multilayer labels on the high performance of the forwarding engine can be avoided, and the cost of encapsulating the MPLS message by the forwarding engine is effectively reduced.
An egress port packet encapsulation module 74, configured to strip the egress auxiliary tag when finding the ingress entry according to the egress auxiliary tag; and encapsulating an inlet node label and a middle node label of the inlet table entry, encapsulating an output port outer layer Ethernet head according to an output port of the inlet node in the inlet table entry on a forwarding path, and sending the output port outer layer Ethernet head through the output port.
In the embodiment of the present application, the egress auxiliary label is obtained by decapsulating the MPLS data packet, and is searched according to the obtained egress auxiliary label, and when the entry is found, the egress auxiliary label may be stripped, and the MPLS data packet is encapsulated again: and encapsulating the inlet node label and the intermediate node label of the inlet table entry, and encapsulating the outer Ethernet head of the outlet port according to the outlet port of the inlet node in the inlet table entry on the forwarding path.
In this embodiment, as an optional embodiment, the loopback interface message encapsulation module 72 is further configured to strip the outlet auxiliary tag when the intermediate entry is found according to the outlet auxiliary tag; packaging an intermediate node label of the intermediate table item, packaging an outer Ethernet header of a loopback interface according to a loopback interface in the intermediate table item, and sending an MPLS message with an intermediate auxiliary label through the loopback interface;
in the embodiment of the present application, the middle auxiliary tag may correspond to a secondary middle table entry or an entry table entry.
A loopback interface message receiving module 73, further configured to receive, through a loopback interface, an MPLS data message with a middle auxiliary label;
the egress port packet encapsulation module 74 is further configured to strip the middle auxiliary tag when finding the entry table entry according to the middle auxiliary tag; and encapsulating an inlet node label and a middle node label of the inlet table entry, encapsulating an output port outer layer Ethernet head according to an output port of the inlet node in the inlet table entry on a forwarding path, and sending the output port outer layer Ethernet head through the output port.
In this embodiment, as another optional embodiment, the loopback interface message encapsulation module 72 is further configured to strip the middle auxiliary label when finding the secondary middle entry according to the middle auxiliary label of the MPLS data message with the middle auxiliary label; and packaging a secondary intermediate auxiliary label and an intermediate node label of the secondary intermediate table entry, packaging an outer Ethernet header of a loopback port according to a loopback port in the secondary intermediate table entry, and sending the MPLS message with the secondary intermediate auxiliary label through the loopback port.
In this embodiment, as a further optional embodiment, the loopback message receiving module 73 is further configured to receive, through a loopback, an MPLS data message having a secondary intermediate auxiliary label;
the egress port packet encapsulation module 74 is further configured to strip the middle auxiliary tag when finding the entry table entry according to the secondary middle auxiliary tag; and encapsulating the inlet node label and the intermediate node label of the inlet table entry, encapsulating the outer Ethernet head of the outlet port according to the outlet port in the inlet table entry, and sending the Ethernet head through the outlet port.
Corresponding to the data packet encapsulation method of fig. 1, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform the steps of the data packet encapsulation method.
Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, and the like, and when a computer program on the storage medium is executed, the data packet encapsulation method can be executed, so as to solve the problem of cost increase caused by performing multi-layer label encapsulation on a forwarding engine in the prior art.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of one logic function, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the technical solutions of the present application, and the scope of the present application is not limited thereto, although the present application is described in detail with reference to the foregoing examples, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

1. A data packet encapsulation method applied to an ingress node of a multi-protocol label switching network, the method comprising:
based on the destination address of the data message to be forwarded, finding an exit table item; the exit table entry comprises an exit auxiliary label, a middle node label, an exit node label and a loopback port;
the export auxiliary label, the intermediate node label and the export node label of the export table item are packaged for the data message, and the MPLS data message with the export auxiliary label is sent through the loopback interface according to the Ethernet header on the outer layer of the loopback interface packaged by the loopback interface;
receiving the MPLS data message with the export auxiliary label through the loopback interface;
stripping the outlet auxiliary label when finding the inlet table item according to the outlet auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating an egress port outer-layer Ethernet header according to an egress port of the entry node on a forwarding path in the entry, and sending the egress port outer-layer Ethernet header through the egress port.
2. The method of claim 1, further comprising: stripping the outlet auxiliary label when the intermediate table item is found according to the outlet auxiliary label; encapsulating the intermediate node label of the intermediate table entry, encapsulating the Ethernet header on the outer layer of the loopback interface according to the loopback interface in the intermediate table entry, and sending the MPLS message with the intermediate auxiliary label through the loopback interface;
receiving the MPLS data message with the intermediate auxiliary label through the loopback interface;
stripping the middle auxiliary label when the entry table item is found according to the middle auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating the egress port outer layer Ethernet header according to the egress port of the entry node on the forwarding path in the entry, and sending the egress port outer layer Ethernet header through the egress port.
3. The method of claim 2, further comprising:
stripping the middle auxiliary label when finding out a secondary middle table item according to the middle auxiliary label of the MPLS data message with the middle auxiliary label; and packaging a secondary intermediate auxiliary label and an intermediate node label of the secondary intermediate table entry, packaging the outer Ethernet header of the loopback interface according to the loopback interface in the secondary intermediate table entry, and sending the MPLS message with the secondary intermediate auxiliary label through the loopback interface.
4. The method of claim 3, further comprising:
receiving the MPLS data message with the secondary intermediate auxiliary label through the loopback interface;
stripping the secondary middle auxiliary label when the entry table item is found according to the secondary middle auxiliary label; and encapsulating the inlet node label and the intermediate node label of the inlet table entry, encapsulating the output port outer layer Ethernet head according to the output port in the inlet table entry, and sending the output port outer layer Ethernet head through the output port.
5. An apparatus for encapsulating data messages, the apparatus comprising:
the exit table item searching module is used for searching the exit table item based on the destination address of the data message to be forwarded; the exit table entry comprises an exit auxiliary label, a middle node label, an exit node label and a loopback port;
a loopback interface message encapsulation module, configured to encapsulate the export auxiliary label, the intermediate node label, and the export node label of the export entry for the data message, and according to the loopback interface, encapsulate an ethernet header on an outer layer of the loopback interface, and send an MPLS data message with the export auxiliary label through the loopback interface;
a loopback interface message receiving module, configured to receive, through the loopback interface, the MPLS data message with the export auxiliary label;
the output port message encapsulation module is used for stripping the outlet auxiliary label when finding the inlet table entry according to the outlet auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating an egress port outer-layer Ethernet header according to an egress port of the entry node on a forwarding path in the entry, and sending the egress port outer-layer Ethernet header through the egress port.
6. The apparatus according to claim 5, wherein the loopback port message encapsulation module is further configured to strip the egress auxiliary tag when the intermediate entry is found according to the egress auxiliary tag; encapsulating the intermediate node label of the intermediate table entry, encapsulating the Ethernet header on the outer layer of the loopback interface according to the loopback interface in the intermediate table entry, and sending the MPLS message with the intermediate auxiliary label through the loopback interface;
the loopback interface message receiving module is further used for receiving the MPLS data message with the intermediate auxiliary label through the loopback interface;
the output port message encapsulation module is also used for stripping the middle auxiliary label when the entry table item is found according to the middle auxiliary label; and encapsulating the entry node label and the intermediate node label of the entry, encapsulating the egress port outer layer Ethernet header according to the egress port of the entry node on the forwarding path in the entry, and sending the egress port outer layer Ethernet header through the egress port.
7. The apparatus according to claim 6, wherein the loopback packet encapsulation module is further configured to strip the middle auxiliary label when finding a secondary middle entry according to the middle auxiliary label of the MPLS data packet with the middle auxiliary label; and packaging a secondary intermediate auxiliary label and an intermediate node label of the secondary intermediate table entry, packaging the outer Ethernet header of the loopback interface according to the loopback interface in the secondary intermediate table entry, and sending the MPLS message with the secondary intermediate auxiliary label through the loopback interface.
8. The apparatus of claim 7, wherein the loopback interface message receiving module is further configured to receive the MPLS data message with the secondary intermediate auxiliary label through the loopback interface;
the output port message encapsulation module is also used for stripping the secondary middle auxiliary label when the entry table item is found according to the secondary middle auxiliary label; and encapsulating the inlet node label and the intermediate node label of the inlet table entry, encapsulating the output port outer layer Ethernet head according to the output port in the inlet table entry, and sending the output port outer layer Ethernet head through the output port.
CN201811170767.3A 2018-10-08 2018-10-08 Data message packaging method and device Active CN109450792B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811170767.3A CN109450792B (en) 2018-10-08 2018-10-08 Data message packaging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811170767.3A CN109450792B (en) 2018-10-08 2018-10-08 Data message packaging method and device

Publications (2)

Publication Number Publication Date
CN109450792A CN109450792A (en) 2019-03-08
CN109450792B true CN109450792B (en) 2021-05-07

Family

ID=65544986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811170767.3A Active CN109450792B (en) 2018-10-08 2018-10-08 Data message packaging method and device

Country Status (1)

Country Link
CN (1) CN109450792B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637705B (en) * 2020-11-26 2022-05-27 新华三技术有限公司合肥分公司 Method and device for forwarding in-band remote measurement message

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571397A (en) * 2003-07-12 2005-01-26 华为技术有限公司 Method for message forwarding on client border-service provider border-client border
CN103220217A (en) * 2013-04-27 2013-07-24 杭州华三通信技术有限公司 Route generating method and equipment
CN107018059A (en) * 2017-04-25 2017-08-04 新华三技术有限公司 A kind of message forwarding method and device
CN107124360A (en) * 2017-04-24 2017-09-01 新华三技术有限公司 Tag Packaging method and device
CN107547399A (en) * 2017-05-31 2018-01-05 新华三技术有限公司 The processing method and PE equipment of a kind of multicast forwarding list item

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070183415A1 (en) * 2006-02-03 2007-08-09 Utstarcom Incorporated Method and system for internal data loop back in a high data rate switch
CN101090355B (en) * 2007-07-24 2010-09-22 杭州华三通信技术有限公司 Label exchange route setting method, system and equipment of virtual special network channel
CN102868614B (en) * 2012-09-13 2015-08-12 杭州华三通信技术有限公司 Message forwarding method in TRILL network and route-bridge
CN108259341B (en) * 2017-12-06 2020-12-29 新华三技术有限公司 Prefix label distribution method and SDN controller

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1571397A (en) * 2003-07-12 2005-01-26 华为技术有限公司 Method for message forwarding on client border-service provider border-client border
CN103220217A (en) * 2013-04-27 2013-07-24 杭州华三通信技术有限公司 Route generating method and equipment
CN107124360A (en) * 2017-04-24 2017-09-01 新华三技术有限公司 Tag Packaging method and device
CN107018059A (en) * 2017-04-25 2017-08-04 新华三技术有限公司 A kind of message forwarding method and device
CN107547399A (en) * 2017-05-31 2018-01-05 新华三技术有限公司 The processing method and PE equipment of a kind of multicast forwarding list item

Also Published As

Publication number Publication date
CN109450792A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
US8971338B2 (en) Expanding network functionalities for openflow based split-architecture networks
US20220078114A1 (en) Method and Apparatus for Providing Service for Traffic Flow
US8351352B1 (en) Methods and apparatus for RBridge hop-by-hop compression and frame aggregation
CN109873760A (en) Handle the method and apparatus of routing and the method and apparatus of data transmission
US10404605B2 (en) Packet processing method, device and computer storage medium
CN109617803B (en) Forwarding table item generation method, device and equipment
US11368357B2 (en) Service fault locating method and apparatus
CN112019433B (en) Message forwarding method and device
US20130287027A1 (en) Apparatus and method for processing packet in mpls-tp network
CN112910772B (en) Message forwarding method and device based on segmented routing
WO2022001835A1 (en) Method and apparatus for sending message, and network device, system and storage medium
WO2015184771A1 (en) Method and node device for operation, administration, and maintenance of service function chaining
CN107968749A (en) Realize method, exchange chip and the interchanger of QinQ route terminations
US10009272B2 (en) Packet transmission apparatus for processing operations, administration, and maintenance (OAM) packet and protection switching message
CN106209554B (en) message forwarding method and device for crossing virtual extensible local area network
CN109450792B (en) Data message packaging method and device
US20090245263A1 (en) Apparatus and method for transmitting packets in a packet switched network
CN101888336B (en) Access device realizes method and the access device of TDM business relaying
JP2016523062A (en) Method and apparatus for generating input parameters
CN112714063B (en) Message transmission method, device and digital processing chip
CN106797344B (en) Method and apparatus for communicating through remote network element port
CN104378245B (en) OAM method and device is realized on the AC mouths of L2VPN frameworks
US9794168B2 (en) Scalable continuity test for a group of communication paths
WO2022000264A1 (en) Fault detection method and apparatus, and pe device
WO2023208056A1 (en) Method, apparatus and system for processing message

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