CN112448888A - Method, equipment and system for forwarding message in SR network - Google Patents

Method, equipment and system for forwarding message in SR network Download PDF

Info

Publication number
CN112448888A
CN112448888A CN201911317222.5A CN201911317222A CN112448888A CN 112448888 A CN112448888 A CN 112448888A CN 201911317222 A CN201911317222 A CN 201911317222A CN 112448888 A CN112448888 A CN 112448888A
Authority
CN
China
Prior art keywords
identifier
network device
segment
identifiers
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911317222.5A
Other languages
Chinese (zh)
Inventor
胡志波
李呈
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202310212097.1A priority Critical patent/CN116319617A/en
Priority to EP20858296.5A priority patent/EP4009596A4/en
Priority to PCT/CN2020/088788 priority patent/WO2021036328A1/en
Priority to CA3177466A priority patent/CA3177466A1/en
Priority to KR1020227009215A priority patent/KR20220047854A/en
Priority to MX2022002448A priority patent/MX2022002448A/en
Priority to JP2022513191A priority patent/JP7403635B2/en
Publication of CN112448888A publication Critical patent/CN112448888A/en
Priority to US17/681,137 priority patent/US20220182323A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/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/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/54Organization of routing tables
    • 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

Landscapes

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

Abstract

A method for forwarding a packet is disclosed. The method comprises the following steps: receiving a message, wherein a first message header of the message comprises a segment list used for forwarding the message, the segment list comprises a plurality of identifiers which are sequentially arranged, each identifier in the plurality of identifiers corresponds to a network device or a link respectively, the list comprises a first element with the length of 128 bits, the first element comprises at least two adjacent identifiers in the plurality of identifiers, and the first message comprises a first pointer; determining the position of a first identifier in a first element according to the value of a first pointer, wherein the first identifier is one of at least two identifiers; copying at least one identifier taking the first identifier as an initial identifier into a second message header of the first message to generate a second message; and sending the second message. By the method, the length of the segment list can be reduced, and the message transmission efficiency is improved.

Description

