WO2016034040A1 - 一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置 - Google Patents

一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置 Download PDF

Info

Publication number
WO2016034040A1
WO2016034040A1 PCT/CN2015/086986 CN2015086986W WO2016034040A1 WO 2016034040 A1 WO2016034040 A1 WO 2016034040A1 CN 2015086986 W CN2015086986 W CN 2015086986W WO 2016034040 A1 WO2016034040 A1 WO 2016034040A1
Authority
WO
WIPO (PCT)
Prior art keywords
label
node
stack
packet
label stack
Prior art date
Application number
PCT/CN2015/086986
Other languages
English (en)
French (fr)
Inventor
林雪峰
刘恩慧
陈国义
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/086986 priority Critical patent/WO2016034040A1/zh
Priority to EP15837992.5A priority patent/EP3179677B1/en
Publication of WO2016034040A1 publication Critical patent/WO2016034040A1/zh
Priority to US15/449,850 priority patent/US10419333B2/en

Links

Images

Classifications

    • 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/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • H04L45/127Shortest path evaluation based on intermediate node capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/34Source routing
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and a device for compressing a label stack, and a method and a device for decompressing a label stack.
  • segment routing (English: Segment Routing, SR for short) technology.
  • the source node Before forwarding the packet, the source node creates a forwarding path between the source node and the destination node according to the forwarding requirements (English: Label Switching Path, LSP for short), and determines the node, link, and node through which the LSP passes.
  • Information such as services, and the information is added to the packets to be forwarded in the form of a label stack. In this way, after receiving the packet, the forwarding node on the LSP can perform subsequent processing according to the meaning of the label indicated at the top of the label stack.
  • the top label of the stack is a service segment identifier (Segment Identification, SID for short), and the forwarding node can perform the service represented by the service SID; the top label of the stack is the node SID, and the forwarding node can forward the packet to the The node represented by the node SID; the top tag of the stack is the link SID, and the intermediate node can perform link forwarding according to the indication of the link SID to forward the message to the opposite node of the intermediate node.
  • SID Segment Identification
  • the forwarding node forwards the packet along the LSP
  • the label is pushed into the packet.
  • the stack will be multi-layered, causing the length of the label stack to be too long, which greatly increases the length of the forwarded packets, which is not conducive to the transmission of packets in the network.
  • the method and device for compressing the label stack and the method and device for decompressing the label stack provided by the embodiment of the present invention can shorten the length of the label stack of the pushed message when the forwarding node forwards the packet, and further Reducing the total length of packets is beneficial for packets to be transmitted over the network.
  • an embodiment of the present invention provides a method for compressing a label stack, where the method includes:
  • the network device selects a first node label from the first label stack, and the node corresponding to the first node label can encapsulate at least two layers of labels in the packet when forwarding the packet;
  • the network device replaces at least two adjacent labels in the first label stack that are located after the first node label with a first compression label to generate a second label stack.
  • the network device directs the source node on the forwarding path to perform packet processing according to the second label stack.
  • the selecting, by the network device, the first node label from the first label stack includes:
  • the network node device obtains the label number i corresponding to the label can be associated with the number of layers M i for packet encapsulation tag label L i and i of the node; tag associated with the node i to node label tag i + 1 And a label after the node label i+1, 1 ⁇ i ⁇ n, n is the number of nodes on the forwarding path;
  • the network device selects the first node label, and the node corresponding to the first node label can encapsulate the number of layers of the packet to be not less than 2, and the first difference corresponding to the first node label is not less than 0. .
  • the first label stack includes a node corresponding to at least two node labels
  • the number of layers of the packet encapsulation label is not less than 2
  • the first difference corresponding to the at least two node labels is not less than 0,
  • the number of labels associated with the first node label is the largest of the number of labels associated with the at least two node labels.
  • the method further includes:
  • the network device to obtain the corresponding node label j M j to the tag can be associated with the number of packet encapsulation layers tag and the node label j L j,; j tag associated with the node labeled node label j + 1 And the label after the node label j+1, 1 ⁇ j ⁇ m,m ⁇ n;
  • the network device selects a second node label, and the node corresponding to the second node label can encapsulate the label number of the packet is not less than 2, and the second difference corresponding to the second node label is not less than 0;
  • the network device replaces at least two adjacent labels in the second label stack that are located after the second node label with a second compression label to generate a third label stack; at least after the second node label The first compression label is included in two adjacent labels;
  • the network device directs the source node on the forwarding path to perform packet processing according to the second label stack:
  • the network device directs the source node on the forwarding path to perform packet processing according to the third label stack.
  • the network device is selected from the first label stack Before the first node label, the method further includes:
  • the network device determines whether the source node can encapsulate at least two layers of labels for the packet, and if yes, performs the step of selecting the first node label from the first label stack.
  • the node label is a node segment identifier SID or a link SID. .
  • an embodiment of the present invention provides a method for decompressing a label stack, where the method includes:
  • the forwarding node acquires label configuration information of the local node, where the label configuration information includes a correspondence between the compressed label and the compressed label, and the compressed label includes at least two labels;
  • the forwarding node receives a packet sent from a source node, where the packet includes a first label stack, and the first label stack includes the compression label;
  • the forwarding node replaces the compressed label in the first label stack with the compressed label according to the label configuration information, to generate a second label stack;
  • the forwarding node processes the packet according to the second label stack.
  • the forwarding node processes the packet according to the second label stack, including:
  • the forwarding node forwards the message to a node corresponding to the node label
  • the forwarding node performs a service corresponding to the service label on the packet.
  • an embodiment of the present invention provides a compression device for a label stack, where the device includes:
  • a label stack obtaining unit configured to obtain a first label stack corresponding to the forwarding path, where the first label stack includes a node label corresponding to each node on the forwarding path;
  • a first selecting unit configured to select a first node label from the first label stack obtained by the label stack obtaining unit, where the node corresponding to the first node label can forward the packet when forwarding the packet Encapsulating at least two layers of labels;
  • a first replacement unit configured to replace at least two adjacent labels in the first label stack that are located after the first node label with a first compression label, to generate a second label stack;
  • the guiding unit is configured to guide the source node on the forwarding path to perform packet processing according to the second label stack generated by the first replacement unit.
  • the first selecting unit includes:
  • a first obtaining unit, i corresponding node label can be used to obtain the number of layers M i tag encapsulated packet label L i and the node i associated with the label; i node associated with the node label tag label i+1 and the label after the node label i+1, 1 ⁇ i ⁇ n, n is the number of nodes on the forwarding path;
  • the sub-unit is configured to select the first node label, where the node corresponding to the first node label can encapsulate the number of layers of the packet is not less than 2, and the first difference corresponding to the first node label is not Less than 0.
  • the apparatus further includes:
  • means for generating said second label stack in the first alternative, to obtain a corresponding node label j to j can tag associated packet encapsulation layers L j and the tag node tag a number M j ;
  • the label associated with the node label j is a node label j+1 and a label after the node label j+1, 1 ⁇ j ⁇ m, m ⁇ n;
  • a second selecting unit configured to select a second node label, where the node corresponding to the second node label can encapsulate the number of layers of the packet is not less than 2, and the second difference corresponding to the second node label is not less than 0;
  • a second replacement unit configured to replace at least two adjacent labels in the second label stack that are located after the second node label with a second compression label to generate a third label stack;
  • the first compressed label is included in at least two adjacent labels;
  • the guiding unit is specifically configured to guide the source node on the forwarding path to perform packet processing according to the third label stack generated by the second replacement unit.
  • the apparatus further includes:
  • a determining unit configured to determine, before the first selecting unit selects the first node label, whether the source node can encapsulate at least two layers of labels, and if yes, notify the first selecting unit to select The first node label is described.
  • an embodiment of the present invention provides a decompression device for a label stack, where the device includes:
  • An acquiring unit configured to acquire label configuration information of the local node, where the label configuration information includes a correspondence between the compressed label and the compressed label, where the compressed label includes at least two labels;
  • a receiving unit configured to receive a packet sent from a source node, where the packet includes a first label stack, where the first label stack includes the compressed label;
  • a replacement unit configured to replace the compressed label in the first label stack included in the packet received by the receiving unit with the compressed label according to the label configuration information acquired by the acquiring unit , generating a second label stack;
  • a processing unit configured to process the packet according to the second label stack.
  • the processing unit is configured to: when the top label of the second label stack is a node label, forward the packet to the node label Or the processing unit is configured to: when the top label of the second label stack is a service label, perform the service corresponding to the service label on the message.
  • the network device selects a first node label from the first label stack, and the node corresponding to the first node label can encapsulate at least the packet when forwarding the packet.
  • Two layers of labels so that the first label stack can be compressed, and at least two adjacent labels in the first label stack that are located after the first node label are replaced with a first compressed label to generate a second Label stack.
  • FIG. 1 is a schematic structural diagram of a network in an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for compressing a label stack according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of selecting a first node label in an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of generating a third label stack in an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a method for decompressing a label stack according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of generating a label stack that satisfies a source node label processing capability according to an embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of a compression apparatus of a label stack according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a decompression device of a label stack according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram showing the hardware configuration of a compression device of a label stack according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram showing the hardware configuration of a decompression device of a label stack according to an embodiment of the present invention.
  • the node on the LSP is instructed to process the packet according to the label stack.
  • the label stack corresponding to the LSP may be: ⁇ 12, 901, 902, 201, 901, 19, 901, 20 ⁇ .
  • node SIDs node SIDs
  • node SIDs correspond to nodes on the LSP
  • 901 and 902 are service SIDs, service SIDs and sections.
  • the service performed by the point corresponds
  • 201 is the link SID
  • the link SID corresponds to the link between the two nodes, which in this example can represent the link between the nodes 12 and 17.
  • the node on the LSP is processed according to the label stack, which can be understood as: determining the type of the top SID of the stack. If the top SID of the stack is the service SID, the service corresponding to the service SID is executed; if the top SID is the node SID or the link The SID forwards the message to the node corresponding to the node SID or the link SID.
  • the node 19 pops up the node SID19 of the node, it determines that the top label is the service SID 901, and the node 19 can perform the service corresponding to 901 locally;
  • the node top tag is determined to be the node SID20, and the node 19 can forward the message to the node 20.
  • the same service SID can be used to represent the same service between different nodes.
  • the service 901 to be executed by the node 12 and the service 901 to be executed by the node 19 can represent the firewall service; or, between different nodes.
  • the service 901 to be executed by the node 12 may represent the firewall service
  • the service 901 to be executed by the node 19 may represent the deep packet detection service, and the service represented by the service SID in the embodiment of the present invention. Can not be specifically limited.
  • the label stack ⁇ 12, 901, 902, 201, 901, 19, 901, 20 ⁇ in the above example contains 8 labels, that is, the source node 10 needs to push 8 labels into the to-be-forwarded packet, occupying a large packet space.
  • the embodiment of the present invention is proposed for this purpose to shorten the length of the label stack.
  • the network device in the embodiment of the present invention may be a standalone device, and the network device may communicate with a controller (Controller) and/or a node on a forwarding path. If the network device communicates with the controller, the network device can send the compressed label stack to the source node by using the controller in the embodiment of the present invention; if the network device communicates with the node on the forwarding path, the network device can directly compress the compressed device. The label stack is sent to the source node, or the network device can also send the compressed label stack to the source node via other nodes on the forwarding path. Or, as shown in FIG.
  • the network device in the embodiment of the present invention may also be a Controller integrated with the function of the network device, or a node integrated with the function of the network device on the forwarding path, for example, the source node 10 is integrated with a network.
  • the function of the device may be performed after the label stack is obtained, and the label stack is first compressed, and then the compressed label stack is pushed into the packet.
  • the embodiment of the network device may not be specifically limited.
  • an embodiment of the present invention provides a method for compressing a label stack, where the method includes:
  • the network device obtains a first label stack corresponding to the forwarding path, where the first label stack includes a node label corresponding to each node on the forwarding path.
  • the network device can obtain the label stack corresponding to the LSP first, and explicitly compress the processing object.
  • the network device may generate the label stack according to the service requirement, or the network device may also receive the label stack generated by the other device.
  • the manner in which the network device obtains the label stack may not be specifically limited.
  • the network device generates a label stack of the service between the node 10 and the node 20, and the process of obtaining the label stack by the network device may be:
  • the network device obtains the service capability of the nodes in the network.
  • the network device can obtain the service capability of the node when the label stack needs to be generated, or the network device can obtain the service capability of the node after the node is powered on, which is not specifically limited in this embodiment of the present invention.
  • the service capability may be a service identifier, such as a service SID; if different nodes use different service SIDs to represent the same service, the service capability may be a service name and a service identifier, for example, Firewall service and corresponding service SID.
  • the node may use an intermediate system to an intermediate system (English: intermediate system to intermediate system, ISIS for short) or an open shortest path first (English: Open Shortest Path First (OSPF) protocol).
  • the service capability is reported to the network device.
  • the node may also use the service capability report message provided by the embodiment of the present invention to report the service capability of the node to the network device.
  • the service capability report message may include: a message type, a message length, and a service capability parameter.
  • the message type is a service capability report, which can be represented by 2 bytes;
  • the service capability parameters are: node SID12, service SID901, firewall service, service SID902, deep packet inspection service, and each parameter can be represented by 4 bytes;
  • the message length is the total number of bytes included in the service capability report message, which can be represented by 2 bytes, so the message length in this example is 24 bytes.
  • the node 12 can perform the firewall service and the deep packet detection service, so that the service between the node 10 and the node 20 needs to implement firewall service and deep packet inspection.
  • the network device may determine the node 12 as a node on the LSP.
  • the label stack corresponding to the LSP includes: a node SID12 corresponding to the node 12, a service SID 901 corresponding to the firewall service, and a service SID 902 corresponding to the deep packet detection service.
  • the network device obtains the first label stack corresponding to the LSP.
  • the network device determines the LSP of the node 10 to the node 20 and the service to be executed by each node in the LSP according to the service requirement, and generates a first label stack according to the service.
  • the first label stack may be ⁇ 12,901,902,201,901,19,901,20 ⁇ .
  • the network device obtains the first label stack corresponding to the LSP, and the first label stack includes the node label corresponding to each node on the LSP.
  • the node tag can be a node SID or a link SID, in this example, the first tag stack includes node tags: 12, 201, 19, and 20.
  • the network device selects a first node label from the first label stack, and the node corresponding to the first node label can encapsulate at least two layers of labels in the packet when forwarding the packet.
  • the network device replaces at least two adjacent labels in the first label stack that are located after the first node label with a first compression label to generate a second label stack.
  • the network device in the embodiment of the present invention may perform compression processing on the first label stack, and at least two of the first label stack.
  • the adjacent tags are replaced with a first compressed tag, and a second tag stack including the first compressed tag is generated.
  • the node on the LSP can also decompress the second label stack, and restore the first compression label to the Said at least two adjacent labels.
  • first node label in the first label stack it can also be understood to be located under the first node label, and specifically, the stack top of the first label stack is oriented toward the bottom of the stack, for example, A node tag is 201, and tags 901, 19, 901, and 20 are all tags located after the first node tag.
  • at least two adjacent tags can be understood as continuous uninterrupted between at least two tags, for example, the relationship between the tags 901, 19, 901 and 20 is adjacent to each other.
  • tag processing capability can be understood as: the number of layers that the node can encapsulate the packet when forwarding the packet, that is, the node can report to the packet.
  • the number of labels pushed in the text For example, node A can encapsulate three layers of labels, that is, node A can push three labels into the message.
  • the network device may first select the first node label from the first label stack, and the node corresponding to the first node label should be able to encapsulate at least two layers of labels in the packet, so that the node corresponding to the first node label When the decompression process is performed, at least two adjacent tags obtained by decompression can be correctly pressed into the message.
  • the first node label selected by the network device is the label 201, and the label corresponds to the node 17. If the node 17 can encapsulate the label of the layer 4, the compression processing can be performed. Replace the labels 901, 19, 901, and 20 with the first compression label K0, and generate the first The second tag stack ⁇ 12, 901, 902, 201, K0 ⁇ , thus reducing the length of the tag stack from 8 to 5, which helps to reduce the space occupied by the tag stack.
  • the label stack forwarded by the node 12 to the node 17 is ⁇ 201, K0 ⁇ , and the node 17 can perform decompression processing to restore K0 to ⁇ 901.
  • 19, 901, 20 ⁇ the service corresponding to the tag 901 is executed, and a total of three tags of 19, 901, and 20 are pushed into the message, and the node 19 is instructed to perform message processing according to the tag stack.
  • the number of labels (3) that need to be pushed into the packet is not greater than the number of layers (4 layers) that the node 17 can encapsulate the packet. Therefore, the node 17 can correctly push the restored label into the packet.
  • the network device may select any node label corresponding to the node that can encapsulate at least two layers of labels into the first node label; or, the node that can encapsulate the label layer with the largest number of packets.
  • the node label is selected as the first node label; or the first node label may be selected according to the manner shown in FIG. 2 below, and the manner in which the first node label is selected by the network device in the embodiment of the present invention may not be specifically limited.
  • At least two adjacent labels replaced by the first compressed label may be all labels after the first node label; or may be part labels after the first node label.
  • the labels 901, 19, 901, and 20 may be replaced with the first compression label K0, or the labels 19, 901, and 20 may be replaced with the first compressed label K0, and
  • the labels 901 and 20 may be replaced with the first compression label K0, which may not be specifically limited in this embodiment of the present invention.
  • the number of at least two adjacent labels of the first compressed label is replaced by the number of at least two adjacent labels of the first compressed label, and the number of nodes corresponding to the first node label can be compared to the packet.
  • the number of layers of the package label is replaced by the number of at least two adjacent labels of the first compressed label.
  • the network device directs a source node on the forwarding path to perform packet processing according to the second label stack.
  • the source node in the LSP can be configured to push the second label stack into the to-be-forwarded packet, so that the source node can process the packet according to the second label stack.
  • the length of the second label stack is reduced, which reduces the total length of the message.
  • an embodiment of the present invention further provides a method for selecting a first node label, where the method includes:
  • the network device obtains the corresponding node label i M i of the label can be associated with the number of packet encapsulation layers tag label L i and i of the node; tag associated with the node i to node label tag i +1 and the label after the node label i+1, 1 ⁇ i ⁇ n, n is the number of nodes on the forwarding path.
  • the network device selects the first node label, and the node corresponding to the first node label can encapsulate the number of layers of the packet to be not less than 2, and the first difference corresponding to the first node label is not Less than 0.
  • the network device can obtain the following two aspects:
  • the node corresponding to the node tag i can encapsulate the number of layers L i of the message.
  • the network device can obtain the number of layers that the node can encapsulate the label when the first node label needs to be selected, or the network device can obtain the layer that the node can encapsulate the label after the node is powered on.
  • the embodiment of the present invention does not specifically limit this.
  • the tag associated with the node tag i is the tag after the node tag i+1 and the node tag i+1.
  • the number of labels associated with the node 19 M 3 1
  • the node corresponding to the first node label can encapsulate the number of layers of the packet to be no less than 2, and the first difference corresponding to the first node label is not less than 0.
  • node 19 corresponds to L.
  • the network device can select the first node label from the three node labels corresponding to the nodes 17, 19, 20.
  • the network device may randomly select one of the three node labels as the first node label, for example, select the node label corresponding to the node 19 as the first node label; or, the network device may also select the largest M i
  • the network device may select a node label with L i ⁇ 2, ⁇ i ⁇ 0, and M i as the first node label, and replace all labels after the first node label with The first compression tag.
  • the node tag 201 corresponding to the node 17 is selected as the first node tag, and the tags 901, 19, 901, and 20 following the first node tag are replaced with the first compression tag K0.
  • the first label stack can be compressed from 8 labels to 5 labels, and the other node labels can be selected as the first node label to achieve the highest compression efficiency.
  • the network node apparatus according to the label L n-1 corresponding to n-1 and M n-1, the way to determine the value of M n. If L n-1 ⁇ M n-1 , the network device may be according to any of the above two methods for obtaining M n; if L n-1 ⁇ M n- 1, the network device can be obtained according to a second embodiment M n The embodiment of the present invention does not specifically limit this.
  • the source node can correctly push the label stack into the packet to be forwarded. That is, the length of the label stack is not greater than the number of layers that the source node can encapsulate the packet.
  • the network device After the network device performs the label stack compression according to the scheme shown in FIG. 2 or FIG. 3, it can be determined whether the length of the second label stack is greater than the number of layers that the source node can encapsulate the label of the packet. If not, the source node can be correctly determined. The second label stack is pushed into the to-be-forwarded packet. If it is greater than, the source node is determined to be unable to correctly push the second label stack into the to-be-forwarded packet.
  • the second node label is selected in the stack.
  • the node corresponding to the second node label can encapsulate at least two layers of labels.
  • the embodiment of the present invention further provides a method for generating a third label stack.
  • the method includes:
  • the network device obtains the node label j corresponding to the number of tags M j can be associated to packet encapsulation layers tag and the node label j L j,; j node associated with the node label j tag label +1 and the label after the node label j+1, 1 ⁇ j ⁇ m, m ⁇ n.
  • m is the number of node tags included in the second tag stack.
  • the network device selects a second node label from the second label stack, where the node corresponding to the second node label can encapsulate the number of layers of the packet label is not less than 2, and the second node label corresponds to the first The difference between the two is not less than zero.
  • the network device replaces at least two adjacent labels in the second label stack that are located after the second node label with a second compression label to generate a third label stack.
  • the first compression tag is included in at least two adjacent tags.
  • the second label stack is ⁇ 12, 901, 902, 201, K0 ⁇
  • the network device can select the node label corresponding to the node 12 as the second node label.
  • the network device may replace all tags following the second node tag with a second compressed tag, such as replacing tags 901, 902, 201, and K0 with K1.
  • the network device may also replace part of the label after the second node label with the second compressed label, for example, replace the labels 902, 201 and K0 with K1, or replace the labels 201 and K0 with K1, or the label 901, 902 and 201 are replaced by K1, which is not specifically limited in this embodiment of the present invention.
  • the network device may further determine whether the length of the third label stack is greater than the number of layers that the source node can encapsulate the label of the packet. If it is greater, continue to compress according to the solution of the embodiment of the present invention.
  • the length of the label after the compression processing is not greater than the number of layers that the source node can encapsulate the label of the packet.
  • the example shown in FIG. 6 is omitted, and details are not described herein again.
  • the embodiment of the present invention further provides a method for decompressing a label stack.
  • the method includes:
  • the forwarding node acquires label configuration information of the local node, where the label configuration information includes a correspondence between the compressed label and the compressed label, and the compressed label includes at least two labels.
  • the forwarding node receives a packet sent from a source node, where the packet includes a first label stack, and the first label stack includes the compressed label.
  • the forwarding node replaces the compressed label in the first label stack with the compressed label according to the label configuration information, to generate a second label stack.
  • the forwarding node processes the packet according to the second label stack.
  • the forwarding node When performing decompression processing, the forwarding node can obtain the following two aspects of information:
  • the forwarding node obtains the label configuration information.
  • the forwarding node may obtain the label configuration information when the decompression process is required to be performed, or the forwarding node may obtain the label configuration information after the network device generates the compression label, which may be specifically limited in this embodiment of the present invention. .
  • the forwarding node may be any one of a source node, a transit node, or a destination node on the LSP. If the forwarding node is the node 12, the first label configuration information can be obtained.
  • the forwarding node may obtain the first label stack from the network device; if the forwarding node is the transit node or the destination node, the forwarding node may receive the packet sent from the source node, and the packet is received from the source node.
  • the manner of obtaining the first label stack by the forwarding node in the embodiment of the present invention may not be specifically limited.
  • the compressed label in the first label stack can be replaced with the compressed label by using the two aspects, and the second label stack is generated, and the packet processing is performed according to the second label.
  • the compressed label may include at least two labels, and at least two labels are adjacent to each other in the second label stack.
  • the forwarding node is the node 12
  • the first label stack is ⁇ 12, K1 ⁇
  • the node 12 can replace the compressed label K1 with the labels 901, 902, 201, and K0, and perform packet processing according to the decompressed replaced label: first popping the top label 901, and Performing the service corresponding to the label 901 on the local packet; popping the top-of-stack label 902 and performing the service corresponding to the label 902 on the local packet; and then popping the top-of-stack label 201, pressing the label 201 and the K0 into the packet, and The message is forwarded to the node 17 through the link corresponding to the tag 201.
  • the forwarding node may obtain the label configuration information of the node first, and then obtain the first label stack; or the forwarding node may obtain the first label stack first, and obtain the label configuration of the node.
  • the forwarding node may also obtain the above two aspects of information at the same time, which may not be specifically limited in this embodiment of the present invention.
  • the compression method of the label stack and the decompression method of the label stack are respectively introduced.
  • the following describes the solution provided by the embodiment of the present invention by taking a label stack that satisfies the processing capability of the source node as an example.
  • the network device can be a Controller with integrated network device capabilities.
  • the controller obtains the service capability and label processing capability of each node in the network, and creates an LSP of the real-time service from the source node 10 to the destination node 20, and generates a first label stack ⁇ 12, 901, 902, 201, 901, 19, 901, 20 ⁇ corresponding to the LSP.
  • Controller selects the first node label.
  • the Controller can obtain the number of labels M i associated with each node on the LSP.
  • the controller calculates the first difference ⁇ i corresponding to each node
  • the following processing may be performed in advance:
  • the node tag corresponding to the destination node is removed.
  • the node label corresponding to the destination node 20 can be eliminated.
  • the Controller can calculate ⁇ 0 , ⁇ 1 and ⁇ 2 , and the scheme without relative pre-processing helps to improve the efficiency of the Controller calculating ⁇ i . It should be noted that culling a certain node label can be understood as that the node label cannot be used as the first node label.
  • the controller may further determine the following according to the label processing capability of the source node and the label included in the first label stack:
  • the controller determines whether the first label stack includes only one destination node label, and the number of labels after the destination node label is zero. If yes, the controller can directly compress the first label stack according to the label processing capability of the source node; The controller can continue to determine whether the label processing capability of the source node is less than 2, and if not, the first node label can be selected according to the solution provided by the embodiment of the present invention; if yes, the source node cannot successfully create an LSP, and can directly end. Compression process. Such a pre-judgment can help improve the efficiency of the compression process of the embodiment of the present invention.
  • the first label stack includes only one destination node label 20, and the number of labels after the label 20 is zero. If the source node has a label processing capability of 1, it can only encapsulate 1
  • the layer label can replace the labels 901, 902, 903, 904, 905, 906, and 20 with the compression label K. After the source node performs the related service according to the indication of the service label, the label 20 can be pressed into the message, and The message is forwarded to node 20.
  • the Controller performs the first compression process on the first label stack, replacing ⁇ 901, 19, 901, 20 ⁇ with the first compression label K0, generating a second label stack ⁇ 12, 901, 902, 201, K0 ⁇ , and the Controller can also record the first
  • the tag configuration information K0 ⁇ 901, 19, 901, 20 ⁇ .
  • the Controller determines whether the length of the second label stack is greater than the label processing capability of the source node, and if so, selects the second node label from the second label stack to perform the second compression process; if not, The source node is instructed to push the second label stack into the to-be-forwarded packet.
  • the length of the second tag stack is 5, and the tag processing capability of the source node 10 is 4, so the second node tag needs to be selected.
  • Controller selects the second node label.
  • the controller may pre-exclude the node tag 17 before calculating the second difference ⁇ ′ i corresponding to each node.
  • the Controller performs a second compression process on the second tag stack, replacing ⁇ 901, 902, 201, K0 ⁇ with the second compression tag K1, generating a third tag stack ⁇ 12, K1 ⁇ , and the Controller can also record the second tag configuration.
  • Information K1 ⁇ 901, 902, 201, K0 ⁇ .
  • the Controller may use different compression tags for each compression process, that is, the same compression tag does not exist in the network; or, the Controller may use different compression tags for each compression process for the same node, that is, in a single node. There is no identical compression tag.
  • the Controller determines whether the length of the third label stack is greater than the label processing capability of the source node, and if so, selects the third node label from the third label stack to perform a third compression process; if not, directs the source node to The third label stack is pushed into the to-be-forwarded packet.
  • the length of the third label stack is 2, and the label processing capability of the source node 10 is 4. Therefore, the source node can be instructed to push the third label stack into the to-be-forwarded packet.
  • the controller compresses the first label stack according to the above 1 to 7, the label stack corresponding to the LSP is compressed from the first label stack of length 8 to the third label stack of length 2.
  • the third label stack is When the packet is pushed in, the total length of the packet can be reduced, which facilitates the transmission of the packet in the network.
  • the source node pushes the third label stack ⁇ 12, K1 ⁇ into the message to be forwarded, and forwards the message to node 12 according to the shortest path.
  • the node 12 receives the packet forwarded by the source node 10, and obtains the third label stack ⁇ 12 from the packet. K1 ⁇ , after popping up the node SID12, determining that the top label K1 is a compressed label, obtaining the second label configuration information, performing decompression processing, restoring K1 to labels 901, 902, 201, and K0, and generating a fourth label stack ⁇ 901, 902, 201 , K0 ⁇ .
  • the node 12 performs the service corresponding to the service SIDs 901 and 902 on the packet, pushes the fifth label stack ⁇ 201, K0 ⁇ into the packet, and forwards the packet to the node 17 through the link corresponding to the link SID201.
  • the node 17 receives the packet forwarded by the node 12, and obtains the fifth label stack ⁇ 201, K0 ⁇ from the packet. After the link SID 201 is popped up, it is determined that the top label K0 is a compressed label, and the first label configuration information is obtained. Decompression processing is performed to restore K0 to tags 901, 19, 901, and 20, and a sixth tag stack ⁇ 901, 19, 901, 20 ⁇ is generated. The node 17 performs the service corresponding to the service SID 901 for the packet, pushes the seventh label stack ⁇ 19, 901, 20 ⁇ into the packet, and forwards the packet to the node 19 according to the shortest path.
  • the node 19 receives the packet forwarded by the node 17, and obtains the seventh label stack ⁇ 19, 901, 20 ⁇ from the packet. After the node SID19 is popped up, the service corresponding to the service SID901 is executed, and the eighth label stack ⁇ 20 ⁇ is pushed in. The message is forwarded to the node 20 by the shortest path.
  • the node 20 receives the packet forwarded by the node 19, and obtains the eighth label stack ⁇ 20 ⁇ from the packet. After the node SID20 is popped up, the node SID20 is determined to be the bottom label of the stack, and the packet is forwarded.
  • the node on the LSP can decompress the label stack compressed by the controller according to the requirements of 8 to 13 to ensure that the node can use the compressed label stack of the controller to correctly process the packet.
  • the embodiment of the present invention further provides a compression device 700 for a label stack, and the device 700 may be a network device in the embodiment shown in FIG. 2 to FIG.
  • the 700 can be a router or a switch, or the device 700 can control the forwarding of the Controller in a separate network architecture.
  • the apparatus 700 includes:
  • a label stack obtaining unit 701 configured to obtain a first label stack corresponding to the forwarding path, where the first label stack includes a node label corresponding to each node on the forwarding path;
  • a first selecting unit 702 configured to select a first node label from the first label stack obtained by the label stack obtaining unit, where the node corresponding to the first node label can report the packet when forwarding the packet Encapsulating at least two layers of labels;
  • a first replacement unit 703 configured to replace at least two adjacent labels in the first label stack that are located after the first node label with a first compression label, to generate a second label stack;
  • the guiding unit 704 is configured to guide the source node on the forwarding path to perform packet processing according to the second label stack generated by the first replacement unit.
  • the compression apparatus of the embodiment of the present invention may select a first node label from the first label stack, and replace at least two adjacent labels in the first label stack after the first node label with one A compression tag generates a second tag stack.
  • the node corresponding to the first node label can encapsulate at least two layers of labels in the packet when forwarding the packet; at least two adjacent labels refer to the label being continuously uninterrupted in the first label stack.
  • the first label stack is ⁇ 12, 901, 902, 201, 901, 19, 901, 20 ⁇
  • the first node label is the node label 201
  • ⁇ 901, 19, 901, 20 ⁇ can be replaced with the first compression label K0
  • the second label stack ⁇ 12, 901, 902, 201, K0 is generated.
  • the first label stack includes eight labels
  • the second label stack includes five labels. The compression processing can shorten the length of the label stack, so that when the second label stack is pushed into the to-be-forwarded message, it helps. Save message space.
  • the first selecting unit includes:
  • a first obtaining unit, i corresponding node label can be used to obtain the number of layers M i tag encapsulated packet label L i and the node i associated with the label; i node associated with the node label tag label i+1 and the label after the node label i+1, 1 ⁇ i ⁇ n, n is the number of nodes on the forwarding path;
  • the sub-unit is configured to select the first node label, where the node corresponding to the first node label can encapsulate the number of layers of the packet is not less than 2, and the first difference corresponding to the first node label is not Less than 0.
  • the number of layers of the packet encapsulation label can be not less than 2, and the first difference corresponding to the at least two node labels is not less than 0.
  • the number of labels associated with the first node label selected by the selecting subunit is the largest of the number of labels associated with the at least two node labels.
  • the number of labels M n associated with the node label i obtained by the first obtaining unit is zero, or Mn is the number of labels after the node label n.
  • the device further includes:
  • means for generating said second label stack in the first alternative, to obtain the node label j corresponding to j can be related to the number of layers of the label L j packet encapsulation tag and the node tag a number M j ;
  • the label associated with the node label j is a node label j+1 and a label after the node label j+1, 1 ⁇ j ⁇ m, m ⁇ n;
  • a second selecting unit configured to select a second node label, where the node corresponding to the second node label can encapsulate the number of layers of the packet is not less than 2, and the second difference corresponding to the second node label is not less than 0;
  • a second replacement unit configured to replace at least two adjacent labels in the second label stack that are located after the second node label with a second compression label to generate a third label stack;
  • the first compressed label is included in at least two adjacent labels;
  • the guiding unit is specifically configured to guide the source node on the forwarding path to perform packet processing according to the third label stack generated by the second replacement unit.
  • the device further includes:
  • a determining unit configured to determine, before the first selecting unit selects the first node label, whether the source node can encapsulate at least two layers of labels, and if yes, notify the first selecting unit to select The first node label is described.
  • the network device can shorten the length of the label stack of the push-in packet when the forwarding node forwards the packet, further reducing the total length of the packet, and facilitating the transmission of the packet in the network.
  • the embodiment of the present invention further provides a decompression device 800 of the label stack, and the device 800 may be a forwarding node in the embodiment shown in FIG. 5, and the device 800 may be Router or switch.
  • the apparatus 800 includes:
  • the obtaining unit 801 is configured to obtain label configuration information of the local node, where the label configuration information includes a correspondence between the compressed label and the compressed label, and the compressed label includes at least two labels.
  • the receiving unit 802 is configured to receive a packet sent from a source node, where the packet includes a first label stack, where the first label stack includes the compressed label;
  • the replacing unit 803 is configured to replace, according to the label configuration information acquired by the acquiring unit, the compressed label in the first label stack included in the packet received by the receiving unit, into the compressed a label to generate a second label stack;
  • the processing unit 804 is configured to process the packet according to the second label stack.
  • the compression device compresses the label stack corresponding to the LSP, and after generating the compressed label stack, the source node on the LSP is instructed to press the compressed label stack into the to-be-forwarded packet, and according to the compressed The label stack processes the message.
  • the embodiment of the present invention further provides a decompression device.
  • the decompression device may be disposed in the forwarding node on the LSP. After receiving the packet sent from the source node, the decompression device may obtain the compressed label stack from the packet, that is, FIG.
  • the first label stack in the example is shown, and the compressed label in the first label stack is decompressed according to the corresponding label configuration information, and the compressed label is replaced with the compressed label to generate a second label stack. In this way, the message processing can be correctly performed according to the second label stack.
  • the processing unit is configured to: when the top label of the second label stack is a node label, forward the message to a node corresponding to the node label; or, the processing unit, Specifically, when the top label of the second label stack is a service label, the service corresponding to the service label is performed on the packet.
  • an embodiment of the present invention further provides a device 900 for tag compression.
  • the device 900 may be a network device in the embodiment shown in FIG. 2 to FIG. 4.
  • the device 900 may be a router or a switch, or
  • the apparatus 900 is a controller in a control forwarding separate network architecture.
  • the apparatus 900 includes a processor 901, a memory 902, a network interface 903, and a bus system 904.
  • the bus system 904 is configured to couple the various hardware components of the compression device together.
  • the network interface 903 is configured to implement a communication connection between the compression device and at least one other network element, and may use an Internet, a wide area network, a local network, a metropolitan area network, or the like.
  • the memory 902 is configured to store program instructions and data.
  • the processor 901 is configured to read instructions and data stored in the memory 902, and perform the following operations:
  • the processor obtains, by using the network interface, a first label stack corresponding to a forwarding path, where the first label stack includes a node label corresponding to each node on the forwarding path;
  • the processor selects a first node label from the first label stack, and the node corresponding to the first node label can encapsulate at least two layers of labels in the packet when forwarding the packet;
  • the processor replaces at least two adjacent labels in the first label stack that are located after the first node label with a first compression label to generate a second label stack;
  • the processor by using the network interface, directs the source node on the forwarding path to perform packet processing according to the second label stack.
  • the processor may perform the following operations, and select a first node label from the first label stack:
  • the node processor obtains the label number i corresponding to the label can be associated with the number of layers M i for packet encapsulation tag label L i and i of the node; tag associated with the node i to node label tag i + 1 And a label after the node label i+1, 1 ⁇ i ⁇ n, n is the number of nodes on the forwarding path;
  • the processor selects the first node label, and the node corresponding to the first node label can encapsulate the number of layers of the packet to be no less than 2, and the first difference corresponding to the first node label is not less than 0. .
  • the number of layers of the packet encapsulation label can be not less than 2, and the first difference corresponding to the at least two node labels is not less than 0.
  • the number of labels associated with the first node label selected by the processor is the largest of the number of labels associated with the at least two node labels.
  • M n is zero or a number M n of the label after the label of the node n.
  • the processor is further configured to:
  • the processor obtains node label j corresponding to the number of tags M j can be associated to packet encapsulation layers tag and the node label j L j,; j tag associated with the node labeled node label j + 1 And the label after the node label j+1, 1 ⁇ j ⁇ m,m ⁇ n;
  • the processor selects a second node label, the node corresponding to the second node label can encapsulate the number of layers of the packet is not less than 2, and the second difference corresponding to the second node label is not less than 0;
  • the processor replaces at least two adjacent labels in the second label stack that are located after the second node label with a second compressed label to generate a third label stack; at least after the second node label
  • the first compression label is included in two adjacent labels;
  • the processor instructs the source node on the forwarding path to perform packet processing according to the third label stack.
  • the processor is further configured to:
  • the processor determines whether the source node can encapsulate at least two layers of labels in the packet, and if so, The step of selecting the first node label from the first label stack is performed.
  • the embodiment of the present invention further provides a hardware configuration of the decompression device 1000 of the label stack.
  • the apparatus 1000 can be a forwarding node in the embodiment shown in FIG. Referring to the schematic diagram shown in FIG. 10, the processor 1001, the memory 1002, the network interface 1003, and the bus system 1004 may be included.
  • the bus system 1004 is for coupling together various hardware components of the decompression device.
  • the network interface 1003 is configured to implement a communication connection between the decompression device and at least one other network element, and may use an Internet, a wide area network, a local network, a metropolitan area network, or the like.
  • the memory 1002 is configured to store program instructions and data.
  • the processor 1001 is configured to read instructions and data stored in the memory 1002, and perform the following operations:
  • the processor acquires label configuration information of the local node, where the label configuration information includes a correspondence between the compressed label and the compressed label, and the compressed label includes at least two labels;
  • the processor receives a packet sent from a source node, where the packet includes a first label stack, and the first label stack includes the compressed label;
  • the processor replaces the compressed label in the first label stack with the compressed label according to the label configuration information, to generate a second label stack;
  • the processor processes the message according to the second label stack.
  • the processor forwards the message to a node corresponding to the node label
  • the processor performs a service corresponding to the service label on the message.
  • the processor in the embodiment of the present invention may be an integrated circuit chip with signal processing capability.
  • each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • These instructions may be implemented and controlled by a processor therein for performing the methods disclosed in the embodiments of the present invention.
  • the processor may also be a general purpose processor, a digital signal processing (DSP), an application specific integrated circuit, a Field Programmable Gate Array (FPGA) or other programmable logic.
  • DSP digital signal processing
  • FPGA Field Programmable Gate Array
  • Device discrete gate or transistor logic device, Discrete hardware components.
  • the above general-purpose processor may be a microprocessor or the processor may be any conventional processor, decoder or the like.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • bus system may include a power bus, a control bus, and a status signal bus in addition to the data bus.
  • various buses are labeled as bus systems in Figures 8 and 9.

