CN107124360B - Label packaging method and device - Google Patents

Label packaging method and device Download PDF

Info

Publication number
CN107124360B
CN107124360B CN201710272289.6A CN201710272289A CN107124360B CN 107124360 B CN107124360 B CN 107124360B CN 201710272289 A CN201710272289 A CN 201710272289A CN 107124360 B CN107124360 B CN 107124360B
Authority
CN
China
Prior art keywords
label
encap
stage
additional information
table entry
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
CN201710272289.6A
Other languages
Chinese (zh)
Other versions
CN107124360A (en
Inventor
李华舟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201710272289.6A priority Critical patent/CN107124360B/en
Publication of CN107124360A publication Critical patent/CN107124360A/en
Application granted granted Critical
Publication of CN107124360B publication Critical patent/CN107124360B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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 application provides a label packaging method and a device, wherein the method comprises the following steps: determining first-stage FEC _ NEXT _ HOP information and second-stage FEC _ NEXT _ HOP information corresponding to a message to be forwarded; searching a first-level ENCAP _ DB table entry and a second-level ENCAP _ DB table entry through second-level FEC _ NEXT _ HOP information; acquiring additional information and original label values from the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry to obtain more than one additional information and more than one original label value; packaging an original label carrying an original label value into a message to be forwarded to obtain a standard label packaging message; and packaging each additional information serving as a tag value of a newly added tag into a standard tag packaging message to obtain an extended tag packaging message.

Description

label packaging method and device
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a tag encapsulation method and apparatus.
Background
MPLS (Multiprotocol Label Switching) is a backbone technology with a wide range of applications. MPLS introduces a connection-oriented label switching concept on a connectionless IP (Internet Protocol) network, combines a Layer 3 routing technology with a Layer2 switching technology, and fully exerts flexibility of IP routing and simplicity of two-Layer switching.
in the MPLS network, after receiving a packet, a forwarding chip in an LSR (Label Switching Router) determines, through table lookup, corresponding FEC _ NEXT _ HOP (forwarding equivalence class NEXT HOP) information, and then obtains, through the FEC _ NEXT _ HOP information, an outgoing Label (Out Label) included in an entry of an ENCAP _ DB, and encapsulates the outgoing Label in the packet and forwards the packet.
In the prior art, the number of labels packaged in a message by some forwarding chips is limited, and at most, only 4 layers of labels can be packaged, so that more layers of labels cannot be packaged according to the requirement of actual networking, and the application range is limited. The specific packaging process is as follows:
after determining the FEC _ NEXT _ HOP information of the message to be forwarded, the forwarding chip acquires the Identifier (ID) of the output port and the Index1_1 of the entry of the first-level ENCAP _ DB (encapsulation database) from the FEC _ NEXT _ HOP information, searches the entry of the first-level ENCAP _ DB through the Index1_1, acquires 2 tag values and the Index1_2 of the entry of the second-level ENCAP _ DB, searches the entry of the second-level ENCAP _ DB through the Index1_2, and acquires 2 tag values from the entry, thereby finally acquiring 4 tag values, where the 4 tag values are the tag values of the outgoing tag of the message to be forwarded. And after the label carrying the label values is encapsulated into the message to be forwarded, forwarding the encapsulated label message obtained by encapsulation from the output port.
it can be seen that, in such a forwarding chip, the ENCAP _ DB table entries in the FEC _ NEXT _ HOP information may be cascaded in a pointer index manner, but the number of cascading times is limited, and only 2 times of cascading, and each ENCAP _ DB table entry only contains 2 tag values, so that at most 4-layer tags can be encapsulated in a message.
Disclosure of Invention
in view of the above, the present application provides a label packaging method and apparatus.
Specifically, the method is realized through the following technical scheme:
In one aspect, a label encapsulation method is provided, where the method is applied to a forwarding chip in a label switching forwarding device, and the method includes:
determining first-stage FEC _ NEXT _ HOP information corresponding to a message to be forwarded and second-stage FEC _ NEXT _ HOP information cascaded with the first-stage FEC _ NEXT _ HOP information, wherein the second-stage FEC _ NEXT _ HOP information comprises an egress port identifier and an index of a first-stage ENCAP _ DB table entry;
Searching a first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry cascaded with the first-stage ENCAP _ DB table entry through second-stage FEC _ NEXT _ HOP information;
Acquiring additional information and original label values from a first-stage FEC _ NEXT _ HOP information, a first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry to obtain more than one additional information and more than one original label value, wherein one or more than two of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry contain the additional information, and the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry contain the original label values;
Packaging an original label carrying an original label value into a message to be forwarded to obtain a standard label packaging message;
and packaging each additional information serving as a tag value of a newly added tag into a standard tag packaging message to obtain an extended tag packaging message.
in another aspect, a label packaging apparatus is provided, where the apparatus is applied to a forwarding chip in a label switching forwarding device, and the apparatus includes:
The device comprises a searching unit and a forwarding unit, wherein the searching unit is used for determining first-stage FEC _ NEXT _ HOP information corresponding to a message to be forwarded and second-stage FEC _ NEXT _ HOP information cascaded with the first-stage FEC _ NEXT _ HOP information, and the second-stage FEC _ NEXT _ HOP information comprises an exit port identifier and an index of a first-stage ENCAP _ DB table entry; searching a first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry cascaded with the first-stage ENCAP _ DB table entry through second-stage FEC _ NEXT _ HOP information;
an obtaining unit, configured to obtain additional information and an original tag value from a first-level FEC _ NEXT _ HOP information, a first-level ENCAP _ DB table entry, and a second-level ENCAP _ DB table entry, to obtain one or more additional information and one or more original tag values, where one or more of the first-level FEC _ NEXT _ HOP information, the first-level ENCAP _ DB table entry, and the second-level ENCAP _ DB table entry include the additional information, and the first-level ENCAP _ DB table entry and the second-level ENCAP _ DB table entry include the original tag value;
the encapsulation unit is used for encapsulating the original label carrying the original label value into the message to be forwarded to obtain a standard label encapsulation message; and packaging each additional information serving as a tag value of a newly added tag into a standard tag packaging message to obtain an extended tag packaging message.
Through the technical scheme, the forwarding chip can package more layers of labels in the message, and can package 7 layers of labels at most, so that more layers of labels can be packaged according to the requirement of actual networking, and the application range is expanded.
drawings
Fig. 1 is a flowchart illustrating a label packaging method according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating the determination of first-stage FEC _ NEXT _ HOP information and second-stage FEC _ NEXT _ HOP information according to an embodiment of the present disclosure;
Fig. 3 is another schematic diagram illustrating the determination of first-stage FEC _ NEXT _ HOP information and second-stage FEC _ NEXT _ HOP information according to an embodiment of the present application;
FIG. 4 is a diagram illustrating a lookup of a first level ENCAP _ DB entry and a second level ENCAP _ DB entry according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a tag format shown in an embodiment of the present application;
Fig. 6 is a schematic structural diagram of a 7-layer tag in an extended tag encapsulation message according to an embodiment of the present application;
Fig. 7 is a schematic structural diagram of a label packaging apparatus according to an embodiment of the present application.
Detailed Description
reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
it is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the prior art, a switch chip in an LSR can only encapsulate 4 layers of labels in a message to be forwarded at most, so that encapsulation of more layers of labels cannot be performed according to the requirement of actual networking, and the application range is limited. In order to solve the above problem, the following embodiments of the present application provide a label packaging method and an apparatus to which the method can be applied.
The label encapsulation method according to the embodiment of the present application may be executed by a forwarding chip in a label switching forwarding device, where the label switching forwarding device may be, for example, a forwarding device with label distribution and switching capabilities, such as an LSR. Currently, a standard forwarding chip may implement FEC _ NEXT _ HOP information concatenation, but limited by chip hardware resources, the number of times of FEC _ NEXT _ HOP information concatenation is limited, and only two times of FEC _ NEXT _ HOP information concatenation is possible, so in this embodiment of the present application, by using the above-mentioned feature of FEC _ NEXT _ HOP information concatenation, when FEC _ NEXT _ HOP information concatenation is performed, the first-stage FEC _ NEXT _ HOP information includes an index of the second-stage FEC _ NEXT _ HOP information, that is, the first-stage FEC _ NEXT _ HOP information points to the second-stage FEC _ NEXT _ HOP information, and carries the index identifying the cap port and the first-stage entry of the first-stage FEC _ DB in the second-stage FEC _ NEXT _ HOP information, at this time, 20 bits of reserved bits may be provided in the first-stage FEC _ NEXT _ HOP information for carrying additional information.
In addition, 20-bit reserved bits for carrying additional information may also be provided in the existing first-level ENCAP _ DB entry and second-level ENCAP _ DB entry.
In an actual implementation process, a specific value of the additional information may be configured by a user, which is not limited in this embodiment of the application. In the embodiment of the present application, additional information may be carried in any one of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry, and the second-stage ENCAP _ DB table entry, two of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry, and the second-stage ENCAP _ DB table entry, or both of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry, and the second-stage.
based on this, the label packaging method of the embodiment of the present application includes: determining first-stage FEC _ NEXT _ HOP information corresponding to a message to be forwarded and second-stage FEC _ NEXT _ HOP information cascaded with the first-stage FEC _ NEXT _ HOP information, wherein the second-stage FEC _ NEXT _ HOP information comprises an egress port identifier and an index of a first-stage ENCAP _ DB table entry; searching a first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry cascaded with the first-stage ENCAP _ DB table entry through second-stage FEC _ NEXT _ HOP information; acquiring additional information and original label values from a first-stage FEC _ NEXT _ HOP information, a first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry to obtain more than one additional information and more than one original label value, wherein one or more than two of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry contain the additional information, and the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry contain the original label values; packaging an original label carrying an original label value into a message to be forwarded to obtain a standard label packaging message; and packaging each additional information serving as a tag value of a newly added tag into a standard tag packaging message to obtain an extended tag packaging message.
the above label packaging method is described in detail below with a specific example. The internal functions of a standard forwarding chip can be divided into: fixed logic, configurable logic, and programmable logic. In the prior art, the tag encapsulation process is done by fixed logic and configurable logic, and programmable logic does not need to participate in the process. In the embodiment of the present application, in order to enable additional information to be carried in one or more of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry, and the second-stage ENCAP _ DB table entry, and subsequently, to enable each additional information to be encapsulated into a standard tag encapsulation message as a tag value of a newly added tag, the following 3 points may be implemented by configurable logic and programmable logic:
(1) the cascade connection of FEC _ NEXT _ HOP information is realized through configurable logic, and the first-stage FEC _ NEXT _ HOP information comprises: an index of 20 bits of additional information and second level FEC _ NEXT _ HOP information; the second level FEC _ NEXT _ HOP information includes: egress port identification and index of first level ENCAP _ DB entry.
(2) Through configurable logic, 20 bits of additional information are carried in the first-level ENCAP _ DB table entry and the second-level ENCAP _ DB table entry respectively, so that each level of ENCAP _ DB table entry can carry additional information in addition to the original tag value.
(3) and through programmable logic, each additional information can be packaged into a standard label packaging message as a label value of a newly added label, wherein the standard label packaging message is a message obtained by packaging according to the prior art, and the standard label packaging message carries 4 layers of original labels at most.
The following description will be given taking an example in which the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry, and the second-stage ENCAP _ DB table entry all contain additional information.
as shown in fig. 1, a label packaging method executed by a forwarding chip in an embodiment of the present application includes the following steps:
Step S101, determining first-stage FEC _ NEXT _ HOP information corresponding to a message to be forwarded and second-stage FEC _ NEXT _ HOP information cascaded with the first-stage FEC _ NEXT _ HOP information;
Wherein, the first-stage FEC _ NEXT _ HOP information includes: 20 bits of additional information 1000 and an Index2_2 of second level FEC _ NEXT _ HOP information; the second level FEC _ NEXT _ HOP information includes: the egress Port identifies Port1 and the Index Index3_1 of the first level ENCAP _ DB entry.
specifically, as shown in fig. 2, when the packet to be forwarded is an IP packet, according to the destination IP address of the packet to be forwarded, an Index2_1 of the first-stage FEC _ NEXT _ HOP Information is searched in an FIB (Forwarding Information Base) table, and the first-stage FEC _ NEXT _ HOP Information is searched through the Index2_ 1; the second-stage FEC _ NEXT _ HOP information is searched for by the Index2_2 of the second-stage FEC _ NEXT _ HOP information contained in the first-stage FEC _ NEXT _ HOP information.
Or, as shown in fig. 3, when the packet to be forwarded is a Label encapsulation packet (e.g., an MPLS packet), according to a Label carried in the packet to be forwarded, an Index2_1 of the first-stage FEC _ NEXT _ HOP Information is searched in an LFIB (Label Forwarding Information Base) table, and the first-stage FEC _ NEXT _ HOP Information is searched through the Index2_ 1; the second-stage FEC _ NEXT _ HOP information is searched for by the Index2_2 of the second-stage FEC _ NEXT _ HOP information contained in the first-stage FEC _ NEXT _ HOP information.
Step S102, searching a first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry cascaded with the first-stage ENCAP _ DB table entry through second-stage FEC _ NEXT _ HOP information;
specifically, as shown in fig. 4, an Index3_1 of the first-level ENCAP _ DB table entry is obtained from the second-level FEC _ NEXT _ HOP information, and the first-level ENCAP _ DB table entry is searched through the Index3_1, where the first-level ENCAP _ DB table entry includes: index3_2 of the second level ENCAP _ DB entry, 2 original tag values 100 and 200, and 20 bits of additional information 2000; searching a second-level ENCAP _ DB table entry through the Index3_2, wherein the second-level ENCAP _ DB table entry comprises: 2 original tag values 300 and 400, and 20 bits of additional information 3000.
Step S103, obtaining additional information and original label values from the first-level FEC _ NEXT _ HOP information, the first-level ENCAP _ DB table entry and the second-level ENCAP _ DB table entry, to obtain 3 additional information 1000, 2000, 3000 and 4 original label values 100, 200, 300, 400.
step S104, packaging the original label carrying the original label value into the message to be forwarded to obtain a standard label packaging message;
Specifically, for each of the obtained 4 original tag values, the original tag carrying the original tag value is encapsulated in the packet to be forwarded, and the specific encapsulation process is the same as that in the prior art, and is not described in detail here. The packaging format of the tag is shown in fig. 5:
Label field: for carrying the tag value, the length of this field is 20 bits.
TC (Traffic Class) field: also called exp (experimental) field, which has a length of 3 bits and is used for QoS (Quality of Service).
And (2) S field: also called a bos field, which is a bottom-of-stack identification bit (bottom-of-stack indicator) of a label, and the field is 1 bit in length. Since MPLS supports multiple labels, multiple layers of labels may be encapsulated in a packet to form a label stack. Because the label is encapsulated between the link layer frame head and the network layer message head of the message, the outermost layer label close to the link layer frame head is a stack top label, and the innermost layer label close to the network layer message head is a stack bottom label. When the S bit is 1, the label is a stack bottom label, and when the S bit is 0, the label is a non-stack bottom label.
TTL (Time To Live) field: the field is 8 bits in length, and the meaning of the field is the same as the TTL meaning in the IP message, and can be used for preventing loop.
Assuming that the label values in 4 original labels in the standard label encapsulation message are as follows in sequence from the inner layer to the outer layer: 100. 200, 300, 400, wherein 100 is the label value of the bottom label of the innermost stack.
in an actual implementation process, the steps S101 to S104 may be specifically executed by fixed logic and configurable logic in the forwarding chip, and when the step S103 is executed to obtain the additional information and the original tag value, the fixed logic and the configurable logic cannot identify the additional information, that is, do not know what type of information the additional information is, and when the step S104 is executed to encapsulate the original tag, the additional information cannot be encapsulated into the packet as the tag value. After step S104 is executed, the fixed logic and the configurable logic will carry the acquired 3 pieces of additional information 1000, 2000, 3000 in the logic forwarding information in the chip, and transmit the logic forwarding information and the standard tag encapsulation packet to the programmable logic together.
In order to enable the programmable logic to determine whether the additional information is carried by the first-level FEC _ NEXT _ HOP information, the first-level ENCAP _ DB table entry, or the second-level ENCAP _ DB table entry, a corresponding identifier needs to be set for each additional information, so as to indicate to which of the first-level FEC _ NEXT _ HOP information, the first-level ENCAP _ DB table entry, or the second-level ENCAP _ DB table entry the additional information belongs.
step S105, aiming at the additional information 1000 contained in the first-stage FEC _ NEXT _ HOP information, generating a first newly added label with the label value of 1000, and packaging the first newly added label serving as the bottom label of the innermost layer into a standard label packaging message; generating a second newly added label with the label value of 2000 aiming at the additional information 2000 contained in the first-level ENCAP _ DB table entry, and packaging the second newly added label to the outermost layer of the original label in the standard label packaging message; and generating a third newly added label with the label value of 3000 according to the additional information 3000 contained in the second-level ENCAP _ DB table entry, and encapsulating the third newly added label to the outermost layer of the original label in the standard label encapsulation message.
the programmable logic may provide a plurality of instructions to flexibly edit the message, and in this embodiment, the step S105 is executed by the programmable logic using the above-mentioned characteristics of the programmable logic. Specifically, in step S105, after receiving the logic forwarding information and the standard label encapsulation packet, the programmable logic may obtain a TC value and an S value in a stack bottom label in the standard label encapsulation packet, and then encapsulate the newly added label according to the following three conditions:
The first condition is as follows: the first stage FEC _ NEXT _ HOP information includes additional information 1000
Setting the S value of the current stack bottom label (the original label with the label value of 100) in the standard label encapsulation message to be 0, and at the moment, changing the label into a non-stack bottom label; generating a first newly added label with a label value of 1000, setting a TC value and an S value in the first newly added label as the obtained TC value and S value respectively, and setting the S value in the first newly added label as 1 to indicate that the first newly added label is a stack bottom label; and then, inserting the first new added label into the innermost layer of the original label in the standard label packaging message to form a new bottom-of-stack label.
Case two: the first level ENCAP _ DB entry contains additional information 2000
generating a second newly added label with a label value of 2000, setting the TC value and the S value in the second newly added label as the obtained TC value and S value respectively, and setting the S value in the second newly added label as 0; then, a second new tag is inserted into the outermost layer of the original tag in the standard tag encapsulation message.
Case three: the second level ENCAP _ DB entry contains additional information 3000
Generating a third newly added label with a label value of 3000, setting the TC value and the S value in the third newly added label as the obtained TC value and S value respectively, and setting the S value in the third newly added label as 0; then, the third new tag is inserted into the outermost layer of the original tag in the standard tag encapsulation message.
In the actual implementation process, as the TC values in different original tags are the same and the TTL values are also the same, when a new tag is encapsulated, the TC value and the TTC value in the bottom-of-stack tag (original tag) in a standard tag encapsulation message can be obtained as the TC value and the TTC value in the new tag; the TC value and the TTC value in other original tags may also be obtained, which is not limited in this embodiment of the application. As can be seen, the TC values in the original tag and the newly added tag in the extended tag encapsulation message are equal, and the TTL values are also equal.
in addition, the second new tag carrying the additional information 2000 and the third new tag carrying the additional information 3000 are both required to be inserted into the outermost layer of the original tag, and the relationship between the inner layer and the outer layer may not be limited between the two new tags, that is, the second new tag may be located on the inner layer or the outer layer of the third new tag.
If the second newly added label is located in the inner layer of the third newly added label, at this time, 7 layers of labels are encapsulated in the extended label encapsulation message, and the label values in the 7 layers of labels are sequentially from the inner layer to the outer layer: 1000. 100, 200, 300, 400, 2000, 3000 as shown in fig. 6. Therefore, by the method of the embodiment of the application, labels with 7 layers at most can be packaged in the message.
corresponding to the foregoing embodiments of the label packaging method, the present application also provides embodiments of a label packaging apparatus, which is applied to a forwarding chip in a label switching forwarding device.
Referring to fig. 7, a label packaging apparatus according to an embodiment of the present application includes: a search unit 701, an acquisition unit 702 and an encapsulation unit 703, wherein:
A searching unit 701, configured to determine first-stage FEC _ NEXT _ HOP information corresponding to a packet to be forwarded, and second-stage FEC _ NEXT _ HOP information cascaded with the first-stage FEC _ NEXT _ HOP information, where the second-stage FEC _ NEXT _ HOP information includes an egress port identifier and an index of a first-stage ENCAP _ DB table entry; searching a first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry cascaded with the first-stage ENCAP _ DB table entry through second-stage FEC _ NEXT _ HOP information;
an obtaining unit 702, configured to obtain additional information and an original tag value from a first-level FEC _ NEXT _ HOP information, a first-level ENCAP _ DB table entry, and a second-level ENCAP _ DB table entry, to obtain one or more additional information and one or more original tag values, where one or more of the first-level FEC _ NEXT _ HOP information, the first-level ENCAP _ DB table entry, and the second-level ENCAP _ DB table entry include the additional information, and the first-level ENCAP _ DB table entry and the second-level ENCAP _ DB table entry include the original tag value;
an encapsulating unit 703, configured to encapsulate an original tag carrying an original tag value into a packet to be forwarded to obtain a standard tag encapsulation packet; and packaging each additional information serving as a tag value of a newly added tag into a standard tag packaging message to obtain an extended tag packaging message.
Wherein, the reserved bits in the first-stage FEC _ NEXT _ HOP information are used for carrying additional information;
reserved bits in the first-level ENCAP _ DB table entry are used for carrying additional information;
reserved bits in the second level ENCAP _ DB table entry are used to carry additional information.
The encapsulating unit 703 is specifically configured to encapsulate each piece of additional information into a standard label encapsulation message as a label value of a newly added label in the following manner:
If the first-stage FEC _ NEXT _ HOP information contains additional information, generating a first newly added label with the label value being the additional information, and packaging the first newly added label serving as an innermost layer of the bottom label in a standard label packaging message;
If the first-level ENCAP _ DB table item contains additional information, generating a second newly added label with the label value being the additional information, and packaging the second newly added label to the outermost layer of the original label in the standard label packaging message;
and if the second-level ENCAP _ DB table entry contains the additional information, generating a third newly added label with the label value being the additional information, and encapsulating the third newly added label to the outermost layer of the original label in the standard label encapsulation message.
In the extended label encapsulation message, the TC value in the newly added label is equal to the TC value in the original label, and the TTL value in the newly added label is equal to the TTL value in the original label.
wherein, the number range of the original tags is between 1 and 4, and the number range of the newly added tags is between 1 and 3.
the implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
for the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the 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 modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. a label encapsulation method is applied to a forwarding chip in a label switching forwarding device, and comprises the following steps:
Determining first-stage forwarding equivalence class NEXT HOP FEC _ NEXT _ HOP information corresponding to a message to be forwarded and second-stage FEC _ NEXT _ HOP information cascaded with the first-stage FEC _ NEXT _ HOP information, wherein the second-stage FEC _ NEXT _ HOP information comprises an egress port identifier and an index of a first-stage encapsulation database ENCAP _ DB entry;
searching the first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry cascaded with the first-stage ENCAP _ DB table entry through the second-stage FEC _ NEXT _ HOP information;
Acquiring additional information and original label values from the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry to obtain more than one additional information and more than one original label value, wherein one or more than two of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry contain the additional information, and the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry contain the original label values;
Packaging the original label carrying the original label value into the message to be forwarded to obtain a standard label packaging message;
packaging each additional information serving as a tag value of a newly added tag into the standard tag packaging message to obtain an extended tag packaging message;
the first stage FEC _ NEXT _ HOP information includes: an index of the additional information and second level FEC _ NEXT _ HOP information;
the first level ENCAP _ DB table entry includes: additional information, original label and index of second-level ENCAP _ DB table item;
the second level ENCAP _ DB table entry includes: additional information and an original label.
2. The method of claim 1, wherein reserved bits in the first stage FEC _ NEXT _ HOP information are used to carry additional information;
reserved bits in the first-level ENCAP _ DB table entry are used for carrying additional information;
and reserved bits in the second-level ENCAP _ DB table entry are used for carrying additional information.
3. The method of claim 1, wherein encapsulating each additional information into the standard label encapsulation message as a label value of a newly added label comprises:
if the first-stage FEC _ NEXT _ HOP information contains additional information, generating a first newly added label with the label value being the additional information, and packaging the first newly added label serving as an innermost layer of stack bottom label into the standard label packaging message;
if the first-level ENCAP _ DB table item contains additional information, generating a second newly added label with the label value being the additional information, and packaging the second newly added label to the outermost layer of the original label in the standard label packaging message;
And if the second-level ENCAP _ DB table entry contains additional information, generating a third newly added label with the label value being the additional information, and packaging the third newly added label to the outermost layer of the original label in the standard label packaging message.
4. the method according to any of claims 1 to 3, wherein in the expanded label encapsulated message, the traffic class TC value in the newly added label is equal to the TC value in the original label, and the time-to-live TTL value in the newly added label is equal to the TTL value in the original label.
5. a method as claimed in any one of claims 1 to 3, wherein the number of old tags ranges from 1 to 4 and the number of new tags ranges from 1 to 3.
6. a label encapsulation apparatus, applied to a forwarding chip in a label switching forwarding device, the apparatus comprising:
The device comprises a searching unit and a forwarding unit, wherein the searching unit is used for determining first-stage forwarding equivalence class NEXT HOP FEC _ NEXT _ HOP information corresponding to a message to be forwarded and second-stage FEC _ NEXT _ HOP information cascaded with the first-stage FEC _ NEXT _ HOP information, and the second-stage FEC _ NEXT _ HOP information comprises an egress port identifier and an index of a first-stage encapsulation database ENCAP _ DB table entry; searching the first-stage ENCAP _ DB table entry and a second-stage ENCAP _ DB table entry cascaded with the first-stage ENCAP _ DB table entry through the second-stage FEC _ NEXT _ HOP information;
An obtaining unit, configured to obtain additional information and an original tag value from the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry, and the second-stage ENCAP _ DB table entry, so as to obtain one or more additional information and one or more original tag values, where one or more of the first-stage FEC _ NEXT _ HOP information, the first-stage ENCAP _ DB table entry, and the second-stage ENCAP _ DB table entry include the additional information, and the first-stage ENCAP _ DB table entry and the second-stage ENCAP _ DB table entry include the original tag value;
The encapsulation unit is used for encapsulating the original label carrying the original label value into the message to be forwarded to obtain a standard label encapsulation message; packaging each additional information serving as a tag value of a newly added tag into the standard tag packaging message to obtain an extended tag packaging message;
The first stage FEC _ NEXT _ HOP information includes: an index of the additional information and second level FEC _ NEXT _ HOP information;
The first level ENCAP _ DB table entry includes: additional information, original label and index of second-level ENCAP _ DB table item;
The second level ENCAP _ DB table entry includes: additional information and an original label.
7. the apparatus of claim 6, wherein reserved bits in the first stage FEC _ NEXT _ HOP information are used to carry additional information;
reserved bits in the first-level ENCAP _ DB table entry are used for carrying additional information;
And reserved bits in the second-level ENCAP _ DB table entry are used for carrying additional information.
8. The apparatus according to claim 6, wherein the encapsulating unit is specifically configured to encapsulate each additional information as a tag value of a new tag into the standard tag encapsulation message by:
if the first-stage FEC _ NEXT _ HOP information contains additional information, generating a first newly added label with the label value being the additional information, and packaging the first newly added label serving as an innermost layer of stack bottom label into the standard label packaging message;
If the first-level ENCAP _ DB table item contains additional information, generating a second newly added label with the label value being the additional information, and packaging the second newly added label to the outermost layer of the original label in the standard label packaging message;
and if the second-level ENCAP _ DB table entry contains additional information, generating a third newly added label with the label value being the additional information, and packaging the third newly added label to the outermost layer of the original label in the standard label packaging message.
9. The apparatus according to any of claims 6 to 8, wherein in the extended label encapsulated message, the traffic class TC value in the newly added label is equal to the TC value in the original label, and the time-to-live TTL value in the newly added label is equal to the TTL value in the original label.
10. The apparatus of any one of claims 6 to 8, wherein the number of original tags ranges from 1 to 4 and the number of added tags ranges from 1 to 3.
CN201710272289.6A 2017-04-24 2017-04-24 Label packaging method and device Active CN107124360B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710272289.6A CN107124360B (en) 2017-04-24 2017-04-24 Label packaging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710272289.6A CN107124360B (en) 2017-04-24 2017-04-24 Label packaging method and device

Publications (2)

Publication Number Publication Date
CN107124360A CN107124360A (en) 2017-09-01
CN107124360B true CN107124360B (en) 2019-12-06

Family

ID=59724812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710272289.6A Active CN107124360B (en) 2017-04-24 2017-04-24 Label packaging method and device

Country Status (1)

Country Link
CN (1) CN107124360B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450792B (en) * 2018-10-08 2021-05-07 新华三技术有限公司 Data message packaging method and device
CN110661713B (en) * 2019-10-22 2021-09-21 新华三信息安全技术有限公司 Message forwarding method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009705B (en) * 2007-01-30 2010-07-28 华为技术有限公司 Method and related device for forwarding data frame
CN101090355B (en) * 2007-07-24 2010-09-22 杭州华三通信技术有限公司 Label exchange route setting method, system and equipment of virtual special network channel
CN102025632B (en) * 2010-12-15 2012-10-17 迈普通信技术股份有限公司 Label distribution method and system for data packets in MPLS network
CN102123097B (en) * 2011-03-14 2015-05-20 杭州华三通信技术有限公司 Method and device for protecting router
CN102111338B (en) * 2011-03-22 2012-08-15 北京星网锐捷网络技术有限公司 Label forwarding information storage method and device, and message forwarding method and device
CN102710533B (en) * 2012-06-28 2014-11-12 杭州华三通信技术有限公司 Label expanding method and label expanding device for multi-protocol label switching
CN105871722B (en) * 2015-01-19 2020-02-14 中兴通讯股份有限公司 Label structure and label message forwarding method and device

Also Published As

Publication number Publication date
CN107124360A (en) 2017-09-01

Similar Documents

Publication Publication Date Title
CN111884934B (en) Method, device and system for forwarding message in Service Function Chain (SFC)
CN106330714B (en) Method and device for realizing service function chain
CN110266594B (en) Cross-network-slice segmented routing forwarding method and device
CN113055289B (en) Message forwarding method, device and system based on service function chain SFC
CN105024985B (en) A kind of message processing method and device
CN102694721B (en) Method for the packet switch in network
CN111953604A (en) Method and device for providing service for service flow
US8411667B2 (en) Methods, apparatus and articles of manufacture to manipulate packet routing
CN106341298B (en) File transmitting method and device
CN106603413B (en) Method and device for transmitting flow through designated path
CN111385209B (en) Message processing method, message forwarding method, device and equipment
JP2006020317A (en) Joint pipelining packet classification, and address search method and device for switching environments
CN107968750A (en) Message transmitting method, device and node
CN110401599A (en) The processing method and processing device of data packet, storage medium, electronic device
US10110487B1 (en) Signaling priority information for encapsulated packets
CN110138618A (en) A kind of message processing method, apparatus and system
CN109861897B (en) Method, device and system for obtaining corresponding relation
CN113411258A (en) Message processing method and device
CN107124360B (en) Label packaging method and device
CN111404797A (en) Control method, SDN controller, SDN access point, SDN gateway and CE
KR20230005369A (en) IOAM methods and electronics
CN101888336A (en) Method of using access device to realize time division multiplexing service relaying and access device
CN115037675A (en) Message forwarding method and device
CN112714063B (en) Message transmission method, device and digital processing chip
CN108574637A (en) A kind of method, apparatus and interchanger of address learning

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