Method, equipment and system for forwarding message in SR network
Technical Field
The present application relates to the field of communications, and in particular, to a method, a network device, and a system for forwarding a packet in a Segment Routing (SR) network.
Background
The SR is a protocol which is designed based on the concept of source routing and is used for forwarding data packets on a network, and supports explicit specification of a data packet forwarding path at a source node. When deployed on the Internet Protocol Version 6 (IPv 6) data plane of the sixth Version, the SR is referred to as IPv6 segment routing (SRv6), and when deployed on the multiprotocol Label switching (MPLS) data plane, the SR is referred to as SR-MPLS. Wherein SRv6 extends Segment Routing Header (SRH) based on IPv 6.
The SRH includes a segment list (segment list), where the segment list includes a plurality of Segment Identifiers (SID) arranged in sequence, and each SID corresponds to a node or a link in a packet forwarding path. The SRH is encapsulated in the message, and the segment list in the SRH carries the process of forwarding and processing the message by the SR network. Where each SID is a 128-bit (bit) IPv6 address. Because each SID occupies 128 bits in the packet, the length of the SRH increases by 128 bits when adding one SID to the segment list, and correspondingly, the length of the packet also increases by 128 bits. On one hand, the increase of the message length will cause a large amount of network resources to be occupied in the forwarding process, such as: bandwidth. For example, when the packet forwarding path includes 100 nodes, the SRH includes 100 SIDs, the length of the segment list is as high as 1600 bytes, and the length of the segment list is too long, which reduces the efficiency of packet transmission in the SR network.
Disclosure of Invention
The application provides a method, equipment and a system for forwarding a message, which are used for solving the technical problem that the message transmission efficiency in an SR network is reduced due to the fact that the length of a segment list is too long.
In a first aspect, the present application provides a method for forwarding a packet. The method comprises the following steps: receiving a first packet, where a first packet header of the first packet includes a segment list used for forwarding the first packet, where the segment list includes multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to a network device or a link, the segment list includes a first element with a length of 128 bits, the first element includes at least two adjacent identifiers in the multiple identifiers, and the first packet includes a first pointer; determining a position of the first identifier in the first element according to the value of the first pointer, wherein the first identifier is one of the at least two identifiers; copying at least one identifier taking the first identifier as an initial identifier into a second message header of the first message to generate a second message; and sending the second message.
The method may be performed by an intermediate node on a packet forwarding path. Wherein the segment list may be a segment list in the SRH of the SRv6 message. At least two identifications corresponding to the network equipment can be stored in the element with the length of 128 bits in the segment list, and each identification does not need to occupy 128 bits, so that the length of the segment list is reduced, the length of a message is reduced, and the message transmission efficiency is improved. The number of identities stored in each 128-bit element may be adjusted according to the actual circumstances of the network. When a plurality of identifiers are included in one 128-bit element, these identifiers can be understood as a compact segment identifier (USID). The position of the compressed segment identifier inside the element can be accurately and quickly obtained through the first pointer included in the message header.
In a possible implementation manner, the plurality of identifiers are mapped to a plurality of segment identifiers one by one, each segment identifier in the plurality of segment identifiers corresponds to one network device or one link, each segment identifier in the plurality of segment identifiers includes a first part and a second part, the first part of each segment identifier in the plurality of segment identifiers is the prefix part, the prefix parts of the plurality of segment identifiers are the same, and each identifier in the plurality of identifiers includes the second part of the segment identifier to which each identifier is mapped. The USID can be obtained by omitting part of the content in the SID. Since the BLOCK part of the SID of all network devices is the same within one domain, the USID can be put in the segment list by omitting the BLOCK of the SID to obtain the USID, thereby reducing the length of the segment list.
In a possible implementation manner, the second header includes a Destination Address (DA) field, where the destination address field includes a first part and a second part; the copying at least one identifier starting with the first identifier into the second packet header of the first packet includes: copying at least one identification starting with the first identification into a second portion of the destination address field. When the element of the segment list includes multiple identifiers, the network device determines a first identifier from the multiple identifiers according to a first pointer, copies at least one identifier starting from the first identifier to the DA field, and directly places a prefix portion of the SID into the DA field, so that the prefix portion of the SID and the at least one identifier starting from the first identifier are combined to guide packet forwarding.
In one possible implementation, the lengths of the plurality of identifiers are the same; before copying at least one identifier starting with the first identifier into the second packet header of the first packet, the method further includes: determining the number of the at least one identifier according to the lengths of the plurality of identifiers and the length of the prefix portion. In the DA field, a part is occupied by the prefix portion, and another part is occupied by the at least one USID copied to the DA field, and the network device may determine the number of the at least one USID that can be copied to the DA field according to the length of the USID and the length of the prefix portion.
In one possible implementation, the segment list does not include the prefix portion. When the head node adds the SRH to the packet, the USID to be processed currently and the BLOCK part corresponding to the USID are also stored in the DA field, where the USID adjacent to the BLOCK part in the DA field may be referred to as an active USID. Therefore, for the active USID and other USIDs corresponding to the same prefix portion as the active USID, the segment list may store only the USID itself without storing the prefix portion corresponding to the USID. Thus, the length of the segment list is reduced.
In a possible implementation manner, the first packet includes a destination address field, the destination address field includes a second identifier, and the second identifier is one of the identifiers; before said determining the position of the first marker in the first element from the value of the first pointer, the method further comprises: determining that the segment list comprises identifiers of different types from the second identifiers according to the switching marks in the second identifiers; the copying at least one identifier starting with the first identifier into the second packet header of the first packet includes: and copying the at least one identifier into the second message header to form a forwarding identifier stack, wherein the at least one identifier is different from the second identifier in type. The segment list may further include other types of identifiers, such as an MPLS label or an Internet Protocol version 4(Internet Protocol, IPv4) address, and the network device establishes a forwarding identifier stack in the header and copies the other types of identifiers to the forwarding identifier stack. Therefore, the method can be compatible with more network scenes, and the whole forwarding path is programmed through the segment list, so that the forwarding efficiency is improved.
In a possible implementation manner, the first packet includes a quantity flag; before copying at least one identifier starting with the first identifier into the second packet header of the first packet, the method further includes: determining the number of the at least one identity according to the value of the number flag. Before copying the other types of identifiers into the forwarding identifier stack, the network device may determine the number of the other types of identifiers according to the number flag, so as to copy the corresponding number of the other types of identifiers into the forwarding identifier stack.
In one possible implementation, the determining a position of the first identifier in the first element according to the value of the first pointer includes: determining the number of redundant identifications in the destination address field, wherein the type of the redundant identifications is different from that of the second identification; correcting the value of the first pointer according to the number of the redundant identifications; and determining the position of the first identifier in the first element according to the corrected value of the first pointer. The first identity is a first identity of at least one other type of identity and the redundant identity is an other type of identity that has been added to the DA field. The network equipment corrects the value of the first pointer according to the number of the other types of identifiers added to the DA field, and determines the starting position of at least one identifier to be added to the DA field in the segment list according to the corrected value of the first pointer.
In a possible implementation manner, the copying at least one identifier starting from the first identifier into the forwarding identifier stack includes: and adding the latter identifier of the last identifier in the at least one identifier into the destination address field of the first message. And the network equipment also copies the compressed segment identifiers after the identifiers of other types in the segment list to the DA field so as to continue forwarding the message according to the DA field after the forwarding identifier stack is popped up.
In one possible implementation, the at least one identification is an MPLS label or an IPv4 address. The other type of identification may be an MPLS label or an IPv4 address.
In one possible implementation, the first pointer is included in the first header. The first pointer may be in a specific field of the SRH or in a segment list.
In a possible implementation manner, after copying at least one identifier starting from the first identifier into the second header of the first packet, the method further includes: modifying the value of the first pointer such that the modified value of the first pointer is used to indicate the location in the first element of a second identity, which does not belong to the at least one identity. And the network equipment modifies the value of the first pointer so that the value of the first pointer always points to the identifier to be added, so that the subsequent network equipment on the forwarding path can continuously determine the identifier to be added according to the value of the first pointer.
In a possible implementation manner, after copying at least one identifier starting from the first identifier into the second header of the first packet, the method further includes: modifying a value of the first pointer such that the modified value of the first pointer is used to indicate a location of a second identity in a second element, the second identity not belonging to the at least one identity, the second element being different from the first element. After the identifier in the current element is processed, the network device may point the first pointer to the identifier in the next element, for example, by setting the value of the first pointer to 0, so as to point to the starting position of the next element.
In a second aspect, the present application provides a method for forwarding a packet. The method comprises the following steps: receiving a first message; obtaining a segment list, where the segment list corresponds to a forwarding path of the first packet, the forwarding path includes multiple network devices, the segment list includes multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers; adding the segment list to the first message to generate a second message, wherein the second message comprises a first pointer, and the value of the first pointer is used for indicating the position of a first identifier in the first element, and the first identifier is one of the at least two identifiers; and sending the second message.
The method may be performed by an ingress node on a packet forwarding path. Wherein the segment list may be a segment list in the SRH of the SRv6 message. At least two identifications corresponding to the network equipment can be stored in the element with the length of 128 bits in the segment list, and each identification does not need to occupy 128 bits, so that the length of the segment list is reduced, the length of a message is reduced, and the message transmission efficiency is improved. The number of identities stored in each 128-bit element may be adjusted according to the actual circumstances of the network. When one 128-bit element contains a plurality of identifiers, the entry node on the message forwarding path adds a first pointer in the message header for indicating the positions of different identifiers inside the element, so that the intermediate node on the message forwarding path can accurately and quickly obtain the positions of the identifiers inside the element.
In one possible implementation manner, the plurality of identifiers are mapped to a plurality of segment identifiers one by one, each of the plurality of segment identifiers corresponds to one of the plurality of network devices or one of the links in the forwarding path, each of the plurality of segment identifiers includes a first part and a second part, the first part of each segment identifier is a prefix part, the prefix parts of the plurality of segment identifiers are the same, and each of the plurality of identifiers includes the second part of the segment identifier to which each identifier is mapped. The USID can be obtained by omitting part of the content in the SID. Since the BLOCK part of the SID of all network devices is the same within one domain, the USID can be put in the segment list by omitting the BLOCK part of the SID to obtain the USID, thereby reducing the length of the segment list.
In a possible implementation manner, a header of the first packet includes a destination address field, and the destination address field includes a first part and a second part; the adding the segment list to the first packet to generate the second packet includes: adding the prefix portion in a first portion of the destination address field; adding one or more of the plurality of identifications in a second portion of the destination address field. Since the prefix part of the SID is omitted from the USID in the segment list, the ingress node on the forwarding path directly adds the prefix part to the DA field, and also adds the first identifier in the segment list to the DA field, so that the prefix part of the SID and the first identifier are combined to guide packet forwarding.
In one possible implementation, the segment list does not include the prefix portion. The prefix part of the SID is stored in the DA field, and only the USID is stored in the segment list, and the prefix part of the SID is not stored any more. Thus, the length of the segment list is reduced.
In one possible implementation, at least one of the plurality of identities is an MPLS label or an IPv4 address.
In a possible implementation manner, the second packet includes a quantity flag, and a value of the quantity flag is used to indicate a quantity of the at least one identifier. The segment list may further include other types of identifiers, and at this time, the ingress node of the forwarding path adds a quantity flag in the packet, so as to indicate the quantity of the other types of identifiers.
In a possible implementation manner, the first pointer is located in a header of the second packet. The first pointer may be in a specific field of the SRH or in a segment list.
In a possible implementation manner, the second packet further includes a second pointer, and a value of the second pointer is used to indicate a position of the first element in the segment list. The second pointer may be a Segment Left (SL) pointer.
In one possible implementation, the obtaining the segment list includes: the segment list is received. The segment list may be received by an ingress node of the forwarding path from a controller in the network.
In one possible implementation, the obtaining the segment list includes: determining the forwarding path of the first packet, and generating the segment list corresponding to the forwarding path. The segment list may be generated by an ingress node of the forwarding path.
In a third aspect, the present application provides a method for generating a segment list for forwarding a packet, where the method includes: determining a forwarding path of a message, wherein the forwarding path comprises a plurality of network devices;
generating the segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, respectively, and the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers.
The method may be performed by a network device that generates a segment list, where the network device that generates the segment list may be a controller in a network or an ingress node of a packet forwarding path in the network. Wherein the segment list may be a segment list in the SRH of the SRv6 message. The network device stores at least two identifiers corresponding to the network device in the element with the length of 128 bits in the segment list, instead of only storing one identifier in every 128 bits, thereby reducing the length of the segment list, reducing the length of the message and improving the message transmission efficiency. The number of identities stored in each 128-bit element may be adjusted according to the actual circumstances of the network. When a 128-bit element contains multiple identifiers, these identifiers can be understood as compressed segment identifiers (USIDs).
In one possible implementation, the plurality of identifiers are mapped to a plurality of segment identifiers one by one, each of the plurality of segment identifiers corresponds to one of the plurality of network devices or one of the links in the forwarding path, each of the plurality of segment identifiers includes a first portion and a second portion, the first portion of each segment identifier is a prefix portion, and each of the plurality of identifiers includes the second portion of the segment identifier to which the each identifier is mapped. The USID can be obtained by omitting part of the content in the SID. Since the BLOCK part of the SID of all network devices is the same within one domain, the USID can be put in the segment list by omitting the BLOCK part of the SID to obtain the USID, thereby reducing the length of the segment list.
In a possible implementation manner, a segment identifier of the plurality of segment identifiers further includes a third part, the third part is a padding part, the padding parts of the plurality of segment identifiers are the same, and the identifier of the plurality of identifiers does not include the padding part. The function field in the USID may be a compressed function field, the length of which is less than the length of the uncompressed function field. Thus, the USID is less than the SID, and the USID is placed in the segment list, thereby reducing the length of the segment list.
In one possible implementation, the plurality of segment identifiers includes a first segment identifier, and the segment list does not include a prefix portion of the first segment identifier. The plurality of segment identifications includes a first segment identification, and the segment list does not include a prefix portion of the first segment identification. Only the USID is stored in the segment list, and the prefix portion of the SID is no longer stored. Thus, the length of the segment list is reduced.
In a possible implementation manner, the plurality of segment identifiers further includes a second segment identifier, a prefix portion of the first segment identifier is different from a prefix portion of the second segment identifier, and the segment list includes the prefix portion of the second segment identifier. When a plurality of network devices on the forwarding path belong to different network domains, there are at least two prefix parts of SIDs of the network devices, and at this time, the first prefix part is not stored in the segment list, and the second prefix part is stored in the segment list. The first prefix portion is placed directly into the DA field by the ingress node of the forwarding path.
In one possible implementation, at least one of the plurality of identities is a segment identity, an MPLS label, or an IPv4 address.
In one possible implementation, the segment list further includes a number flag, and a value of the number flag is used to indicate the number of the at least one other identifier.
In one possible implementation, after the generating the segment list corresponding to the forwarding path, the method further includes: sending the segment list to an ingress device of the forwarding path; or packaging the segment list into a message and sending the message. When the network device generating the segment list is a controller in the network, the controller generates the segment list and sends the segment list to an entry node of a forwarding path, so that the entry node encapsulates the segment list into a message and guides the message to be forwarded. When the network device generating the segment list is an entry node of a message forwarding path, the entry node encapsulates the segment list into a message and guides the message forwarding.
In a fourth aspect, the present application provides a network device that performs the method in the first aspect or any one of the possible implementation manners of the first aspect. In particular, the network device comprises means for performing the first aspect or the method in any one of its possible implementations.
In a fifth aspect, the present application provides a network device that performs the method of the second aspect or any one of the possible implementations of the second aspect. In particular, the network device comprises means for performing the second aspect or the method in any one of its possible implementations.
In a sixth aspect, the present application provides a network device, which executes the method in the third aspect or any one of the possible implementation manners of the third aspect. In particular, the network device comprises means for performing the method of the third aspect or any one of its possible implementations.
In a seventh aspect, the present application provides a network device, including: a processor, a communication interface, and a memory. The communication interface may be a transceiver. The memory may be configured to store program codes, and the processor is configured to call the program codes in the memory to perform the foregoing first aspect or any one of the possible implementations of the first aspect, which is not described herein again.
In an eighth aspect, the present application provides a network device, including: a processor, a communication interface, and a memory. The communication interface may be a transceiver. The memory may be configured to store program code, and the processor is configured to call the program code in the memory to perform the foregoing second aspect or any one of the possible implementations of the second aspect, which is not described herein again.
In a ninth aspect, the present application provides a network device, comprising: a processor, a communication interface, and a memory. The communication interface may be a transceiver. The memory may be configured to store program codes, and the processor is configured to call the program codes in the memory to perform any one of the foregoing possible implementations of the third aspect or the third aspect, which is not described herein again.
In a tenth aspect, the present application provides a network system, which includes the network device provided in the fourth, fifth or sixth aspect, or the network system includes the network device provided in the seventh, eighth or ninth aspect.
In an eleventh aspect, the present application provides a computer-readable storage medium having stored therein instructions, which when run on a computer, cause the computer to perform the method of the above aspects.
In a twelfth aspect, the present application provides a computer program product comprising computer program instructions that, when run on a network device, cause the network device to perform the method provided in the first aspect, the second aspect, the third aspect, any one of the possible implementations of the first aspect, any one of the possible implementations of the second aspect, or any one of the possible implementations of the third aspect.
In a thirteenth aspect, the present application provides a chip, which includes a memory and a processor, where the memory is used to store a computer program, and the processor is used to call and execute the computer program from the memory to perform the method in the first aspect and any possible implementation manner of the first aspect, or the processor performs the method in the second aspect or any possible implementation manner of the second aspect, or the processor performs the method in the third aspect or any possible implementation manner of the third aspect.
Optionally, the chip only includes a processor, and the processor is configured to read and execute the computer program stored in the memory, and when the computer program is executed, the processor executes the method in the first aspect or any possible implementation manner of the first aspect, or the processor executes the method in the second aspect or any possible implementation manner of the second aspect, or the processor executes the method in any possible implementation manner of the third aspect or the third aspect.
In a fourteenth aspect, the present application provides a method for forwarding a packet. The method comprises the following steps: receiving a first packet, where a first packet header of the first packet includes a segment list used for forwarding the first packet, where the segment list includes multiple identifiers arranged in sequence, an identifier in the multiple identifiers corresponds to a network device or a link, the segment list includes a first element and a second element, the lengths of the first element and the second element are 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers; a second message header of the first message comprises a destination address field, the destination address field comprises a first identifier, and the first identifier is one identifier in the plurality of identifiers; adding the second element to the destination address field according to the indication of the first identifier to generate a second message; and sending the second message.
The method may be performed by an intermediate node on a packet forwarding path. Wherein the segment list may be a segment list in the SRH of the SRv6 message. At least two identifications corresponding to the network equipment can be stored in the element with the length of 128 bits in the segment list, and each identification does not need to occupy 128 bits, so that the length of the segment list is reduced, the length of a message is reduced, and the message transmission efficiency is improved. When a 128-bit element contains multiple identifiers, these identifiers can be understood as compressed segment identifiers (USIDs). The segment list may also store a Segment Identifier (SID) with a length of 128 bits, that is, the SID and the USID are stored in the segment list at the same time. When the SID is added into the DA field, the SID corresponds to a different addition mode from the USID, so that a switching flag needs to be set between the USID and the SID, and the network device can obtain the switching flag from the DA field and adopt a corresponding addition mode according to an indication of the switching flag, for example, when the SID is added into the DA field, an element with a length of 128 bits in the segment list is added into the DA field as a whole. Thus, message forwarding is ensured.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings used in the embodiments will be briefly described below. It should be apparent that the following drawings are only drawings of some embodiments of the present application, and it is obvious for a person skilled in the art that other technical solutions and drawings capable of implementing the present application can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic format diagram of a SID provided in the embodiment of the present application;
fig. 3 is a schematic structural diagram of a packet according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a segment list provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a SID provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a segment list provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a segment list provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a segment list provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a packet according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 17 is a schematic structural diagram of a message according to an embodiment of the present application;
fig. 18 is a flowchart of a method for processing a message according to an embodiment of the present application;
fig. 19 is a flowchart of a method for processing a message according to an embodiment of the present application;
fig. 20 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 21 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 22 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 23 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 24 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 25 is a schematic structural diagram of a network system according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings.
Fig. 1 shows a possible application scenario of an embodiment of the present application. The network of the application scenario includes a network device, and specifically includes: network device S, network device 1, network device 2, network device 3, network device 4, network device 5, network device 6, network device 7, network device 8, network device 9, network device 10, network device 11, and network device 12. These network devices may be switches, routers, or repeaters. The network device S may be an ingress device of the network. The network device may also include a controller, not shown in fig. 1. The controller may be connected to the network devices 1 to 10. The controller may generate a segment list corresponding to a forwarding path of the packet and send the segment list to the network entry device. The controller may send control messages containing network configuration information to the network devices 1 to 12. The network devices in the embodiments of the present application may also be referred to as network nodes, or nodes.
The network device S is a network device supporting SR. The network devices 1 to 12 may be SR-enabled network devices, specifically SRv 6-enabled network devices, or MPLS-enabled network devices. The network devices 1 to 12 may also be network devices that support IPv4 but do not support SR.
In an SR network, the process of processing a message consists of a number of segments, each segment being an instruction or set of instructions to process the message. In SRv6 the network, each segment has a corresponding segment identification, i.e., SID. The segment identifier includes two types of node segment identifier (node SID) and adjacent segment identifier (adjacent SID). Fig. 2 illustrates SRv6 the format of SIDs in a network, and as shown in fig. 2, each SID may include a location (Locator) field and a Function (Function) field.
The location field in the SID is used to locate the particular network device executing the instruction or set of instructions included in the segment. The location field includes a prefix (BLOCK) portion and a sequence number (Node ID) portion. Within an SRv6 network domain (domain), the prefix portion of the SID of a network device may be the same. Within an SRv6 network domain (domain), the sequence number portion of the SID for each network device is different, and each sequence number portion is used to uniquely identify a network device within the domain. For a particular SID, the network device uniquely identified by the sequence number portion of the SID is the network device executing the segment identified by the SID.
The Function field in the SID is used to indicate the specific content of the instruction or set of instructions that the segment comprises, i.e., the Function (Function) in the SRv6 network. SRv6 the functions in the network may also involve parameters, represented by the parameter (alignment) field in the SID (not shown in FIG. 2). When the function does not involve parameters, then the parameter field may not be included in the SID.
Typically, the total length of SIDs in an SRv6 network is 128 bits. Wherein the location field and the function field are each of a specific length, and the specific lengths are changeable by network settings. For example, the location field is 48 bits, the function field is 80 bits, or the location field is 64 bits, and the function field is 64 bits, or the location field is 48 bits, the function field is 64 bits, and the parameter field is 16 bits.
The plurality of SIDs make up a segment list. Fig. 3 shows SRv6 the format of a message in a network. As shown in fig. 3, a header of the packet includes an IPv6 header and an SRH, where the IPv6 header includes a Destination Address (DA) field, and the SRH includes a segment list, and the segment list includes a plurality of SIDs arranged in sequence. These SIDs may be node segment identifications, neighbor segment identifications, or a combination of node segment identifications and neighbor segment identifications.
The segment list may be encapsulated in the message by an ingress node on the message forwarding path, and subsequent network devices on the message forwarding path may process the message according to the segment list in the message. Specifically, a message is sent by an ingress node on a forwarding path, and a specific network device on the forwarding path receives the message. And the network equipment determines that the DA field of the IPv6 message header of the message comprises the SID of the network equipment, and processes the message according to the instruction set corresponding to the segment identified by the SID. The specific way of processing the packet may be, for example, forwarding the packet. The network device also needs to update the DA field. In updating the DA field, a Segment Left (SL) pointer in SRH needs to be utilized. As shown in FIG. 3, the Segment List includes a plurality of SIDs, i.e., Segment List [0] to Segment List [ n ], arranged in sequence. The plurality of SIDs respectively correspond to a plurality of network devices on the message forwarding path, and the plurality of network devices respectively execute instruction sets corresponding to the plurality of segments. The SL pointer may point to multiple SIDs in the segment list in sequence. Specifically, in the process of processing the packet, the value of the SL pointer is updated once each segment is executed, the position pointed by the SL pointer in the segment list after each update is shifted by the length of one SID, that is, 128 bits, and the value of the SL pointer is continuously updated along with the sequential execution of a plurality of segments represented by a plurality of SIDs in the segment list. Thus, the SL pointer is used to indicate the number of segments remaining to be processed in the segment list. Or, each value of the SL pointer corresponds to a certain number of segments remaining to be processed in the segment list, and the SL pointer always points to the current SID to be processed. And according to the sequence of the segments represented by the plurality of SIDs in the message processing process, the plurality of SIDs are arranged in the segment list in a reverse order, that is, the SID of the segment executed first is arranged at the lowest part in the segment list, the SIDs of the segments executed subsequently are arranged upwards in sequence, and the SID of the segment executed last is arranged at the highest part in the segment list. Referring to FIG. 3, Segment List [ n ] represents the first Segment to execute, and Segment List [0] represents the last Segment to execute. For example, if the value of the SL pointer is 3, it indicates that the number of remaining segments to be processed in the segment list is 4, and it can also be understood that the SL pointer points to the current SID to be processed, that is, the 4 th SID from bottom to top; if the value of the SL pointer is 0, it indicates that the number of segments remaining to be processed is 1, and it can also be understood that the SL pointer points to the current SID to be processed, i.e. the last SID from bottom to top, i.e. the Segment List [0] in fig. 3. After determining the current SID to be processed according to the SL pointer, the network equipment copies the SID to a DA field in an IPv6 message header for subsequently processing the message according to the content in the DA field. The specific way of processing the packet may be, for example, forwarding the packet.
The message may be processed through the network shown in fig. 1. For example, the processing manner may be forwarding, that is, forwarding the packet through the network shown in fig. 1. For example, the network device S sends a message to the network device 10, and a forwarding path of the message sequentially passes through the network device 1, the network device 2, the network device 3, the network device 4, the network device 5, the network device 6, the network device 7, the network device 8, and the network device 9. I.e. the network device S is the head node of the forwarding path. In addition to the head node network device S, the forwarding path includes 10 network devices, from network device 1 to network device 10. If the 10 network devices are network devices supporting SRv6 and the forwarding behavior at each network device corresponds to a segment, the segment list representing the entire packet forwarding process includes 10 SIDs. Each SID is 128 bits in length and the segment list is 160 bytes in length. Therefore, the existence of the message middle section list causes the increase of the message length, and reduces the transmission efficiency and the processing efficiency of the network.
The embodiment of the application provides a method for forwarding a message, and equipment and a system based on the method. These methods, devices and systems are based on the same inventive concept. By the method, the compressed segment identifier with smaller length can be used for replacing SID with length of 128 bits, so that the length of the segment list is reduced, the message length is further reduced, and the transmission efficiency and the processing efficiency of the network are improved.
The embodiment of the invention provides a method for forwarding a message. The method involves nodes on a forwarding path of the packet. In combination with the application scenario shown in fig. 1, the network device S sends a packet to the network device 10, and a forwarding path of the packet sequentially passes through the network device 1, the network device 2, the network device 3, the network device 4, the network device 5, the network device 6, the network device 7, the network device 8, and the network device 9. The method comprises the following steps:
the network device S receives the message. The network device S is a network entry device in the network and is an entry node of a forwarding path of the packet. The network device S receives a message, which may be a message generated by a host (not shown in fig. 1), and the host may be a terminal device such as a personal computer, a mobile phone, or a tablet computer.
As an entry node of a forwarding path of a packet, the network device S needs to determine the forwarding path of the received packet. Optionally, the network device S may find a forwarding path for forwarding the packet from the stored multiple forwarding paths according to the feature of the packet, so as to determine the forwarding path of the packet. The stored plurality of forwarding paths may be received by the network device S from a controller in the network. The message may be characterized by any one element or a combination of multiple elements in a five-tuple of the message, where the five-tuple includes the following elements: the source IP address, source port, destination IP address, destination port, and protocol number of the message. Optionally, the network device S may also calculate a forwarding path for forwarding the packet according to the information carried by the packet and the network topology information. The forwarding path includes a plurality of network devices. In combination with the application scenario shown in fig. 1, the network device S sends a packet to the network device 10, and a forwarding path of the packet sequentially passes through the network device 1, the network device 2, the network device 3, the network device 4, the network device 5, the network device 6, the network device 7, the network device 8, and the network device 9.
The network device S obtains a segment list. The segment list may be the segment list in the SRH of the SRv6 message. As shown in fig. 4, the segment list at this time corresponds to a forwarding path of the packet, where the forwarding path includes network device 1 to network device 10, the segment list includes a plurality of SIDs arranged in sequence, each SID in the plurality of SIDs corresponds to one network device in the plurality of network devices or one link in the forwarding path, and the length of each SID is 128 bits.
The segment list may be received by the network device S from a controller and stored inside the device, and specifically, the network device S finds a forwarding path for forwarding the packet from the stored multiple forwarding paths, and finds a segment list corresponding to the forwarding path. The segment list may also be generated by the network device S, and specifically, the network device S calculates a forwarding path for forwarding a packet according to information carried by the packet, and generates a segment list corresponding to the forwarding path.
In SRv6, the forwarding path of a message may also be represented by multiple segments. Each segment is executed by a particular network device and each segment has a corresponding SID. Thus, for a segment, there is a correspondence between the SID of the segment and the network device executing the segment, i.e., the SID corresponds to a network device, or can be said to be the SID of a network device.
For example, in connection with the application scenario shown in fig. 1, the segment identifier of the network device 1 may be a:1:01:11:, the length of the segment identifier is 128 bits, and: "represents all 0 bytes. Wherein, A:1:01 is a position field with a length of 48 bits, A:1/48 is a BLOCK part with a length of 32 bits, "/48" represents a mask with 48 bits, 01 is a sequence number part with a length of 16 bits, that is, the length of the position field is 48 bits. 11: function field with length of 80 bits. Similarly, network device 2, network device 3, network device 4, network device 5, network device 6, network device 7, network device 8, network device 9, or network device 10 may also be network devices within the same domain, and the segment identifiers for these network devices may be A:1:02:22: A:1:03:33: A:1:04:44: A:1:05:55: A:1:06:66: A:1:07:77: A:1:08:88: A:1:09:99: A:1:0a: aa, respectively.
To reduce the length of each SID, some part or parts of the SID may be omitted to form a compressed segment identification (USID), and the length of the segment list may be reduced by placing these USIDs in place of the SID in the segment list.
Since the BLOCK part of the SID of all network devices may be the same within one domain, the BLOCK part of the SID may be omitted to form the USID in order to reduce the length of each SID in the segment list. That is, the SID of the network device is divided into two parts, the first part is a BLOCK part, and the second part is the rest part of the SID except the BLOCK part, and when putting the segment list, the same BLOCK part is omitted. For example, the SID of the network device 1 in FIG. 1 is A:1:01:11: where A:1/48 is a BLOCK portion, 01 is a sequence number portion, and has a length of 16 bits. The BLOCK portion of the SID is omitted, with the remainder being 01:11:, 96 bits in length. Similarly, the BLOCK portion of the location field of the SID for network device 2, network device 3, network device 4, network device 5, network device 6, network device 7, network device 8, network device 9, or network device 10 may all be omitted, with the remainder being 02:22: 03:33: 04:44: 05:55: 06:66: 07:77: 08:88: 09:99: 0a: aa: respectively. The remaining portions are each of a length less than the length of the SID.
Optionally, in the segment list, in order to reduce the length of the SID, the functional field of the SID may also be set to a compressed format, where the functional field of the compressed format is smaller than the functional field of the uncompressed format. In SID planning, all functional fields are divided into two parts, compressed functional fields and uncompressed functional fields. Fig. 5 shows a SID including compressed function fields, and a SID including uncompressed function fields. Wherein, the compressed function field is used for indicating the commonly used function, and the non-compressed function field is used for indicating the non-commonly used function. The length of the compressed functional field is smaller than the length of the uncompressed functional field, for example, the length of the compressed functional field is 16 bits and the length of the uncompressed functional field is 80 bits. As shown in fig. 5, when the compressed function field is used for the SID, the compressed function field is followed by a padding portion, and the padding portion has the same specific content, so that the length of the entire SID is still 128 bits. For example, the filling portion may be all 0 s. Therefore, in order to reduce the length of the SID, when the function field in the SID is a compressed function field, the padding portion after the compressed function field may be omitted to form the USID. For example, the SID of the network device 1 in FIG. 1 may be A:1:01:11: where 11 is a functional field and is a compressed functional field with a length of 16 bits, i.e., a padding portion with a length of 64 bits. The padding part after the compressed functional field of the SID is omitted, and the remainder is a:1:01:11, 64 bits in length. Similarly, the padded portions after the compressed function field of the SID for network device 2, network device 3, network device 4, network device 5, network device 6, network device 7, network device 8, network device 9, or network device 10 may all be omitted, with the remaining portions being A:1:02:22, A:1:03:33, A:1:04:44, A:1:05:55, A:1:06:66, A:1:07:77, A:1:08:88, A:1:09:99, A:1:0a: aa, respectively. The remaining portions are each of a length less than the length of the SID.
Alternatively, the first bit of the compressed function field and the first bit of the uncompressed function field may be set to different values. Thus, for the obtained SID, the network device may determine, through the first bit of the function field, whether the function field of the SID is a compressed function field or an uncompressed function field. For example, the first bit of the compressed function field is 0 and the first bit of the uncompressed function field is 1, or the first bit of the compressed function field is 1 and the first bit of the uncompressed function field is 0.
Preferably, if the BLOCK portion of the location field of the SID and the padding portion after the compressed function field of the SID are omitted at the same time, the length of the remaining portion can be further reduced, where the USID includes the sequence number portion of the location field of the SID and the compressed function field. For example, the BLOCK part of SID and the padding part after the compressed function field of the network device 1 in fig. 1 may be omitted at the same time, with the remaining part being 01:11 and 32 bits long. Similarly, the BLOCK portion and the padded portion following the compressed function field of the SID for network device 2, network device 3, network device 4, network device 5, network device 6, network device 7, network device 8, network device 9, or network device 10 may all be omitted, with the remaining portions being 02:22,03:33,04:44,05:55,06:66,07:77,08:88,09:99,0a: aa, respectively. The remaining portions are each of a length less than the length of the SID.
It can be seen that the USID is less than 128 bits in length. There is a one-to-one mapping relationship between the USID and the SID, and there is also a one-to-one mapping relationship between the USID and the segment represented by the SID, that is, each SID can obtain a unique USID, and there is a one-to-one mapping relationship between the SID and the USID. Thus, for a segment, there is a correspondence between the USID of the segment and the SID of the segment, and there is a correspondence between the USID of the segment and the network device executing the segment, i.e., the USID corresponds to a network device, or it can be said that the USID is the USID of a network device.
Optionally, the length of the compressed function field is the same for all SIDs and the length of all USIDs is the same.
The plurality of SIDs are arranged in sequence according to the sequence of the corresponding network device on the forwarding path, and then a segment list is formed. And the SID in the segment list is replaced by the corresponding USID, so that the length of the segment list can be reduced, the length of the message is further reduced, and the network efficiency is improved.
In the embodiment of the present application, the space in the segment list is divided into a plurality of elements, and the SL pointer points to a different element after each update. For example, the space occupied by each SID may be divided into one element, i.e., each element is 128 bits in length, and the position pointed to in the segment list after each update of the SL pointer is still offset by 128 bits. Since the length of the USID is smaller than 128 bits, for example, the length of the USID may be 32 bits, the network device S stores a plurality of USIDs, for example, at least two USIDs, in the element of the segment list with the length of 128 bits, thereby achieving the purpose of reducing the length of the segment list. Fig. 6 shows the structure of the segment list, for example, when the USID is 32 bits long, each element in the segment list holds 4 USIDs. For example, the first element stores USID1, USID2, USID3, and USID4, and the second element stores USID5, USID6, USID7, and USID 8.
Thus, the network device S obtains the segment list. The segment list corresponds to a forwarding path of the first packet, the forwarding path includes a plurality of network devices, the segment list includes a plurality of identifiers arranged in sequence, an identifier in the plurality of identifiers corresponds to one network device in the plurality of network devices or one link in the forwarding path, the segment list includes an element with a length of 128 bits, and the element includes at least two adjacent identifiers in the plurality of identifiers.
In this embodiment of the present application, the multiple USIDs in the segment list are sequentially arranged according to the order of the corresponding network device on the forwarding path. However, the arrangement of the USIDs within the element is not limited. The multiple USIDs may be arranged sequentially or in reverse order within the element. As shown in fig. 6, the 4 USIDs stored in the first element may be USID1, USID2, USID3, and USID4 from top to bottom, and the 4 USIDs may also be USID4, USID3, USID2, and USID1 from top to bottom.
Optionally, the network device generating the segment list may choose whether to generate the segment list including the USID. The network device may issue masks of different lengths, corresponding to the compressed functional fields and the uncompressed functional fields, respectively. For example, the length of the mask of the compressed segment identifier is the sum of the length of the position field in the SID and the length of the compressed functional field, and the length of the mask of the uncompressed segment identifier is the sum of the length of the position field in the SID and the length of the uncompressed functional field. And, the length of the mask identified by the compressed segment is smaller than the length of the mask identified by the uncompressed segment. In connection with the application scenario shown in fig. 1, the compressed mask length corresponding to network device 1 is 64 bits, and the uncompressed mask length corresponding to network device 1 is 128 bits. Thus, the network device generating the segment list obtains the masks of the different lengths issued by the other network devices. When the network device generating the segment list generates the segment list including the USID, the segment list including the USID is bound with a mask compressing the segment identification. When the network device generating the segment list generates the segment list including the SID, the segment list including the SID is bound with the uncompressed mask. Therefore, after the segment list is encapsulated in the message, the network device forwarding the message can obtain the SID or USID from the segment list by using masks with different lengths.
Optionally, both the USID and other types of identifications may be included in the segment list. The other type of identification may be a SID, i.e. the segment list assuming the USID may still be interspersed with SIDs. Some network devices may not have the capability of processing the USID among the network devices passed by the forwarding path of the packet, and at this time, SID with a length of 128 bits corresponding to these network devices may still be stored in the segment list. Thus, network compatibility is improved. As shown in fig. 6, when the network device 9 does not have the capability of handling the USID, the segment list stores SID9, i.e., a:1:09:99:, which is 128 bits in length, corresponding to the network device 9.
Optionally, the network device generating the segment list may determine to put the USID or SID of the network devices in the segment list according to whether other network devices have the capability of processing the USID. The network device generating the segment list may be a controller in a network, or may be an entry node of a packet forwarding path, for example, the network device S shown in fig. 1. For example, the network device S obtains a compression capability flag corresponding to the network device 9, the compression capability flag indicating whether the network device 9 has the capability of handling the USID. When the compression capability flag indicates that the network device 9 has the capability of processing the USID, the network device S stores the USID corresponding to the network device 9 in the generated segment list, and when the compression capability flag indicates that the network device 9 does not have the capability of processing the USID, the network device S stores the SID corresponding to the network device 9 in the generated segment list.
Optionally, when a SID with a length of 128 bits corresponding to a certain network device is stored in the segment list, a prompt flag is included in a previous USID of the segment identifier in the segment list, where the prompt flag is used to indicate that a next SID with a length of 128 bits is identified after a current USID. Optionally, the hint flag may be included in a compressed function field portion of the USID. For example, two associated compressed function fields may be provided for each USID, one of which is employed when the hint flag is included in the USID and the other of which is employed when the hint flag is not included in the USID. As shown in FIG. 6, two associated compressed function fields, 87 and 88 respectively, may be provided for USID8, 87 being employed when the hint flag is included in USID8 and 88 being employed when the hint flag is not included in USID 8. Since the segment list shown in fig. 6 stores SID9 of 128 bits in length corresponding to network device 9, a hint flag should be included in USID8, i.e., USID8 is 08: 87.
Optionally, after storing the SID with the length of 128 bits in the segment list, it is necessary to put the BLOCK portion of the SID in the start position of the next element of the SID in the segment list. As shown in fig. 6, if SID9 with a length of 128 bits corresponding to network device 9 is stored in the segment list, then the start position of the next element in the segment list stores a BLOCK, which may be a:1 and has a length of 32 bits. The USID10 corresponding to network device 10 is stored after the BLOCK.
Optionally, in an element of the segment list, multiple USIDs are stored in sequence, and after storing multiple USIDs, if there are still excess bits at the end of the element, the excess bits may be padded. For example, these extra bits are padded to all 0 s.
Optionally, when multiple network devices in the forwarding path of the packet belong to different domains, the BLOCK part of the SID also needs to be put in the segment list. The BLOCK portion of the SID of all network devices is the same within a domain, whereas the BLOCK portion of the SID of a network device is different between different domains. When a network device and the last hop network device in the forwarding path belong to different domains, the BLOCK part of the SID of the network device needs to be put in the segment list. Alternatively, the BLOCK portion needs to be placed at the beginning of an element, i.e., the BLOCK portion is placed at the beginning of an element subsequent to the USID of the network device of the last hop, and then, after the BLOCK portion, the USID of the network device is placed. Fig. 7 shows a structure of a segment list, and in conjunction with the application scenario shown in fig. 1, the network device 9 and the network device 8 belong to different domains, the SID of the network device 8 is a:1:8:88:, the SID of the network device 9 is a2:9:99:, that is, the BLOCK part of the SID of the network device 8 is a:1, the BLOCK part of the SID of the network device 9 is a2, the USID8 of the network device 8 is 8:88, and the USID9 of the network device 9 is 9: 99. As shown in fig. 7, the USID9 corresponding to the network device is stored in the next element of USID8, and before USID9 is stored a BLOCK, which is a2 and is 32 bits long.
As an entry node of a forwarding path of a packet, the network device S adds a segment list to the packet. Specifically, the network device S adds a segment list to the SRH of the packet.
Optionally, the segment list further includes a SL pointer. In conjunction with the above description, the SRH includes a SL pointer that points to an element in the segment list. In the process of forwarding the message, the intermediate node on the forwarding path adds the SID stored in the element pointed by the SL pointer to a Destination Address (DA) field in an IPv6 message header on the outer layer of the SRH. That is, the SL pointer is used to indicate the element in the segment list that is currently pending.
When the USID is adopted, because the length of the USID is smaller than that of the SID, an element space which originally stores one SID can store a plurality of USIDs. A new pointer needs to be set for indicating the location of a different USID inside each element. Optionally, the segment list contains a first pointer, the value of which is used to indicate the position in the element of the first identifier that needs to be copied into the header of the packet, and this new pointer may be referred to as a PI pointer. The SL in the segment list may become a second pointer, the value of the SL pointer indicating the location of the different element in the segment list, and the value of the PI pointer indicating the location of the different USID in the element. The PI pointer and the SL pointer together constitute a two-dimensional pointer. Thus, the intermediate node on the forwarding path can determine the identifier to be added currently in the element of the segment list, for example, the USID to be added currently, according to the value of the PI pointer.
The location of the PI pointer may be in a header, which may be an SRH or IPv6 header. For example, the PI pointer may be located in the PI field of the SRH, or the PI pointer may be located in the DA field of the IPv6 header. The PI pointer may also be located in the segment list. For example, the PI pointer may be located in the first USID in each element in the segment list.
Optionally, the network device S further adds a BLOCK part of the SID to the DA field of the IPv6 header in the message. Optionally, the network device S further adds at least one identifier in the DA field. The at least one identity may be a plurality of identities. The plurality of identifications may be a plurality of USIDs or a combination of USIDs and other types of identifications. That is, the DA field of the IPv6 header in the packet may also be divided into two parts. The first part of the DA field is placed with the BLOCK part omitted in the segment list and the second part of the DA field is placed with at least one identification.
Optionally, the number of the at least one identifier added in the DA field by the network device S is determined by the length of the BLOCK and the length of the identifier. The network device S adds as many identifiers as possible to the DA field except for BLOCK. For example, when the plurality of identities are a plurality of USIDs, the number of the plurality of USIDs may be (128-L)BLOCK)/LUSIDWherein L is an integer part ofBLOCKIs the length of BLOCK, LUSIDIs the length of the USID. For example, when the BLOCK has a length of 32 bits and the USID has a length of 32 bits, 3 USIDs are added to the DA field. For example, when the other type of identification is the same length as the USID, the number of the plurality of identifications including the combination of the USID and the other type of identification may also be (128-L)BLOCK)/LUSIDThe integer part of (2). For example, when the BLOCK has a length of 32 bits, the USID has a length of 32 bits, and the MPLS label has a length of 32 bits, a combination of 2 USIDs and 1 MPLS label is added to the DA field.
This is illustrated in connection with fig. 9. FIG. 9 shows the structure of the message with the addition of a segment list and a PI pointer, the PI pointer being located in the PI field of the SRH. And, the network device S adds the BLOCK part of the SID in the DA field. After BLOCK of the DA field, 3 USIDs are added. As shown in fig. 9, the 3 USIDs are USID1, USID2, and USID 3. The PI pointer has a value of 3, indicating that the first 3 USIDs in this element of the segment list have been added to the DA field. The identity to be added in this element, i.e. the 4 th USID, USID4, can be determined from the value of the PI pointer.
And the network equipment S sends the message. And when the network equipment S sends the message, determining the next hop network equipment of the message according to the content of the DA field and the longest matching rule. The DA field includes a BLOCK and a plurality of USIDs arranged in sequence, and the combination of the BLOCK and the first USID forms the SID corresponding to the first USID. Therefore, the determined next hop network device is the network device corresponding to the first USID.
Referring to the message structure shown in fig. 9, which is exemplified by referring to the application scenario shown in fig. 1, the network device S queries the local routing table according to the longest matching rule according to the content in the DA field in the message header of the message. Specifically, the part consisting of BLOCK + USID1 is a:1:01:11, and matches with the entry in the routing table, and matches successfully with SID1, that is, network device S determines that the next-hop network device is network device 1, thereby sending the packet including the segment list to network device 1.
After receiving the packet, the network device 1 queries a local segment identifier table (local SID table) according to the longest match rule according to the content of the DA field, and determines a packet processing action. The DA field includes a BLOCK and a plurality of USIDs arranged in sequence, and the combination of the BLOCK and the first USID forms the SID corresponding to the first USID. Therefore, the identified message processing action is the message processing action corresponding to the function field in the first USID, and may also be referred to as the message processing action corresponding to the first USID.
Referring to the message structure shown in fig. 9, which is exemplified by referring to the application scenario shown in fig. 1, a message including a segment list is sent from the network device S to the network device 1, the network device 1 queries the local segment identifier table according to the longest matching rule according to the DA field in the message, and if matching between the part composed of BLOCK + USID1 and the entry in the local segment identifier table is successful, the network device 1 executes a message forwarding processing action corresponding to the USID 1.
Optionally, the message forwarding processing action may include updating the DA field. Specifically, the network device 1 deletes a bit of the USID length from the portion following the BLOCK in the DA field, moves the rest forward, and fills all 0 in the blank portion at the end.
Optionally, after completing the update of the DA field, the network device 1 further determines whether all parts after BLOCK in the DA field are 0. If not all are 0, the network device 1 queries the local routing table according to the longest matching rule and the content in the DA field, and continues to forward the packet.
Optionally, after the packet reaches other intermediate nodes on the forwarding path, the processing action of the other intermediate nodes on the packet may be the same as the above-mentioned packet processing action of the network device 1. That is, the processing action of the packet by the intermediate nodes on the forwarding path includes updating the DA field, and determining whether all the parts following the BLOCK in the DA field are 0.
As illustrated in the application scenario shown in fig. 1, the network device 1 updates the DA field, deletes the USID1 after BLOCK in the DA field, moves the rest forward, and fills all 0 in the blank end portion. At this time, the DA field includes BLOCK, USID2, and USID3, and the structure of the packet is as shown in fig. 11. And the network equipment 1 judges that all the parts behind the BLOCK in the DA field are not 0, and continues to forward the message. At this time, the content of the DA field is successfully matched with the SID of the network device 2 according to the longest matching rule, that is, the part consisting of BLOCK + USID2 is successfully matched with the SID of the network device 2, and the network device 1 sends the packet to the network device 2.
And when the message reaches the network device 2, the network device 2 queries the local segment identification table according to the DA field in the message and the longest matching rule, successfully matches the part consisting of BLOCK + USID2, and executes corresponding message processing action. And, network device 2 updates the DA field, i.e., deletes USID2 in the DA field, moves the rest forward, and fills all 0 s with the last blank portion. At this time, the DA field includes BLOCK and USID3, and the structure of the packet is shown in fig. 12. And the network equipment 2 judges that all the parts behind the BLOCK in the DA field are not 0, and continues to forward the message. At this time, the content of the DA field is successfully matched with the SID of the network device 3 according to the longest matching rule, that is, the part consisting of BLOCK + USID3 is successfully matched with the SID of the network device 3, and the network device 2 sends the packet to the network device 3.
The network device 3 receives the message. Optionally, after completing updating the DA field, the network device 3 further determines that there are remaining identifiers after the BLOCK in the DA field, and if there are no remaining identifiers, for example, all of the parts after the BLOCK are 0, the network device 3 needs to continue to copy the identifiers into the DA field. The network device performing the copy action may be referred to as a copy node, i.e. the network device 3 is a copy node.
The copy node determines the location of the first identifier in the first element based on the value of the first pointer. The first pointer is a PI pointer, and the first identifier is an identifier to be added currently. Optionally, before determining the identifier to be added currently according to the value of the PI pointer, the network device 3 determines the current element according to the value of the SL pointer. The network device 3 in turn determines the identity currently to be added in the current element according to the value of the PI pointer. And determining the current identifier to be added according to the value of the PI pointer. The identifier to be added currently is the first identifier.
For example, referring to the application scenario shown in fig. 1, the network device 3 queries the local segment identifier table according to the longest matching rule according to the DA field in the message, and performs a corresponding forwarding action after successful matching of the part consisting of BLOCK + USID 3. And, network device 3 updates the DA field, i.e., deletes USID3 in the DA field, moves the rest forward, and fills all 0 s with the last blank portion. At this time, only BLOCK is included in the DA field. The network device 3 judges that the part following BLOCK in the DA field is all 0, i.e., need to add USID to the DA field. At this time, the network device 3 determines the current element from the value of the SL pointer. For example, the value of the SL pointer in the message may be 4, and network device 3 determines that the current element is the first element in the segment list. Further, the network device 3 determines that the identifier to be added currently is the 4 th USID in the current element, that is, the USID4, according to the value of the PI pointer being 3.
And the copying node copies at least one identifier taking the first identifier as the start into the message header of the first message. Optionally, when the at least one identifier starting from the first identifier may be at least one USID, the header may be an IPv6 header. The copy node determines the number of the at least one USID.
Optionally, copy node determination (128-L)BLOCK)/LUSIDThe value of the integer part is taken as the number of the at least one USID.
Optionally, copy node comparison (128-L)BLOCK)/LUSIDAnd the number of remaining USIDs in the current element that are not added to the DA field, the smaller of the two being the number of the at least one USID.
Optionally, after adding the at least one USID in the DA field, the copy node modifies the value of the PI pointer in the message, so that the modified value of the PI pointer points to the identifier to be currently added in the segment list, where the identifier to be currently added may be referred to as a third identifier, and the third identifier may be a next identifier of a last USID in the at least one USID in the segment list.
Alternatively, the identifier to be added may be a USID, which is located in the next element of the current element in the segment list, that is, all USIDs in the current element are already added to the DA field. At this time, the USID may be the first USID in the latter element. At this time, the value of the modified PI pointer is used to indicate the position of the USID in the next element, for example, the value of the modified PI pointer may be 0.
Optionally, after all identifiers in the current element have been added to the DA field, the copy node modifies the value of the SL pointer in the message so that the modified value of the SL pointer points to the next element of the current element in the segment list.
As illustrated in connection with the application scenario shown in fig. 1, the network device 3 determines that the identifier to be added currently is the USID 4. And, the network device 3 determines that the number of remaining USIDs in the current element that are not added to the DA field is 1, i.e., only USID 4. Since the USID has a length of 32 bits, the BLOCK has a length of 32 bits, (128-L)BLOCK)/LUSIDIs 3, greater than the number of remaining USIDs. Thus, the network device 3 determines that the number of at least one USID to be added to the DA field is 1. The network device 3 adds the USID4 to the DA field of the IPv6 header of the packet, and the packet structure at this time is as shown in fig. 14. And, since all USIDs in the current element have been added to the DA field, the network device 3 modifies the value of the SL pointer in the message, decrements the value of the SL pointer by 1, the modified value of the SL pointer being 3, pointing to the second element in the segment list. And the network device 3 modifies the value of the PI pointer, the modified PI pointer having a value of 0 and pointing to the first USID in the second element, i.e., USID 5.
The network device 3 sends the message. And the message is continuously forwarded along the forwarding path, and the intermediate node on the forwarding path continuously updates the DA field in the message. And when the identification in the DA field is processed, namely no residual identification exists after the BLOCK in the DA field, the copy node on the forwarding path continuously updates the DA field in the message. For example, after at least one USID added to the DA field is processed, the copy node will continue to add at least one identifier starting with the identifier to be added currently to the DA field of the packet according to the value of the PI pointer.
Optionally, at least one identifier starting from the identifier to be added currently may be a USID, and at this time, the processing procedure of the copy node is similar to that described above, and is not described herein again.
Optionally, the at least one USID is a plurality of USIDs. When the at least one USID is a plurality of USIDs, the plurality of USIDs are adjacent to each other in the segment list.
Optionally, after the at least one USID is added to the DA field, the copy node modifies the value of the PI pointer in the message, so that the modified value of the PI pointer points to the identifier to be added currently, where the identifier to be added currently is the next identifier in the segment list of the last USID in the at least one USID.
Optionally, the identifier to be added currently may be a USID, and both the USID and the at least one USID may be located in the current element. At this point, the value of the modified PI pointer is used to indicate the location of the USID in the current element.
Alternatively, the identifier to be added currently may be a USID, which is located in the next element of the current element in the segment list, that is, all the USIDs in the current element are already added to the DA field. At this time, the USID may be the first USID in the latter element. At this time, the value of the modified PI pointer is used to indicate the position of the USID in the next element, for example, the value of the modified PI pointer may be 0.
Optionally, after all identifiers in the current element have been added to the DA field, the copy node modifies the value of the SL pointer in the message so that the modified value of the SL pointer points to the next element of the current element in the segment list.
The network device 4 receives the message and processes the message according to BLOCK + USID4 in the DA field. And, the network device 4 updates the DA field, deletes the USID4 in the DA field, moves the rest forward, and fills all 0 s with the blank last portion. At this time, only BLOCK is included in the DA field. The network device 4 is a copy node. If the network device 4 determines that all of the parts after BLOCK in the DA field are 0, the network device 4 continues to add the identifier to the DA field of the packet. The network device 4 determines the current element as the second element in the segment list according to the value of the SL pointer in the message, and determines the first USID identified in the second element to be added currently, i.e., the USID5, according to the value of the PI pointer. Network device 4 determines (128-L)BLOCK)/LUSIDIs 3, the number of remaining USIDs in the current element that are not added to the DA field is determined to be 4, and the smaller value of the two, i.e., 3, is taken as the number of USIDs added to the DA field. Thus, the network device 4 adds 3 USIDs starting from USID5 to the DA field, where the 3 USIDs are USID5, USID6, and USID7, and the message structure at this time is as shown in fig. 15. Also, network device 4 modifies the value of the PI pointer so that the value of the PI pointer points to the USID to be added, USID 8.
Thereafter, the packet continues to pass through the network device 5, the network device 6, and the network device 7 and is forwarded to the network device 8, and packet processing actions of these network devices are respectively similar to those of the network device 1, the network device 2, the network device 3, and the network device 4, where the network device 7 is also a copy node, which is not described herein again.
Optionally, at least one identifier starting from the identifier to be added currently may be a SID with a length of 128 bits, and in this case, in combination with the above description, a prompt flag is included in the previous USID of the SID in the segment list. When the copying node processes the previous USID, the last identification of the USID can be determined to be the SID with the length of 128 bits according to the prompt mark. Optionally, the copying node adds an SID with a length of 128 bits in a DA field of the packet. That is, the BLOCK portion in the DA field will also be overwritten.
Optionally, after the at least one USID is added to the DA field, the copy node modifies the value of the PI pointer in the message, so that the modified value of the PI pointer points to the identifier to be added currently, where the identifier to be added currently is the next identifier in the segment list of the last USID in the at least one USID.
Optionally, the identifier to be added currently may be a SID with a length of 128 bits. At this time, since the SID occupies the entire space in one element, for example, the value of the modified PI pointer may be 0.
For example, the network device 8 is also a copy node. The network device 8 receives the message, processes the message according to BLOCK + USID8 in the DA field, finds that USID8 includes a prompt flag, and determines that the next id in the segment list of USID8 is identified as a SID with a length of 128 bits. The network device 8 determines that the current element is the third element in the segment list according to the value of the SL pointer in the packet, and adds the SID in the element to the DA field, that is, adds SID9 to the DA field, where the packet at this time is as shown in fig. 16.
Optionally, both the USID and other types of identifications may be included in the segment list. The other type of identifier may be an MPLS label or an IPv4 address, that is, the segment list adopting the USID may be accompanied by an MPLS label or an IPv4 address. Some network devices may not support SRv6 but may support MPLS or may support IPv4 among the network devices through which the forwarding path of the packet passes, and at this time, MPLS labels or IPv4 addresses corresponding to these network devices are directly stored in the segment list. Therefore, network compatibility is improved, and network efficiency is improved. In combination with the application scenario shown in fig. 1, the network device S sends a packet to the network device 10, and a forwarding path of the packet sequentially passes through the network device 1, the network device 2, the network device 3, the network device 4, the network device 5, the network device 6, the network device 7, the network device 8, and the network device 9. Among them, network device 3, network device 4, network device 5, and network device 6 do not support SRv6, but are capable of supporting MPLS.
In the segment list, the USIDs and the MPLS labels and/or IPv4 addresses are arranged in order on the forwarding path of the corresponding network devices. Wherein, the length of each MPLS label may be 32 bits, and the length of each IPv4 address may also be 32 bits. The length of the MPLS label or IPv4 address may be the same as or different from the length of the USID. Fig. 8 shows the structure of the segment list at this time, and when MPLS is supported, since network device 3, network device 4, network device 5, and network device 6 do not support SRv6, MPLS labels, i.e., M3, M4, M5, and M6, respectively, may be stored in the segment list. The segment list stores the USIDs or SIDs respectively corresponding to the other network devices. The length of the MPLS label is 32 bits and is the same as the USID length. Also, these MPLS labels may be stored in one element together with the USID, as shown in fig. 8, the USID1, USID2, M3, and M4 in the first element of the segment list, and the USID8 in the second element, M5, M6, USID7, and USID 8. The storage manner of the IPv4 address is similar to that of the MPLS label, and is not described herein again.
Optionally, when the segment list includes the MPLS label and/or the IPv4 address, the network device S adds a switching flag to the message, where the switching flag may be located in the segment list. For example, when a plurality of MPLS labels or IPv4 addresses arranged in series are included in the segment list, the switch flag may be located in a specific identifier in the segment list, which is referred to as the second identifier, for example. The second identification may be in the first MPLS label or the previous USID of the IPv4 address. Alternatively, the switch flag may be a separate identity that is added between the last USID and the first MPLS label or IPv4 address. The switch flag is used to indicate that the subsequent id in the segment list will include an MPLS label and/or an IPv4 address, so that when the network device reads the previous USID, it can be determined that the USID will include an MPLS label and/or an IPv4 address in the subsequent id in the segment list. The specific process will be described in detail below.
Optionally, when the network device S adds at least one identifier in the DA field, the network device S determines whether each identifier in the at least one added identifier includes the handover flag, and if a certain identifier includes the handover flag, the network device S does not add the next identifier of the identifier to the DA field after adding the identifier to the DA field. At this time, at least one identification added to the DA field is all the USID, and does not include other types of identifications.
Optionally, when the segment list includes the MPLS label and/or the IPv4 address, the network device S further adds a quantity flag to the packet, where a value of the quantity flag is used to indicate the quantity of the MPLS label and/or the IPv4 address in the segment list. The location of the quantity flag may be in a header, which may be an SRH or IPv6 header. For example, the quantity flag may be located in a specific field of the SRH, or the quantity flag may be located in the DA field of the IPv6 header. The quantity flag may also be located in the segment list. For example, when a plurality of MPLS labels or IPv4 addresses arranged in series are included in the segment list, the number flag may be located in the previous USID of the first MPLS label or IPv4 address. At this time, the PI pointer is used to indicate the location of a different USID, MPLS label, or IPv4 address in the element.
Optionally, the switch flag and the quantity flag may be the same flag, that is, the quantity flag simultaneously functions as a switch flag. At this time, the segment list includes a plurality of MPLS labels or IPv4 addresses arranged in series, and the number flag may be located in the previous USID of the first MPLS label or IPv4 address.
This is illustrated in connection with fig. 10. Fig. 10 shows the structure of the message with the addition of a segment list and PI pointers, and the segment list includes MPLS labels. And, the network device S adds the BLOCK part of the SID in the DA field. After BLOCK of the DA field, 2 USIDs and 1 MPLS label are added. As shown in fig. 10, 2 USIDs are USID1, USID2, and 1 MPLS label is M3. The PI pointer has a value of 3, indicating that the first 3 identifiers in this element of the segment list have been added to the DA field. The identity to be added in the element, i.e., M3, can be determined from the value of the PI pointer, as will be described in detail below.
When other types of identifiers, such as MPLS labels and/or IPv4 addresses, are also included in the segment list of the packet, the intermediate node on the forwarding path may copy the other types of identifiers to a forwarding identifier stack in the packet, where the forwarding identifier stack is used to direct packet forwarding. The intermediate nodes that perform the above-described copying behavior may be referred to as copy nodes.
Optionally, when processing the current USID, the copy node on the forwarding path can determine that the latter identifier in the segment list will include the MPLS label or IPv4 address through the above-mentioned switch identifier or number identifier. At this time, the identifier to be added currently should be the first MPLS label or IPv4 address. The copy node in turn determines the first MPLS label or IPv4 address based on the value of the PI pointer.
If the current USID is the last USID in the DA field, that is, there is no other identifier behind the USID in the DA field, the copy node may directly determine the first MPLS label or IPv4 address in the segment list according to the value of the PI pointer.
If the current USID is not the last USID in the DA field, i.e., there is other identification in the DA field after the USID, then it is stated that there has been a partial MPLS label or IPv4 address added to the DA field and the first MPLS label or IPv4 address added to the DA field. Alternatively, the copy node may obtain other identities that have been added to the DA field, and other identities that have not been added to the DA field, respectively. Optionally, the copy node may also determine the number N of MPLS labels or IPv4 addresses that have been added to the DA field, where N is an integer, correct the value of the PI pointer according to the value and the number N of the PI pointer, and determine the first MPLS label or IPv4 address in the segment list according to the corrected value of the PI pointer. Specifically, the copy node corrects the value of the PI pointer by subtracting the value of the number N from the value of the PI pointer. The above process can also be viewed as a rollback of the PI pointer in the segment list.
Referring to the message structure shown in fig. 13, the DA field in the message includes BLOCK, USID2, and M3, and the USID2 includes a number flag, which may have a value of 4. And, the value of the PI pointer in the message may be 3. For example, in connection with the application scenario shown in fig. 1, the copy node may be a network device 2. The network device 2 queries the local segment identifier table according to the DA field in the message and the longest matching rule, and the part consisting of BLOCK + USID2 is successfully matched to execute the corresponding forwarding action. Also, network device 2, when processing current USID2, determines from the number flag included in USID2 that USID2 will include MPLS labels in the latter identification in the segment list, and the number of MPLS labels is 4. At this time, the identifier to be added currently should be the first MPLS label.
Network device 2 further determines that the current USID2 is not the last USID in the DA field, 32 non-0 bits after USID2 and 1 MPLS label after USID2, i.e., the first MPLS label has been added to the DA field. Network device 2 determines that the value of the corrected PI pointer should be 2 based on the value of the PI pointer being 3 in combination with the number of MPLS labels that have been added to the DA field being 1, and determines that the first MPLS label should be the 3 rd identifier in the current element, i.e., M3, based on the value of the corrected PI pointer.
Optionally, when the at least one identifier starting with the first identifier is at least one identifier of another type, such as an MPLS label or an IPv4 address, the copy node adds the identifier of another type to the second packet header to form a forwarding identifier stack, such as an MPLS label stack or an IPv4 address stack.
In combination with the above description, when part of the other types of identifiers have been added to the DA field, optionally, the copy node may obtain the other identifiers that have been added to the DA field and the other identifiers that have not been added to the DA field, respectively, and add the two parts of the other identifiers together to the second packet header to form a forwarding identifier stack; optionally, the copy node may also determine the position of the first other type identifier in the segment list according to the corrected value of the PI pointer, so as to obtain all other types of identifiers from the segment list.
The copy node determines the number of the at least one MPLS label or IPv4 address. Optionally, the intermediate node takes the value of the number flag as the number of the at least one MPLS label or IPv4 address.
The at least one MPLS label or IPv4 address corresponds to at least one network device supporting MPLS or IPv4, and after passing through these network devices, the message may re-enter the SRv6 network. At this time, in the segment list, one or more USIDs exist after the at least one MPLS label or IPv4 address, and these USIDs also need to be copied into the DA field of the IPv6 header in the packet. Alternatively, these USIDs may be copied into the DA field by the intermediate node. Optionally, the USIDs may also be copied into the DA field by the last network device of the at least one network device supporting MPLS or IPv 4.
When these USIDs can be copied into the DA field by the intermediate node, optionally, the copy node modifies the value of the PI pointer in the message after copying these USIDs into the DA field, so that the modified value of the PI pointer points to another identifier in the segment list, which may be referred to as a third identifier, for example. The third identification may be the next identification in the fragment list of the last of the USIDs copied into the DA field as described above. The third identifier may be located in the same element of the segment list as the last USID or in a different element of the segment list than the last USID. For example, when the element in which the last USID is located is the first element, and the element in which the third identifier is located is the second element, the first element and the second element may be the same or different. Optionally, when the first element is different from the second element, the copy node further modifies a value of an SL pointer in the message, so that the modified SL pointer points to the second element. For example, the second element may be the latter element of the first element in the list of segments.
For example, referring to the application scenario shown in fig. 1, the copy node may be a network device 2, and a structure of a packet received by the network device 2 is shown in fig. 13. Network device 2 determines that the first MPLS label should be the 3 rd identity in the current element, i.e., M3. And, the network device 2 determines that the number of at least one MPLS label to be added to the DA field is 4 according to the value of the number flag being 4. The network device 2 establishes an MPLS packet header outside the IPv6 packet header of the packet, where the MPLS packet header includes a forwarding identifier stack, i.e., an MPLS label stack. Network device 2 adds 4 MPLS labels starting with M3 to the MPLS label stack. These 4 MPLS labels include M3, M4, M5, and M6. And network device 2 copies at least one USID after M6 in the segment list into the DA field, specifically, network device 2 copies USID7 and USID8 into the DA field. And, network device 2 modifies the value of the SL pointer, the modified SL pointer having a value of 2, pointing to the third element in the segment list, network device 2 modifies the value of the PI pointer, the modified PI pointer having a value of 0, pointing to the 1 st identifier in the third element, i.e., SID 9. At this time, the structure of the message is as shown in fig. 17.
The network device 2 forwards the packet to the network device 3 according to the top label of the MPLS label stack in the MPLS packet header, i.e., M3. When the message reaches the network device 3, the M3 at the top of the MPLS label stack pops up, and the M4 becomes the top label of the stack. Network device 3 forwards the message to network device 4 according to M4. Then, the message sequentially reaches the network device 4, the network device 5, and the network device 6, and the specific process is similar to the above description and is not described again here. At network device 5 or network device 6, the MPLS header in the message is stripped. Network device 6 supports both MPLS and SRv 6. The network device 6 continues to forward the packet according to the DA field in the IPv6 packet header of the packet, see the packet structure shown in fig. 17, where the DA field includes BLOCK, USID7, and USID 8. Thus, network device 6 forwards the message to network device 7. The specific process is similar to the above description and is not repeated herein.
The above is illustrated by the processing procedure of the MPLS label, and the processing procedure of the IPv4 address is similar to the above description, and is not described herein again.
The embodiment of the invention provides a method for forwarding a message. Fig. 18 shows a method flow diagram of the method. The method involves network device 401 and network device 402. The network device 401 may be a network entry device in a network, and is configured to encapsulate a segment list of a forwarding path of a corresponding packet in the packet, for example, the network device S shown in fig. 1. Network device 402 may be a forwarding device in a network, and in particular, network device 402 is a copy node in the above embodiments, for example, network device 3, network device 4, network device 7, network device 8, or network device 9 shown in fig. 1, or network device 2 shown in fig. 1. The method comprises the following steps:
s410, the network device 401 receives the message.
S420, the network device 401 obtains the segment list. The segment list corresponds to a forwarding path of the first packet, the forwarding path includes a plurality of network devices, the segment list includes a plurality of identifiers arranged in sequence, an identifier in the plurality of identifiers corresponds to one network device in the plurality of network devices or one link in the forwarding path, the segment list includes an element with a length of 128 bits, and the element includes at least two adjacent identifiers in the plurality of identifiers.
S430, the network device 401 adds the segment list to the packet, where the segment list includes a first pointer, and a value of the first pointer is used to indicate a position of a first identifier in an element, where the first identifier is one of the at least two identifiers.
S440, the network device 401 sends the message.
The network device 401 may be a network ingress device in a network, and the network device 401 is an ingress node of a forwarding path of the packet, for example, the network device S shown in fig. 1. For a specific process, reference may be made to the description of the network device S in the foregoing embodiment, and the similar parts are not described herein again.
S450, the network device 402 receives the message. The message header of the message comprises a segment list used for forwarding the message, the segment list comprises a plurality of identifiers which are sequentially arranged, each identifier in the plurality of identifiers corresponds to a network device or a link respectively, the segment list comprises a first element with the length of 128 bits, the first element comprises at least two adjacent identifiers in the plurality of identifiers, and the first message comprises a first pointer.
S460, the network device 402 determines the position of the first identifier in the first element according to the value of the first pointer.
S470, the network device 402 copies at least one identifier starting with the first identifier into the header of the packet.
S480, the network device 402 sends the message.
Network device 402 may be a copy node of a forwarding path of the packet, i.e. network device 402 is an intermediate node that copies at least one identifier into the packet. The at least one identity copied by network device 402 may be a USID, an MPLS label, or an IPv4 address. Specifically, in conjunction with the application scenario shown in fig. 1, network device 402 may be network device 2, network device 3, network device 4, network device 7, network device 8, or network device 9 in 1. For a specific process, reference may be made to the description of network device 2, network device 3, network device 4, network device 7, network device 8, or network device 9 in the foregoing embodiments, and similar parts are not described herein again.
In an actual network, a forwarding path of a packet may be generated by a controller, or may be generated by an ingress node of the forwarding path. When the controller generates a forwarding path of the packet, the controller will also generate a segment list corresponding to the forwarding path, which may be a segment list including the USID. The controller sends the segment list to an ingress node of the forwarding path. After receiving the message, the entry node of the forwarding path determines the forwarding path of the message from a plurality of forwarding paths stored in the device, and determines a segment list corresponding to the forwarding path. And encapsulating the segment list into the message for forwarding the message.
The embodiment of the invention provides a method for forwarding a message. Fig. 19 shows a method flow diagram of the method. The method involves network device 301, network device 302, and network device 303. The network device 301 may be a controller in a network, and is configured to calculate a forwarding path of a packet and generate a segment list corresponding to the forwarding path. Network device 302 may be a network entry device for encapsulating a segment list in a message, such as network device S shown in fig. 1. The network device 303 may be a forwarding device in the network, configured to forward the packet according to the segment list, and specifically, the network device 303 may be a copy node in the above embodiment, for example, the network device 2, the network device 3, the network device 4, the network device 7, the network device 8, or the network device 9 shown in fig. 1. The method comprises the following steps:
s310, the network device 301 determines a forwarding path of the packet, where the forwarding path includes multiple network devices.
The network device 301 may be a controller in a network. The controller calculates a forwarding path for forwarding the packet.
S315, the network device 301 generates the segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, respectively, the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers.
Optionally, the network device 301 obtains a plurality of segment identifiers, where the plurality of segment identifiers correspond to at least one of the plurality of network devices or at least one link in the forwarding path. For example, the controller obtains the SIDs of the various network devices on the forwarding path. The network device 301 obtains a plurality of identifiers according to the plurality of segment identifiers, and the plurality of identifiers are mapped to the plurality of segment identifiers one by one. To reduce the length of the SID, the controller may convert the plurality of SIDs into a plurality of USIDs, which are mapped one by one to the plurality of SIDs. Specific methods include omitting the BLOCK portion of the SID and/or setting the functional fields of the SID to a compressed format. For a specific process, reference may be made to the description of step S420, and details of the similar parts are not repeated.
Network device 301 generates the segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, and the segment list includes an element with a length of 128 bits, where the element includes at least two adjacent identifiers in the multiple identifiers. For example, the controller places multiple USIDs in place of multiple SIDs in the segment list, thereby reducing the length of the segment list. The space in the segment list may be divided into a plurality of elements, and each element may be 128 bits in length. At least two USIDs may be stored in each element. For a specific process, reference may be made to the description of step S420, and details of the similar parts are not repeated.
S320, the network device 301 sends the segment list to the network device 302.
The network device 302 is a network device in the network, and the network device 302 is an ingress node of a forwarding path of the packet, for example, the network device S shown in fig. 1. The network device 302 obtains a segment list, where the segment list corresponds to a forwarding path of the packet, the segment list includes multiple identifiers arranged in sequence, and each identifier in the multiple identifiers corresponds to one network device in the multiple network devices.
S325, the network device 302 receives the message.
As an ingress node of the forwarding path, the network device 302 receives the packet and determines the forwarding path of the packet. Optionally, the network device 302 may find out a forwarding path for forwarding the packet from the stored multiple forwarding paths, so as to determine the forwarding path of the packet. The stored plurality of forwarding paths may be received by network device 302 from the controller.
S330, the network device 302 adds the segment list in the packet, where the segment list includes the first pointer, and a value of the first pointer is used to indicate a position of a first identifier in the element, where the first identifier is one of the at least two identifiers.
The specific process of step S330 may refer to the description of step S430, and the similar descriptions are omitted.
S335, the network device 302 sends the message.
The specific process of step S335 may refer to the description of step S440, and the similar descriptions are omitted.
S340, the network device 303 receives the message.
The specific process of step S340 may refer to the description of step S450, and the similar descriptions are omitted.
S345, the network device 303 determines the position of the first identifier in the first element according to the value of the first pointer. The first pointer is the newly added PI pointer described above.
The specific process of step S345 may refer to the description of step S460, and the similar descriptions are omitted.
S350, the network device 303 copies at least one identifier starting with the first identifier into the header of the packet.
The specific process of step S350 may refer to the description of step S470, and the similar descriptions are omitted.
S355, the network device 303 sends the message.
The specific process of step S355 may refer to the description of step S480, and the similar descriptions are omitted.
Fig. 20 is a schematic structural diagram of an apparatus 400 according to an embodiment of the present application. Any of the network devices in fig. 1 may be implemented by the device shown in fig. 20. Network device 401 and network device 402 in the embodiment shown in fig. 18, and network device 301, network device 302, and network device 303 in the embodiment shown in fig. 19 may be implemented by the devices shown in fig. 20. Referring to fig. 20, the device 2000 includes at least one processor 2001, a communication bus 2002 and at least one communication interface 2004, and optionally the device 2000 may also include a memory 2003.
Processor 2001 processor 1502 may be a Central Processing Unit (CPU), a general purpose processor, a Digital Signal Processor (DSP), an application-specific integrated circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic device, transistor logic, hardware component, or any combination thereof. Which may implement or perform the various logical blocks, modules, and circuits described in connection with the embodiment disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others. . The processor may be configured to generate a segment list, or process the received packet and forward the processed packet through the communication interface. To implement the methods provided in the embodiments of the present application.
For example, when the controller or the network entry device in the network is implemented by the device shown in fig. 20, the processor may be configured to generate the segment list, so that the network device performs forwarding processing on a corresponding packet according to the segment list, where a specific function is implemented by referring to a processing portion of the controller or the network entry device in the method embodiment. For example, when the network entry device in fig. 1 is implemented by the device shown in fig. 20, the processor may be configured to add a segment list to a received message, so that a subsequent network device forwards the message according to the segment list in the message, where specific function implementation may refer to a processing portion of the network entry device in the method embodiment. For another example, when the forwarding device in the network in fig. 1 is implemented by the device shown in fig. 20, the processor may be configured to perform forwarding processing on the packet according to the segment list in the packet, and the specific function implementation may refer to a processing portion of the forwarding device in the method embodiment.
The communication bus 2002 is used to transfer information between the processor 2001, the communication interface 2004, and the memories 2003. The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 20, but this is not intended to represent only one bus or type of bus.
The Memory 2003 may be, but is not limited to, a read-only Memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only Memory (EEPROM), a compact disk read-only Memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 2003 may be separate and coupled to the processor 2001 via a communication bus 2002. The memory 403 may also be integrated with the processor 2001.
Optionally, the memory 2003 is used for storing program codes or instructions for performing the scheme of the present application, and is controlled to be executed by the processor 2001. The processor 2001 is used to execute program codes stored in the memory 2003. One or more software modules may be included in the program code. Optionally, the processor 2001 itself may also store program code or instructions to perform aspects of the present application.
Communication interface 2004, using any transceiver or the like, may be used to communicate with other devices or communication networks, such as ethernet, Radio Access Network (RAN), or Wireless Local Area Networks (WLAN). In this embodiment, the communication interface 2004 may be configured to receive messages sent by other nodes in the segment routing network, and may also send messages to other nodes in the segment routing network. The communication interface 2004 may be an Ethernet (Ethernet) interface, a Fast Ethernet (FE) interface, a Gigabit Ethernet (GE) interface, or an Asynchronous Transfer Mode (ATM) interface.
In particular implementations, device 2000 may include multiple processors, such as processor 2001 and processor 2005 shown in fig. 20, for example, as an example. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
Fig. 21 is a schematic structural diagram of an apparatus 2100 according to an embodiment of the present disclosure. Any network device in fig. 1 other than the controller may be implemented by the device shown in fig. 21. The network device 401 and the network device 402 in the embodiment shown in fig. 18, and the network device 302 and the network device 303 in the embodiment shown in fig. 19 can be implemented by the devices shown in fig. 21. See the schematic diagram of the device structure shown in fig. 21. The device 2100 includes a main control board and one or more interface boards, the main control board communicatively connected to the interface boards. The main control board, also referred to as a Main Processing Unit (MPU) or a route processor card (route processor card), is responsible for controlling and managing various components in the device 2100, including routing computation, device management, and maintenance functions. An interface board is also called a Line Processing Unit (LPU) or a line card (line card) and is used to forward data. In some embodiments, the device 2100 may also include a switch board, where the switch board is communicatively connected to the main control board and an interface board, the switch board is used to forward data between the interface boards, and the switch board may also be referred to as a Switch Fabric Unit (SFU). The interface board includes a central processing unit, a memory, a forwarding chip, and a Physical Interface Card (PIC). The central processor is in communication connection with the memory, the network processor and the physical interface card respectively. The memory is used for storing a forwarding table. The forwarding chip is configured to forward the received data frame based on a forwarding table stored in the memory, and if a destination address of the data frame is an address of the device 2100, upload the data frame to the CPU for processing; if the destination address of the data frame is not the address of the device 2100, the next hop and the egress interface corresponding to the destination address are found from the forwarding table according to the destination address, and the data frame is forwarded to the egress interface corresponding to the destination address. The forwarding chip may be a Network Processor (NP). The PIC is also called a daughter card and can be installed on an interface board to convert the photoelectric signal into a data frame, and forward the data frame to a forwarding chip for processing after validity check is performed on the data frame. In some embodiments, the central processing unit may also perform the functions of a forwarding chip, such as implementing software forwarding based on a general purpose CPU, so that no forwarding chip is needed in the interface board. The communication connection among the main control board, the interface board and the exchange network board can be realized through a bus. In some embodiments, the forwarding chip may be implemented by an application-specific integrated circuit (ASIC) or a Field Programmable Gate Array (FPGA).
Logically, the device 2100 includes a control plane including a main control board and a central processor, and a forwarding plane including various components performing forwarding, such as a memory, a PIC, and an NP. The control plane executes the functions of the router, generating a forwarding table, processing signaling and protocol messages, configuring and maintaining the state of the PE1, and the like, and the control plane issues the generated forwarding table to the forwarding plane, and in the forwarding plane, the NP looks up the table of the message received by the PIC of the device 2100 based on the forwarding table issued by the control plane and forwards the table. The forwarding table issued by the control plane may be stored in a memory. In some embodiments, the control plane and the forwarding plane may be completely separate and not on the same device.
Fig. 22 shows a schematic diagram of a possible structure of the network device involved in the foregoing embodiment, and the network device 1400 may implement the functions of the network device 402 or the network device 303 in the foregoing embodiment. Referring to fig. 20, the network device 1400 includes: a receiving unit 1401, a processing unit 1402 and a transmitting unit 1403. These units may perform the respective functions of network device 402 or network device 303 in the above-described method. For example,
a receiving unit 1401, configured to receive a first packet, where a first packet header of the first packet includes a segment list used for forwarding the first packet, where the segment list includes multiple identifiers arranged in sequence, where an identifier in the multiple identifiers corresponds to one network device or one link, the segment list includes a first element with a length of 128 bits, the first element includes at least two adjacent identifiers in the multiple identifiers, and the first packet includes a first pointer and a second pointer.
A processing unit 1402, configured to determine a position of the first element in the segment list according to a value of the second pointer, determine a position of the first identifier in the first element according to a value of the first pointer, where the first identifier is one of the at least two identifiers; copying at least one identifier taking the first identifier as an initial identifier into a second message header of the first message to generate a second message.
A sending unit 1403, configured to send the second packet.
Network device 1400 may also be implemented by the device shown in fig. 20. At this time, the network device 1400 includes: at least one processor, a communication bus, and at least one communication interface. Optionally, network device 1400 may also include memory.
In a specific embodiment, a processor in the network device 1400 is configured to receive a first packet through a communication interface, where a first packet header of the first packet includes a segment list used to forward the first packet, the segment list includes a plurality of identifiers arranged in sequence, each identifier in the plurality of identifiers corresponds to a network device or a link, the segment list includes a first element with a length of 128 bits, the first element includes at least two adjacent identifiers in the plurality of identifiers, and the first packet includes a first pointer; determining a position of the first identifier in the first element according to the value of the first pointer, wherein the first identifier is one of the at least two identifiers; copying at least one identifier taking the first identifier as an initial identifier into a second message header of the first message to generate a second message; the second message is sent via communication interface 1503. For the detailed processing procedure of the processor, please refer to the detailed descriptions of the procedures S450, S460, S470, S480 and the procedures S340, S345, S350, S355 in the above embodiments, which are not repeated herein.
The communication interface in the network device 1400 is used for the network device 1400 to receive and send messages through the network system. For a specific process, please refer to the detailed descriptions of S450, S480, S340, and S355 in the above embodiments, which are not repeated herein.
Network device 1400 may also be implemented by the device shown in fig. 21. At this time, the network device 1400 includes a main control board and one or more interface boards, and the main control board is communicatively connected to the interface boards. For details, reference is made to the description of the network device 2100 in the foregoing embodiment, which is not described herein again.
Fig. 23 shows a schematic diagram of a possible structure of the network device involved in the foregoing embodiment, and the network device 1600 may implement the functions of the network device 401 or the network device 302 in the foregoing embodiment. Referring to fig. 23, the network device 1600 includes: a receiving unit 1601, a processing unit 1602, and a transmitting unit 1603. These units may perform the respective functions of network device 401 or network device 302 in the above-described methods. For example,
the receiving unit 1601 is configured to receive a first message.
A processing unit 1602, configured to obtain a segment list, where the segment list corresponds to a forwarding path of the first packet, where the forwarding path includes multiple network devices, where the segment list includes multiple identifiers arranged in sequence, where an identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, where the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers; adding the segment list to the first packet to generate a second packet, where the second packet includes a first pointer, and a value of the first pointer is used to indicate a location of a first identifier in the first element, where the first identifier is one of the at least two identifiers.
A sending unit 1603, configured to send the second packet.
Network device 1600 may also be implemented by the devices illustrated in fig. 20. At this time, the network device 1600 includes: at least one processor, a communication bus, and at least one communication interface. Optionally, network device 1600 may also include memory.
In a specific embodiment, the processor in the network device 1600 is configured to receive the first packet through the communication interface; obtaining a segment list, where the segment list corresponds to a forwarding path of the first packet, the forwarding path includes multiple network devices, the segment list includes multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers; adding the segment list to the first packet to generate a second packet, where the second packet includes a first pointer, and a value of the first pointer is used to indicate a location of a first identifier in the first element, where the first identifier is one of the at least two identifiers. And sending the second message through a communication interface. For the detailed processing procedure of the processor, please refer to the detailed descriptions of the procedures S410, S420, and S430 and the procedures S325, S330, and S335 in the above embodiments, which are not described herein again.
The communication interface in network device 1600 is used for network device 1600 to receive and send messages through the network system. For a specific process, please refer to the detailed descriptions of S410, S440, S325, and S335 in the above embodiments, which are not repeated herein.
Network device 1600 may also be implemented by the device shown in fig. 21. At this time, the network device 1600 includes a main control board and one or more interface boards, and the main control board is communicatively connected to the interface boards. For details, reference is made to the description of the network device 2100 in the foregoing embodiment, which is not described herein again.
Fig. 24 is a schematic diagram illustrating a possible structure of the network device 301 in the above embodiment, and the network device 1800 may implement the functions of the network device 301 or the network device 401 in the above embodiment. Referring to fig. 24, the network device 1800 includes: a determination unit 1801 and a processing unit 1802. These units may perform the respective functions of network device 301 or network device 401 in the above-described methods. For example,
a determining unit 1801 is configured to determine a forwarding path of the packet, where the forwarding path includes multiple network devices.
A processing unit 1802, configured to generate the segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, respectively, and the segment list includes a first element with a length of 128 bits, where the first element includes at least two adjacent identifiers in the multiple identifiers.
Optionally, the network device 1800 further includes: a transmission unit 1803. A sending unit 1803, configured to send the segment list to an ingress device of the forwarding path. Or, the processing unit 1802 is further configured to encapsulate the segment list into a message; the sending unit 1803 is configured to send the message.
Network device 1800 may also be implemented by the devices illustrated in fig. 20. At this time, the network device 1800 includes: at least one processor, a communication bus, and at least one communication interface. Optionally, the network device 1800 may also include memory.
In a specific embodiment, a processor in the network device 1800 is configured to determine a forwarding path of a packet, where the forwarding path includes multiple network devices; generating the segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, respectively, and the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers.
Optionally, the processor in the network device 1800 is further configured to transmit the segment list over the communication interface.
For a detailed processing procedure of the processor, please refer to the detailed description of the procedures S310, S315, S320, and S420 in the above embodiment, which is not described herein again.
The communication interface in the network device 1800 is used for the network device 1900 to receive and transmit information through the network system. For a specific process, please refer to the detailed description of S320 and S420 in the above embodiment, which is not repeated herein.
Referring to fig. 25, fig. 25 is a schematic diagram illustrating a possible structure of a network system according to an embodiment of the present invention. The network system 2200 includes a first network device 2201 and a second network device 2202. The first network device 2201 in the network system may perform the processing steps S410, S420, S430, and S440 of the network device 401 in the embodiment shown in fig. 18, or the processing steps S325, S330, and S335 of the network device 302 in the embodiment shown in fig. 19. The second network device 2202 in the network system may perform the processing steps S450, S460, S470 of the network device 402 in the embodiment shown in fig. 20 described above, or the processing steps S340, S345, S350 of the network device 303.
Optionally, the network system 2200 further includes a third network device 2203. The first network device 2203 in the network system may perform the processing steps S310, S315, and S320 of the network device 301 in the embodiment shown in fig. 19 described above.
Accordingly, the first network device 2201 in the network system may be the network device 1600 in the embodiment shown in fig. 23, the second network device 2202 in the network system may be the network device 1400 in the embodiment shown in fig. 22, and the third network device 2203 in the network system may be the network device 1800 in the embodiment shown in fig. 24.
Specifically, the third network device is configured to determine a forwarding path of the packet, where the forwarding path includes multiple network devices; generating the segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, respectively, and the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers.
The second network device is used for receiving a first message; obtaining a segment list, where the segment list corresponds to a forwarding path of the first packet, the forwarding path includes multiple network devices, the segment list includes multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers; adding the segment list to the first message to generate a second message, wherein the second message comprises a first pointer, and the value of the first pointer is used for indicating the position of a first identifier in the first element, and the first identifier is one of the at least two identifiers; and sending the second message.
Optionally, when the network system includes the third network device, the second network device obtains the segment list, that is, the second network device receives the segment list sent by the third network device. Optionally, when the network system does not include the third network device, the second network device obtains the segment list, which means that the second network device generates the segment list.
The first network device is configured to receive the second packet, where a first packet header of the second packet includes the segment list, and the second packet includes a first pointer; determining a position of the first identifier in the first element according to a value of the first pointer; copying at least one identifier taking the first identifier as an initial identifier into a second message header of the second message to generate a third message; and the sending unit is used for sending the third message.
Embodiments of the present invention also provide a non-transitory storage medium for storing software instructions used in the foregoing embodiments, which includes a program for executing the method shown in the foregoing embodiments, and when the program is executed on a computer or a network device, the computer or the network device is caused to execute the method in the foregoing method embodiments.
Embodiments of the present invention also provide a computer program product comprising computer program instructions, which, when run on a computer, cause the network node to perform the method in the aforementioned method embodiments.
The first message, the first network device, the first identifier, the first pointer and the number flag mentioned in the embodiment of the present invention are only used as name identifiers, and do not represent the first in sequence. The same applies to "second", "third" and "fourth", etc. However, the "first" in the first label mentioned in the embodiment of the present invention represents the first in order. The rule applies equally to the "nth".
In the present examples, "A and/or B" is considered to include A alone, B alone, and A + B.
It should be noted that any of the above-described device embodiments are merely schematic, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of embodiments of the network device or the host provided by the present invention, the connection relationship between the modules indicates that there is a communication connection therebetween, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
The steps of a method or algorithm described in the disclosure of the embodiments of the present invention may be implemented in hardware, or may be implemented by a processor executing software instructions. The software instructions may be comprised of corresponding software modules that may be stored in Random Access Memory (RAM), flash memory, read-only memory (ROM), Erasable Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), a hard disk, a removable hard disk, an optical disk, or any other form of storage medium known in the art. A storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only illustrative of the present invention and are not intended to limit the scope of the present invention, and any modification, replacement, improvement, etc. made on the basis of the technical solutions of the present invention should be included in the scope of the present invention.