Landscapes

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

Abstract

本发明实施例提供一种标签栈的压缩方法及装置,所述方法包括:网络设备获得转发路径对应的第一标签栈,第一标签栈包括转发路径上的每个节点对应的节点标签;网络设备从第一标签栈中选取第一节点标签,第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;网络设备将第一标签栈中位于第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈;网络设备指导转发路径上的源节点根据第二标签栈进行报文处理。如此,在转发节点对报文进行转发时,能够缩短压入报文的标签栈长度,进一步减少报文的总长度,有利于报文在网络中传输。相应地,本发明实施例还提供一种标签栈的解压缩方法及装置。

Description

一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置
本申请要求于2014年9月5日提交中国专利局、申请号为CN201410453368.3、发明名称为“一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,具体涉及一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置。
背景技术
为了实现数据包的快速转发,现有技术中存在一种分段路由(英文:Segment Routing,简称:SR)技术。在进行报文转发之前,由源节点根据转发需求创建源节点与目的节点之间的转发路径(英文:Label Switching Path,简称:LSP),确定出LSP经过的节点、链路以及节点要执行的业务等信息,并以标签栈形式将这些信息添加在待转发的报文中。这样,LSP上的转发节点接收到报文后,即可根据标签栈栈顶的标签表示的含义进行后续处理。例如,栈顶标签为业务分段标识(英文:Segment Identification,简称:SID),转发节点就可执行该业务SID代表的业务;栈顶标签为节点SID,转发节点就可将报文转发至该节点SID代表的节点;栈顶标签为链路SID,中间节点就可按照该链路SID的指示进行链路转发,以将报文转发至中间节点的对端节点。
由此可知,当转发节点对报文沿着该LSP进行转发时,如果确定出的LSP经过的节点、链路以及节点要执行的业务等信息较多,那么压入到该报文中的标签栈就会嵌套多层标签,导致标签栈的长度过长,大大的增加了被转发的报文长度,不利于报文在网络中传输。
发明内容
本发明实施例提供的标签栈的压缩方法及装置、标签栈的解压缩方法及装置,在转发节点对报文进行转发时,能够缩短压入报文的标签栈长度,进一步 减少报文的总长度,有利于报文在网络中传输。
为此,本发明实施例提供如下技术方案:
第一方面,本发明实施例提供了一种标签栈的压缩方法,所述方法包括:
网络设备获得转发路径对应的第一标签栈,所述第一标签栈包括所述转发路径上的每个节点对应的节点标签;
所述网络设备从所述第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;
所述网络设备将所述第一标签栈中位于所述第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈;
所述网络设备指导所述转发路径上的源节点根据所述第二标签栈进行报文处理。
在第一方面的第一种可能的实现方式中,所述网络设备从所述第一标签栈中选取第一节点标签,包括:
所述网络设备获得节点标签i对应的节点能对报文封装标签的层数Li和所述节点标签i关联的标签个数Mi;所述节点标签i关联的标签为节点标签i+1及所述节点标签i+1之后的标签,1≤i<n,n为所述转发路径上的节点的个数;
所述网络设备计算第一差值Δi=Li-Mi
所述网络设备选取所述第一节点标签,所述第一节点标签对应的节点能对报文封装标签的层数不小于2,且所述第一节点标签对应的第一差值不小于0。
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,如果所述第一标签栈包括至少两个节点标签对应的节点能对报文封装标签的层数不小于2,且所述至少两个节点标签对应的第一差值不小于0,则,
所述第一节点标签关联的标签个数是所述至少两个节点标签关联的标签个数中数值最大的。
结合第一方面的第一种或第二种可能的实现方式,在第三种可能的实现方式中,若i=n,则Mn为零,或者Mn为节点标签n之后的标签数。
结合第一方面的第一种至第三种中的任一种可能的实现方式,在第四种可能的实现方式中,在所述生成第二标签栈之后,所述方法还包括:
所述网络设备获得节点标签j对应的节点能对报文封装标签的层数Lj和所述节点标签j关联的标签个数Mj;所述节点标签j关联的标签为节点标签j+1 及所述节点标签j+1之后的标签,1≤j<m,m≤n;
所述网络设备计算第二差值Δj=Lj-Mj
所述网络设备选取第二节点标签,所述第二节点标签对应的节点能对报文封装标签的层数不小于2,且所述第二节点标签对应的第二差值不小于0;
所述网络设备将所述第二标签栈中位于所述第二节点标签之后的至少两个相邻标签替换为一个第二压缩标签,生成第三标签栈;所述第二节点标签之后的至少两个相邻标签中包括所述第一压缩标签;
相应地,所述网络设备指导所述转发路径上的源节点根据所述第二标签栈进行报文处理为:
所述网络设备指导所述转发路径上的源节点根据所述第三标签栈进行报文处理。
结合第一方面或第一方面的第一种至第四种中的任一种可能的实现方式,在第五种可能的实现方式中,在所述网络设备从所述第一标签栈中选取第一节点标签之前,所述方法还包括:
所述网络设备判断所述源节点是否能对报文封装至少两层标签,如果是,再执行从所述第一标签栈中选取第一节点标签的步骤。
结合第一方面或第一方面的第一种至第五种中的任一种可能的实现方式,在第六种可能的实现方式中,所述节点标签为节点分段标识SID或链路SID。
第二方面,本发明实施例提供了一种标签栈的解压缩方法,所述方法包括:
转发节点获取本节点的标签配置信息,所述标签配置信息包括压缩标签与被压缩标签的对应关系,所述被压缩标签包括至少两个标签;
所述转发节点接收从源节点发送来的报文,所述报文包含第一标签栈,所述第一标签栈包括所述压缩标签;
所述转发节点根据所述标签配置信息,将所述第一标签栈中的所述压缩标签替换为所述被压缩标签,生成第二标签栈;
所述转发节点根据所述第二标签栈对所述报文进行处理。
在第二方面的第一种可能的实现方式中,所述转发节点根据所述第二标签栈对所述报文进行处理,包括:
如果所述第二标签栈的栈顶标签为节点标签,所述转发节点将所述报文转发至所述节点标签对应的节点;
如果所述第二标签栈的栈顶标签为业务标签,所述转发节点对所述报文执行所述业务标签对应的业务。
第三方面,本发明实施例提供了一种标签栈的压缩装置,所述装置包括:
标签栈获得单元,用于获得转发路径对应的第一标签栈,所述第一标签栈包括所述转发路径上的每个节点对应的节点标签;
第一选取单元,用于从所述标签栈获得单元获得的所述第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;
第一替换单元,用于将所述第一标签栈中位于所述第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈;
指导单元,用于指导所述转发路径上的源节点根据所述第一替换单元生成的所述第二标签栈进行报文处理。
在第三方面的第一种可能的实现方式中,所述第一选取单元包括:
第一获得单元,用于获得节点标签i对应的节点能对报文封装标签的层数Li和所述节点标签i关联的标签个数Mi;所述节点标签i关联的标签为节点标签i+1及所述节点标签i+1之后的标签,1≤i<n,n为所述转发路径上的节点的个数;
第一计算单元,用于根据所述第一获得单元获得的Li和Mi计算第一差值Δi=Li-Mi
选取子单元,用于选取所述第一节点标签,所述第一节点标签对应的节点能对报文封装标签的层数不小于2,且所述第一节点标签对应的第一差值不小于0。
结合第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述装置还包括:
第二获得单元,用于在所述第一替换单元生成所述第二标签栈后,获得节点标签j对应的节点能对报文封装标签的层数Lj和所述节点标签j关联的标签个数Mj;所述节点标签j关联的标签为节点标签j+1及所述节点标签j+1之后的标签,1≤j<m,m≤n;
第二计算单元,用于根据所述第二获得单元获得的Lj和Mj计算第二差值Δj=Lj-Mj
第二选取单元,用于选取第二节点标签,所述第二节点标签对应的节点能对报文封装标签的层数不小于2,且所述第二节点标签对应的第二差值不小于0;
第二替换单元,用于将所述第二标签栈中位于所述第二节点标签之后的至少两个相邻标签替换为一个第二压缩标签,生成第三标签栈;所述第二节点标签之后的至少两个相邻标签中包括所述第一压缩标签;
相应地,所述指导单元,具体用于指导所述转发路径上的源节点根据所述第二替换单元生成的所述第三标签栈进行报文处理。
结合第三方面或第三方面的第一种或第二种可能的实现方式,在第三种可能的实现方式中,所述装置还包括:
判断单元,用于在所述第一选取单元选取所述第一节点标签之前,判断所述源节点是否能对报文封装至少两层标签,如果是,再通知所述第一选取单元选取所述第一节点标签。
第四方面,本发明实施例提供了一种标签栈的解压缩装置,所述装置包括:
获取单元,用于获取本节点的标签配置信息,所述标签配置信息包括压缩标签与被压缩标签的对应关系,所述被压缩标签包括至少两个标签;
接收单元,用于接收从源节点发送来的报文,所述报文包含第一标签栈,所述第一标签栈包括所述压缩标签;
替换单元,用于根据所述获取单元获取的所述标签配置信息,将所述接收单元接收的所述报文包含的所述第一标签栈中的所述压缩标签替换为所述被压缩标签,生成第二标签栈;
处理单元,用于根据所述第二标签栈对所述报文进行处理。
在第四方面的第一种可能的实现方式中,所述处理单元,具体用于在所述第二标签栈的栈顶标签为节点标签时,将所述报文转发至所述节点标签对应的节点;或者,所述处理单元,具体用于在所述第二标签栈的栈顶标签为业务标签时,对所述报文执行所述业务标签对应的业务。
本发明实施例的标签栈的压缩方法及装置,网络设备从第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签,如此,可对第一标签栈进行压缩处理,将第一标签栈中位于第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二 标签栈。通过上述技术方案,在转发节点对报文进行转发时,能够缩短压入报文的标签栈长度,进一步减少报文的总长度,有利于报文在网络中传输。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其它的附图。
图1是本发明实施例中一种网络结构示意图;
图2是本发明实施例提供的的一种标签栈的压缩方法的流程示意图;
图3是本发明实施例中选取第一节点标签的流程示意图;
图4是本发明实施例中生成第三标签栈的流程示意图;
图5是本发明实施例提供的的一种标签栈的解压缩方法的流程示意图;
图6是本发明实施例生成满足源节点标签处理能力的标签栈的示意图;
图7是本发明实施例提供的的一种标签栈的压缩装置的构成示意图;
图8是本发明实施例提供的的一种标签栈的解压缩装置的构成示意图;
图9是本发明实施例提供的的一种标签栈的压缩装置的硬件构成示意图;
图10是本发明实施例提供的的一种标签栈的解压缩装置的硬件构成示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和实施方式对本发明实施例作进一步的详细说明。
在进行报文转发之前,可先根据业务需求创建源节点与目的节点之间的LSP,确定出LSP经过的节点、链路以及节点要执行的业务等信息,并以标签栈形式将这些信息添加在待转发的报文中,指导LSP上的节点根据标签栈进行报文处理。以实现图1所示网络中的节点10到节点20的实时业务为例,LSP对应的标签栈可为:{12,901,902,201,901,19,901,20}。其中,12、19和20为节点SID,节点SID与LSP上的节点相对应;901和902为业务SID,业务SID与节 点执行的业务相对应;201为链路SID,链路SID与两个节点之间的链路相对应,在本示例中201可表示节点12和17之间的链路。
指导LSP上的节点根据标签栈进行报文处理,可理解为:判断栈顶SID的类型,如果栈顶SID为业务SID,则执行业务SID对应的业务;如果栈顶SID为节点SID或链路SID,则将报文转发至节点SID或链路SID对应的节点。以标签栈中的{19,901,20}为例,节点19弹出(pop)本节点的节点SID19后,判定栈顶标签为业务SID901,节点19可在本地对报文执行901对应的业务;如此之后,判定栈顶标签为节点SID20,节点19可将报文转发至节点20。
对于业务SID来说,不同节点之间,可采用相同的业务SID表示同一业务,如,节点12要执行的业务901和节点19要执行的业务901均可表示防火墙业务;或者,不同节点之间,也可采用不同的业务SID表示同一业务,如,节点12要执行的业务901可表示防火墙业务,节点19要执行的业务901可表示深度包检测业务,本发明实施例对业务SID表示的业务可不做具体限定。
上述示例中的标签栈{12,901,902,201,901,19,901,20},包含有8个标签,也即源节点10需要将8个标签压入待转发报文中,占用了较大的报文空间。本发明实施例即是为此而提出,用以缩短标签栈长度。
需要说明的是,本发明实施例中的网络设备可以是一台独立的设备,且网络设备可与控制器(Controller)和/或转发路径上的节点相通信。若网络设备与Controller相通信,网络设备可经由Controller将利用本发明实施例方案压缩后的标签栈下发至源节点;若网络设备与转发路径上的节点通信,网络设备可直接将压缩后的标签栈下发至源节点,或者网络设备也可经由转发路径上的其它节点将压缩后的标签栈下发至源节点。或者,参见图1所示,本发明实施例中的网络设备也可为集成有该网络设备功能的Controller,或为转发路径上集成有该网络设备功能的节点,如,源节点10集成有网络设备功能,可在获得标签栈后,先对标签栈进行压缩处理,再将压缩处理后的标签栈压入报文中,本发明实施例对网络设备的表现形式可不做具体限定。
下面对本发明实施例标签栈的压缩方法进行解释说明。
参见图2,本发明实施例提供了一种标签栈压缩的方法,该方法包括:
201,网络设备获得转发路径对应的第一标签栈,所述第一标签栈包括所述转发路径上的每个节点对应的节点标签。
网络设备可先获得LSP对应的标签栈,明确压缩处理对象。作为一种示例,网络设备可根据业务需求生成标签栈,或者,网络设备也可接收其它设备生成的标签栈,本发明实施例对网络设备获得标签栈的方式可不做具体限定。
结合图1所示网络,以网络设备生成节点10到节点20间业务的标签栈为例,网络设备获得标签栈的过程可为:
(1)网络设备获得网络中节点的业务能力。
作为一种示例,网络设备可在需要生成标签栈时获得节点的业务能力,或者,网络设备也可在节点上电后就获得节点的业务能力,本发明实施例对此可不做具体限定。若不同节点采用相同的业务SID表示同一业务,则业务能力可为业务标识,如,业务SID;若不同节点采用不同的业务SID表示同一业务,则业务能力可为业务名称和业务标识,如,防火墙业务及对应的业务SID。
作为一种示例,节点可采用中间系统到中间系统(英文:Intermediate system to intermediate system,简称:ISIS)或者开放式最短路径优先(英文:Open Shortest Path First,简称:OSPF)协议,将本节点的业务能力上报至网络设备。或者,节点也可采用本发明实施例提供的业务能力上报消息,将本节点的业务能力上报至网络设备,具体地,业务能力上报消息可包括:消息类型、消息长度和业务能力参数。举例来说,消息类型为业务能力上报,可采用2字节表示;业务能力参数为:节点SID12、业务SID901、防火墙业务、业务SID902、深度包检测业务,每个参数可采用4字节表示;消息长度为业务能力上报消息包括的总字节数,可采用2字节表示,如此本示例中的消息长度为24字节。对应于此,网络设备接收到上述示例中的业务能力上报消息后可知,节点12可以执行防火墙业务和深度包检测业务,如此,在节点10到节点20间的业务需要实现防火墙业务和深度包检测业务时,网络设备可以将节点12确定为LSP上的节点,LSP对应的标签栈中包括:节点12对应的节点SID12、防火墙业务对应的业务SID901和深度包检测业务对应的业务SID902。
(2)网络设备获得LSP对应的第一标签栈。
网络设备根据业务需求确定节点10到节点20的LSP,以及LSP中各节点要执行的业务,并据此生成第一标签栈,举例来说,该第一标签栈可以为 {12,901,902,201,901,19,901,20}。如此,网络设备就获得了LSP对应的第一标签栈,且第一标签栈中包括LSP上的每个节点对应的节点标签。作为一种示例,节点标签可为节点SID或链路SID,在本示例中,第一标签栈包括的节点标签为:12、201、19和20。
202,所述网络设备从所述第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签。
203,所述网络设备将所述第一标签栈中位于所述第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈。
为了缩短第一标签栈的长度,进而减少报文总长度,便于报文在网络中传输,本发明实施例的网络设备可对第一标签栈进行压缩处理,将第一标签栈中的至少两个相邻标签替换为一个第一压缩标签,生成包括第一压缩标签的第二标签栈。与此同时,为了保证LSP上的节点可以利用所述第二标签栈正确进行报文处理,LSP上的节点还可对第二标签栈进行解压缩处理,将所述第一压缩标签还原为所述至少两个相邻标签。需要说明的是,所述第一标签栈中位于第一节点标签之后也可以理解为位于第一节点标签之下,且具体为第一标签栈的栈顶向栈底方向,举例来说,第一节点标签为201,则标签901、19、901和20均为位于第一节点标签之后的标签。另外,至少两个相邻标签可以理解为至少两个标签之间连续不间断,举例来说,标签901、19、901和20之间的关系即为互为相邻。
需要说明的是,网络中的节点都具有一定的标签处理能力,所谓标签处理能力可以理解为:节点在对报文进行转发时,能对报文封装标签的层数,也即节点可向报文中压入(push)标签的个数。如,节点A能封装3层标签,也就是说节点A可向报文中压入3个标签。
网络设备在进行压缩处理时,可先从第一标签栈中选取第一节点标签,第一节点标签对应的节点应能对报文封装至少两层标签,这样,在第一节点标签对应的节点进行解压缩处理时,可将解压缩获得的至少两个相邻标签正确压入报文中。
如,针对第一标签栈{12,901,902,201,901,19,901,20},网络设备选取出的第一节点标签为标签201,该标签对应节点17,若节点17能对报文封装4层标签,压缩处理时可将标签901、19、901和20替换为第一压缩标签K0,生成第 二标签栈{12,901,902,201,K0},如此就将标签栈的长度从8缩减到5,有助于降低标签栈占用报文的空间。对应于此,在LSP上的节点按照第二标签栈进行报文处理时,节点12转发至节点17的标签栈为{201,K0},节点17可进行解压缩处理,将K0还原为{901,19,901,20},执行标签901对应的业务,并将19、901和20共计3个标签压入报文中,指导节点19根据标签栈进行报文处理。因为需要压入报文的标签个数(3个)不大于节点17能对报文封装标签的层数(4层),因此,节点17可将还原出的标签正确压入报文中。
需要说明的是,网络设备可将任一个能对报文封装至少两层标签的节点对应的节点标签选取为第一节点标签;或者,也可将能对报文封装标签层数最多的节点对应的节点标签选取为第一节点标签;或者,还可按照下文图2所示方式选取第一节点标签,等等,本发明实施例对网络设备选取第一节点标签的方式可不做具体限定。
另外,需要说明的是,替换为第一压缩标签的至少两个相邻标签可以为第一节点标签之后的所有标签;或者,也可以为第一节点标签之后的部分标签。如,第一节点标签为标签201时,可将标签901、19、901和20替换为第一压缩标签K0,或者,也可将标签19、901和20替换为第一压缩标签K0,再者,还可将标签901和20替换为第一压缩标签K0,本发明实施例对此可不做具体限定。优选地,从将解压缩后的标签正确压入报文的角度考虑,替换为第一压缩标签的至少两个相邻标签的个数,不多于第一节点标签对应的节点能对报文封装标签的层数。
204,所述网络设备指导所述转发路径上的源节点根据所述第二标签栈进行报文处理。
网络设备生成第二标签栈后,即可指导LSP中的源节点将第二标签栈压入待转发报文中,使源节点可以根据第二标签栈进行报文处理。相对第一标签栈来说,第二标签栈的长度有所缩减,可减少报文的总长度。
参见图3,本发明实施例还提供了一种选取第一节点标签的方法,该方法包括:
301,所述网络设备获得节点标签i对应的节点能对报文封装标签的层数Li和所述节点标签i关联的标签个数Mi;所述节点标签i关联的标签为节点标签 i+1及所述节点标签i+1之后的标签,1≤i<n,n为所述转发路径上的节点的个数。
302,所述网络设备计算第一差值Δi=Li-Mi
303,所述网络设备选取所述第一节点标签,所述第一节点标签对应的节点能对报文封装标签的层数不小于2,且所述第一节点标签对应的第一差值不小于0。
选取第一节点标签时,网络设备可获得以下两方面信息:
(a)节点标签i对应的节点能对报文封装标签的层数Li
作为一种示例,网络设备可在需要选取第一节点标签时获得节点能对报文封装标签的层数,或者,网络设备也可在节点上电后就获得节点能对报文封装标签的层数,本发明实施例对此可不做具体限定。
如,针对上述示例中的第一标签栈{12,901,902,201,901,19,901,20},LSP上的节点的个数n=4,也即第一标签栈包括的节点标签的个数n=4,其中,节点12能对报文封装标签的层数L1=3、节点17能对报文封装标签的层数L2=3、节点19能对报文封装标签的层数L3=4、节点20能对报文封装标签的层数L4=2。
(b)节点标签i关联的标签个数Mi
作为一种示例,节点标签i关联的标签为节点标签i+1及节点标签i+1之后的标签。如,针对上述示例中的第一标签栈{12,901,902,201,901,19,901,20},节点12关联的标签个数M1=5、节点17关联的标签个数M2=3、节点19关联的标签个数M3=1、节点20关联的标签个数M4=0。
网络设备获得Li和Mi后,可计算节点对应的第一差值Δi=Li-Mi,进而从第一标签栈中选取第一节点标签。具体地,第一节点标签对应的节点能对报文封装标签的层数不小于2,且第一节点标签对应的第一差值不小于0。
如,针对上述示例中的第一标签栈{12,901,902,201,901,19,901,20},节点12对应L1=3和Δ1=-2、节点17对应L2=3和Δ2=0、节点19对应L3=4和Δ3=3、节点20对应L4=2和Δ4=2,网络设备可从节点17、19、20对应的3个节点标签中选取第一节点标签。举例来说,网络设备可随机从所述3个节点标签中选取一个作为第一节点标签,如,选取节点19对应的节点标签作为第一节点标签;或者,网络设备还可选取Mi最大的节点标签作为第一节点标签,如,选取M2=3的节点17对应的节点标签作为第一节点标签。需要说明的是,选取Mi最大的 节点标签作为第一节点标签可以理解为,第一节点标签关联的标签个数是第一标签栈中所有节点标签关联的标签个数中数值最大的。
可选地,为了最大程度的提高压缩效率,网络设备可选取Li≥2、Δi≥0且Mi最大的节点标签作为第一节点标签,并将第一节点标签之后的所有标签替换为第一压缩标签。如,上述示例中,选取节点17对应的节点标签201作为第一节点标签,并将第一节点标签之后的标签901、19、901和20替换为第一压缩标签K0,如此,单次压缩处理就可将第一标签栈从8个标签压缩为5个标签,相对选取其它节点标签作为第一节点标签的方案,可使压缩效率达到最高。
可选地,在上文图3所示方案的基础上,第一标签栈的最后一个节点标签n关联的标签个数Mn可有以下两种取值方式:第一种取值方式为Mn=0;第二种取值方式为节点标签n之后的标签数。具体地,网络设备可根据节点标签n-1对应的Ln-1和Mn-1,确定Mn的取值方式。如果Ln-1≥Mn-1,网络设备可按照上述两种方式中的任一种获得Mn;如果Ln-1<Mn-1,网络设备可按照第二种方式获得Mn,本发明实施例对此可不做具体限定。
基于图2或图3提供的标签栈压缩方案,为了进一步缩短标签栈长度,并提高LSP创建成功的可能性,本发明实施例还提供了如下优选方案,下面进行解释说明。
需要说明的是,LSP创建成功可以理解为,源节点可以正确将标签栈压入待转发报文,也就是说,标签栈的长度不大于源节点能对报文封装标签的层数。
网络设备按照图2或图3所示方案进行标签栈压缩后,可判断第二标签栈的长度是否大于源节点能对报文封装标签的层数,如果不大于,则判定源节点可正确将第二标签栈压入待转发报文;如果大于,则判定源节点不能正确将第二标签栈压入待转发报文,需要继续对第二标签栈进行压缩处理。
如,针对上述示例中的第二标签栈{12,901,902,201,K0},标签栈长度为5,若源节点10能对报文封装标签的层数L0=6,则说明源节点10可正确将第二标签栈压入待转发报文中;若源节点10能对报文封装标签的层数L0=4,则说明源节点10不能正确将第二标签栈压入待转发报文中,可进一步对第二标签栈进行压缩处理,缩短第二标签栈的长度。
进一步对第二标签栈进行压缩处理的方案,可参照图2所示,从第二标签 栈中选取第二节点标签,同样地,第二节点标签对应的节点亦能对报文封装至少两层标签。对于选取第二节点标签、替换第二压缩标签等过程,可参照上文所做介绍,此处不再赘述。
可选地,若网络设备按照图3所示方法选取第一节点标签,本发明实施例还提供了一种生成第三标签栈的方法,参见图4,该方法包括:
401,所述网络设备获得节点标签j对应的节点能对报文封装标签的层数Lj和所述节点标签j关联的标签个数Mj;所述节点标签j关联的标签为节点标签j+1及所述节点标签j+1之后的标签,1≤j<m,m≤n。其中,m为第二标签栈包括的节点标签的个数。
402,所述网络设备计算第二差值Δj=Lj-Mj
403,所述网络设备从第二标签栈中选取第二节点标签,所述第二节点标签对应的节点能对报文封装标签的层数不小于2,且所述第二节点标签对应的第二差值不小于0。
404,所述网络设备将所述第二标签栈中位于所述第二节点标签之后的至少两个相邻标签替换为一个第二压缩标签,生成第三标签栈;所述第二节点标签之后的至少两个相邻标签中包括所述第一压缩标签。
例如,第二标签栈为{12,901,902,201,K0},源节点10能对报文封装标签的层数L0=4,则,第二标签栈中节点标签的个数m=2,节点12对应L1=3、M1=2和Δ1=1,节点17对应L2=3、M2=0和Δ2=3。基于此,网络设备可选取节点12对应的节点标签作为第二节点标签。
作为一种示例,网络设备可将第二节点标签之后的所有标签替换为第二压缩标签,如,将标签901、902、201和K0替换为K1。或者,网络设备也可将第二节点标签之后的部分标签替换为第二压缩标签,如,将标签902、201和K0替换为K1,或者将标签201和K0替换为K1,或者将标签901、902和201替换为K1,本发明实施例对此可不做具体限定。
同样地,生成第三标签栈后,网络设备还可继续判断第三标签栈的长度是否大于源节点能对报文封装标签的层数,如果大于,则继续按照本发明实施例方案进行压缩处理,直至压缩处理后的标签长度不大于源节点能对报文封装标签的层数为止,对此可参照下文图6所示示例,此处不再赘述。
与上述标签栈的压缩方法相对应地,本发明实施例还提供了一种标签栈的解压缩方法,参见图5,该方法包括:
501,转发节点获取本节点的标签配置信息,所述标签配置信息包括压缩标签与被压缩标签的对应关系,所述被压缩标签包括至少两个标签。
502,所述转发节点接收从源节点发送来的报文,所述报文包含第一标签栈,所述第一标签栈包括所述压缩标签。
503,所述转发节点根据所述标签配置信息,将所述第一标签栈中的所述压缩标签替换为所述被压缩标签,生成第二标签栈。
504,所述转发节点根据所述第二标签栈对所述报文进行处理。
在进行解压缩处理时,转发节点可先获得以下两方面信息:
(1)转发节点获得标签配置信息。
作为一种示例,转发节点可在需要进行解压缩处理时获得标签配置信息,或者,转发节点也可在网络设备生成所述压缩标签后获得标签配置信息,本发明实施例对此可不做具体限定。
如,针对LSP对应的标签栈{12,901,902,201,901,19,901,20},网络设备进行压缩处理后得到标签栈{12,K1},对应有如下两个标签配置信息:针对节点12的第一标签配置信息K1={901,902,201,K0},针对节点17的第二标签配置信息K0={901,19,901,20}。
本发明实施例中,转发节点可为LSP上的源节点、中转节点或目的节点中的任一个节点。若转发节点为节点12,则可获得第一标签配置信息。
(2)转发节点获得第一标签栈。
如果转发节点为源节点,则转发节点可从网络设备处获得第一标签栈;如果转发节点为中转节点或目的节点,则转发节点可接收从源节点发送来的报文,并从报文中获得第一标签栈,本发明实施例对转发节点获得第一标签栈的方式可不做具体限定。
转发节点获得上述两方面信息后,就可利用这两方面信息将第一标签栈中的压缩标签替换为被压缩标签,生成第二标签栈,并根据第二标签进行报文处理。需要说明的是,被压缩标签可包括至少两个标签,至少两个标签在第二标签栈中互为相邻。
若转发节点为节点12,获得的第一标签配置信息为K1={901,902,201,K0}、 第一标签栈为{12,K1},节点12可将压缩标签K1替换为标签901、902、201和K0,并根据解压缩替换出的标签进行报文处理:先弹出栈顶标签901,并在本地对报文执行标签901对应的业务;再弹出栈顶标签902,并在本地对报文执行标签902对应的业务;再弹出栈顶标签201,将标签201和K0压入报文,并通过标签201对应的链路将报文转发至节点17。
需要说明的是,转发节点可如图3所示,先获得本节点的标签配置信息,再获得第一标签栈;或者,转发节点也可先获得第一标签栈,再获得本节点的标签配置信息;或者,转发节点也可同时获得上述两方面信息,本发明实施例对此可不做具体限定。
上文分别介绍了标签栈的压缩方法和标签栈的解压缩方法,下面结合图1和图6,以生成满足源节点标签处理能力的标签栈为例,对本发明实施例提供的方案进行解释说明。在本示例中,网络设备可为集成有网络设备功能的Controller。
1.Controller获得网络中各节点的业务能力和标签处理能力,并据此创建源节点10到目的节点20的实时业务的LSP,生成LSP对应的第一标签栈{12,901,902,201,901,19,901,20}。
其中,源节点10上报的标签处理能力为能对报文封装4层标签,即L0=4;节点12上报的标签处理能力为能对报文封装3层标签,即L1=3;节点17上报的标签处理能力为能对报文封装3层标签,即L2=3;节点19上报的标签处理能力为能对报文封装1层标签,即L3=3;目的节点20上报的标签处理能力为能对报文封装4层标签,即L4=4。
2.Controller选取第一节点标签。
基于第一标签栈{12,901,902,201,901,19,901,20},Controller可获得LSP上各节点关联的标签数Mi。其中,源节点10关联的标签数M0=8;节点12关联的标签个数M1=5;节点17关联的标签个数M2=3;节点19关联的标签个数M3=1;节点20关联的标签个数M4=0。
Controller计算LSP上各节点对应的第一差值Δi=Li-Mi。其中,源节点10对应的Δ0=-4;节点12对应的Δ1=-2;节点17对应的Δ2=0;节点19对应的Δ3=2;目的节点12对应的Δ4=4。
Controller可选取标签201作为第一节点标签,第一节点标签201对应的节点17的L2=3不小于2、Δ2=0不小于0、且与M3=1和M4=0相比M2=3最大。
可选地,在Controller计算各节点对应的第一差值Δi之前,可预先做如下处理:
(1)剔除标签处理能力为1的节点对应的节点标签。如,上述示例中,可剔除节点19对应的节点标签。
(2)在目的节点对应的节点标签之后的标签数为零时,剔除目的节点对应的节点标签。如,上述示例中,可剔除目的节点20对应的节点标签。
经上述预处理后,Controller可计算Δ0、Δ1和Δ2,相对不进行预处理的方案,有助于提高Controller计算Δi的效率。需要说明的是,剔除某一节点标签可以理解为,该节点标签不可作为第一节点标签。
可选地,在选取第一节点标签之前,Controller还可根据源节点的标签处理能力和第一标签栈包括的标签,预先做如下判断:
Controller判断第一标签栈中是否仅包括一个目的节点标签,且目的节点标签之后的标签数为零,如果是,Controller可直接根据源节点的标签处理能力,对第一标签栈进行压缩处理;如果否,Controller可继续判断源节点的标签处理能力是否小于2,如果否,则可按本发明实施例提供的方案选取第一节点标签;如果是,则说明源节点无法成功创建LSP,可直接结束压缩处理过程。相对经压缩处理后得到无法成功创建LSP的方案,如此预先判断可有助于提高本发明实施例压缩处理的效率。
如,针对第一标签栈{901,902,903,904,905,906,20},第一标签栈只包括一个目的节点标签20,且标签20之后的标签数为零,若源节点的标签处理能力为1,即只能封装1层标签,则可将标签901、902、903、904、905、906和20替换为压缩标签K,如此,源节点根据业务标签的指示执行相关业务后,可将标签20压入报文,并将报文转发至节点20。
3.Controller对第一标签栈进行第一次压缩处理,将{901,19,901,20}替换为第一压缩标签K0,生成第二标签栈{12,901,902,201,K0},同时,Controller还可记录第一标签配置信息K0={901,19,901,20}。
4.Controller判断第二标签栈的长度是否大于源节点的标签处理能力,如果是,则从第二标签栈中选取第二节点标签,执行第二次压缩处理;如果否, 则指导源节点将第二标签栈压入待转发报文中。
在本示例中,第二标签栈的长度为5,源节点10的标签处理能力为4,故需要选取第二节点标签。
5.Controller选取第二节点标签。
基于第二标签栈{12,901,902,201,K0},源节点10关联的标签数M′0=5、Δ′0=L0-M′0=-1,节点12关联的标签个数M′1=2、Δ′1=L1-M′1=1,节点17关联的标签个数M′2=1、Δ′2=L2-M′2=2。对应于此,Controller可选取标签12作为第二节点标签,第二节点标签对应的节点12的不小于2、Δ′1=1不小于0、且与M′2=1相比M′1=2最大。
可选地,Controller在计算各节点对应的第二差值Δ′i之前,可预先剔除节点标签17。
6.Controller对第二标签栈进行第二次压缩处理,将{901,902,201,K0}替换为第二压缩标签K1,生成第三标签栈{12,K1},同时,Controller还可记录第二标签配置信息K1={901,902,201,K0}。
可选地,Controller可使每次压缩处理使用不同的压缩标签,即网络中不存在相同的压缩标签;或者,Controller可针对同一节点,使每次压缩处理使用不同的压缩标签,即单个节点中不存在相同的压缩标签。
7.Controller判断第三标签栈的长度是否大于源节点的标签处理能力,如果是,则从第三标签栈中选取第三节点标签,执行第三次压缩处理;如果否,则指导源节点将第三标签栈压入待转发报文中。
在本示例中,第三标签栈的长度为2,源节点10的标签处理能力为4,故可指导源节点将第三标签栈压入待转发报文中。
Controller按照上述1~7对第一标签栈进行压缩处理后,将LSP对应的标签栈,从长度为8的第一标签栈压缩为长度为2的第三标签栈,如此,将第三标签栈压入报文时,可减少报文的总长度,有利于报文在网络中传输。
8.参见图1,Controller将第一标签配置信息K0={901,19,901,20}发送节点17,将第二标签配置信息K1={901,902,201,K0}发送至节点12。
9.源节点将第三标签栈{12,K1}压入待转发报文中,并按最短路径将报文转发至节点12。
10.节点12接收源节点10转发的报文,并从报文中获得第三标签栈{12, K1},弹出节点SID12后,判定栈顶标签K1为压缩标签,可获得第二标签配置信息,进行解压缩处理,将K1还原为标签901、902、201和K0,生成第四标签栈{901,902,201,K0}。节点12对报文执行业务SID901和902对应的业务,将第五标签栈{201,K0}压入报文,并通过链路SID201对应的链路将报文转发至节点17。
11.节点17接收节点12转发的报文,并从报文中获得第五标签栈{201,K0},弹出链路SID201后,判定栈顶标签K0为压缩标签,可获得第一标签配置信息,进行解压缩处理,将K0还原为标签901、19、901和20,生成第六标签栈{901,19,901,20}。节点17对报文执行业务SID901对应的业务,将第七标签栈{19,901,20}压入报文,并按最短路径将报文转发至节点19。
12.节点19接收节点17转发的报文,并从报文中获得第七标签栈{19,901,20},弹出节点SID19后,执行业务SID901对应的业务,将第八标签栈{20}压入报文,并按最短路径将报文转发至节点20。
13.节点20接收节点19转发的报文,并从报文中获得第八标签栈{20},弹出节点SID20后,判定节点SID20为栈底标签,结束报文转发。
LSP上的节点在进行报文转发时,可根据需要,按照8~13对Controller压缩后的标签栈进行解压缩处理,确保节点能利用Controller压缩后的标签栈正确进行报文处理。
与上述标签栈的压缩方法相对应地,本发明实施例还提供了一种标签栈的压缩装置700,所述装置700可以为图2-图4所示实施例中的网络设备,所述装置700可以为路由器或交换机,或者所述装置700为控制转发分离网络架构中的Controller。参见图7,所述装置700包括:
标签栈获得单元701,用于获得转发路径对应的第一标签栈,所述第一标签栈包括所述转发路径上的每个节点对应的节点标签;
第一选取单元702,用于从所述标签栈获得单元获得的所述第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;
第一替换单元703,用于将所述第一标签栈中位于所述第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈;
指导单元704,用于指导所述转发路径上的源节点根据所述第一替换单元生成的所述第二标签栈进行报文处理。
本发明实施例的压缩装置获得LSP对应的第一标签栈后,可从中选取一个第一节点标签,并将第一标签栈中位于第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈。其中,第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;至少两个相邻标签指的是标签在第一标签栈中连续不间断。
例如,第一标签栈为{12,901,902,201,901,19,901,20},第一节点标签为节点标签201,可将{901,19,901,20}替换为第一压缩标签K0,生成第二标签栈{12,901,902,201,K0}。本示例中,第一标签栈包括8个标签,第二标签栈包括5个标签,经压缩处理可缩短标签栈的长度,如此,将第二标签栈压入待转发报文时,有助于节省报文空间。
可选地,所述第一选取单元包括:
第一获得单元,用于获得节点标签i对应的节点能对报文封装标签的层数Li和所述节点标签i关联的标签个数Mi;所述节点标签i关联的标签为节点标签i+1及所述节点标签i+1之后的标签,1≤i<n,n为所述转发路径上的节点的个数;
第一计算单元,用于根据所述第一获得单元获得的Li和Mi计算第一差值Δi=Li-Mi
选取子单元,用于选取所述第一节点标签,所述第一节点标签对应的节点能对报文封装标签的层数不小于2,且所述第一节点标签对应的第一差值不小于0。
可选地,如果所述第一标签栈包括至少两个节点标签对应的节点能对报文封装标签的层数不小于2,且所述至少两个节点标签对应的第一差值不小于0,则所述选取子单元选取出的第一节点标签关联的标签个数是所述至少两个节点标签关联的标签个数中数值最大的。
可选地,若i=n,则所述第一获得单元获得的节点标签i关联的标签个数Mn为零,或者Mn为节点标签n之后的标签数。
可选地,所述装置还包括:
第二获得单元,用于在所述第一替换单元生成所述第二标签栈后,获得节 点标签j对应的节点能对报文封装标签的层数Lj和所述节点标签j关联的标签个数Mj;所述节点标签j关联的标签为节点标签j+1及所述节点标签j+1之后的标签,1≤j<m,m≤n;
第二计算单元,用于根据所述第二获得单元获得的Lj和Mj计算第二差值Δj=Lj-Mj
第二选取单元,用于选取第二节点标签,所述第二节点标签对应的节点能对报文封装标签的层数不小于2,且所述第二节点标签对应的第二差值不小于0;
第二替换单元,用于将所述第二标签栈中位于所述第二节点标签之后的至少两个相邻标签替换为一个第二压缩标签,生成第三标签栈;所述第二节点标签之后的至少两个相邻标签中包括所述第一压缩标签;
相应地,所述指导单元,具体用于指导所述转发路径上的源节点根据所述第二替换单元生成的所述第三标签栈进行报文处理。
可选地,所述装置还包括:
判断单元,用于在所述第一选取单元选取所述第一节点标签之前,判断所述源节点是否能对报文封装至少两层标签,如果是,再通知所述第一选取单元选取所述第一节点标签。
通过上述技术方案,网络设备就可在转发节点对报文进行转发时,缩短压入报文的标签栈长度,进一步减少报文的总长度,有利于报文在网络中传输。
与图5所示方法相对应地,本发明实施例还提供了一种标签栈的解压缩装置800,所述装置800可以为图5所示实施例中的转发节点,所述装置800可以为路由器或交换机。参见图8,所述装置800包括:
获取单元801,用于获取本节点的标签配置信息,所述标签配置信息包括压缩标签与被压缩标签的对应关系,所述被压缩标签包括至少两个标签;
接收单元802,用于接收从源节点发送来的报文,所述报文包含第一标签栈,所述第一标签栈包括所述压缩标签;
替换单元803,用于根据所述获取单元获取的所述标签配置信息,将所述接收单元接收的所述报文包含的所述第一标签栈中的所述压缩标签替换为所述被压缩标签,生成第二标签栈;
处理单元804,用于根据所述第二标签栈对所述报文进行处理。
压缩装置对LSP对应的标签栈进行压缩处理,生成压缩后的标签栈后,可指导LSP上的源节点将所述压缩后的标签栈压入待转发报文中,并根据所述压缩后的标签栈对报文进行处理。为了保证LSP上的节点可以利用所述压缩后的标签栈正确进行报文处理,本发明实施例还相应提供了一种解压缩装置。作为一种示例,解压缩装置可以设置在LSP上的转发节点内,解压缩装置接收到从源节点方向发送来的报文后,可从报文中获得压缩后的标签栈,即图7所示示例中的第一标签栈,并根据对应的标签配置信息,对第一标签栈中的压缩标签进行解压缩处理,将压缩标签替换为被压缩标签,生成第二标签栈。如此,就可根据第二标签栈正确进行报文处理。
可选地,所述处理单元,具体用于在所述第二标签栈的栈顶标签为节点标签时,将所述报文转发至所述节点标签对应的节点;或者,所述处理单元,具体用于在所述第二标签栈的栈顶标签为业务标签时,对所述报文执行所述业务标签对应的业务。
参见图9,本发明实施例还提供了一种标签压缩的装置900,所述装置900可以为图2-图4所示实施例中的网络设备,所述装置900可以为路由器或交换机,或者所述装置900为控制转发分离网络架构中的Controller。所述装置900包括:处理器901、存储器902、网络接口903、总线系统904。
所述总线系统904,用于将压缩装置的各个硬件组件耦合在一起。
所述网络接口903,用于实现压缩装置与至少一个其它网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等方式。
所述存储器902,用于存储程序指令和数据。
所述处理器901,用于读取存储器902中存储的指令和数据,执行以下操作:
所述处理器通过所述网络接口获得转发路径对应的第一标签栈,所述第一标签栈包括所述转发路径上的每个节点对应的节点标签;
所述处理器从所述第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;
所述处理器将所述第一标签栈中位于所述第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈;
所述处理器通过所述网络接口指导所述转发路径上的源节点根据所述第二标签栈进行报文处理。
可选地,所述处理器可执行以下操作,从所述第一标签栈中选取第一节点标签:
所述处理器获得节点标签i对应的节点能对报文封装标签的层数Li和所述节点标签i关联的标签个数Mi;所述节点标签i关联的标签为节点标签i+1及所述节点标签i+1之后的标签,1≤i<n,n为所述转发路径上的节点的个数;
所述处理器计算第一差值Δi=Li-Mi
所述处理器选取所述第一节点标签,所述第一节点标签对应的节点能对报文封装标签的层数不小于2,且所述第一节点标签对应的第一差值不小于0。
可选地,如果所述第一标签栈包括至少两个节点标签对应的节点能对报文封装标签的层数不小于2,且所述至少两个节点标签对应的第一差值不小于0,则所述处理器选取的第一节点标签关联的标签个数是所述至少两个节点标签关联的标签个数中数值最大的。
可选地,若i=n,则Mn为零,或者Mn为节点标签n之后的标签数。
可选地,在所述生成第二标签栈之后,所述处理器还用于执行以下操作:
所述处理器获得节点标签j对应的节点能对报文封装标签的层数Lj和所述节点标签j关联的标签个数Mj;所述节点标签j关联的标签为节点标签j+1及所述节点标签j+1之后的标签,1≤j<m,m≤n;
所述处理器计算第二差值Δj=Lj-Mj
所述处理器选取第二节点标签,所述第二节点标签对应的节点能对报文封装标签的层数不小于2,且所述第二节点标签对应的第二差值不小于0;
所述处理器将所述第二标签栈中位于所述第二节点标签之后的至少两个相邻标签替换为一个第二压缩标签,生成第三标签栈;所述第二节点标签之后的至少两个相邻标签中包括所述第一压缩标签;
相应地,所述处理器指导所述转发路径上的源节点根据所述第三标签栈进行报文处理。
可选地,在从所述第一标签栈中选取第一节点标签之前,所述处理器还用于执行以下操作:
所述处理器判断所述源节点是否能对报文封装至少两层标签,如果是,再 执行从所述第一标签栈中选取第一节点标签的步骤。
本发明实施例还提供了标签栈的解压缩装置1000的硬件构成。所述装置1000可以为图5所示实施例中的转发节点。参见图10所示示意图,可包括:处理器1001、存储器1002、网络接口1003、总线系统1004。
所述总线系统1004,用于将解压缩装置的各个硬件组件耦合在一起。
所述网络接口1003,用于实现解压缩装置与至少一个其它网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等方式。
所述存储器1002,用于存储程序指令和数据。
所述处理器1001,用于读取存储器1002中存储的指令和数据,执行以下操作:
所述处理器获取本节点的标签配置信息,所述标签配置信息包括压缩标签与被压缩标签的对应关系,所述被压缩标签包括至少两个标签;
所述处理器接收从源节点发送来的报文,所述报文包含第一标签栈,所述第一标签栈包括所述压缩标签;
所述处理器根据所述标签配置信息,将所述第一标签栈中的所述压缩标签替换为所述被压缩标签,生成第二标签栈;
所述处理器根据所述第二标签栈对所述报文进行处理。
可选地,如果所述第二标签栈的栈顶标签为节点标签,所述处理器将所述报文转发至所述节点标签对应的节点;
如果所述第二标签栈的栈顶标签为业务标签,所述处理器对所述报文执行所述业务标签对应的业务。
需要说明的是,本发明实施例中的处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。这些指令可以通过其中的处理器以配合实现及控制,用于执行本发明实施例揭示的方法。上述处理器还可以是通用处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(application specific integrated circuit)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、 分立硬件组件。
其中,上述通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器,解码器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。
另外,需要说明的是,总线系统除了包括数据总线之外,还可包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图8、9中将各种总线都标为总线系统。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到上述实施例方法中的全部或部分步骤可借助软件加通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者诸如媒体网关等网络通信设备)执行本发明各个实施例或者实施例的某些部分所述的方法。
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备及系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的设备及系统实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
以上所述仅是本发明的优选实施方式,并非用于限定本发明的保护范围。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (15)

  1. 一种标签栈的压缩方法,其特征在于,所述方法包括:
    网络设备获得转发路径对应的第一标签栈,所述第一标签栈包括所述转发路径上的每个节点对应的节点标签;
    所述网络设备从所述第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;
    所述网络设备将所述第一标签栈中位于所述第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈;
    所述网络设备指导所述转发路径上的源节点根据所述第二标签栈进行报文处理。
  2. 根据权利要求1所述的方法,其特征在于,所述网络设备从所述第一标签栈中选取第一节点标签,包括:
    所述网络设备获得节点标签i对应的节点能对报文封装标签的层数Li和所述节点标签i关联的标签个数Mi;所述节点标签i关联的标签为节点标签i+1及所述节点标签i+1之后的标签,1≤i<n,n为所述转发路径上的节点的个数;
    所述网络设备计算第一差值Δi=Li-Mi
    所述网络设备选取所述第一节点标签,所述第一节点标签对应的节点能对报文封装标签的层数不小于2,且所述第一节点标签对应的第一差值不小于0。
  3. 根据权利要求2所述的方法,其特征在于,如果所述第一标签栈包括至少两个节点标签对应的节点能对报文封装标签的层数不小于2,且所述至少两个节点标签对应的第一差值不小于0,则,
    所述第一节点标签关联的标签个数是所述至少两个节点标签关联的标签个数中数值最大的。
  4. 根据权利要求2或3所述的方法,其特征在于,若i=n,则Mn为零,或者Mn为节点标签n之后的标签数。
  5. 根据权利要求2~4任一项所述的方法,其特征在于,在所述生成第二标签栈之后,所述方法还包括:
    所述网络设备获得节点标签j对应的节点能对报文封装标签的层数Lj和所述节点标签j关联的标签个数Mj;所述节点标签j关联的标签为节点标签j+1及所述节点标签j+1之后的标签,1≤j<m,m≤n;
    所述网络设备计算第二差值Δj=Lj-Mj
    所述网络设备选取第二节点标签,所述第二节点标签对应的节点能对报文封装标签的层数不小于2,且所述第二节点标签对应的第二差值不小于0;
    所述网络设备将所述第二标签栈中位于所述第二节点标签之后的至少两个相邻标签替换为一个第二压缩标签,生成第三标签栈;所述第二节点标签之后的至少两个相邻标签中包括所述第一压缩标签;
    相应地,所述网络设备指导所述转发路径上的源节点根据所述第二标签栈进行报文处理为:
    所述网络设备指导所述转发路径上的源节点根据所述第三标签栈进行报文处理。
  6. 根据权利要求1~5任一项所述的方法,其特征在于,在所述网络设备从所述第一标签栈中选取第一节点标签之前,所述方法还包括:
    所述网络设备判断所述源节点是否能对报文封装至少两层标签,如果是,再执行从所述第一标签栈中选取第一节点标签的步骤。
  7. 根据权利要求1~6任一项所述的方法,其特征在于,所述节点标签为节点分段标识SID或链路SID。
  8. 一种标签栈的解压缩方法,其特征在于,所述方法包括:
    转发节点获取本节点的标签配置信息,所述标签配置信息包括压缩标签与被压缩标签的对应关系,所述被压缩标签包括至少两个标签;
    所述转发节点接收从源节点发送来的报文,所述报文包含第一标签栈,所述第一标签栈包括所述压缩标签;
    所述转发节点根据所述标签配置信息,将所述第一标签栈中的所述压缩标签替换为所述被压缩标签,生成第二标签栈;
    所述转发节点根据所述第二标签栈对所述报文进行处理。
  9. 根据权利要求8所述的方法,其特征在于,所述转发节点根据所述第二标签栈对所述报文进行处理,包括:
    如果所述第二标签栈的栈顶标签为节点标签,所述转发节点将所述报文转发至所述节点标签对应的节点;
    如果所述第二标签栈的栈顶标签为业务标签,所述转发节点对所述报文执行所述业务标签对应的业务。
  10. 一种标签栈的压缩装置,其特征在于,所述装置包括:
    标签栈获得单元,用于获得转发路径对应的第一标签栈,所述第一标签栈包括所述转发路径上的每个节点对应的节点标签;
    第一选取单元,用于从所述标签栈获得单元获得的所述第一标签栈中选取第一节点标签,所述第一节点标签对应的节点在对报文进行转发时,能对报文封装至少两层标签;
    第一替换单元,用于将所述第一标签栈中位于所述第一节点标签之后的至少两个相邻标签替换为一个第一压缩标签,生成第二标签栈;
    指导单元,用于指导所述转发路径上的源节点根据所述第一替换单元生成的所述第二标签栈进行报文处理。
  11. 根据权利要求10所述的装置,其特征在于,所述第一选取单元包括:
    第一获得单元,用于获得节点标签i对应的节点能对报文封装标签的层数Li和所述节点标签i关联的标签个数Mi;所述节点标签i关联的标签为节点标签i+1及所述节点标签i+1之后的标签,1≤i<n,n为所述转发路径上的节点的个数;
    第一计算单元,用于根据所述第一获得单元获得的Li和Mi计算第一差值Δi=Li-Mi
    选取子单元,用于选取所述第一节点标签,所述第一节点标签对应的节点能对报文封装标签的层数不小于2,且所述第一节点标签对应的第一差值不小于0。
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:
    第二获得单元,用于在所述第一替换单元生成所述第二标签栈后,获得节点标签j对应的节点能对报文封装标签的层数Lj和所述节点标签j关联的标签个数Mj;所述节点标签j关联的标签为节点标签j+1及所述节点标签j+1之后的标签,1≤j<m,m≤n;
    第二计算单元,用于根据所述第二获得单元获得的Lj和Mj计算第二差值Δj=Lj-Mj
    第二选取单元,用于选取第二节点标签,所述第二节点标签对应的节点能对报文封装标签的层数不小于2,且所述第二节点标签对应的第二差值不小于0;
    第二替换单元,用于将所述第二标签栈中位于所述第二节点标签之后的至少两个相邻标签替换为一个第二压缩标签,生成第三标签栈;所述第二节点标签之后的至少两个相邻标签中包括所述第一压缩标签;
    相应地,所述指导单元,具体用于指导所述转发路径上的源节点根据所述第二替换单元生成的所述第三标签栈进行报文处理。
  13. 根据权利要求10~12任一项所述的装置,其特征在于,所述装置还包括:
    判断单元,用于在所述第一选取单元选取所述第一节点标签之前,判断所述源节点是否能对报文封装至少两层标签,如果是,再通知所述第一选取单元选取所述第一节点标签。
  14. 一种标签栈的解压缩装置,其特征在于,所述装置包括:
    获取单元,用于获取本节点的标签配置信息,所述标签配置信息包括压缩标签与被压缩标签的对应关系,所述被压缩标签包括至少两个标签;
    接收单元,用于接收从源节点发送来的报文,所述报文包含第一标签栈,所述第一标签栈包括所述压缩标签;
    替换单元,用于根据所述获取单元获取的所述标签配置信息,将所述接收单元接收的所述报文包含的所述第一标签栈中的所述压缩标签替换为所述被压缩标签,生成第二标签栈;
    处理单元,用于根据所述第二标签栈对所述报文进行处理。
  15. 根据权利要求14所述的装置,其特征在于,
    所述处理单元,具体用于在所述第二标签栈的栈顶标签为节点标签时,将所述报文转发至所述节点标签对应的节点;或者,
    所述处理单元,具体用于在所述第二标签栈的栈顶标签为业务标签时,对所述报文执行所述业务标签对应的业务。
PCT/CN2015/086986 2014-09-05 2015-08-14 一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置 WO2016034040A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2015/086986 WO2016034040A1 (zh) 2014-09-05 2015-08-14 一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置
EP15837992.5A EP3179677B1 (en) 2014-09-05 2015-08-14 Method and apparatus for compressing label stack, and method and apparatus for decompressing label stack
US15/449,850 US10419333B2 (en) 2014-09-05 2017-03-03 Method and apparatus for compressing label stack, and method and apparatus for decompressing label stack

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201410453368.3 2014-09-05
CN201410453368.3A CN105471737B (zh) 2014-09-05 2014-09-05 一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置
PCT/CN2015/086986 WO2016034040A1 (zh) 2014-09-05 2015-08-14 一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/449,850 Continuation US10419333B2 (en) 2014-09-05 2017-03-03 Method and apparatus for compressing label stack, and method and apparatus for decompressing label stack

Publications (1)

Publication Number Publication Date
WO2016034040A1 true WO2016034040A1 (zh) 2016-03-10

Family

ID=55439111

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/086986 WO2016034040A1 (zh) 2014-09-05 2015-08-14 一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置

Country Status (4)

Country Link
US (1) US10419333B2 (zh)
EP (1) EP3179677B1 (zh)
CN (1) CN105471737B (zh)
WO (1) WO2016034040A1 (zh)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9967184B2 (en) * 2015-07-02 2018-05-08 Telefonaktiebolaget Lm Ericsson (Publ) Using border gateway protocol to expose maximum segment identifier depth to an external application
EP3417580B1 (en) 2016-02-15 2021-03-03 Telefonaktiebolaget LM Ericsson (PUBL) Techniques for exposing maximum node and/or link segment identifier depth utilizing is-is
EP3417579B1 (en) 2016-02-15 2020-12-30 Telefonaktiebolaget LM Ericsson (PUBL) Techniques for exposing maximum node and/or link segment identifier depth utilizing ospf
CN107248941B (zh) 2017-06-30 2020-01-10 华为技术有限公司 一种检测路径的方法和装置
CN109246012A (zh) * 2017-07-10 2019-01-18 中兴通讯股份有限公司 报文转发方法、装置及计算机可读存储介质
CN110290068B (zh) * 2018-03-19 2021-09-14 华为技术有限公司 一种粘连标签的发送方法、接收方法及设备
CN111510386B (zh) * 2019-01-30 2023-06-20 华为技术有限公司 用于处理报文的方法和装置
CN111917640B (zh) * 2019-05-09 2023-06-06 华为技术有限公司 SRv6网络生成段列表、报文转发的方法、设备和系统
CN112350935B (zh) * 2019-08-08 2023-03-24 中兴通讯股份有限公司 针对具有栈深约束的路径计算方法及装置
CN112583745A (zh) * 2019-09-27 2021-03-30 华为技术有限公司 一种在sr网络中转发报文的方法、设备和系统
CN112714063B (zh) * 2019-10-25 2022-08-09 华为技术有限公司 一种报文传输方法、设备以及数字处理芯片
CN115314563A (zh) * 2020-01-20 2022-11-08 华为技术有限公司 一种消息生成方法、处理方法及装置
CN112511428A (zh) * 2020-03-10 2021-03-16 中兴通讯股份有限公司 报文封装方法、报文转发方法、通告方法、电子设备、和存储介质
CN112100533B (zh) * 2020-06-30 2024-04-30 网络通信与安全紫金山实验室 一种基于区域划分的标签压缩方法
US11445048B2 (en) 2020-08-11 2022-09-13 Cisco Technology, Inc. Systems and methods for compressing a SID list
CN118200771A (zh) * 2020-09-27 2024-06-14 华为技术有限公司 一种数据帧的发送方法和网络设备
US11579781B2 (en) * 2020-10-23 2023-02-14 Red Hat, Inc. Pooling distributed storage nodes that have specialized hardware
CN113472657B (zh) * 2021-06-29 2022-07-29 新华三大数据技术有限公司 一种路径优化方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003073709A1 (en) * 2002-02-22 2003-09-04 Nortel Networks Limited System, device, and method for traffic and subscriber service differentiation using multiprotocol label switching
CN1471282A (zh) * 2002-07-24 2004-01-28 华为技术有限公司 一种基于多协议标签交换网络的报文传送方法
CN1571359A (zh) * 2003-07-15 2005-01-26 华为技术有限公司 一种标签展开的多级标签转发方法
CN101110773A (zh) * 2007-08-13 2008-01-23 杭州华三通信技术有限公司 生成标签转发表项、及查找标签转发表项的方法和装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1283071C (zh) 2003-02-20 2006-11-01 华为技术有限公司 网络中指定路由的方法
CN1283079C (zh) 2003-02-20 2006-11-01 华为技术有限公司 Ip网络业务质量保证方法及系统
CN100450077C (zh) 2004-09-15 2009-01-07 华为技术有限公司 一种在网络中路由转发的方法
US7602778B2 (en) * 2005-06-29 2009-10-13 Cisco Technology, Inc. System and methods for compressing message headers
US20110122893A1 (en) * 2008-07-30 2011-05-26 British Telecommunications Public Limited Company Header compression scheme
US8634418B2 (en) * 2011-07-01 2014-01-21 Juniper Networks, Inc. Providing extended administrative groups in computer networks
US9537769B2 (en) * 2013-03-15 2017-01-03 Cisco Technology, Inc. Opportunistic compression of routing segment identifier stacks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003073709A1 (en) * 2002-02-22 2003-09-04 Nortel Networks Limited System, device, and method for traffic and subscriber service differentiation using multiprotocol label switching
CN1471282A (zh) * 2002-07-24 2004-01-28 华为技术有限公司 一种基于多协议标签交换网络的报文传送方法
CN1571359A (zh) * 2003-07-15 2005-01-26 华为技术有限公司 一种标签展开的多级标签转发方法
CN101110773A (zh) * 2007-08-13 2008-01-23 杭州华三通信技术有限公司 生成标签转发表项、及查找标签转发表项的方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3179677A4 *