Claims (48)

1. A method for forwarding a packet, the method comprising:
receiving a first packet, where a first packet header of the first packet includes a segment list used for forwarding the first packet, where the segment list includes multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to a network device or a link, the segment list includes a first element with a length of 128 bits, the first element includes at least two adjacent identifiers in the multiple identifiers, and the first packet includes a first pointer;
determining the position of a first identifier in the first element according to the value of the first pointer, wherein the first identifier is one of the at least two identifiers;
copying at least one identifier taking the first identifier as an initial identifier into a second message header of the first message to generate a second message;
and sending the second message.
2. The method of claim 1, wherein the plurality of identifiers are mapped to a plurality of segment identifiers one-to-one, each segment identifier of the plurality of segment identifiers corresponds to one network device or one link, respectively, each segment identifier of the plurality of segment identifiers comprises a first portion and a second portion, the first portion of each segment identifier of the plurality of segment identifiers is a prefix portion, and each identifier of the plurality of identifiers comprises the second portion of the segment identifier to which the each identifier is mapped, respectively.
3. The method of claim 2, wherein the second header includes a destination address field, wherein the destination address field includes a first portion and a second portion, and wherein the first portion of the destination address includes the prefix portion;
the copying at least one identifier starting with the first identifier into the second packet header of the first packet includes:
copying at least one identification starting with the first identification into a second portion of the destination address field.
4. The method of claim 2 or 3, wherein the segment list does not include the prefix portion.
5. The method according to any of claims 2-4, wherein the plurality of identifiers are of the same length, and before copying the at least one identifier starting with the first identifier into the second header of the first packet, the method further comprises:
determining the number of the at least one identifier according to the lengths of the plurality of identifiers and the length of the prefix portion.
6. The method of claim 1, wherein the first packet includes a destination address field, wherein the destination address field includes a second identifier, and wherein the second identifier is one of the plurality of identifiers;
before said determining the position of the first marker in the first element from the value of the first pointer, the method further comprises:
determining that the segment list comprises identifiers of different types from the second identifiers according to the switching marks in the second identifiers;
the copying at least one identifier starting with the first identifier into the second packet header of the first packet includes:
and copying the at least one identifier into the second message header to form a forwarding identifier stack, wherein the at least one identifier is different from the second identifier in type.
7. The method of claim 6, wherein the first packet includes a quantity flag;
before copying at least one identifier starting with the first identifier into the second packet header of the first packet, the method further includes:
determining the number of the at least one identity according to the value of the number flag.
8. The method according to claim 6 or 7, wherein said determining the position of the first marker in the first element according to the value of the first pointer comprises:
determining the number of redundant identifications in the destination address field, wherein the type of the redundant identifications is different from that of the second identification;
correcting the value of the first pointer according to the number of the redundant identifications;
and determining the position of the first identifier in the first element according to the corrected value of the first pointer.
9. The method according to any of claims 6-8, wherein said at least one identity is a multiprotocol label switching, MPLS, label or an internet protocol version 4IPv4 address.
10. The method according to any of claims 1-9, wherein after copying at least one identifier starting with the first identifier into the second header of the first packet, the method further comprises:
modifying the value of the first pointer such that the modified value of the first pointer is used to indicate the location of a third identity in the first element, the third identity not belonging to the at least one identity.
11. The method according to any of claims 1-9, wherein after copying at least one identifier starting with the first identifier into the second header of the first packet, the method further comprises:
modifying the value of the first pointer such that the modified value of the first pointer is used to indicate a location of a third identity in a second element, the third identity not belonging to the at least one identity, the second element being different from the first element.
12. The method according to any of claims 1-11, wherein the first packet further comprises a second pointer, and wherein determining the position of the first identifier in the first element according to the value of the first pointer further comprises:
determining a position of the first element in the first message according to a value of the second pointer.
13. A method for forwarding a packet, the method comprising:
receiving a first message;
obtaining a segment list, where the segment list corresponds to a forwarding path of the first packet, the forwarding path includes multiple network devices, the segment list includes multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers;
adding the segment list to the first message to generate a second message, wherein the second message comprises a first pointer, and the value of the first pointer is used for indicating the position of a first identifier in the first element, and the first identifier is one of the at least two identifiers;
and sending the second message.
14. The method of claim 13, wherein the plurality of identifiers are mapped one-to-one to a plurality of segment identifiers, each segment identifier of the plurality of segment identifiers corresponds to one network device of the plurality of network devices or one link of the forwarding path, and wherein each segment identifier of the plurality of segment identifiers comprises a first portion and a second portion, the first portion of each segment identifier is a prefix portion, the prefix portions of the plurality of segment identifiers are the same, and each identifier of the plurality of identifiers comprises the second portion of the segment identifier to which the each identifier is mapped.
15. The method of claim 14, wherein the header of the first packet includes a destination address field, the destination address field including a first portion and a second portion;
the adding the segment list to the first packet to generate the second packet includes:
adding the prefix portion in a first portion of the destination address field;
adding one or more of the plurality of identifications in a second portion of the destination address field.
16. The method of any of claims 14-15, wherein the prefix portion is not included in the segment list.
17. The method of claim 13, wherein at least one of the plurality of identities is a multiprotocol label switching (MPLS) label or an Internet protocol version 4IPv4 address.
18. The method of claim 17, wherein the second packet comprises a quantity flag, and wherein a value of the quantity flag is used to indicate a quantity of the at least one identifier.
19. The method according to any of claims 13-18, wherein the first pointer is located in a header of the second packet.
20. The method according to any of claims 13-19, wherein the second packet further comprises a second pointer, the value of the second pointer being used to indicate the position of the first element in the segment list.
21. A method of generating a segment list for forwarding a packet, the method comprising:
determining a forwarding path of a message, wherein the forwarding path comprises a plurality of network devices;
generating the segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, respectively, and the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers.
22. The method of claim 21, wherein the plurality of identifiers are mapped one-to-one to a plurality of segment identifiers, each segment identifier of the plurality of segment identifiers corresponds to one network device of the plurality of network devices or one link of the forwarding path, respectively, wherein each segment identifier of the plurality of segment identifiers comprises a first portion and a second portion, wherein the first portion of each segment identifier is a prefix portion, and wherein each identifier of the plurality of identifiers comprises the second portion of the segment identifier to which the each identifier is mapped.
23. The method of claim 22, wherein a segment identifier of the plurality of segment identifiers further comprises a third portion, wherein the third portion is a padded portion, wherein the padded portion of the plurality of segment identifiers is the same, and wherein the identifier of the plurality of identifiers does not comprise the padded portion.
24. The method of claim 22 or 23, wherein the plurality of segment identifiers includes a first segment identifier, and wherein the segment list does not include a prefix portion of the first segment identifier.
25. The method of claim 24, wherein the plurality of segment identifiers further comprises a second segment identifier, wherein a prefix portion of the first segment identifier is different from a prefix portion of the second segment identifier, and wherein the segment list comprises the prefix portion of the second segment identifier.
26. The method of any of claims 21-25, wherein at least one of the plurality of identities is a segment identity, a multiprotocol label switching (MPLS) label, or an Internet protocol version 4IPv4 address.
27. The method of any of claims 21-26, wherein after generating the segment list corresponding to the forwarding path, the method further comprises:
sending the segment list to an ingress device of the forwarding path; alternatively, the first and second electrodes may be,
and packaging the segment list into a message, and sending the message.
28. A network device, characterized in that the network device comprises:
a receiving unit, configured to receive a first packet, where a first packet header of the first packet includes a segment list used to forward the first packet, where the segment list includes multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to a network device or a link, the segment list includes a first element with a length of 128 bits, the first element includes at least two adjacent identifiers in the multiple identifiers, and the first packet includes a first pointer;
a processing unit, configured to determine, according to a value of the first pointer, a position of a first identifier in the first element, where the first identifier is one of the at least two identifiers; copying at least one identifier taking the first identifier as an initial identifier into a second message header of the first message to generate a second message;
and the sending unit is used for sending the second message.
29. The network device of claim 28, wherein the plurality of identifiers are mapped one-to-one to a plurality of segment identifiers, each segment identifier of the plurality of segment identifiers corresponds to one network device or one link, respectively, each segment identifier of the plurality of segment identifiers comprises a first portion and a second portion, the first portion of each segment identifier of the plurality of segment identifiers is a prefix portion, and each identifier of the plurality of identifiers comprises the second portion of the segment identifier to which the each identifier is mapped.
30. The network device of claim 29, wherein the second header includes a destination address field, wherein the destination address field includes a first portion and a second portion, and wherein the first portion of the destination address includes the prefix portion;
the processing unit is further configured to copy at least one identifier starting with the first identifier into a second portion of the destination address field.
31. The network device of claim 29 or 30, wherein the plurality of identifiers are the same length;
the processing unit is further configured to determine the number of the at least one identifier according to the lengths of the plurality of identifiers and the length of the prefix portion.
32. The network device of claim 28, wherein the first packet includes a destination address field, wherein the destination address field includes a second identifier, and wherein the second identifier is one of the plurality of identifiers;
the processing unit is further configured to determine, according to a switching flag in the second identifier, that the segment list includes an identifier of a type different from that of the second identifier; and copying the at least one identifier into the second message header to form a forwarding identifier stack, wherein the at least one identifier is different from the second identifier in type.
33. The network device of claim 32, wherein the first packet includes a quantity flag;
the processing unit is further configured to determine the number of the at least one identifier according to a value of the number flag.
34. The network device of claim 32 or 33,
the processing unit is further configured to determine the number of redundant identifiers in the destination address field, where the type of the redundant identifiers is different from the second identifiers; correcting the value of the first pointer according to the number of the redundant identifications; and determining the position of the first identifier in the first element according to the corrected value of the first pointer.
35. The network device of any of claims 32-34, wherein the at least one identity comprises a multiprotocol label switching (MPLS) label or an Internet protocol version 4IPv4 address.
36. The network device of any one of claims 28-35,
the processing unit is further configured to modify a value of the first pointer, so that the modified value of the first pointer is used to indicate a position of a third identifier in the first element, where the third identifier does not belong to the at least one identifier.
37. The network device of any one of claims 28-35,
the processing unit is further configured to modify a value of the first pointer such that the modified value of the first pointer is used to indicate a location of a third identifier in a second element, the third identifier not belonging to the at least one identifier, the second element being different from the first element.
38. A network device, characterized in that the network device comprises:
a receiving unit, configured to receive a first packet;
a processing unit, configured to obtain a segment list, where the segment list corresponds to a forwarding path of the first packet, the forwarding path includes multiple network devices, the segment list includes multiple identifiers arranged in sequence, an identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers; adding the segment list to the first message to generate a second message, wherein the second message comprises a first pointer, and the value of the first pointer is used for indicating the position of a first identifier in the first element, and the first identifier is one of the at least two identifiers;
and the sending unit is used for sending the second message.
39. The network device of claim 38, wherein the plurality of identifiers are mapped one-to-one to a plurality of segment identifiers, each segment identifier of the plurality of segment identifiers corresponds to one network device of the plurality of network devices or one link of the forwarding path, respectively, wherein a segment identifier of the plurality of segment identifiers comprises a first portion and a second portion, the first portion of each segment identifier is a prefix portion, the prefix portions of the plurality of segment identifiers are the same, and each identifier of the plurality of identifiers comprises the second portion of the segment identifier to which the each identifier is mapped.
40. The network device of claim 39, wherein the header of the first packet comprises a destination address field, wherein the destination address field comprises a first portion and a second portion;
the processing unit is further configured to add the prefix portion in a first portion of the destination address field; adding one or more of the plurality of identifications in a second portion of the destination address field.
41. The network device of claim 38, wherein at least one of the plurality of identities is a multiprotocol label switching (MPLS) label or an Internet protocol version 4IPv4 address.
42. A network device, characterized in that the network device comprises:
a determining unit, configured to determine a forwarding path of a packet, where the forwarding path includes multiple network devices;
a processing unit, configured to generate a segment list corresponding to the forwarding path, where the segment list includes the multiple identifiers arranged in sequence, each identifier in the multiple identifiers corresponds to one network device in the multiple network devices or one link in the forwarding path, respectively, the segment list includes a first element with a length of 128 bits, and the first element includes at least two adjacent identifiers in the multiple identifiers.
43. The network device of claim 42, wherein the plurality of identifiers are mapped one-to-one to a plurality of segment identifiers, each of the plurality of segment identifiers corresponds to one of the plurality of network devices or one of the links in the forwarding path, respectively, each of the plurality of segment identifiers comprises a first portion and a second portion, the first portion of each segment identifier is a prefix portion, and each of the plurality of identifiers comprises the second portion of the segment identifier to which the each identifier is mapped.
44. The network device of claim 43, wherein a segment identifier of the plurality of segment identifiers further comprises a third portion, wherein the third portion is a padded portion, wherein the padded portion of the plurality of segment identifiers is the same, and wherein an identifier of the plurality of identifiers does not comprise the padded portion.
45. The network device of any of claims 42-44, wherein at least one of the plurality of identities is a segment identity, a multiprotocol Label switching (MPLS) label, or an Internet protocol version 4IPv4 address.
46. The network device according to any of claims 42-45, wherein the network device further comprises a transmitting unit,
the sending unit is configured to send the segment list to an ingress device of the forwarding path; alternatively, the first and second electrodes may be,
the processing unit is further configured to encapsulate the segment list into a message,
and the sending unit is used for sending the message.
47. A network system, characterized in that the network system comprises a first network device and a second network device, wherein the first network device is a network device according to any one of claims 28-37 and the second network device is a network device according to any one of claims 38-41.
48. The network system according to claim 47, wherein the network system further comprises a third network device, wherein the third network device is a network device according to any one of claims 42-46.
CN201911317222.5A 2019-08-31 2019-12-19 Method, equipment and system for forwarding message in SR network Pending CN112448888A (en)

Priority Applications (8)

Application Number Priority Date Filing Date Title
CN202310212097.1A CN116319617A (en) 2019-08-31 2019-12-19 Method, equipment and system for forwarding message in SR network
EP20858296.5A EP4009596A4 (en) 2019-08-31 2020-05-06 Message forwarding method, device, and system in sr network
PCT/CN2020/088788 WO2021036328A1 (en) 2019-08-31 2020-05-06 Message forwarding method, device, and system in sr network
CA3177466A CA3177466A1 (en) 2019-08-31 2020-05-06 Method for forwarding packet in sr network, device, and system
KR1020227009215A KR20220047854A (en) 2019-08-31 2020-05-06 Packet forwarding method, apparatus and system in SRS network
MX2022002448A MX2022002448A (en) 2019-08-31 2020-05-06 Message forwarding method, device, and system in sr network.
JP2022513191A JP7403635B2 (en) 2019-08-31 2020-05-06 METHODS, APPARATUS AND SYSTEM FOR FORWARDING PACKETS IN SR NETWORK
US17/681,137 US20220182323A1 (en) 2019-08-31 2022-02-25 Method for forwarding packet in sr network, device, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2019108198776 2019-08-31
CN201910819877 2019-08-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310212097.1A Division CN116319617A (en) 2019-08-31 2019-12-19 Method, equipment and system for forwarding message in SR network