Also Published As

Publication number Publication date
CN105471737A (zh) 2016-04-06
EP3179677B1 (en) 2019-10-09
US20170180247A1 (en) 2017-06-22
CN105471737B (zh) 2019-05-10
EP3179677A4 (en) 2017-11-22
EP3179677A1 (en) 2017-06-14
US10419333B2 (en) 2019-09-17

Similar Documents

Publication Publication Date Title
WO2016034040A1 (zh) 一种标签栈的压缩方法及装置、标签栈的解压缩方法及装置
JP6643431B2 (ja) 通信システムにおけるパケット送受信方法及び装置
KR102148158B1 (ko) 통신 시스템에서 패킷 송수신 방법 및 장치
JP6177250B2 (ja) 通信システムにおけるパケット送受信装置及び方法
EP3751799B1 (en) Message processing method, controller, and forwarding device
JP2021534618A (ja) トラフィック伝送方法、装置及びコンピュータ記憶媒体
JP6486684B2 (ja) 移動通信システムにおける順方向誤り訂正パケットを送受信する装置及び方法
US10432755B2 (en) SDN, SDN configuration method, SDN-based data transmission method, and network controller
US11876723B2 (en) Method and apparatus for transmitting and receiving packet in communication system
US8724451B2 (en) Method for protecting a pseudo-wire
US10051266B2 (en) Apparatus and method for transmitting and receiving hybrid packets in a broadcasting and communication system using error correction source blocks and MPEG media transport assets
WO2017041223A1 (zh) 一种报文的处理方法和基站
KR101682508B1 (ko) 라우팅 장치 및 네트워크 장치
KR102153554B1 (ko) 미디어 데이터의 처리를 위한 mmt 장치 및 방법
JP6694430B2 (ja) アプリケーション階層順方向誤り訂正方式を使用して提供される放送サービスの受信を制御する方法及び装置
CN109196870B (zh) 用于发射和接收mmtp分组的方法和装置
KR102210437B1 (ko) 미디어 컨텐츠 전송 제어 방법, 이를 위한 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15837992

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2015837992

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2015837992

Country of ref document: EP