Publications (1)

Publication Number Publication Date
CN112448888A true CN112448888A (en) 2021-03-05

Family

ID=74733113

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911317222.5A Pending CN112448888A (en) 2019-08-31 2019-12-19 Method, equipment and system for forwarding message in SR network

Country Status (1)

Country Link
CN (1) CN112448888A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113242180A (en) * 2021-07-12 2021-08-10 广东省新一代通信与网络创新研究院 Message forwarding method, device, equipment, readable storage medium and program product
CN114448881A (en) * 2022-02-25 2022-05-06 烽火通信科技股份有限公司 Method and system for interoperation communication between cross SR MPLS and SRV6 domains
WO2022228533A1 (en) * 2021-04-29 2022-11-03 华为技术有限公司 Message processing method, apparatus and system, and storage medium
WO2023006002A1 (en) * 2021-07-29 2023-02-02 华为技术有限公司 Data transmission method, related device, and computer storage medium
WO2023029871A1 (en) * 2021-08-30 2023-03-09 华为技术有限公司 Message sending method and apparatus, and method and apparatus for controlling sending of message
CN116192968A (en) * 2023-01-10 2023-05-30 广东云下汇金科技有限公司 IPv6 message data processing method and communication method based on SRv6
WO2023216622A1 (en) * 2022-05-11 2023-11-16 华为技术有限公司 Packet processing method, device, system, and computer-readable storage medium

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022228533A1 (en) * 2021-04-29 2022-11-03 华为技术有限公司 Message processing method, apparatus and system, and storage medium
CN113242180A (en) * 2021-07-12 2021-08-10 广东省新一代通信与网络创新研究院 Message forwarding method, device, equipment, readable storage medium and program product
CN113242180B (en) * 2021-07-12 2021-12-14 广东省新一代通信与网络创新研究院 Message forwarding method, device, equipment, readable storage medium and program product
WO2023006002A1 (en) * 2021-07-29 2023-02-02 华为技术有限公司 Data transmission method, related device, and computer storage medium
WO2023029871A1 (en) * 2021-08-30 2023-03-09 华为技术有限公司 Message sending method and apparatus, and method and apparatus for controlling sending of message
CN114448881A (en) * 2022-02-25 2022-05-06 烽火通信科技股份有限公司 Method and system for interoperation communication between cross SR MPLS and SRV6 domains
CN114448881B (en) * 2022-02-25 2023-06-09 烽火通信科技股份有限公司 Method and system for inter-operating communication of cross-SR MPLS and SRV6 domains
WO2023216622A1 (en) * 2022-05-11 2023-11-16 华为技术有限公司 Packet processing method, device, system, and computer-readable storage medium
CN116192968A (en) * 2023-01-10 2023-05-30 广东云下汇金科技有限公司 IPv6 message data processing method and communication method based on SRv6
CN116192968B (en) * 2023-01-10 2024-02-13 广东云下汇金科技有限公司 IPv6 message data processing method and communication method based on SRv6

Similar Documents

Publication Publication Date Title
US11245620B2 (en) Method for forwarding packet and network device
CN112448888A (en) Method, equipment and system for forwarding message in SR network
WO2021036328A1 (en) Message forwarding method, device, and system in sr network
KR20220062335A (en) Method, apparatus and system for establishing BIER forwarding table entry
CN114365464B (en) Method, equipment and system for forwarding message in SR network
KR102544995B1 (en) Method for forwarding packet in hybrid network, device, and system
US20220038364A1 (en) SRv6-Based Data Processing Method and Related Network Device
CN110401599B (en) Data packet processing method and device, storage medium and electronic device
EP4102783A1 (en) Method, device and system for sending message
CN111385209A (en) Message processing method, message forwarding method, device and equipment
WO2022111606A1 (en) Message transmission method, segment list generation method, compressed segment identifier acquisition method, and apparatuses
US11757775B2 (en) Message generation method and apparatus, and message processing method and apparatus
CN112491706A (en) Data message processing method and device, storage medium and electronic device
CN114650255B (en) Message processing method and network equipment
CN114006854B (en) Communication method and network equipment
CN117221201A (en) Message sending method, network equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination