WO2023078144A1 - 报文处理方法、装置及系统 - Google Patents

报文处理方法、装置及系统 Download PDF

Info

Publication number
WO2023078144A1
WO2023078144A1 PCT/CN2022/127833 CN2022127833W WO2023078144A1 WO 2023078144 A1 WO2023078144 A1 WO 2023078144A1 CN 2022127833 W CN2022127833 W CN 2022127833W WO 2023078144 A1 WO2023078144 A1 WO 2023078144A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
packet
header
extended
matching
Prior art date
Application number
PCT/CN2022/127833
Other languages
English (en)
French (fr)
Inventor
董杰
王海波
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023078144A1 publication Critical patent/WO2023078144A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/252Store and forward routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • the present application relates to the technical field of communication, and in particular to a message processing method, device and system.
  • the message header of the message may include a basic message header and an extended message header.
  • An IPv6 packet can include a basic packet header and one or more extended packet headers.
  • the basic message header may be used to carry basic information of the IPv6 message, such as the destination address and source address of the message.
  • the extended packet header can be used to carry extended information of the IPv6 packet.
  • the present application provides a method, device and system for message processing, which are used to flexibly control the processing with extended message headers, thereby improving the reliability and flexibility of message forwarding.
  • the present application provides a packet processing method, which can be applied to a first device, and the first device can be a network device for forwarding data packets, such as a router or a switch.
  • the packet processing method may include: the first device first obtains a forwarding entry, for example, may establish a forwarding entry or receive a forwarding entry sent by another device.
  • the forwarding entry includes a match item and an action item, and the match item includes one or more extension header identifiers, which are used to limit the extension headers of the processed message.
  • the first device may determine whether the forwarded packet matches the matching item.
  • the first device confirms that the first packet meets the matching item. For the first packet header that satisfies the matching item, the first device may process the first packet according to the action item. That is to say, the first device may determine whether the extended packet header included in the first packet matches the matching item in the forwarding entry before forwarding the first packet. If the identifier of the extended header included in the first packet matches the matching item, the packet will be processed according to the action item of the forwarding entry, thus providing a flexible control of the packet carrying the extended header processing method. For example, a packet with an extended header can be forwarded through a specified path, and all devices on the specified path are capable of processing the extended header.
  • one or more network devices specified on the first forwarding path have the ability to process the first packet. That is to say, the first forwarding path may include a network device capable of processing the extended header included in the first packet, and the remaining network devices on the first forwarding path do not need to process the extended header included in the first packet. Header. In this way, the first packet can be prevented from being forwarded to a network device not capable of processing the extended packet header, thereby avoiding the discarding of the first packet, and improving the reliability and flexibility of packet forwarding.
  • the matching item includes a first packet header information set
  • the first packet header information set may include identifiers of one or more extended packet headers.
  • the extended packet header included in the first packet satisfying the matching item may match the first packet header information set.
  • the first device may judge whether the matching condition is satisfied between the second packet header information set and the first packet header information set, wherein the second packet The header information set includes identifiers of one or more extended message headers included in the first message. If the matching condition is satisfied between the second packet header information set and the first packet header information set, the first device determines that the first packet is a packet satisfying the matching condition.
  • the matching condition may be any one or more of covering matching condition, optional matching condition and excluded matching condition.
  • the matching condition is an overlay matching condition
  • the matching condition between the second packet header information set and the first packet header information set includes: the second packet header information set includes the first packet header information set The identifiers of all extended headers in the header information set. That is to say, if the first device determines that the first packet header information set is a subset of the second packet header information set, the first device may determine that the first packet is a packet that satisfies the matching condition, and the first packet includes The extension headers that match the match.
  • the matching condition is an optional matching condition
  • satisfying the matching condition between the second packet header information set and the first packet header information set includes: the second packet header information set includes the first packet header information set The identifier of any one or more extended headers in the packet header information set. That is to say, if the first device determines that there is an intersection between the first packet header information set and the second packet header information set, the first device may determine that the first packet is a packet that satisfies the matching condition, and the first packet Include the extension headers that match the match.
  • the matching condition is an exclusion matching condition
  • the matching condition between the second packet header information set and the first packet header information set includes: the second packet header information set does not include the first packet header information set The identifier of any one or more extended headers in the packet header information set. That is to say, if the first device determines that there is no intersection between the first packet header information set and the second packet header information set, the first device may determine that the first packet is a packet that satisfies the matching condition, and the first packet The text includes the extension headers that match the match.
  • the matching conditions may also be other conditions than the above three matching conditions, and are used to match specific fields in a specific packet header of a packet.
  • the first packet header information set may include the identifier of the first extended header and the identifier of the first field.
  • satisfying the matching condition between the second packet header information set and the first packet header information set may include: the second packet header information set includes the identifier of the first extended header and the identifier of the first field. If the second packet header information set includes the identifier of the first extended packet header and the identifier of the first field, it means that the first packet includes the first extended packet header, and the first extended packet header of the first packet Include the first field, which satisfies the requirements for a match.
  • the matching item may also be used to match a specific value of a specific field in a specific header of a packet.
  • the first packet header information set may include the identifier of the second extended header, the identifier of the second field, and the second value.
  • satisfying the matching condition between the second packet header information set and the first packet header information set may include: the second packet header information set includes the identifier of the second extended header, the identifier of the second field, and the first one value.
  • the second packet header information set includes the identifier of the second extended header, the identifier of the second field, and the first value, it means that the first packet includes the second extended header, and the second extension of the first packet
  • the value of the second field in the packet header is the first value, which meets the requirements of the matching item.
  • the action item is used to instruct the first network device to forward the first packet according to a specific forwarding path.
  • the first device may determine the first forwarding path corresponding to the first packet according to the action item, and send the first packet through the first forwarding path first message.
  • any network device on the first forwarding path has the ability to process the extended packet header included in the first packet.
  • one or more network devices specified on the first forwarding path have the ability to process the first packet. That is to say, the first forwarding path may include a network device capable of processing the extended header included in the first packet, and the remaining network devices on the first forwarding path do not need to process the extended header included in the first packet. Header. In this way, the reliability of message forwarding is improved by adjusting the forwarding path of the first message.
  • the action item is used to instruct the first device to encapsulate a specific packet header in the first packet.
  • the first device encapsulates the outer packet header for the first packet to obtain the second packet.
  • the first device may encapsulate the first packet as a payload in the second packet.
  • the destination address of the outer layer message header is the destination address of the first message, or the destination address of the outer layer message header is the address of the upper N-hop network device of the destination device of the first message (N is a positive integer )
  • the source address of the outer packet header is the address of the first device.
  • the second path may include a network device not capable of processing the extended header included in the first packet. That is to say, by encapsulating the outer packet header for the first packet, the network device transmitting the second packet does not parse the extended packet header included in the first packet. In this way, even if a network device that does not have the ability to parse the extended message header included in the first message is located on the forwarding path of the second message, since the second message contains the outer message header, the network device does not need to The extended packet header included in the first packet is parsed, and the second packet will not be discarded by the network device, thereby improving the reliability of packet forwarding.
  • the outer packet header may also include a first identifier, and the first identifier may be used by devices on the second forwarding path to determine that it is not necessary to process the extended packet included in the second packet. Header. Because the first identifier is used to trigger the device on the second forwarding path to determine according to the first identifier that it does not need to parse the extended header contained in the second packet, thereby preventing the network device on the second forwarding path from parsing the second packet The extended packet header included in the first packet in the packet prevents the second packet from being discarded.
  • the first identifier is carried by a Next Header field in the outer packet header of the second packet.
  • the device on the second forwarding path determines according to the Next Header field contained in the outer packet header that it does not need to parse the extended packet header included in the second packet.
  • the value of the Next Header field is 41, indicating that the outer header of the second packet is encapsulated as an IPv6 packet, that is to say, the extended header contained in the second packet does not need to be transmitted by the network as payload information.
  • Device handling is
  • the forwarding entry is generated by the first device according to the notification message sent by the second device.
  • the second device can be other network devices except the first device in the network system, and can also be a control device
  • the notification message can include a flow specification (Flow Specification, Flowspec) field
  • the FlowSpec field of the notification message can include matching items and action item.
  • the first device generates a forwarding entry according to the notification message.
  • the above-mentioned extended message header may include any one of the IPv6 extended message header, the Multi-Protocol Label Switching (Multi-Protocol Label Switching, MPLS) extended header and the IPv4 message header including the IPv4 option field.
  • MPLS Multi-Protocol Label Switching
  • the MPLS extension header may be called MPLS auxiliary information (MPLS Ancillary Data).
  • the present application provides a message processing method, which can be applied to a second device, and the second device can be a control device for controlling network devices in a network system, such as a controller, etc. equipment.
  • the packet processing method includes: the second device generates a notification message, where the notification message includes a matching item and an action item.
  • the match item may include one or more identifiers of extended message headers, and the action item is used to control the network device to process the message.
  • the second device sends a notification message to the first device.
  • the first device can process the packet including the extended packet header matching the matching item according to the action item included in the notification message, thereby providing a flexible control The processing method of the header packet.
  • a packet with an extended packet header can be forwarded through a specified path, and all devices on the specified path have the ability to process the extended packet header, which can prevent the first packet from being forwarded to a network that does not have the ability to process the extended packet header. device, thereby avoiding the discarding of the first packet and improving the reliability and flexibility of packet forwarding.
  • the notification message is used by the first device to generate a forwarding entry, where the forwarding entry includes a correspondence between a matching item and an action item.
  • the above notification message is a Border Gateway Protocol (Border Gateway Protocol, BGP) update (BGP Update) message.
  • BGP Border Gateway Protocol
  • BGP Update Border Gateway Protocol update
  • the matching item can be carried in the network layer reachability information (Network Layer Reachability Information, NLRI) field corresponding to the BGP Flowspec of the advertisement message.
  • NLRI Network Layer Reachability Information
  • the action item may be carried in the NLRI field or the routing attribute information field of the notification message.
  • the action item may be carried in an extended community attribute (extended community) field or a wide community attribute (wide community) field related to the IPv6 address of the notification message.
  • each network device in the network system controlled by the second device is connected based on a Path Computation Element Communication Protocol (Path Computation Element Communication Protocol, PCEP).
  • PCEP Path Computation Element Communication Protocol
  • the notification message can be any one of Path Computation Initiate (PCInitiate) message, Path Computation Update (PCUpd) message and Path Computation Reply (PCRep) message.
  • PCInitiate Path Computation Initiate
  • PCUpd Path Computation Update
  • PCep Path Computation Reply
  • the above matching item may be carried in the Flow Filter Type-length-value (Flow Filter Type-length-value, Flow Filter TLV) field of the notification message.
  • the extended packet header included in the matching item may include any one or more of the IPv6 extended packet header, the MPLS extended header, and the IPv4 packet header including the IPv4 option field.
  • the MPLS extension header may be called MPLS Ancillary Data.
  • the present application provides a packet processing method, which is applied to a first device, where the first device is a network device for forwarding data packets, such as a router or a switch.
  • the message processing method includes: the first device acquires a notification message, the notification message may include a matching item and an action item, the matching item may include one or more extension header identifiers, and the action item may be used to indicate The first device processes the packet including the extended packet header matching the matching item.
  • the first device generates a forwarding entry according to the notification message, and the forwarding entry may include a correspondence between an action item and a matching item.
  • the first device can judge according to the forwarding entry whether the packet includes an extended packet header that matches the matching item. If included, the first device processes the packet according to the action item. In this way, if the identifier of the extended message header included in the first message matches the matching item, the message is processed according to the action item of the forwarding entry, thereby providing a flexible control method for carrying the extended message header. Packet processing method.
  • the notification message is sent by the second device.
  • the second device may be a control device such as a controller, or may be other network devices in the network system.
  • the above notification message is a BGP Update message. Then the matching item can be carried in the NLRI field corresponding to the BGP Flowspec of the advertisement message.
  • the action item may be carried in the NLRI field or the route attribute information field of the notification message.
  • the action item may be carried in the IPv6 address-related extended community attribute field or wide community attribute field of the notification message.
  • each network device in the network system controlled by the second device is connected based on the PCEP.
  • the notification message may be any one of a PCInitiate message, a PCUpd message and a PCRep message.
  • the above matching item may be carried in the Flow Filter TLV field of the notification message.
  • the extended packet header included in the matching item may include any one or more of an IPv6 extended packet header, an MPLS extended packet header, and an IPv4 packet header including an IPv4 option field.
  • the MPLS extension header may be called MPLS Ancillary Data.
  • the present application provides a device for message processing, the device is applied to a first device, and the first device is used to implement the first aspect, any possibility of the first aspect, the third aspect or the third aspect Aspects of any one of the possible design methods.
  • the first network device includes a unit for performing the first aspect or the method in any possible design of the first aspect; or, the first network device includes a unit for performing the third aspect or the third aspect Any one possible design of the method's unit.
  • the present application provides a packet processing apparatus, the apparatus is applied to a second device, and the second device is configured to execute the method in the second aspect or any possible design of the second aspect.
  • the first network device includes a unit for executing the method in the second aspect or any possible design of the second aspect.
  • the present application provides a message processing system, the message processing system includes a first device and a second device, and the first device is used to implement any one of the first aspect and the first aspect.
  • the third aspect or the method in any one possible design of the third aspect the second device is used to execute the method in the second aspect or any one possible design of the second aspect.
  • the present application provides a first device, the first device includes a processor and a memory, the memory is used to store instructions or program codes, and the processor is used to call and execute the instructions from the memory or program codes, so as to execute the packet processing method described in the aforementioned first aspect or third aspect.
  • the present application provides a second device, the second device includes a processor and a memory, the memory is used to store instructions or program codes, and the processor is used to call and execute the instructions from the memory Or a program code, to execute the method for processing a message as described in the aforementioned second aspect.
  • the present application provides a chip, including a memory and a processor, the memory is used to store instructions or program codes, and the processor is used to call and run the instructions or program codes from the memory, so as to perform the aforementioned first aspect, The message processing method described in the second aspect or the third aspect.
  • the embodiment of the present application provides a computer-readable storage medium, including instructions, programs or codes, which, when executed on a computer, enable the computer to perform the above-mentioned first aspect, second aspect or third aspect.
  • the message processing method described in the aspect is not limited to:
  • Figure 1-A is a network structure diagram of the network system provided by the embodiment of the present application.
  • FIG. 1-B is another network structure diagram of the network system provided by the embodiment of the present application.
  • FIG. 1-C is a schematic diagram of an application scenario of the message processing method provided by the embodiment of the present application.
  • FIG. 1-D is a schematic diagram of another application scenario of the message processing method provided by the embodiment of the present application.
  • FIG. 1-E is a schematic diagram of another application scenario of the message processing method provided by the embodiment of the present application.
  • FIG. 2 is a signaling interaction diagram of a message processing method provided in an embodiment of the present application
  • FIG. 3 is a schematic diagram of a possible format of the NLRI field provided by the embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an apparatus 400 for message processing provided by an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an apparatus 500 for message processing provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an apparatus 600 for message processing provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a device 700 provided in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a device 800 provided in an embodiment of the present application.
  • an IPv6 message can include one or more extended message headers, and each extended message header can be used to carry additional forwarding information to instruct network devices on the forwarding path of the IPv6 message to perform corresponding forward operation.
  • the extended message header can be carried between the basic message header (basic IPv6 header) of the IPv6 message and the upper layer protocol data unit. Wherein, the upper-layer protocol data unit includes a payload (payload) part in the IPv6 message.
  • the basic message header and the extended message header may include a next message header (Next Header) field, which is used to indicate the type of the next message header of the message header. For example, suppose an IPv6 packet includes N extended packet headers.
  • the Next Header field of the basic message header of this IPv6 message can be used to indicate the type of the first extended message header of this IPv6 message;
  • the Next Header field of the i-th extended message header of the IPv6 message can be used It is used to indicate the type of the i+1 extended header of the IPv6 packet, where i is a positive integer less than N;
  • the Next Header field of the Nth extended header of the IPv6 packet can be used to indicate the type of the IPv6 packet
  • the next part of the N extended message headers is the upper layer protocol data unit. In this way, an IPv6 packet can theoretically carry any number of extended headers and support multiple different forwarding operations.
  • the ability to process the extended packet header may be configured on the network device, so that the network device can process packets including the extended packet header.
  • various network devices in the network system may have different support capabilities for the extended packet header.
  • some network devices in the network system may have the ability to process extended message headers, while other network devices may not have the ability to process extended message headers.
  • the packet including the extended packet header may be discarded by a network device incapable of processing the extended packet header during forwarding, resulting in packet loss of service packets.
  • the network device does not have the ability to process the extended message header, which may include that the network device does not have the ability to process a specific extended message header, and may also include that the network device does not have the ability to process any extended message header.
  • the network system includes a device 111 , a device 112 , a network device 121 , a network device 122 , a network device 123 , a network device 124 , a network device 125 and a network device 126 .
  • the network device 121 is respectively connected with the device 111, the network device 122 and the network device 124, the network device 123 is respectively connected with the device 112, the network device 122 and the network device 126, and the device 112 is respectively connected with the network device 123 and the network device 126.
  • the device 111 can send the data packet to the device 112 through the forwarding of each network device between the network systems.
  • the network device 121 may be connected to the network device 122 through a network interface (Interface) A1, and connected to the network device 124 through a network interface A2.
  • the network device 121 and the network device 123 in FIG. 1-A have the ability to process the extended header M, and the network device 122 does not have the ability to process the extended header M. Then, if device 111 sends a message including an extended message header to device 112, and the message is transmitted through the forwarding path "network device 121 ⁇ network device 122 ⁇ network device 123". During the transmission of the message, the network device 121 may process the message and send the message to the network device 122 through the network interface A1.
  • the network device 122 cannot process the message and cannot continue to forward the message, so the Packets are discarded, reducing the reliability of packet forwarding.
  • IPv6-based network system As an example. It can be understood that the above problem also exists in other application scenarios where the packet includes the extended packet header.
  • MPLS Multi-Protocol Label Switching
  • MPLS Multi-Protocol Label Switching
  • MPLS Multi-Protocol Label Switching
  • an IPv4-based network system if the IPv4 header of the message includes an Option field, and different values of the Option field can correspond to different types of IPv4 headers, then the above-mentioned problems also exist in the IPv4 network system.
  • the extended header mentioned in the embodiment of the present application may refer to the extended header of the IPv6 protocol, or may refer to the MPLS extended header or the IPv4 Option header.
  • the MPLS extension header may also be called MPLS auxiliary information (MPLS Ancillary Data).
  • the embodiments of the present application provide a message processing method, device and system, aiming to flexibly control the processing of messages with extended message headers, thereby improving the reliability and flexibility of message forwarding.
  • the packet processing method provided in the embodiment of the present application can be applied to the network shown in FIG. 1-A .
  • the packet processing method may be implemented by any one or more of the network device 121, the network device 122, the network device 123, the network device 124, the network device 125 and the network device 126 in the embodiment shown in FIG. 1-A network device implementation.
  • the device 111 and the device 112 may be terminal devices, or devices such as servers or databases.
  • the terminal equipment may be called user equipment (User Equipment, UE), mobile station (Mobile Station, MS), mobile terminal (Mobile Terminal, MT) or terminal, etc.
  • a terminal device is a device that provides voice and/or data connectivity to a user, or a chip disposed in the device.
  • the terminal device may be a handheld device with a wireless connection function, a vehicle-mounted device, and the like.
  • Terminal devices can be mobile phones, desktop computers, tablet computers, notebook computers, handheld computers, mobile Internet devices (Mobile Internet Device, MID), wearable devices, virtual reality (Virtual Reality, VR) devices, augmented reality (Augmented Reality, AR) ) equipment, wireless terminals or wired terminals in Industrial Control, wireless terminals in Self Driving, wireless terminals in Remote Medical Surgery, wireless terminals in Smart Grid Terminals, wireless terminals in Transportation Safety, wireless terminals in Smart City, wireless terminals in Smart Home, or home gateway devices that support 5G access (5G ⁇ Residential Gateway, 5G ⁇ RG) etc.
  • Mobile Internet Device Mobile Internet Device, MID
  • wearable devices virtual reality (Virtual Reality, VR) devices, augmented reality (Augmented Reality, AR) ) equipment
  • wireless terminals or wired terminals in Industrial Control wireless terminals in Self Driving
  • wireless terminals in Smart Grid Terminals wireless terminals in Transportation Safety
  • wireless terminals in Smart City wireless terminals in Smart Home
  • wireless terminals in Smart Home or home gateway devices that support 5G access (5G
  • the network device may be a device with a forwarding function, such as a forwarding device such as a router (Router) or a switch (Switch), or may be a device with a forwarding function such as a server or a terminal device.
  • the network device may be a provider edge (Provider Edge, PE) device deployed at the edge of the network, for example, it may be the network device 121, the network device 123 or the network device 126 in FIG. 1-A;
  • An operator (Provider, P) device inside the network may be, for example, the network device 122, the network device 124, or the network device 125 in FIG. 1-A.
  • the packet processing part may be executed by a forwarding plane of the network device, for example, may be executed by a forwarding chip of the network device.
  • the part of generating the forwarding entry in the packet processing method may be executed by the control plane of the network device, for example, may be executed by a processor of the network device.
  • the processor may be a central processing unit (Central Processing Unit, CPU) of the network device.
  • the data processing method may also be executed by an independent control plane device.
  • the forwarding table entry described below may be generated by a server or a controller as a control plane device, and sent to a network device as a forwarding plane device, In order for the network device to process the packet according to the forwarding entry.
  • VNF Virtualized Network Function
  • the part of generating and sending the notification message in the message processing method provided in the embodiment of the present application may be executed by the control device.
  • the control device can be used to control one or more network devices in the network system.
  • the control device may be a server or other computer devices with data processing capabilities.
  • the packet processing method provided in this embodiment of the present application may be implemented by the control device 130 shown in FIG. 1-B .
  • the control device 130 shown in FIG. 1-B may be connected to the network device 121 , the network device 122 , the network device 123 , the network device 124 , the network device 125 and the network device 126 respectively.
  • the shown control device may be a server or a controller.
  • FIG. 2 this figure is a signaling interaction diagram of the message processing method provided by the embodiment of the present application, which specifically includes the following steps S201-S205.
  • S201 The first device receives a notification message sent by the second device.
  • the first device may be a network device.
  • the second device may be a control device, such as a server or a controller for controlling one or more network devices.
  • the second device may also be a network device.
  • the first device may be a network device for forwarding data packets in a network system, for example, it may be network device 121, network device 122, network device 123, network device 124, Any one or more of network device 125 and network device 126 .
  • the second device may be any network device in FIG. 1-A except the first device, and may also be the control device 130 in FIG. 1-B.
  • the notification message may include a match item and an action item. The matching items and action items are introduced respectively below.
  • the matching item is used to determine whether the extended header contained in the packet to be processed matches the matching condition.
  • a packet including an extended packet header matching the matching item is called a packet satisfying the matching item.
  • the extended header refers to the header including optional extended information except the outermost header in the packet.
  • the extended header may include any one or more of the IPv6 extended header, the MPLS extended header, and the IPv4 header including the IPv4option.
  • the extended packet header as an IPv6 extended packet header as an example.
  • the IPv6 extended message header can include a hop-by-hop option extended message header (Hop-by-Hop Options Header, HBH), a routing extended message header (Routing Header, RH), a destination option extended message header (Destination Options Header) , DOH) and segment routing extended message header (Segment Routing Header, SRH) and other extended message headers in any one or more.
  • HBH hop-by-hop option extended message header
  • RH routing extended message header
  • Destination Options Header Destination Options Header
  • DOH Segment Routing Header
  • the matching item can be used to match the type of the extended header included in the message, and can also be used to match the specific field and/or the value of the specific field in the extended header included in the message . Introduce them separately below.
  • the matching item may include a first packet header information set, and the first packet header information set includes identifiers of one or more extended packet headers.
  • the identifier of the extended packet header may be, for example, the protocol number of the target packet header. For example, if the first packet header information set includes the HBH identifier and the DOH identifier, then the first packet header information set includes the type number 0 of the HBH and the type number 60 of the DOH.
  • the matching item may also include a matching condition, because the correspondence between the extended header included in the message to be processed and the extended header corresponding to the first header information set is determined. That is to say, if the packet to be processed satisfies the matching item, the matching condition must be satisfied between the first packet header information set and the second packet header information set included in the packet to be processed.
  • the matching conditions may include three matching conditions: coverage matching conditions, optional matching conditions and exclusion matching conditions. Introduce them separately below.
  • the matching condition is an overriding matching condition. If the coverage matching condition is satisfied between the second packet header information set and the first packet header information set, the second packet header information set includes the identifiers of all extended headers in the first packet header information set, that is, the first packet header information set A set of message header information is a subset of the second set of message header information. That is to say, if the packet satisfies the matching condition of covering the matching item of the matching condition, then the packet includes each extended packet header corresponding to the first packet header information set.
  • the first device can judge whether the packet includes one or more Each extension header in the extension header. If yes, the first device determines that the packet satisfies the matching item.
  • the matching condition is an optional matching condition. If the optional matching condition is satisfied between the second set of header information and the first set of header information, the second set of header information includes any one or more extended headers in the first set of header information , that is, there is an intersection between the first packet header information set and the second packet header information set. That is to say, if the packet meets the matching item whose matching condition is an optional matching condition, then the packet includes any one or more extended packet headers corresponding to the first packet header information set.
  • the first device can judge whether the packet includes any one or more elements in the first packet header information set. an extended header. If yes, the first device determines that the packet satisfies the matching item.
  • the matching condition is an exclusion matching condition. If the exclusion matching condition is satisfied between the second packet header information set and the first packet header information set, the second packet header information set does not include the identifier of any extended packet header in the first packet header information set, That is, there is no intersection between the first packet header information set and the second packet header information set. That is to say, if the packet satisfies the matching item whose matching condition is the exclusion matching condition, then the packet does not include any extended packet header corresponding to the first packet header information set.
  • the first device can judge whether the packet includes any one or more of the first packet header information set. Extended header. If not, the first device determines that the packet satisfies the matching item.
  • the matching condition corresponding to the matching item may include any one or more of the above three matching conditions, and the exclusion matching condition and the optional matching condition do not correspond to the same matching item.
  • the matching item in the notification message may be a newly defined matching type (Component).
  • the matching type corresponding to the matching item may be called an extension header (Extension_Headers) type.
  • Matching items can be described in the format of " ⁇ Type,Length,match_op,[value]+>".
  • the type (Type) indicates the type number of the newly defined component Extension_Headers; the length (Length) indicates the total length of the matching item; the matching rule (match_op) indicates the matching condition corresponding to the matching item, which can include optional matching conditions (match- any), coverage matching condition (match-all) and exclusion matching condition (exclude); the value (value) indicates the identification of the extended header corresponding to the matching item, and a matching item can include one or more values .
  • the above matching items can also be expressed in the format of ⁇ type,(length),[numeric_op,value]+>, where the role of numeric_op is the same or similar to that of match_op.
  • the above describes the scenario where the matching condition is used to match the type of the extended header included in the packet.
  • the following describes the scenario where the matching item is used to match a specific field or a value of a specific field in an extended header included in a packet.
  • the first packet header information set includes the identifier of the first extended header and the identifier of the first field.
  • the first packet header information set may include the correspondence between the identifier of the first extended packet header and the identifier of the first field, indicating that the packet that meets the matching item includes the first extended packet header, and the first extended packet header
  • the message header includes the first field.
  • its corresponding second packet header information set also includes the identifier of the first extended header and the identifier of the first field.
  • the matching condition corresponding to the first packet header information set may be the aforementioned coverage matching condition or optional matching criteria. That is to say, the packet matching the matching item includes the first extended packet header, and the first extended packet header further includes the first field.
  • the first field may be, for example, an option (Option) field in the extended packet header.
  • the matching item is used to match the type of the packet header included in the packet and the specific fields in the packet header. In some other implementation manners, the matching item may further be used to match the value of a specific field in the packet header of the packet.
  • the first packet header information set includes the identifier of the second extended header, the identifier of the second field, and the first value.
  • the first message header information set may include the identifier of the second extended message header, the correspondence between the identifier of the second field and the first value, indicating that the message that meets the matching item includes the second extended message header, And the second extended header of the message includes a second field whose value is the first value.
  • its corresponding second packet header information set also includes the identifier of the second extended packet header, the correspondence between the identifier of the second field and the first value. That is to say, the packet matching the matching item includes the second extended packet header, and the value of the second field in the second extended packet header is the first value.
  • the matching item may be a newly defined matching type (Component).
  • the matching type corresponding to the matching item may be called an extension header options (Extension_Header_Options) type.
  • Matching items can be described in the format of " ⁇ Type, Length, option_type, option_value>".
  • the type (Type) represents the type number of the newly defined Extension_Header_Options s component
  • the length (Length) represents the total length of the matching item
  • the option type (option_type) represents the field value corresponding to the matching item or the type of Option
  • the option value ( option_value) indicates the value of the field or option corresponding to the matching item.
  • the packet is first judged whether the packet includes the second extended packet header. If the packet includes the second extended packet header, it may continue to determine whether the second extended packet header of the packet includes the second field. If included, it may be further determined whether the value of the second field in the second extended header of the message is the first value. If yes, it can be determined that the packet is a packet that satisfies the matching item. It can be understood that if the first packet header information set includes the correspondence between the identifier of the second packet header, the identifier of the second field, and the first value, then the matching condition corresponding to the first packet header information set can be is the preceding override match condition or an optional match condition.
  • the action item is used to instruct the first device to process the packet including the extended packet header matching the matching item. That is to say, if the extended header included in the packet matches the matching item, it means that the packet includes a specific extended header, and the first device may process the packet in a specific processing manner according to the action item. In this way, by adjusting the matching item and the action item, the processing of the message carrying the extended message header can be flexibly controlled, and the flexibility of message processing can be improved.
  • the matching items and action items included in the notification message are introduced above, and the manner of carrying the matching items and action items in the notification message is described below.
  • the notification message is sent by the second device to the first device.
  • the second device may send a notification message to the first device based on BGP, or may send a notification message to the first device based on PCEP. Introduce respectively below.
  • the second device sends a notification message to the first device based on BGP, then the notification message is a BGP Update) message.
  • BGP Update a BGP Update
  • the foregoing matching item may be carried in the NLRI field of the notification message.
  • the NLRI field may be carried in the NLRI information corresponding to the BGP FlowSpec address family (Address Family) of the advertisement message.
  • the NLRI information of the BGP FlowSpec address family of the notification message may include a Multi-Protocol Reachable NLRI (Multi-Protocol Reachable NLRI, MP_REACH_NLRI) field, and the MP_REACH_NLRI may further include an NLRI field for carrying a matching item.
  • the format of the MP_REACH_NLRI field may be as shown in FIG. 3 .
  • the MP_REACH_NLRI field may include an AF information field, a Next Hop Network Address Information (Next Hop Network Address Information) field, and an NLRI field.
  • the AF information field occupies 3 octets, ie 24 bits.
  • the aforementioned matching item may be carried in the NLRI field.
  • the foregoing action item may be carried as a new BGP routing attribute in the routing attribute information field or NLRI field of the advertisement message.
  • the action item can be carried in the IPv6 address-related extended community attribute field or wide community attribute field of the advertisement message as a new BGP IPv6 address-related extended community (Extended Community) attribute or wide community (Wide Community) attribute.
  • the extended community attribute and the wide community attribute belong to the routing attribute, that is, the extended community attribute field or the wide community attribute field related to the IPv6 address carrying the action item can be one of the BGP routing attribute information. That is to say, the action item may be carried in the IPv6 address-related extended community attribute field of the BGP routing attribute information field of the advertisement message.
  • the second device sends a notification message to the first device based on the PCEP.
  • the notification message may be any one of a PCInitiate message, a PCUpd message and a PCRep message.
  • the foregoing matching items may be carried in flow specification object (Flowspec Object) information of the notification message.
  • the Flowspec Object information of the notification message may include a flow filter type length value (Flow Filter TLV) field.
  • the Flow Filter TLV field may include one or more TLV fields, which are used to carry the matching rules of the BGP flowspec.
  • the Flow Filter TLV field of the notification message may include an extension header TLV (Extension_Headers TLV) field, and/or, an extension header options TLV (Extension_Header_options TLV).
  • the Extension_Headers TLV field and the Extension_Header_options TLV field are used to carry the aforementioned matching items. Specifically, if the matching item includes the first packet header information set and the matching condition, then the matching item can be carried in the Extension_Headers TLV field; if the matching item's first packet header information set also includes the first packet header identification and the identifier of the first field, then the matching item can be carried in the Extension_Header_options TLV field.
  • the second device may also send a notification message to the first device through a network configuration (Network Configuration, NETCONF) protocol.
  • NETCONF Network Configuration, NETCONF
  • the notification message sent by the second device may be a NETCONF message.
  • a notification message may include one matching item and one action item, or may include multiple matching items and/or multiple action items. If the notification message received by the first device includes multiple matching items and multiple action items, the first device may generate multiple forwarding entries. Wherein, each forwarding entry in the multiple forwarding entries may correspond to a matching item and an action item. Alternatively, if multiple matching items correspond to one action item, the first device may also generate a forwarding entry, where the forwarding entry includes a correspondence between the multiple matching items and the one action item.
  • S202 The first device generates a forwarding entry according to the notification message.
  • the first device may generate a forwarding entry according to the notification message.
  • the forwarding entry includes a correspondence between the matching item and the action item, and is used to instruct the first device to process the packet satisfying the matching item according to the action item.
  • the forwarding entry may be an access control list (Access Control List, ACL) entry or a forwarding information base (Forwarding Information Base, FIB) entry.
  • ACL Access Control List
  • FIB Forwarding Information Base
  • the above describes how the second device configures the forwarding entry on the first device, and the following describes the method for the first device to process packets based on the forwarding entry.
  • S203 The first device receives the first packet sent by the third device.
  • the first device may be a network device for forwarding data packets in a network system
  • the third device may be a device directly connected to the first device.
  • the first packet may be an IPv6 packet, or an MPLS packet or an IPv4 packet.
  • IPv6 packet or an MPLS packet or an IPv4 packet.
  • the following description takes the first packet as an IPv6 packet as an example.
  • the third device may be a terminal device that generates the first message, such as a computer or a server; if the first device is a P device, the third device may be on the forwarding path of the first message The last-hop network device of the first device.
  • the first device since the first device is a network device for processing the first packet, in order to prevent the first packet from being discarded by the first device, the first device may be configured to process various extended packet headers. ability. In this way, after receiving the first packet, the first device can process the extended packet header included in the first packet. The first packet will not be discarded because the first device is not capable of processing the extended packet header.
  • S204 The first device determines whether the first packet includes an extended packet header matching the matching item.
  • the first device After receiving the first packet, the first device judges whether the first packet satisfies the matching item, that is, judges whether the first packet includes a packet header matching the matching item. If the first packet does not satisfy the matching item, the first device forwards the first packet according to the destination address of the first packet; if the first packet meets the matching item, the first device executes S205. The following describes the method for the first device to determine whether the first packet satisfies the matching item.
  • the matching item may include a first packet header information set, and the first packet header information set includes identifiers of one or more packet headers. Then, in the process of judging whether the first packet satisfies the matching item, the first device may first determine the second packet header information set corresponding to the first packet, and then determine the second packet header information set corresponding to the first packet Whether the matching condition is satisfied between the first packet header information set and the first packet header information set.
  • the first device determines that the first packet does not meet the matching item;
  • the matching condition is satisfied between the second packet header information set and the first packet header information set, and the first device may determine that the first packet satisfies the matching item.
  • the matching conditions may include any one of covering matching conditions, optional matching conditions and excluded matching conditions. The following are introduced respectively.
  • the matching condition is an overriding matching condition
  • the first device can determine whether the first packet includes each extended packet in one or more extended packet headers corresponding to the first packet header information set. Header. If the first packet includes each extended packet header in one or more extended packet headers corresponding to the first packet header information set, the first device determines that the first packet meets the matching condition.
  • the first device can determine whether the first packet includes HBH, DOH, and RH at the same time.
  • Extended header If the first packet does not include any of the three extended headers HBH, DOH, and RH, the first device determines that the first packet does not meet the matching item; An extended packet header, the first device determines that the second device meets the matching condition.
  • the matching condition is an optional matching condition
  • the first device may determine whether the first packet includes any extended packet header corresponding to the first packet header information set. If the first packet includes any extended packet header corresponding to the first packet header information set, the first device determines that the first packet meets the matching condition.
  • the first device can determine whether the first packet includes HBH, DOH, and RH. Any one or more of the extended message headers. If the first packet includes any one of the three extended headers HBH, DOH, and RH, the first device determines that the second device satisfies the matching item. If the first packet does not include any one of the three extended packet headers HBH, DOH, and RH, the first device determines that the second device does not meet the matching item.
  • the matching condition is an exclusion matching condition
  • the first device may determine whether the first packet includes any extended packet header corresponding to the first packet header information set. If the first packet includes any extended packet header corresponding to the first packet header information set, the first device determines that the first packet does not meet the matching condition.
  • the first device can determine whether the first packet includes the three extensions of HBH, DOH, and RH Any one or more of the packet headers. If the first packet includes any one of the three extended headers HBH, DOH, and RH, the first device determines that the second device does not meet the matching item. If the first packet does not include any one of the three extended packet headers HBH, DOH, and RH, the first device determines that the second device meets the matching item.
  • the extended message header of the same type can be used for different purposes. That is to say, if the Types of the two extended headers are the same, but the fields in the extended headers have different values, the two extended headers may correspond to different forwarding behaviors. Correspondingly, there may also be differences in the processing manners of the two extended headers. That is to say, for the same type of extended header, if the fields in the extended header have different values, the required processing capabilities may also be different.
  • the extended packet header of RH type includes a routing type (Routing Type) field.
  • the value of the Routing Type field of the RH is different, and the function of the RH may be different. For example, if the value of the Routing Type field in the extended packet header is 4, then the extended packet header belongs to the SRH type extended packet header.
  • the method of processing the RH-type extended header whose Routing Type field is 1, 2, 3, 5, etc. is different from the method of processing the SRH-type extended header, and the required processing capabilities are also different.
  • the matching item may also include information of fields in the extended packet header.
  • the first packet header information set may include the identifier of the first packet header and the identifier of the first field, and may also include the identifier of the second packet header, the identifier of the second field and first value.
  • the first device may judge whether the first packet includes the first packet header. If the first packet does not include the first packet header, the first device determines that the first packet does not satisfy the matching item. If the first packet includes the first packet header, the first device may further determine whether the first packet header of the first packet includes the first field. If the first packet header of the first packet does not include the first field, the first device determines that the first packet does not satisfy the matching item. If the first packet header of the first packet includes the first field, the first device determines that the first packet satisfies the matching item.
  • the first device may first judge whether the first packet Whether the text includes the second packet header. If the first packet includes the second packet header, the first device may continue to determine whether the second packet header includes the second field. If the second packet header of the first packet includes the second field, the first device may further determine whether the value of the second field is the first value.
  • the first device determines that the first packet does not satisfy the matching item. If the value of the second field in the second packet header of the first packet is the first value, the first device determines that the first packet satisfies the matching item.
  • the first device may process the first packet according to the action item.
  • the action item is used to prevent a network device that is not capable of processing the extended header of the packet matching the matching item from processing the first packet.
  • each network device on the forwarding path of the first message can correctly process the first message, which improves the reliability of message forwarding.
  • the data message is forwarded by the network device capable of processing the extended message header of the first message, which reduces the probability of the message being discarded and improves the reliability of message forwarding.
  • the first device determines a specific forwarding path according to the action item, and network devices on the forwarding path can process the extended packet header included in the first packet.
  • the first device may first determine the first forwarding path according to the first packet, and then forward the first packet through the first forwarding path.
  • any network device on the first forwarding path has the ability to process the extended message header included in the first message, or, one or more network devices specified on the first forwarding path have the ability to process the extended message header included in the first message The ability to extend the header.
  • the specified one or more network devices are network devices on the first forwarding path that need to process the extended message header included in the first message. In this way, the network device on the first forwarding path will not discard the first packet due to the extended packet header included in the first packet, which improves the reliability of packet forwarding.
  • network device 122 and network device 125 do not have the capability of processing SRH
  • network device 121 , network device 123 , network device 124 and network device 126 have the capability of processing SRH.
  • the first forwarding path determined by network device 121 for message K is the forwarding path "network device 121 ⁇ network device 124 ⁇ network device 125 ⁇ network device 126", then the packet
  • the Segment Identifier (Segment Identifier, SID) list (SID List) corresponding to K may include the SID of the network device 121, the SID of the network device 124, and the SID of the network device 126.
  • the network device 121 , the network device 124 and the network device 126 are designated network devices on the first forwarding path, and these designated network devices are all capable of processing the extended packet header included in the first packet.
  • the network device 121 After the network device 121 receives the message K, since the SID List of the message K includes the SID of the network device 121, the network device 121 can process the SRH of the message K. After the network device 125 receives the message K, because the SID List of the message K does not include the SID of the network device 125, the network device 125 does not need to process the SRH of the message K, and directly uses the SID of the network node 126 in the forwarding process. to retweet.
  • the network device 125 can be prevented from parsing the SRH of the message K, thereby preventing the message K from being discarded by the network device 125 and improving the message quality. Reliability of forwarding.
  • the method for determining the first forwarding path by the first device is introduced below.
  • the support of the extended packet header by each network device in the network may be configured on the first device.
  • the first device may determine a plurality of candidate network devices according to the network device's support for the extended message header and the identifier of the extended message header included in the first message.
  • the candidate network device is a network device that will not discard the first message due to the extended message header included in the first message, for example, it may be a network device capable of processing the extended message header included in the first message .
  • the first device determines a plurality of target network devices from the plurality of candidate network devices according to the destination address of the first packet and the topology of the network system to obtain a first forwarding path.
  • the target network device is a network device on the first forwarding path. That is to say, after determining the plurality of candidate network devices, the first device may plan a forwarding path from the first device to the destination device of the first message according to the connection relationship between the plurality of candidate network devices.
  • the foregoing forwarding path is the first forwarding path.
  • the first device After determining the first forwarding path, the first device sends the first packet through the first forwarding path.
  • the sending of the first packet by the first device through the first forwarding path may The sending of the first packet by the next-hop network device of the first device on the path may also include sending the first packet by the first device through a tunnel corresponding to the first forwarding path. That is to say, the action item may be used to specify the next-hop network device of the first packet, or may be used to specify a tunnel for transmitting the first packet.
  • the first forwarding path is an SRv6 path
  • the SID list corresponding to the SRv6 path may be pushed into the first packet, so that the first packet is forwarded along the SRv6 path.
  • the foregoing method for determining the first forwarding path may be performed by the first device, or may be performed by a control device in the network system.
  • the aforementioned second device or other control devices may determine the first forwarding path according to the support capability and connection relationship of each network device on the packet header in the network system, and send "send the packet through the first forwarding path" as an action item to the first device.
  • the first device can send the first message through the first forwarding path, without the need for the first device to determine the first forwarding path, which saves the time for the first device to process the first message and reduces delay in message transmission.
  • FIG. 1-C Take Figure 1-C as an example for illustration. Assume that network device 121, network device 123, network device 124, network device 125, and network device 126 in FIG. 1-C have the ability to process HBH, and network device 122 does not have the ability to process HBH.
  • the forwarding path obtained according to the traditional routing strategy is the forwarding path "network device 121 ⁇ network device 122 ⁇ network device 123".
  • the packet X may be discarded by the network device 122 .
  • the control device 130 may send a notification message to the network device 121 .
  • the network device 121 may generate a forwarding entry according to the notification message.
  • the matching item of the forwarding table item can include the identification of the HBH and optional matching conditions
  • the action item of the forwarding table item includes the information of the specific forwarding path, such as the SID of the ⁇ network device 121, the SID of the network device 124, the network device 124 as the SID list.
  • the first device ensures that the first packet can be correctly forwarded to the destination by encapsulating the first packet with a specific packet header, and forwarding the first packet with the specific packet header
  • the path may pass through a network device that does not support processing the extended packet header included in the first packet.
  • the first forwarding path is the forwarding path from the first device to the destination device of the first message, and each hop of network devices on the first forwarding path has the ability to process the extended message header included in the first message Ability.
  • the number of network devices capable of processing the extended header included in the first packet is limited, and it is impossible to form a forwarding path from the first device to the destination device.
  • the first device may encapsulate a specific header of the first packet, and send the encapsulated first packet along the second forwarding path.
  • the specific packet header may be called an outer layer packet header.
  • the destination address of the outer packet header is the same as the destination address of the first packet, or the destination address of the outer packet header is the address of the upper N-hop network device of the destination device of the first packet (N is a positive integer)
  • the source address of the outer packet header is the address of the first device.
  • the network device on the second forwarding path may have the ability to process the outer packet header.
  • IPv6 encapsulation IPv6 encapsulation
  • the first device may encapsulate the first packet into the second packet as the payload of the second packet.
  • the second packet is an IPv6 packet
  • the first device may carry the first packet in the upper-layer protocol data unit of the second packet, and add a basic packet header as an outer layer packet header.
  • the extended packet header can be an IPv6 extended packet header or an MPLS extended packet header.
  • the first device encapsulates the outer MPLS label for the first packet to obtain the second packet.
  • the outer MPLS label of the second message may identify a forwarding path to the destination address. In this way, the network device forwarding the second message can determine the transmission path of the second message according to the outer MPLS label of the second message.
  • the outer packet header encapsulated by the first device for the first packet further includes a first identifier
  • the first identifier is used to trigger devices on the second forwarding path to determine that the second packet does not need to be parsed according to the first identifier Included extension headers. That is to say, the device on the second forwarding path may directly forward the second packet according to the outer packet header without processing the extended packet header included in the second packet according to the indication of the first identifier. Therefore, the device on the second forwarding path is prevented from discarding the second packet because it is not capable of processing the extended packet header included in the second packet.
  • the second forwarding path includes a fourth network device. After receiving the second packet, the fourth network device determines that the second packet contains the first identifier, and then forwards the second packet according to the outer header of the second packet. Parsing any extended header contained in the first packet in the second packet.
  • the value of the Next Header field in the outer layer message header of the second message can be the value of the non-extended message header type, for example, 41 can be taken.
  • 41 is the type number allocated for IPv6, indicating that an IPv6 packet is encapsulated in the outer packet header. Therefore, if the first device encapsulates the outer packet header with the Next Header field value of 41 for the first packet, then the device receiving the second packet can be determined according to the value 41 of the Next Header field in the outer packet header An IPv6 packet (i.e.
  • the first packet is encapsulated in the outer packet header, that is to say, the first packet is used as the payload of the second packet, and there is no need to further parse the second packet on the device receiving the second packet.
  • the extended packet header contained in a packet avoids processing the first packet and reduces the probability that the network device discards the second packet.
  • the destination address of the outer packet header is the destination address of the first packet.
  • the destination address of the outer packet may also be the address of the upper N-hop network device of the destination device of the first packet.
  • N is a positive integer, and any network device on the forwarding path from the N-hop network device of the destination device of the first message to the destination device of the first message has the ability to process the extended message included in the first message.
  • Ability to write headers
  • the destination device of the second message can process the second message, restore the second message to the first message, and Continue the normal transmission of the first message.
  • FIG. 1-D Take Figure 1-D as an example for illustration. It is assumed that network device 121, network device 123, network device 124, and network device 126 in FIG. 1-D have the capability of processing SRH, and network device 122 and network device 125 do not have the capability of processing SRH.
  • the extended packet header N belongs to the extended packet header of the RH type, and the routing of the extended packet header N
  • the value of the type (Routing Type) field is 4.
  • the forwarding path corresponding to message Y is the forwarding path "network device 121 ⁇ network device 122 ⁇ network device 123".
  • the packet Y may be discarded by the network device 122 .
  • the network device 125 does not have the ability to process SRH, it is impossible to ensure the normal transmission of the message Y by modifying the forwarding path of the message Y.
  • the control device 130 may send a notification message to the network device 121 .
  • the network device 121 may generate a forwarding entry according to the notification message.
  • the matching item of the forwarding entry includes the corresponding relationship between the protocol number 43 corresponding to the SRH, the identifier of the Routing Type field, and the first value 4, and the action item of the forwarding entry includes IPv6_Encaps.
  • the network device 121 can further determine whether the value of the Routing Type field in the extended header N of the message Y is The first value is 4. Since the type number of the extended packet header N is 43, and the value of the Routing Type field in the extended packet header N is 4, which matches the matching item, it means that the extended packet header N is SRH and matches the matching item. Then, the network device 121 can encapsulate the outer packet header for the packet Y according to the action item to obtain the packet header Z.
  • the destination address of the message Z is the address of the network device 123
  • the source address of the message Z is the address of the network device 121 .
  • the network device 121 can determine the forwarding path of the message Z according to the destination address of the message Z, and send the message Z to the destination device of the message Z through a corresponding network interface. For example, the network device 121 may determine that the forwarding path of the packet Z is the forwarding path "network device 121 ⁇ network device 122 ⁇ network device 123", and then send the packet Z to the network device 123 through the network interface A1.
  • the network device 123 can obtain the message Y according to the upper layer protocol data unit of the message Z, and send the message Z to the device 112 to realize the normal transmission of the message Z.
  • the transmission path of message X may be as shown in FIG. 1-D.
  • the second device can establish a forwarding table item including a matching item and an action item on the first device through a notification message, so that the first device can process the forwarding table item including the extended packet header matching the matching item according to the action item.
  • message if the packet includes the extended packet header that matches the matching item, the first device may process the packet according to the action item.
  • the matching item is a matching condition for the extended header included in the packet. If the packet satisfies the matching item, it means that the packet includes a specific extended packet header, and the first device may process the packet in a specific processing manner according to the action item. In this way, by adjusting the matching item and the action item, the message carrying the extended message header can be flexibly processed to improve the reliability of message forwarding.
  • a packet with any extended packet header can be flexibly processed through a match item and an action item. That is to say, the first device processes packets with specific extended packet headers.
  • the second device may instruct the first device to collect relevant information during packet transmission, or forward the packet through a specific forwarding path, thereby improving the flexibility of packet forwarding.
  • FIG. 1-E Take Figure 1-E as an example for illustration. Assume that each network device in FIG. 1-E has the ability to process the message header M, and the device 111 sends the message P and the message Q to the device 112. Wherein, both the packet P and the packet Q include the extended header N, and both the extended header N of the packet P and the extended header N of the packet Q include the third field. For the packet P, the value of the third field in the extended header N is 101, and for the packet Q, the value of the third field in the extended header N is 102. According to the traditional routing policy, the packet P and the packet Q can be forwarded to the device 112 through the forwarding path "network device 121 ⁇ network device 122 ⁇ network device 123".
  • the control device 130 may send a notification message to the network device 121.
  • the network device 121 may generate a forwarding entry according to the notification message.
  • Forward representations include match items and action items.
  • the matching item includes the corresponding relationship between the identifier of the extended header N, the identifier of the third field, and the first value 102, and the action item is used to indicate the forwarding path "network device 121 ⁇ network device 124 ⁇ network device 125 ⁇ The network device 126" forwards the message.
  • the network device 121 can send a message to the network device through the network interface A1.
  • 122 sends the packet P, so that the packet P is forwarded through the forwarding path "network device 121 ⁇ network device 122 ⁇ network device 123".
  • the network device 121 can send the message Q to the network device 124 through the network interface A2, so that the message Q passes through the forwarding path " Network device 121 ⁇ network device 124 ⁇ network device 125 ⁇ network device 126" forwarding.
  • the transmission path of message X may be as shown in Figure 1-E.
  • the embodiment of the present application further provides a packet processing apparatus 400 , and the packet processing apparatus 400 can realize the functions of the first device in the embodiment shown in FIG. 2 .
  • the packet processing device 400 includes an obtaining unit 410 , a receiving unit 420 and a processing unit 430 .
  • the obtaining unit 410 is used to realize S203 in the embodiment shown in FIG. 2
  • the receiving unit 420 is used to realize S204 in the embodiment shown in FIG. 2
  • the processing unit 430 is used to realize S205 and S206.
  • the obtaining unit 410 is configured to obtain a forwarding entry, where the forwarding entry includes a matching item and an action item, and the matching item includes one or more extension header identifiers.
  • the receiving unit 420 is configured to receive the first message.
  • a processing unit 430 configured to determine that the first packet includes an extended header that matches the matching item; in response to determining that the first packet includes an extended header that matches the matching item, Process the first packet according to the action item.
  • the obtaining unit 410 may belong to the receiving unit 420 . If the forwarding entry is generated by the first device according to the notification message, the obtaining unit 410 may belong to the processing unit 430
  • the embodiment of the present application further provides a message processing apparatus 500 , and the message processing apparatus 500 can realize the function of the second device in the embodiment shown in FIG. 2 .
  • the packet processing apparatus 500 includes a processing unit 510 and a sending unit 520 .
  • the processing unit 510 is configured to implement S201 in the embodiment shown in FIG. 2
  • the sending unit 5420 is configured to implement S202 in the embodiment shown in FIG. 2 .
  • the processing unit 510 is configured to generate a notification message, where the notification message includes a matching item and an action item, and the matching item includes one or more identifiers of extended message headers.
  • a sending unit 520 configured to send the notification message to the first device, where the notification message is used to trigger the first device to process the message including the extended header matching the matching item according to the action item .
  • the embodiment of the present application further provides a packet processing apparatus 600 , and the packet processing apparatus 600 can realize the functions of the first device in the embodiment shown in FIG. 2 .
  • the packet processing apparatus 600 includes an acquiring unit 610 and a processing unit 620 .
  • the acquiring unit 610 is configured to receive the notification message sent by the first device
  • the processing unit 620 is configured to implement S203 in the embodiment shown in FIG. 2 .
  • the obtaining unit 610 is configured to obtain a notification message, the notification message includes a matching item and an action item, the matching item includes one or more extension header identifiers, and the action item is used to indicate that the first A device processes the message including the extended message header matching the matching item.
  • the processing unit 620 is configured to generate a forwarding entry according to the notification message, where the forwarding entry includes a correspondence between the matching item and an action item.
  • each functional unit in the embodiment of the present application may be integrated into one processing unit, or each unit may physically exist separately, or two or more units may be integrated into one unit.
  • the acquisition unit, the processing unit, and the sending unit may be the same unit or different units.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • FIG. 7 is a schematic structural diagram of a device 700 provided in an embodiment of the present application.
  • the device 400 for processing the message, the device 500 for processing the message and the device 600 for processing the message above can be implemented by the device shown in FIG. 7 .
  • the device 700 includes at least one processor 701 , a communication bus 702 and at least one network interface 704 , and optionally, the device 700 may further include a memory 703 .
  • the processor 701 can be a general-purpose central processing unit (Central Processing Unit, CPU), a specific application integrated circuit (Application-specific Integrated Circuit, ASIC) or one or more integrated circuits (Integrated Circuit , IC).
  • the processor may be used to process packets or periodic parameters, so as to implement the packet processing method provided in the embodiment of the present application.
  • the processor may be used to obtain a forwarding entry, the forwarding entry includes a matching item and an action item, and the matching item includes identification of one or more extended message headers; receiving a first message; determining that the first message includes an extended message header that matches the matching item; in response to determining that the first message includes the The extended packet header matching the matching item is used to process the first packet according to the action item.
  • Communication bus 702 is used to transfer information between processor 701 , network interface 704 and memory 703 .
  • the memory 703 can be a read-only memory (Read-only Memory, ROM) or other types of static storage devices that can store static information and instructions, and the memory 703 can also be a random access memory (Random Access Memory, RAM) or can store information Other types of dynamic storage devices and instructions, it can also be a compact disc (Compact Disc Read-only Memory, CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray optical discs, 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, but is not limited thereto.
  • the memory 703 may exist independently, and is connected to the processor 701 through the communication bus 702 .
  • the memory 703 can also be integrated with the processor 701.
  • the memory 703 is used to store program codes or instructions for executing the technical solutions provided by the embodiments of the present application, and the execution is controlled by the processor 701 .
  • the processor 701 is used to execute program codes or instructions stored in the memory 703 .
  • One or more software modules may be included in the program code.
  • the processor 701 may also store program codes or instructions for executing the technical solutions provided by the embodiments of the present application. In this case, the processor 701 does not need to read the program codes or instructions from the memory 703 .
  • the network interface 704 can be a device such as a transceiver for communicating with other devices or a communication network.
  • the communication network can be Ethernet, radio access network (RAN) or wireless local area network (Wireless Local Area Networks, WLAN).
  • RAN radio access network
  • WLAN wireless local area network
  • the network interface 704 may be used 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 network interface 704 may be an Ethernet interface (Ethernet) interface, a Fast Ethernet (Fast Ethernet, FE) interface or a Gigabit Ethernet (Gigabit Ethernet, GE) interface, etc.
  • the device 700 may include multiple processors, for example, the processor 701 and the processor 705 shown in FIG. 7 .
  • 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 (eg, computer program instructions).
  • FIG. 8 is a schematic structural diagram of a device 800 provided in an embodiment of the present application. Each device in Fig. 2 can be realized by the device shown in Fig. 8.
  • the device 800 includes a main control board and one or more interface boards.
  • the main control board is communicatively connected with the interface board.
  • the main control board is also called the main processing unit (Main Processing Unit, MPU) or the route processing card (Route Processor Card). Route calculation, device management and maintenance functions.
  • the interface board is also called a line processing unit (Line Processing Unit, LPU) or a line card (Line Card), which is used to receive and send packets.
  • LPU Line Processing Unit
  • Line Card Line Card
  • the communication between the main control board and the interface board or between the interface board and the interface board is through a bus.
  • the interface boards communicate through the SFU.
  • the device 800 also includes the SFU, the SFU communicates with the main control board and the interface board, and the SFU is used to forward the interface board.
  • the data between SFUs can also be called SFUs (Switch Fabric Units, SFUs).
  • the interface board includes a CPU, a memory, a forwarding engine, and an interface card (Interface Card, IC), where the interface card may include one or more network interfaces.
  • the network interface may be an Ethernet interface, an FE interface, or a GE interface.
  • the CPU communicates with the memory, the forwarding engine and the interface card respectively.
  • the memory is used to store the forwarding table.
  • the forwarding engine is used to forward the received message based on the forwarding table stored in the memory. If the destination address of the received message is the IP address of the device 800, the message is sent to the CPU of the main control board or the interface board for further processing. Processing; if the destination address of the received message is not the IP address of the device 800, the forwarding table is checked according to the destination, if the next hop and the outgoing interface corresponding to the destination address are found from the forwarding table, the message is Forward to the outbound interface corresponding to the destination address.
  • the forwarding engine may be a network processor (Network Processor, NP).
  • the interface card is also called a daughter card, which can be installed on the interface board.
  • the CPU can also perform the function of the forwarding engine, such as implementing soft forwarding based on a general-purpose CPU, so that no forwarding engine is needed in the interface board.
  • the forwarding engine may be implemented by ASIC or Field Programmable Gate Array (Field Programmable Gate Array, FPGA).
  • the memory storing the forwarding table can also be integrated into the forwarding engine as a part of the forwarding engine.
  • the embodiment of the present application also provides a chip system, including: a processor, the processor is coupled with a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor, the The system-on-a-chip implements the packet processing method executed by the first device in the embodiment shown in FIG. 2 above, or enables the chip system to implement the packet processing method executed by the second device in the embodiment shown in FIG. 2 above.
  • processors in the chip system there may be one or more processors in the chip system.
  • the processor can be realized by hardware or by software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software codes stored in a memory.
  • the memory can be integrated with the processor, or can be set separately from the processor, which is not limited in this application.
  • the memory can be a non-transitory processor, such as a read-only memory ROM, which can be integrated with the processor on the same chip, or can be respectively arranged on different chips.
  • the setting method of the processor is not specifically limited.
  • the system-on-a-chip can be an FPGA, an ASIC, a system chip (System on Chip, SoC), a CPU, an NP, or a digital signal processing circuit (Digital Signal Processor, DSP), it can also be a microcontroller (Micro Controller Unit, MCU), it can also be a programmable controller (Programmable Logic Device, PLD) or other integrated chips.
  • SoC System on Chip
  • DSP Digital Signal Processor
  • MCU Micro Controller Unit
  • PLD Programmable Logic Device
  • each step in the foregoing method embodiments may be implemented by an integrated logic circuit of hardware in a processor or instructions in the form of software.
  • the method steps disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
  • the embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when run on a computer, cause the computer to execute the message processing method performed by the first device provided in the method embodiment above, or cause the The computer executes the packet processing method performed by the second device provided in the above method embodiments.
  • the embodiment of the present application also provides a computer program product containing instructions. When it is run on a computer, it causes the computer to execute the message processing method provided by the above method embodiment and executed by the first device, or causes the computer to execute The packet processing method performed by the second device provided in the above method embodiment.
  • the disclosed system, device and method can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical module division.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be obtained according to actual needs to achieve the purpose of the solution of this embodiment.
  • each module unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software module units.
  • the integrated unit is implemented in the form of a software module unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .
  • the functions described in the present invention may be implemented by hardware, software, firmware or any combination thereof.
  • the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
  • Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage media may be any available media that can be accessed by a general purpose or special purpose computer.

Abstract

本申请实施例提供了一种报文处理的方法、装置及系统,旨在灵活的控制带有扩展报文头的报文的处理,从而有利于提高报文转发的可靠性与灵活性。其中,所述报文处理方法包括:第一设备获得转发表项,所述转发表项包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识;所述第一设备接收第一报文;所述第一设备确定所述第一报文包括与所述匹配项相匹配的扩展报文头;响应于确定所述第一报文包括与所述匹配项相匹配的扩展报文头,所述第一设备根据所述动作项处理所述第一报文。

Description

报文处理方法、装置及系统
本申请要求于2021年11月04日提交中国国家知识产权局、申请号为202111300903.8、发明名称为“一种通过Flowspec下发基于IPv6扩展头的报文匹配和转发策略的方法”的中国专利申请的优先权,以及要求于2021年12月17日提交中国国家知识产权局、申请号为202111554313.8、申请名称为“报文处理方法、装置及系统”的中国专利申请的优先权,以及要求于2022年03月18日提交中国国家知识产权局、申请号为202210270403.2、申请名称为“报文处理方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种报文处理方法、装置及系统。
背景技术
在第六版互联网协议(Internet Protocol Version 6,IPv6)技术中,报文的报文头可以包括基本报文头和扩展报文头。一个IPv6报文可以包括一个基本报文头,以及一个或多个扩展报文头。其中,基本报文头可以用于携带IPv6报文的基本信息,例如报文的目的地址和源地址等。扩展报文头可以用于携带IPv6报文的扩展信息。
但是,由于扩展报文头的类型较多,网络系统中部分网络设备不具有处理扩展报文头的能力,这些网络设备由于不能处理扩展报文头的能力,这些网络设可能会直接丢弃这些包含扩展报文头的报文,从而导致报文转发过程中出现丢包,降低了报文转发的可靠性。
发明内容
本申请提供了一种报文处理的方法、装置及系统,用于灵活的控制带有扩展报文头的处理,从而有利于提高报文转发的可靠性与灵活性。
第一方面,本申请提供了一种报文处理的方法,该方法可以应用于第一设备,第一设备可以是用于转发数据报文的网络设备,例如可以是路由器或交换机等设备。具体地,所述报文处理方法可以包括:第一设备先获得转发表项,例如可以建立转发表项或接收其他设备发送的转发表项。转发表项包括匹配项和动作项,匹配项包括一个或多个扩展报文头的标识,用于限定被处理的报文所具有的扩展报文头。在转发数据报文的过程中,第一设备可以判断被转发的报文是否与匹配项相匹配。如果第一设备转发的第一报文包括与匹配项相匹配的扩展报文头,第一设备确认第一报文满足匹配项。对于满足匹配项的第一报文头,第一设备可以根据动作项处理第一报文。也就是说,第一设备可以在转发第一报文之前判断第一报文所包括的扩展报文头是否与转发表项的匹配项相匹配。如果第一报文所包括的扩展报文头的标识与匹配项相匹配,则根据转发表项的动作项对报文进行处理,从而提供了一种灵活控制携带有扩展报文头的报文的处理方式。例如,可以通过指定路径转发携带有扩展报文头的报文,指定路径上的设备都具有处理报文扩展头的能力。或者,第一转发路径上指定的一个或多个网络设备具有处理第一报文的能力。也就是说,第一转发路径上可以包括处理第一报文所包括的扩展报文头的能力的网络设备,且第一转发路径上剩余网络设备不需要处理第一报文所包括的扩展报文头。这样可以避免第一报文转发到不具 有处理扩展报文头的网络设备,从而避免了第一报文被丢弃,提高了报文转发的可靠性与灵活性。
在一种可能的设计中,匹配项包括第一报文头信息集合,第一报文头信息集合可以包括一个或多个扩展报文头的标识。满足匹配项的第一报文所包括的扩展报文头可以与第一报文头信息集合相匹配。具体地,在判断第一报文是否满足匹配项的过程中,第一设备可以判断第二报文头信息集合与第一报文头信息集合之间是否满足匹配条件,其中,第二报文头信息集合包括第一报文所包括的一个或多个扩展报文头的标识。如果第二报文头信息集合与第一报文头信息集合之间满足匹配条件,第一设备确定第一报文为满足匹配条件的报文。
在一种可能的设计中,匹配条件可以是覆盖匹配条件、可选匹配条件和排除匹配条件中的任意一种或多种。
在第一种可能的实现中,匹配条件为覆盖匹配条件,那么第二报文头信息集合与第一报文头信息集合之间满足匹配条件包括:第二报文头信息集合包括第一报文头信息集合中所有扩展报文头的标识。也就是说,如果第一设备确定第一报文头信息集合为第二报文头信息集合的子集,第一设备可以确定第一报文为满足匹配条件的报文,第一报文包括与匹配项相匹配的扩展报文头。
在第二种可能的实现中,匹配条件为可选匹配条件,那么第二报文头信息集合与第一报文头信息集合之间满足匹配条件包括:第二报文头信息集合包括第一报文头信息集合中任意一个或多个扩展报文头的标识。也就是说,如果第一设备确定第一报文头信息集合和第二报文头信息集合之间存在交集,第一设备可以确定第一报文为满足匹配条件的报文,第一报文包括与匹配项相匹配的扩展报文头。
在第三种可能的实现中,匹配条件为排除匹配条件,那么第二报文头信息集合与第一报文头信息集合之间满足匹配条件包括:第二报文头信息集合不包括第一报文头信息集合中任意一个或多个扩展报文头的标识。也就是说,如果第一设备确定第一报文头信息集合和第二报文头信息集合之间不存在交集,第一设备可以确定第一报文为满足匹配条件的报文,第一报文包括与匹配项相匹配的扩展报文头。
在一种可能的设计中,匹配条件还可以为上述三种匹配条件以外的其他条件,用于匹配报文的具体报文头中的具体字段。第一报文头信息集合可以包括第一扩展报文头的标识和第一字段的标识。相应地,第二报文头信息集合与第一报文头信息集合之间满足匹配条件可以包括:第二报文头信息集合包括第一扩展报文头的标识和第一字段的标识。如果第二报文头信息集合包括第一扩展报文头的标识和第一字段的标识,说明第一报文包括第一扩展报文头,且第一报文的第一扩展报文头中包括第一字段,满足匹配项的要求。
在一种可能的设计中,匹配项还可以用于匹配报文的具体报文头中具体字段的具体值。第一报文头信息集合可以包括第二扩展报文头的标识、第二字段的标识和第二值。相应地,第二报文头信息集合与第一报文头信息集合之间满足匹配条件可以包括:第二报文头信息集合包括第二扩展报文头的标识、第二字段的标识和第一值。如果第二报文头信息集合包括第二扩展报文头的标识、第二字段的标识和第一值,说明第一报文包括第二扩展报文头, 且第一报文的第二扩展报文头中第二字段的值为第一值,满足匹配项的要求。
在一种可能的设计中,动作项用于指示第一网络设备根据特定转发路径转发第一报文。具体地,在确定第一报文包括与所述匹配项相匹配的扩展报文头之后,第一设备可以根据动作项确定第一报文对应的第一转发路径,并通过第一转发路径发送第一报文。其中,第一转发路径上任一网络设备具有处理第一报文所包括的扩展报文头的能力。或者,第一转发路径上指定的一个或多个网络设备具有处理第一报文的能力。也就是说,第一转发路径上可以包括处理第一报文所包括的扩展报文头的能力的网络设备,且第一转发路径上剩余网络设备不需要处理第一报文所包括的扩展报文头。这样,通过调整第一报文的转发路径提高了报文转发的可靠性。
在一种可能的设计中,动作项用于指示第一设备对第一报文封装特定报文头。具体地,第一设备为第一报文封装外层报文头,得到第二报文。例如第一设备可以将第一报文作为载荷封装在第二报文中。其中,外层报文头的目的地址为第一报文的目的地址,或者,外层报文头的目的地址为第一报文的目的设备的上N跳网络设备的地址(N为正整数),外层报文头的源地址为第一设备的地址。在封装得到第二报文之后,第一设备通过第二转发路径发送第二报文。其中,第二路径上可以包括不具有处理第一报文所包括扩展报文头的能力的网络设备。也就是说,通过为第一报文封装外层报文头,传输第二报文的网络设备不解析第一报文所包括的扩展报文头。这样,即使不具有解析第一报文所包括的扩展报文头的能力的网络设备位于第二报文的转发路径上,由于该第二报文包含该外层报文头,网络设备不需要解析第一报文所包括的扩展报文头,第二报文不会被网络设备丢弃,提高报文转发的可靠性。
在一种可能的设计中,外层报文头还可以包括第一标识,第一标识可以被所述第二转发路径上的设备用于确定不需要处理所述第二报文包含的扩展报文头。由于第一标识用于触发所述第二转发路径上的设备根据第一标识确定不需要解析第二报文包含的扩展报文头,从而避免第二转发路径上的网络设备解析第二报文中第一报文所包括的扩展报文头,避免第二报文被丢弃。
在一种可能的设计中,第一标识通过第二报文的外层报文头中下一报文头(Next Header)字段携带。第二转发路径上的设备根据外层报文头中包含的Next Header字段确定不需要解析第二报文包含的扩展报文头。例如,Next Header字段的取值41,表示第二报文的外层报文头内封装的为IPv6报文,也就是说第二报文包含的扩展报文头作为净荷信息不需要被网络设备处理。
在一种可能的设计中,转发表项是第一设备根据第二设备发送的通告消息生成的。其中,第二设备可以是网络系统中除第一设备以外的其他网络设备,也可以是控制设备,通告消息可以包括流规范(Flow Specification,Flowspec)字段,通告消息的FlowSpec字段可以包括匹配项和动作项。相应地,第一设备根据通告消息生成转发表项。
在一种可能的设计中,上述扩展报文头可以包括IPv6扩展报文头、多协议标签交换(Multi-Protocol Label Switching,MPLS)扩展头和包括IPv4选项字段的IPv4报文头中的任意一种或多种。可选地,所述MPLS扩展头又可以被称为MPLS辅助信息(MPLS Ancillary  Data)。
第二方面,本申请提供了一种报文处理的方法,该方法可以应用于第二设备,第二设备可以是用于对网络系统中网络设备进行控制的控制设备,例如可以是控制器等设备。具体地,所述报文处理的方法包括:第二设备生成通告消息,通告消息包括匹配项和动作项。其中,匹配项可以包括一个或多个扩展报文头的标识,动作项用于控制网络设备对报文进行处理。接着,第二设备向第一设备发送通告消息。在接收到通告消息之后,第一设备可以根据通告消息所包括的动作项,对包括与匹配项相匹配的扩展报文头的报文进行处理,从而提供了一种灵活控制携带有扩展报文头的报文的处理方式。例如,可以通过指定路径转发携带有扩展报文头的报文,指定路径上的设备都具有处理报文扩展头的能力,这样可以避免第一报文转发到不具有处理扩展报文头的网络设备,从而避免了第一报文被丢弃,提高了报文转发的可靠性与灵活性。
在一种可能的设计中,通告消息用于第一设备生成转发表项,该转发表项包括匹配项和动作项之间的对应关系。
在一种可能的设计中,上述通告消息是边界网关协议(Border Gateway Protocol,BGP)更新(BGP Update)消息。那么匹配项可以被携带在通告消息的BGP Flowspec对应的网络层可达性信息(Network Layer Reachability Information,NLRI)字段中。
在一种可能的设计中,如果通告消息为BGP Update消息,动作项可以被携带在通告消息NLRI字段或路由属性信息字段中。可选地,动作项可以被携带在通告消息的IPv6地址相关的扩展团体属性(extended community)字段或宽团体属性(wide community)字段中。
在一种可能的设计中,第二设备控制的网络系统中各个网络设备基于路径计算单元通信协议(Path Computation Element Communication Protocol,PCEP)连接。那么通告消息可以是路径计算发起(Path Computation Initiate,PCInitiate)消息、路径计算更新(Path Computation Update,PCUpd)消息和路径计算回复(Path Computation Reply,PCRep)消息中的任意一种消息。
在一种可能的设计中,如果网络系统中各个网络设备基于PCEP连接,上述匹配项可以被携带在通告消息的流过滤类型长度值(Flow Filter Type-length-value,Flow Filter TLV)字段中。
在一种可能的设计中,匹配项所包括的扩展报文头可以包括IPv6扩展报文头MPLS扩展头和包括IPv4选项字段的IPv4报文头中的任意一种或多种。可选地,所述MPLS扩展头又可以被称为MPLS Ancillary Data。
第三方面,本申请提供了一种报文处理的方法,该方法应用于第一设备,第一设备是用于转发数据报文的网络设备,例如可以是路由器或交换机等设备。具体地,所述报文处理的方法包括:第一设备获取通告消息,通告消息可以包括匹配项和动作项,匹配项可以包括一个或多个扩展报文头的标识,动作项可以用于指示第一设备对包括与匹配项相匹配的扩展报文头的报文进行处理。接着,第一设备根据通告消息生成转发表项,转发表项可以包括动作项和匹配项之间的对应关系。这样,在接收到报文之后,第一设备可以根据转发表项判断报文是否包括与匹配项相匹配的扩展报文头。若包括,第一设备根据动作项对 报文进行处理。这样,如果第一报文所包括的扩展报文头的标识与匹配项相匹配,则根据转发表项的动作项对报文进行处理,从而提供了一种灵活控制携带有扩展报文头的报文的处理方式。
在一种可能的设计中,通告消息是第二设备发送的。第二设备可以是控制器等控制设备,也可以是网络系统中其他网络设备。
在一种可能的设计中,上述通告消息是BGP Update消息。那么匹配项可以被携带在通告消息的BGP Flowspec对应的NLRI字段中。
在一种可能的设计中,如果通告消息为BGP Update消息,动作项可以被携带在通告消息的NLRI字段或路由属性信息字段中。可选地,动作项可以被携带在通告消息的IPv6地址相关扩展团体属性字段或宽团体属性字段中。
在一种可能的设计中,第二设备控制的网络系统中各个网络设备基于PCEP连接。那么通告消息可以是PCInitiate消息、PCUpd消息和PCRep消息中的任意一种消息。
在一种可能的设计中,如果网络系统中各个网络设备基于PCEP连接,上述匹配项可以被携带在通告消息的Flow Filter TLV字段中。
在一种可能的设计中,匹配项所包括的扩展报文头可以包括IPv6扩展报文头、MPLS扩展头和包括IPv4选项字段的IPv4报文头中的任意一种或多种。可选地,所述MPLS扩展头又可以被称为MPLS Ancillary Data。
第四方面,本申请提供了一种报文处理的装置,所述装置应用于第一设备,第一设备用于执行第一方面、第一方面的任意一种可能、第三方面或第三方面的任意一种可能的设计中的方法。具体地,该第一网络设备包括用于执行第一方面或第一方面的任意一种可能的设计中的方法的单元;或,该第一网络设备包括用于执行第三方面或第三方面的任意一种可能的设计中的方法的单元。
第五方面,本申请提供了一种报文处理的装置,所述装置应用于第二设备,第二设备用于执行第二方面或第二方面的任意一种可能的设计中的方法。具体地,该第一网络设备包括用于执行第二方面或第二方面的任意一种可能的设计中的方法的单元。
第六方面,本申请提供了一种报文处理的系统,所述报文处理的系统包括第一设备和第二设备,所述第一设备用于执行第一方面、第一方面的任意一种可能、第三方面或第三方面的任意一种可能的设计中的方法,所述第二设备用于执行第二方面或第二方面的任意一种可能的设计中的方法。
第七方面,本申请提供了一种第一设备,所述第一设备包括处理器和存储器,所述存储器用于存储指令或程序代码,所述处理器用于从存储器中调用并运行所述指令或程序代码,以执行如前述第一方面或第三方面所述的报文处理的方法。
第八方面,本申请提供了一种第二设备,所述第二设备包括处理器和存储器,所述存储器用于存储指令或程序代码,所述处理器用于从存储器中调用并运行所述指令或程序代码,以执行如前述第二方面所述的报文处理的方法。
第九方面,本申请提供了一种芯片,包括存储器和处理器,存储器用于存储指令或程序代码,处理器用于从存储器中调用并运行该指令或程序代码,以执行如前述第一方面、 第二方面或第三方面所述的报文处理的方法。
第十方面,本申请实施例提供了一种计算机可读存储介质,包括指令、程序或代码,当其在计算机上执行时,使得所述计算机执行如前述第一方面、第二方面或第三方面所述的报文处理的方法。
附图说明
图1-A为本申请实施例提供的网络系统的一种网络结构图;
图1-B为本申请实施例提供的网络系统的另一种网络结构图;
图1-C为本申请实施例提供的报文处理的方法的一种应用场景示意图;
图1-D为本申请实施例提供的报文处理的方法的另一种应用场景示意图;
图1-E为本申请实施例提供的报文处理的方法的又一种应用场景示意图;
图2为本申请实施例提供的报文处理的方法的一种信令交互图;
图3为本申请实施例提供的NLRI字段的一种可能的格式示意图;
图4为本申请实施例提供的报文处理的装置400的一种结构示意图;
图5为本申请实施例提供的报文处理的装置500的一种结构示意图;
图6为本申请实施例提供的报文处理的装置600的一种结构示意图;
图7为本申请实施例提供的一种设备700的结构示意图;
图8为本申请实施例提供的一种设备800的结构示意图。
具体实施方式
下面结合附图对传统技术、本申请实施例提供的报文处理的方法、装置及系统进行介绍。
在IPv6技术中,一个IPv6报文可以包括一个或多个扩展报文头,每个扩展报文头可以用于携带额外的转发信息,以指导IPv6报文的转发路径上的网络设备执行对应的转发操作。扩展报文头可以被携带在IPv6报文的基本报文头(basic IPv6 header)和上层协议数据单元之间。其中,上层协议数据单元包括IPv6报文中载荷(payload)部分。基本报文头和扩展报文头中可以包括下一报文头(Next Header)字段,用于指示报文头的下一个报文头的类型。例如,假设一个IPv6报文包括N个扩展报文头。那么这个IPv6报文的基本报文头的Next Header字段可以用于指示该IPv6报文的第一个扩展报文头的类型;IPv6报文的第i个扩展报文头的Next Header字段可以用于指示IPv6报文的第i+1个扩展报文头的类型,其中i为小于N的正整数;IPv6报文的第N个扩展报文头的Next Header字段可以用于指示IPv6报文第N个扩展报文头的下一部分为上层协议数据单元。这样,一条IPv6报文理论上可以携带任意数量个扩展报文头,支持多种不同的转发操作。
可选地,为了执行扩展报文头对应的操作,可以在网络设备上配置处理扩展报文头的能力,以使网络设备能够处理包括扩展报文头的报文。但是,网络系统中各个网络设备对扩展报文头的支持能力可能不同。例如,网络系统中可能存在一部分网络设备具有处理扩展报文头的能力,而另一部分网络设备可能不具有处理扩展报文头的能力。这样,包括扩展报文头的报文在转发的过程中,可能被不具有处理扩展报文头的能力的网络设备丢弃,导致业务报文出现丢包。可以理解的是,网络设备不具有处理扩展报文头的能力,可以包 括网络设备不具有处理特定的扩展报文头的能力,也可以包括网络设备不具有处理任意扩展报文头的能力。
进一步地,在传统的IPv6技术中,不同网络设备对相同的扩展报文头的处理能力是固定的。也就是说,不同网络设备对于具有同一扩展报文头的报文的处理方法是统一的,无法灵活地对扩展报文头进行处理。
结合说明书附图进行说明。参见图1-A,该图为本申请实施例提供一种网络架构图。在图1-A中,网络系统包括设备111、设备112、网络设备121、网络设备122、网络设备123、网络设备124、网络设备125和网络设备126。其中,网络设备121分别与设备111、网络设备122和网络设备124连接,网络设备123分别与设备112、网络设备122和网络设备126连接,设备112分别与网络设备123和网络设备126连接。通过网络系统之间各个网络设备的转发,设备111可以向设备112发送数据报文。具体地,网络设备121可以通过网络接口(Interface)A1与网络设备122连接,通过网络接口A2与网络设备124连接。
假设图1-A中网络设备121和网络设备123具有处理扩展报文头M的能力,网络设备122不具有处理扩展报文头M的能力。那么,如果设备111向设备112发送包括扩展报文头的报文,且该报文通过转发路径“网络设备121→网络设备122→网络设备123”传输。在报文的传输过程中,网络设备121可以处理该报文,并通过网络接口A1向网络设备122发送该报文。如果报文的扩展报文头包括扩展报文头M,由于网络设备122不具有处理扩展报文头M的能力,网络设备122无法对该报文进行处理,无法继续转发报文,从而将该报文丢弃,降低报文转发的可靠性。
前述例子以基于IPv6的网络系统为例进行说明。可以理解的是,在其他的报文包括扩展报文头的应用场景中,同样存在上述问题。例如,在基于多协议标签交换(Multi-Protocol Label Switching,MPLS)协议的网络系统中,同样可能存在因网络设备解析MPLS扩展头的能力不同导致的上述问题。在基于IPv4的网络系统中,如果报文的IPv4报文头包括选项(Option)字段,且Option字段不同的取值可以对应不同类型的IPv4报文头,那么IPv4网络系统同样存在上述问题。也就是说,本申请实施例提及的扩展报文头可以指IPv6协议的扩展报文头,也可以指MPLS扩展头或IPv4 Option报文头。可选地,所述MPLS扩展头又可以被称为MPLS辅助信息(MPLS Ancillary Data)。
本申请实施例提供了一种报文处理的方法、装置和系统,旨在灵活的控制带有扩展报文头的报文的处理,从而提高报文转发的可靠性与灵活性。
本申请实施例提供的报文处理的方法可以应用于图1-A所示的网络。具体地,所述报文处理的方法可以由图1-A所示实施例中网络设备121、网络设备122、网络设备123、网络设备124、网络设备125和网络设备126中任意一个或多个网络设备执行。
在本申请实施例中,设备111和设备112可以是终端设备,也可以是服务器或数据库等设备。其中,终端设备可以称为用户设备(User Equipment,UE)、移动台(Mobile Station,MS)、移动终端(Mobile Terminal,MT)或终端等。终端设备是一种向用户提供语音和/或数据连通性的设备,或,设置于该设备内的芯片。例如,终端设备可以是具有无线连接 功能的手持式设备、车载设备等。终端设备可以为手机、台式电脑、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(Mobile Internet Device,MID)、可穿戴设备、虚拟现实(Virtual Reality,VR)设备、增强现实(Augmented Reality,AR)设备、工业控制(Industrial Control)中的无线终端或有线终端、无人驾驶(Self Driving)中的无线终端、远程手术(Remote Medical Surgery)中的无线终端、智能电网(Smart Grid)中的无线终端、运输安全(Transportation Safety)中的无线终端、智慧城市(Smart City)中的无线终端、智慧家庭(Smart Home)中的无线终端或支持5G接入的家庭网关设备(5G→Residential Gateway,5G→RG)等。
所述网络设备可以是具有转发功能的设备,比如:路由器(Router)或交换机(Switch)等转发设备,还可以是服务器或者终端设备等具有转发功能的设备。可选地,网络设备可以是部署在网络边缘的运营商边缘(Provider Edge,PE)设备,例如可以是图1-A中的网络设备121、网络设备123或网络设备126;也可以是部署在网络内部的运营商(Provider,P)设备,例如可以是图1-A中的网络设备122、网络设备124或网络设备125。
可以理解的是,所述报文处理的方法中对报文进行处理的部分可以由网络设备的转发面执行,例如可以由网络设备的转发芯片执行。所述报文处理的方法中生成转发表项的部分可以由网络设备的控制面执行,例如可以由网络设备的处理器执行。所述处理器可以是由网络设备的中央处理器(Central Processing Unit,CPU)。可选地,在一些其他可能的实现方式中,所述数据处理方法还可以由独立的控制面设备执行。例如,在虚拟化网络功能(Virtualized Network Function,VNF)等应用场景中,下文所述的转发表项可以由作为控制面设备的服务器或控制器生成,并向作为转发面设备的网络设备发送,以便网络设备根据转发表项处理报文。
本申请实施例提供的报文处理的方法中生成并发送通告消息的部分可以由控制设备执行。控制设备可以用于对网络系统中的一个或多个网络设备进行控制。所述控制设备可以为服务器或其他具有数据处理能力的计算机设备。例如,本申请实施例提供的报文处理方法可以由图1-B所示的控制设备130。其中,图1-B所示的控制设备130可以分别与网络设备121、网络设备122、网络设备123、网络设备124、网络设备125和网络设备126连接。可选地,所示控制设备可以是服务器或控制器。
下面结合图2对本申请实施例提供的技术方案进行介绍。参见图2,该图为本申请实施例提供的报文处理的方法的一种信令交互图,具体包括以下步骤S201-S205。
S201:第一设备接收第二设备发送的通告消息。
在本申请实施例中,第一设备可以是网络设备。第二设备可以是控制设备,例如可以是用于对一个或多个网络设备进行控制的服务器或控制器。或者,第二设备也可以是网络设备。具体地,第一设备可以是网络系统中用于转发数据报文的网络设备,例如可以是图1-A或图1-B中网络设备121、网络设备122、网络设备123、网络设备124、网络设备125和网络设备126中的任意一个或多个。第二设备可以是图1-A除所述第一设备以外的任意一个网络设备,也可以是图1-B中的控制设备130。该通告消息可以包括匹配(match)项 和动作(action)项。下面分别对匹配项和动作项进行介绍。
首先对匹配项进行介绍。
匹配项用于判断待处理的报文包含的扩展报文头是否与匹配条件匹配。包括与所述匹配项相匹配的扩展报文头的报文被称为满足匹配项的报文。在本申请实施例中,扩展报文头是指报文中除了最外层的报文头以外的包含可选扩展信息的报文头。根据前文介绍可知,扩展报文头可以包括IPv6扩展报文头、MPLS扩展头和包括IPv4option的IPv4报文头中的任意一种或多种。为便于说明,后续以扩展报文头为IPv6扩展报文头为例进行说明。
其中,IPv6扩展报文头可以包括逐跳选项扩展报文头(Hop-by-Hop Options Header,HBH)、路由扩展报文头(Routing Header,RH)、目的选项扩展报文头(Destination Options Header,DOH)和段路由扩展报文头(Segment Routing Header,SRH)等扩展报文头中的任意一种或多种。
在本申请实施例中,匹配项可以用于匹配报文所包括的扩展报文头的类型,也可以用于匹配报文所包括的扩展报文头中特定字段和/或特定字段的取值。下面分别进行介绍。
首先介绍匹配项用于匹配报文所包括的扩展报文头的类型的情况。具体地,匹配项可以包括第一报文头信息集合,第一报文头信息集合包括一个或多个扩展报文头的标识。可选地,扩展报文头的标识例如可以是目标报文头的协议号。例如,如果第一报文头信息集合包括HBH的标识和DOH的标识,那么第一报文头信息集合包括HBH的类型号0,以及DOH的类型号60。
此外,匹配项还可以包括匹配条件,由于判断待处理的报文所包括的扩展报文头与第一报文头信息集合所对应的扩展报文头之间的对应关系。也就是说,如果待处理的报文满足匹配项,第一报文头信息集合与待处理的报文包括的第二报文头信息集合之间要满足匹配条件。在本申请实施例中,匹配条件可以包括覆盖匹配条件、可选匹配条件和排除匹配条件三种匹配条件。下面分别进行介绍。
在第一种可能的实现方式中,匹配条件为覆盖匹配条件。如果第二报文头信息集合与第一报文头信息集合之间满足覆盖匹配条件,则第二报文头信息集合包括第一报文头信息集合中所有扩展报文头的标识,即第一报文头信息集合是第二报文头信息集合的子集。也就是说,如果报文满足匹配条件为覆盖匹配条件的匹配项,那么该报文包括第一报文头信息集合对应的每个扩展报文头。
相应地,如果匹配项对应的匹配条件为覆盖匹配条件,在判断报文是否满足匹配项的过程中,第一设备可以判断该报文是否包括第一报文头信息集合对应的一个或多个扩展报文头中每个扩展报文头。若是,第一设备确定该报文满足匹配项。
在第二种可能的实现方式中,匹配条件为可选匹配条件。如果第二报文头信息集合与第一报文头信息集合之间满足可选匹配条件,则第二报文头信息集合包括第一报文头信息集合中任意一个或多个扩展报文头的标识,即第一报文头信息集合和第二报文头信息集合之间存在交集。也就是说,如果报文满足匹配条件为可选匹配条件的匹配项,那么该报文包括第一报文头信息集合对应的任意一个或多个扩展报文头。
相应地,如果匹配项对应的匹配条件为可选匹配条件,在判断报文是否满足匹配项的 过程中,第一设备可以判断该报文是否包括第一报文头信息集合中任意一个或多个扩展报文头。若是,第一设备确定该报文满足匹配项。
在第三种可能的实现方式中,匹配条件为排除匹配条件。如果第二报文头信息集合与第一报文头信息集合之间满足排除匹配条件,则第二报文头信息集合不包括第一报文头信息集合中任意一个扩展报文头的标识,即第一报文头信息集合和第二报文头信息集合之间不存在交集。也就是说,如果报文满足匹配条件为排除匹配条件的匹配项,那么该报文不包括第一报文头信息集合对应的任意一个扩展报文头。
相应地,如果匹配项对应的匹配条件为排除匹配条件,在判断报文是否满足匹配项的过程中,第一设备可以判断该报文是否包括第一报文头信息集合中任意一个或多个扩展报文头。若否,第一设备确定该报文满足匹配项。
可以理解的是,匹配项对应的匹配条件可以包括上述三种匹配条件中的任意一种或多种,且排除匹配条件和可选匹配条件不对应同一匹配项。
在上述三种可能的实现方式中,如果上述技术方案基于FlowSpec技术实现,那么匹配项在通告消息中可以是一种新定义的匹配类型(Component)。可选地,匹配项对应的匹配类型可以被称为扩展头(Extension_Headers)类型。匹配项可以通过“<Type,Length,match_op,[value]+>”的格式描述。其中,类型(Type)表示新定义Extension_Headers这一component的类型号;长度(Length)表示匹配项的总长度;匹配规则(match_op)表示匹配项对应的匹配条件,可以包括可选匹配条件(match-any)、覆盖匹配条件(match-all)和排除匹配条件(exclude)中的任意一种;值(value)表示匹配项对应的扩展报文头的标识,一条匹配项可以包括一个或多个value。可选地,上述匹配项也可以通过<type,(length),[numeric_op,value]+>的格式表示,其中numeric_op的作用与match_op的作用相同或相似。
上面介绍了匹配条件用于匹配报文所包括的扩展报文头的类型的场景。下面介绍匹配项用于匹配报文所包括的扩展报文头中特定字段或特定字段的取值的场景。
具体地,第一报文头信息集合包括第一扩展报文头的标识和第一字段的标识。例如,第一报文头信息集合可以包括第一扩展报文头的标识和第一字段的标识之间的对应关系,表示满足匹配项的报文包括第一扩展报文头,且第一扩展报文头中包括第一字段。相应地,对于满足匹配项的报文,其对应的第二报文头信息集合也包括第一扩展报文头的标识和第一字段的标识。可以理解的是,如果第一报文头信息集合包括第一报文头的标识第一字段的标识之间的对应关系,那么第一报文头信息集合对应的匹配条件可以是前述覆盖匹配条件或可选匹配条件。也就是说,与匹配项相匹配的报文,包括第一扩展报文头,且第一扩展报文头中进一步包括第一字段。在判断报文是否为满足匹配项的报文的过程中,可以先判断报文是否包括第一扩展报文头。如果报文包括第一扩展报文头,可以进一步判断报文的第一扩展报文头是否包括第一字段。若包括,第一设备确定该报文为满足匹配项的报文。可选地,所述第一字段例如可以是扩展报文头中的选项(Option)字段。
在上述实现方式中,匹配项用于匹配报文所包括的报文头的类型,以及报文头中具体字段。在一些其他的实现方式中,匹配项还可以进一步用于匹配报文的报文头中具体字段的取值。
具体地,第一报文头信息集合包括第二扩展报文头的标识、第二字段的标识和第一值。例如,第一报文头信息集合可以包括第二扩展报文头的标识、第二字段的标识和第一值之间的对应关系,表示满足匹配项的报文包括第二扩展报文头,且报文的第二扩展报文头中包括取值为第一值的第二字段。相应地,对于满足匹配项的报文,其对应的第二报文头信息集合也包括第二扩展报文头的标识、第二字段的标识和第一值之间的对应关系。也就是说,与匹配项相匹配的报文,包括第二扩展报文头,且第二扩展报文头中第二字段的取值为第一值。
如果上述技术方案基于FlowSpec技术实现,那么匹配项可以是一种新定义的匹配类型(Component)。可选地,匹配项对应的匹配类型可以被称为扩展头选项(Extension_Header_Options)类型。匹配项可以通过“<Type,Length,option_type,option_value>”的格式描述。其中,类型(Type)表示新定义Extension_Header_Options s这一component的类型号;长度(Length)表示匹配项的总长度;选项类型(option_type)表示匹配项对应的字段取值或Option的类型;选项值(option_value)表示匹配项对应的字段或选项的取值。判断报文是否为满足匹配项的报文的过程中,先判断报文是否包括第二扩展报文头。如果报文包括第二扩展报文头,可以继续判断报文的第二扩展报文头是否包括第二字段。若包括,可以进一步判断报文的第二扩展报文头中第二字段的取值是否为第一值。若是,可以确定报文为满足匹配项的报文。可以理解的是,如果第一报文头信息集合包括第二报文头的标识、第二字段的标识和第一值之间的对应关系,那么第一报文头信息集合对应的匹配条件可以是前述覆盖匹配条件或可选匹配条件。
上面对匹配项进行了介绍。下面对动作项进行介绍。
在本申请实施例中,动作项用于指示第一设备对包括与匹配项相匹配的扩展报文头的报文进行处理。也就是说,如果报文包括的扩展报文头与匹配项相匹配,说明该报文包括特定的扩展报文头,那么第一设备可以根据动作项对报文采用特定的处理方式进行处理。这样,通过调整匹配项和动作项,可以灵活地控制对携带有扩展报文头的报文的处理,提高报文处理的灵活性。
举例说明。根据前文介绍可知,网络系统中不同的网络设备对扩展报文头的处理能力可能不同,导致包括某扩展报文头的报文在被不具有处理该扩展报文头的网络设备处理的过程中被丢弃。因此,为了提高报文转发的可靠性,可以避免不具有处理某扩展报文头的网络设备接收到包括该扩展报文头的报文。当网络中存在无法处理该报文的网络设备,如果报文的转发路径上包含不能正确处理报文包含的扩展报文头的设备,报文可能在转发过程中被丢弃。为此,第一设备可以通过动作项控制报文的转发路径,避免报文在转发过程中被丢弃,提升报文转发的可靠性。
关于对动作项的详细介绍可以参见下文,这里不再赘述。
上面介绍了通告消息包括的匹配项和动作项,下面介绍通告消息携带匹配项和动作项的方式。
在本申请实施例中,通告消息是第二设备向第一设备发送的。具体地,第二设备可以基于BGP向第一设备发送通告消息,也可以基于PCEP向第一设备发送通告消息。下面分 别进行介绍。
在第一种可能的实现方式中,第二设备基于BGP向第一设备发送通告消息,那么通告消息是BGP Update)消息。本申请实施例提供的技术方案可以在BGP Flowspec技术的基础上实现。
具体地,前述匹配项可以被携带在通告消息的NLRI字段中。所述NLRI字段可以被携带在通告消息的BGP FlowSpec地址族(Address Family)对应的NLRI信息中。例如,通告消息的BGP FlowSpec地址族的NLRI信息可以包括多协议扩展可达NLRI(Multi-Protocol Reachable NLRI,MP_REACH_NLRI)字段,该MP_REACH_NLRI可以进一步包括NLRI字段,用于携带匹配项。可选地,MP_REACH_NLRI字段的格式可以如图3所示。MP_REACH_NLRI字段可以包括AF信息字段、下一跳网络地址信息(Next Hop Network Address Information)字段和NLRI字段。在一个示例中,AF信息字段占3个八位字节,即24比特(bit)。前述匹配项可以被携带在NLRI字段中。
相应地,前述动作项可以作为一种新的BGP路由属性,被携带在通告消息的路由属性信息字段或NLRI字段中。例如,动作项可以作为新的BGP的IPv6地址相关的扩展团体(Extended Community)属性或宽团体(Wide Community)属性,被携带在通告消息的IPv6地址相关扩展团体属性字段或宽团体属性字段中。其中,扩展团体属性和宽团体属性属于路由属性,即携带动作项的IPv6地址相关扩展团体属性字段或宽团体属性字段可以是BGP路由属性信息中的一种。也就是说,动作项可以被携带在通告报文的BGP路由属性信息字段的IPv6地址相关扩展团体属性字段中。
在第二种可能的实现方式中,第二设备基于PCEP向第一设备发送通告消息。那么通告消息可以是PCInitiate消息、PCUpd消息和PCRep消息中的任意一种消息。相应地,前述匹配项可以被携带在通告消息的流规范对象(Flowspec Object)信息中。具体地,通告消息的Flowspec Object信息可以包括流过滤类型长度值(Flow Filter TLV)字段。该Flow Filter TLV字段可以包括一个或多个TLV字段,用于携带BGP flowspec的匹配规则。
举例说明。通告消息的Flow Filter TLV字段可以包括扩展头TLV(Extension_Headers TLV)字段,和/或,扩展头选项TLV(Extension_Header_options TLV)。Extension_Headers TLV字段和Extension_Header_options TLV字段用于携带前述匹配项。具体地,如果匹配项包括第一报文头信息集合和匹配条件,那么匹配项可以被携带在Extension_Headers TLV字段中;如果匹配项的第一报文头信息集合还包括第一报文头的标识和第一字段的标识,那么匹配项可以被携带在Extension_Header_options TLV字段中。
在一些其他可能的实现方式中,第二设备也可以通过网络配置(Network Configuration,NETCONF)协议向第一设备发送通告消息。相应地,如果第二设备通过NETCONF协议以YANG模型定义的格式向第一设备发送通告消息,那么第二设备发送的通告消息可以是NETCONF消息。
可以理解的是,一条通告消息中可以包括一个匹配项和一个动作项,也可以包括多个匹配项和/或多个动作项。如果第一设备接收到的通告消息中包括多个匹配项和多个动作项,第一设备可以生成多条转发表项。其中,多条转发表项中每条转发表项可以对应一个 匹配项和一个动作项。或者,如果多个匹配项和一个动作项对应,第一设备也可以生成一条转发表项,该转发表项中包括所述多个匹配项和所述一个动作项之间的对应关系。
S202:第一设备根据通告消息生成转发表项。
在接收到第二设备发送的通告消息之后,第一设备可以根据通告消息生成转发表项。其中,转发表项包括匹配项和动作项之间的对应关系,用于指示第一设备根据动作项处理满足匹配项的报文。可选地,所述转发表项可以是访问控制列表(Access Control List,ACL)表项或转发信息库(Forwarding Information Base,FIB)表项。
上面介绍了第二设备在第一设备上配置转发表项的方式,下面介绍第一设备基于转发表项处理报文的方法。
S203:第一设备接收第三设备发送的第一报文。
在本申请实施例中,第一设备可以是网络系统中用于转发数据报文的网络设备,第三设备可以是与第一设备直接连接的设备。第一报文可以是IPv6报文,也可以是MPLS报文或IPv4报文。为了便于理解,下文以第一报文为IPv6报文为例进行说明。
如果第一设备为PE设备,第三设备可以是生成第一报文的终端设备,例如可以是计算机或服务器;如果第一设备为P设备,第三设备可以是第一报文的转发路径上第一设备的上一跳网络设备。
可以理解的是,由于第一设备为用于对第一报文进行处理的网络设备,为了避免第一报文被第一设备丢弃,可以在第一设备上配置处理多种扩展报文头的能力。这样,在接收到第一报文之后,第一设备可以处理第一报文所包括的扩展报文头。第一报文不会因第一设备不具有处理扩展报文头的能力被丢弃。
S204:第一设备判断第一报文是否包括与匹配项相匹配的扩展报文头。
在接收到第一报文之后,第一设备判断第一报文是否满足匹配项,即判断第一报文是否包括与匹配项相匹配的报文头。如果第一报文不满足匹配项,第一设备根据第一报文的目的地址转发第一报文;如果第一报文满足匹配项,第一设备执行S205。下面介绍第一设备判断第一报文是否满足匹配项的方法。
在本申请实施例中,匹配项可以包括第一报文头信息集合,第一报文头信息集合包括一个或多个报文头的标识。那么在判断第一报文是否满足匹配项的过程中,第一设备可以先确定第一报文对应的第二报文头信息集合,再判断第一报文对应的第二报文头信息集合和第一报文头信息集合之间是否满足匹配条件。如果第一报文对应的第二报文头信息集合和第一报文头信息集合之间不满足匹配条件,第一设备确定第一报文不满足匹配项;如果第一报文对应的第二报文头信息集合和第一报文头信息集合之间满足匹配条件,第一设备可以确定第一报文满足匹配项。
根据前文介绍可知,匹配条件可以包括覆盖匹配条件、可选匹配条件和排除匹配条件中的任意一种。下面分别进行介绍。
在第一种可能的实现方式中,匹配条件为覆盖匹配条件,第一设备可以判断第一报文是否包括第一报文头信息集合对应的一个或多个扩展报文头中每个扩展报文头。如果第一报文包括第一报文头信息集合对应的一个或多个扩展报文头中每个扩展报文头,第一设备 确定第一报文满足匹配条件。
举例说明。如果第一报文头信息集合中包括HBH的标识、DOH的标识和RH的标识,且匹配条件为覆盖匹配条件,那么第一设备可以判断第一报文是否同时包括HBH、DOH和RH三种扩展报文头。如果第一报文不包括HBH、DOH和RH三种扩展报文头中的任意一种,第一设备确定第一报文不满足匹配项;如果第一报文同时包括HBH、DOH和RH三种扩展报文头,第一设备确定第二设备满足匹配条件。
在第二种可能的实现方式中,匹配条件为可选匹配条件,第一设备可以判断第一报文是否包括第一报文头信息集合对应的任意一个扩展报文头。如果第一报文包括第一报文头信息集合对应的任意一个扩展报文头,第一设备确定第一报文满足匹配条件。
举例说明。如果第一报文头信息集合中包括HBH的标识、DOH的标识和RH的标识,且匹配条件为可选匹配条件,那么第一设备可以判断第一报文是否包括HBH、DOH和RH三种扩展报文头中的任意一种或多种。如果第一报文包括HBH、DOH和RH三种扩展报文头中的任意一种,第一设备确定第二设备满足匹配项。如果第一报文不包括HBH、DOH和RH三种扩展报文头中的任意一种,第一设备确定第二设备不满足匹配项。
在第三种可能的实现方式中,匹配条件为排除匹配条件,第一设备可以判断第一报文是否包括第一报文头信息集合对应的任意一个扩展报文头。如果第一报文包括第一报文头信息集合对应的任意一个扩展报文头,第一设备确定第一报文不满足匹配条件。
举例说明。如果第一报文头信息集合中包括HBH的标识、DOH的标识和RH的标识,且匹配条件为排除匹配条件,那么第一设备可以判断第一报文是否包括HBH、DOH和RH三种扩展报文头中的任意一种或多种。如果第一报文包括HBH、DOH和RH三种扩展报文头中的任意一种,第一设备确定第二设备不满足匹配项。如果第一报文不包括HBH、DOH和RH三种扩展报文头中的任意一种,第一设备确定第二设备满足匹配项。
在一些可能的实现方式中,通过调整扩展报文头中的部分字段的值,可以使得同一Type的扩展报文头的实现不同的用途。也就是说,如果两个扩展报文头的Type相同,但是扩展报文头中字段的取值不同,这两个扩展报文头可能对应不同的转发行为。相应地,对这两个扩展报文头的处理方式也可能存在区别。也就是说,对于同一类型的扩展报文头,如果扩展报文头中字段的取值不同,所需的处理能力也可能不同。
举例说明。RH类型的扩展报文头包括路由类型(Routing Type)字段。RH的Routing Type字段的取值不同,RH的作用可能不同。例如,如果扩展报文头中Routing Type字段的值为4,那么该扩展报文头属于SRH类型的扩展报文头。显然,处理Routing Type字段取值为1,2,3,5等的RH类型的扩展报文头的方法和处理SRH类型的扩展报文头的方法不同,所需的处理能力也不同。
因此,为了进一步确定网络设备对扩展报文头的处理能力,匹配项还可以包括扩展报文头中字段的信息。为了解决上述问题,根据前文介绍可知,第一报文头信息集合可以包括第一报文头的标识和第一字段的标识,也可以包括第二报文头的标识、第二字段的标识和第一值。
如果第一报文头信息集合包括第一报文头的标识和第一字段的标识,在判断第一报文 是否满足匹配项的过程中,第一设备可以判断第一报文是否包括第一报文头。如果第一报文不包括第一报文头,第一设备确定第一报文不满足匹配项。如果第一报文包括第一报文头,第一设备可以进一步判断第一报文的第一报文头中是否包括第一字段。如果第一报文的第一报文头中不包括第一字段,第一设备确定第一报文不满足匹配项。如果第一报文的第一报文头中包括第一字段,第一设备确定第一报文满足匹配项。
如果第一报文头信息集合包括第二报文头的标识、第二字段的标识和第一值,在判断第一报文是否满足匹配项的过程中,第一设备可以先判断第一报文是否包括第二报文头。如果第一报文包括第二报文头,第一设备继续可以判断第二报文头是否包括第二字段。如果第一报文的第二报文头包括第二字段,第一设备可以进一步判断第二字段的值是否为第一值。如果第一报文不包括第二报文头,或,第一报文的第二报文头不包括第二字段,或,第一报文的第二报文头的第二字段的值不为第一值,第一设备确定第一报文不满足匹配项。如果第一报文的第二报文头中第二字段的值为第一值,第一设备确定第一报文满足匹配项。
S205:响应于第一报文包括与匹配项相匹配的扩展报文头,第一设备根据动作项对第一报文进行处理。
可选地,在确定第一报文满足匹配项之后,第一设备可以根据动作项对第一报文进行处理。在本申请实施例中,动作项用于避免不具有处理与匹配项相匹配的报文的扩展报文头的能力的网络设备处理第一报文。这样,在后续转发第一报文的过程中,第一报文的转发路径上各个网络设备能够正确处理第一报文,提升了报文转发的可靠性。如此,通过具有处理第一报文的扩展报文头的能力的网络设备转发数据报文,减少了报文被丢弃的概率,提供了报文转发的可靠性。
在第一种可能的实现方式中,第一设备根据动作项确定特定的转发路径,该转发路径上的网络设备能够处理第一报文所包括的扩展报文头。
具体地,第一设备可以先根据第一报文确定第一转发路径,再通过第一转发路径转发第一报文。其中,第一转发路径上任意一个网络设备具有处理第一报文所包括的扩展报文头的能力,或者,第一转发路径上指定的一个或多个网络设备具有处理第一报文所包括的扩展报文头的能力。其中,指定的一个或多个网络设备为第一转发路径上需要处理第一报文所包括的扩展报文头的网络设备。这样,第一转发路径上的网络设备不会因第一报文所包括的扩展报文头丢弃第一报文,提升了报文转发的可靠性。
以图1为例进行说明,假设网络设备122和网络设备125不具有处理SRH的能力,网络设备121、网络设备123、网络设备124和网络设备126具有处理SRH的能力。
对于设备111向设备112发送的SRv6报文K,网络设备121为报文K确定的第一转发路径为转发路径“网络设备121→网络设备124→网络设备125→网络设备126”,那么报文K对应的段标识(Segment Identifier,SID)列表(SID List)中可以包括网络设备121的SID、网络设备124的SID和网络设备126的SID。网络设备121、网络设备124和网络设备126为第一转发路径上指定的网络设备,这些指定的网络设备都具有处理第一报文所包括的扩展报文头的能力。在网络设备121接收到报文K之后,由于报文K的SID List中包括网络设备121的SID,网络设备121可以对报文K的SRH进行处理。而网络设备125 接收到报文K之后,由于报文K的SID List不包括网络设备125的SID,网络设备125无需对报文K的SRH进行处理,在转发过程中直接根据网络节点126的SID进行转发。这样,即使第一网络设备125不具有处理SRH的能力,通过调整报文K的SID List,可以避免网络设备125解析报文K的SRH,从而避免报文K被网络设备125丢弃,提升报文转发的可靠性。
下面介绍第一设备确定第一转发路径的方法。
具体地,可以先在第一设备上配置网络中各个网络设备对扩展报文头的支持情况。在接收到第一报文之后,第一设备可以根据网络设备对扩展报文头的支持情况和第一报文所包括的扩展报文头的标识,确定多个候选网络设备。其中,候选网络设备是不会因第一报文所包括的扩展报文头丢弃第一报文的网络设备,例如可以是具有处理第一报文所包括的扩展报文头的能力的网络设备。
接着,第一设备根据第一报文的目的地址以及网络系统的拓扑结构,从多个候选网络设备中确定多个目标网络设备,得到第一转发路径。其中,目标网络设备为第一转发路径上的网络设备。也就是说,在确定多个候选网络设备之后,第一设备可以从根据多个候选网络设备之间的连接关系,规划出一条从第一设备到第一报文的目的设备的转发路径。上述转发路径即为第一转发路径。
在确定第一转发路径之后,第一设备通过第一转发路径发送第一报文在本申请实施例中,第一设备通过第一转发路径发送第一报文可以包括第一设备向第一转发路径上第一设备的下一跳网络设备发送第一报文,也可以包括第一设备通过第一转发路径对应的隧道发送第一报文。也就是说,动作项可以用于指定第一报文的下一跳网络设备,也可以用于指定传输第一报文的隧道。例如:第一转发路径为SRv6路径,可以将SRv6路径对应的SID list压入所述第一报文,从而实现所述第一报文沿着所述SRv6路径转发。
需要说明的是,上述确定第一转发路径的方法可以由第一设备执行,也可以由网络系统中的控制设备执行。例如,前述第二设备或其他控制设备可以根据网络系统中各个网络设备对报文头的支持能力和连接关系确定第一转发路径,并将“通过第一转发路径发送报文”作为动作项发送给第一设备。这样,在接收到第一报文之后,第一设备可以通过第一转发路径发送第一报文,无需第一设备确定第一转发路径,节省了第一设备处理第一报文的时间,降低了报文传输的时延。
以图1-C为例进行说明。假设图1-C中网络设备121、网络设备123、网络设备124、网络设备125和网络设备126具有处理HBH的能力,网络设备122不具有处理HBH的能力。
对于设备111向设备112发送的、包括HBH的报文X,根据传统的路由策略得到的转发路径为转发路径“网络设备121→网络设备122→网络设备123”。但是由于网络设备122无法处理报文X的HBH,报文X可能被网络设备122丢弃。
为了确保报文X的正常传输,控制设备130可以向网络设备121发送通告消息。网络设备121可以根据通告消息生成转发表项。其中,转发表项的匹配项可以包括HBH的标识和可选匹配条件,转发表项的动作项包括特定转发路径的信息,如SID list为<网络设备 121的SID,网络设备124的SID,网络设备125的SID,网络设备126的SID>,或者为<网络设备124的SID,网络设备125的SID,网络设备126的SID>,这样,在接收到报文X之后,由于报文X包括HBH,网络设备121确定报文X满足匹配项,进而将SID list压入报文X,通过转发路径“网络设备121→网络设备124→网络设备125→网络设备126”发送报文X。具体地,报文X的传输路径可以如图1-C所示。
在第二种可能的实现方式中,第一设备通过对第一报文封装特定报文头来保证第一报文能够正确的转发到目的地,封装了特定报文头的第一报文转发路径可以经过不支持处理第一报文包含的扩展报文头的网络设备。
在上述实现方式中,第一转发路径为从第一设备到第一报文的目的设备的转发路径,且第一转发路径上每跳网络设备均具有处理第一报文包括的扩展报文头的能力。但是,在一些可能的应用场景中,具有处理第一报文所包括的扩展报文头的能力的网络设备的数量有限,无法组成从第一设备到目的设备的转发路径。
为了实现报文的正常传输,第一设备可以对第一报文封装特定报文头,并沿着第二转发路径发送封装后的第一报文。具体地,该特定报文头可以被称为外层报文头。外层报文头的目的地址与第一报文的目的地址相同,或者,外层报文头的目的地址为第一报文的目的设备的上N跳网络设备的地址(N为正整数),外层报文头的源地址为第一设备的地址。可选地,第二转发路径上的网络设备可以具有处理外层报文头的能力。这样,即使第二转发路径上存在不具有处理第一报文所包括的扩展报文头的能力的网络设备,通过将第一报文封装外层报文头生成第二报文,可以避免第二转发路径上的网络设备处理第一报文所包括的扩展报文头,从而确保第一报文的正常传输。在一些可能的实现方式中,上述通过第二报文发送第一报文的处理策略可以被称为IPv6外层封装(IPv6 encapsulation,IPv6_Encaps)。
可选地,第一设备可以将第一报文作为第二报文的载荷封装到第二报文中。例如,假设第二报文为IPv6报文,那么第一设备可以将第一报文携带在第二报文的上层协议数据单元中,并为第二报文头添加基本报文头作为外层报文头。
根据前文介绍可知,扩展报文头可以是IPv6扩展报文头,也可以是MPLS扩展头。相应地,如果扩展报文头为MPLS扩展头,第一设备为第一报文封装外层MPLS标签,得到第二报文。第二报文的外层MPLS标签可以标识到目的地址的一条转发路径。这样,转发第二报文的网络设备可以根据第二报文的外层MPLS标签确定第二报文的传输路径。
可选地,第一设备为第一报文封装的外层报文头还包括第一标识,第一标识用于触发第二转发路径上的设备根据第一标识确定不需要解析第二报文包含的扩展报文头。也就是说,第二转发路径上的设备可以根据第一标识的指示,不对第二报文所包括的扩展报文头进行处理,直接按照外层报文头转发该第二报文。从而避免第二转发路径上的设备因不具有处理第二报文所包括的扩展报文头的能力而丢弃第二报文。例如,第二转发路径包括第四网络设备,第四网络设备接收到第二报文后,确定第二报文包含第一标识,则根据第二报文外层报文头进行转发,不需要解析第二报文中第一报文包含的任何扩展报文头。
举例说明。如果第一报文为IPv6报文,那么第二报文的外层报文头中Next Header字 段的值可以为非扩展报文头类型的值,例如可以取41。根据RFC2473中对于IPv6扩展报文头的规定,41是为IPv6分配的类型号,表示外层报文头内封装了IPv6报文。因此,如果第一设备为第一报文封装了Next Header字段的值为41的外层报文头,那么接收第二报文的设备可以根据外层报文头中Next Header字段的值41确定外层报文头内封装了IPv6报文(即第一报文),也就是说第一报文作为第二报文的净荷,在接收第二报文的设备上不需要再进一步解析第一报文包含的扩展报文头,从而避免对第一报文进行处理,降低网络设备丢弃第二报文的概率。
在上述实现方式中,外层报文头的目的地址为第一报文的目的地址。在一些其他的实现方式中,外层报文的目的地址也可以是第一报文的目的设备的上N跳网络设备的地址。其中,N为正整数,且从第一报文的目的设备的上N跳网络设备,到第一报文的目的设备的转发路径上任一网络设备,均具有处理第一报文包括的扩展报文头的能力。
可以理解的是,在第二报文的目的设备接收到第二报文之后,第二报文的目的设备可以对第二报文进行处理,将第二报文还原为第一报文,并继续第一报文的正常传输。
以图1-D为例进行说明。假设图1-D中网络设备121、网络设备123、网络设备124和网络设备126具有处理SRH的能力,网络设备122和网络设备125不具有处理SRH的能力。
对于设备111向设备112发送的报文Y,且报文Y包括类型为SRH的扩展报文头N,那么扩展报文头N属于RH类型的扩展报文头,且扩展报文头N的路由类型(Routing Type)字段的取值为4。根据传统的路由策略,报文Y对应的转发路径为转发路径“网络设备121→网络设备122→网络设备123”。但是,由于网络设备122无法处理SRH,导致报文Y可能被网络设备122丢弃。进一步地,由于网络设备125也不具有处理SRH能力,也无法通过修改报文Y的转发路径确保报文Y的正常传输。
为了确保报文Y的正常传输,控制设备130可以向网络设备121发送通告消息。网络设备121可以根据通告消息生成转发表项。其中,转发表项的匹配项包括SRH对应的协议号43、Routing Type字段的标识和第一值4之间的对应关系,转发表项的动作项包括IPv6_Encaps。
这样,在接收到报文Y之后,由于报文Y包括类型号为43的扩展报文头N,网络设备121可以进一步判断报文Y的扩展报文头N中Routing Type字段的取值是否为第一值4。由于扩展报文头N的类型号为43,且扩展报文头N中Routing Type字段的取值为4,与匹配项相匹配,说明扩展报文头N为SRH,与匹配项相匹配。那么,网络设备121可以根据动作项为报文Y封装外层报文头,得到报文头Z。报文Z的目的地址为网络设备123的地址,报文Z的源地址为网络设备121的地址。
在得到报文Z之后,网络设备121可以根据报文Z的目的地址确定报文Z的转发路径,并通过对应的网络接口向报文Z的目的设备发送。例如,网络设备121可以确定报文Z的转发路径为转发路径“网络设备121→网络设备122→网络设备123”,进而通过网络接口A1向网络设备123发送报文Z。网络设备123在接收到报文Z之后,可以根据报文Z的上层协议数据单元得到报文Y,并向设备112发送报文Z,实现报文Z的正常传输。具体地, 报文X的传输路径可以如图1-D所示。
通过上述介绍可知,第二设备可以通过通告消息在第一设备上建立包括匹配项和动作项的转发表项,以使第一设备根据动作项处理包括与匹配项相匹配的扩展报文头的报文。也就是说,如果报文包括与匹配项相匹配的扩展报文头,那么第一设备可以根据动作项对报文进行处理。匹配项是对报文所包括的扩展报文头的匹配条件。如果报文满足匹配项,说明报文包括特定的扩展报文头,那么第一设备可以根据动作项对报文采用特定的处理方式进行处理。这样,通过调整匹配项和动作项,可以灵活地对携带有扩展报文头的报文进行处理,提高报文转发的可靠性。
可以理解的是,匹配项和动作项的作用不限于此。在一些其他可能的实现方式中,通过匹配项和动作项,可以灵活地对具有任意扩展报文头的报文进行处理。也就是说,第一设备对具有特定的扩展报文头的报文进行处理。例如,在一些可能的实现方式中,第二设备可以指示第一设备收集报文传输过程中的相关信息,或者通过特定的转发路径转发报文,从而提升报文转发的灵活性。
以图1-E为例进行说明。假设图1-E中各个网络设备均具有处理报文头M的能力,且对于设备111向设备112发送了报文P和报文Q。其中,报文P和报文Q均包括扩展报文头N,且报文P的扩展报文头N和报文Q的扩展报文头N均包括第三字段。对于报文P,其扩展报文头N中第三字段的取值为101,对于报文Q,其扩展报文头N中第三字段的取值为102。根据传统的路由策略,报文P和报文Q可以通过转发路径“网络设备121→网络设备122→网络设备123”向设备112转发。
为了降低网络设备122的压力,控制设备130可以向网络设备121发送通告消息。网络设备121可以根据通告消息生成转发表项。转发表现包括匹配项和动作项。其中,匹配项包括扩展报文头N的标识、第三字段的标识和第一值102之间的对应关系,动作项用于指示通过转发路径“网络设备121→网络设备124→网络设备125→网络设备126”转发报文。
这样,在接收到报文P和报文Q之后,由于报文P的扩展报文头N中第三字段的值为102,不满足匹配项,那么网络设备121可以通过网络接口A1向网络设备122发送报文P,以使报文P通过转发路径“网络设备121→网络设备122→网络设备123”转发。由于报文Q的扩展报文头N中第三字段的值为101,满足匹配项,那么网络设备121可以通过网络接口A2向网络设备124发送报文Q,以使报文Q通过转发路径“网络设备121→网络设备124→网络设备125→网络设备126”转发。如此,提升了报文转发的灵活性。具体地,报文X的传输路径可以如图1-E所示。
参见图4,本申请实施例还提供了一种报文处理的装置400,该报文处理的装置400可以实现图2所示实施例中第一设备的功能。该报文处理装置400包括获得单元410、接收单元420和处理单元430。其中,获得单元410用于实现图2所示实施例中的S203,接收单元420用于实现图2所示实施例中的S204,处理单元430用于实现图2所示实施例中的 S205和S206。
具体的,获得单元410,用于获得转发表项,所述转发表项包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识。
接收单元420,用于接收第一报文。
处理单元430,用于确定所述第一报文包括与所述匹配项相匹配的扩展报文头;响应于确定所述第一报文包括与所述匹配项相匹配的扩展报文头,根据所述动作项处理所述第一报文。
可以理解的是,如果转发表项是其他网络设备向第一设备发送的,所述获得单元410可以属于所述接收单元420。如果转发表项是第一设备根据通告消息生成的,所述获得单元410可以属于所述处理单元430
具体执行过程请参考上述图2所示实施例中相应步骤的详细描述,这里不再一一赘述。
参见图5,本申请实施例还提供了一种报文处理的装置500,该报文处理的装置500可以实现图2所示实施例中第二设备的功能。该报文处理的装置500包括处理单元510和发送单元520。其中,处理单元510用于实现图2所示实施例中的S201,发送单元5420用于实现图2所示实施例中的S202。
具体的,处理单元510,用于生成通告消息,所述通告消息包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识。
发送单元520,用于向第一设备发送所述通告消息,所述通告消息用于触发所述第一设备根据所述动作项处理包括与所述匹配项相匹配的扩展报文头的报文。
具体执行过程请参考上述图2所示实施例中相应步骤的详细描述,这里不再一一赘述。
参见图6,本申请实施例还提供了一种报文处理的装置600,该报文处理的装置600可以实现图2所示实施例中第一设备的功能。该报文处理的装置600包括获取单元610和处理单元620。其中,获取单元610用于接收第一设备发送的通告消息,处理单元620用于实现图2所示实施例中的S203。
具体的,获取单元610,用于获取通告消息,所述通告消息包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识,所述动作项用于指示所述第一设备对包括与所述匹配项相匹配的扩展报文头的报文进行处理。
处理单元620,用于根据所述通告消息生成转发表项,所述转发表项包括所述匹配项和动作项之间的对应关系。
具体执行过程请参考上述图2所示实施例中相应步骤的详细描述,这里不再一一赘述。
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。本申请实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。例如,上述实施例中,获取单元、处理单元和发送单元可以是同一个单元,也不同的单元。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
图7是本申请实施例提供的一种设备700的结构示意图。上文中的报文处理的装置400、 报文处理的装置500和报文处理的装置600可以通过图7所示的设备来实现。参见图7,该设备700包括至少一个处理器701,通信总线702以及至少一个网络接口704,可选地,该设备700还可以包括存储器703。
处理器701可以是一个通用中央处理器(Central Processing Unit,CPU)、特定应用集成电路(Application-specific Integrated Circuit,ASIC)或一个或多个用于控制本申请方案程序执行的集成电路(Integrated Circuit,IC)。处理器可以用于对报文或周期参数进行处理,以实现本申请实施例中提供的报文处理的方法。
比如,当图2中的第一设备通过图7所示的设备来实现时,该处理器可以用于,获得转发表项,所述转发表项包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识;接收第一报文;确定所述第一报文包括与所述匹配项相匹配的扩展报文头;响应于确定所述第一报文包括与所述匹配项相匹配的扩展报文头,根据所述动作项处理所述第一报文。
通信总线702用于在处理器701、网络接口704和存储器703之间传送信息。
存储器703可以是只读存储器(Read-only Memory,ROM)或可存储静态信息和指令的其它类型的静态存储设备,存储器703还可以是随机存取存储器(Random Access Memory,RAM)或者可存储信息和指令的其它类型的动态存储设备,也可以是只读光盘(Compact Disc Read-only Memory,CD-ROM)或其它光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质,但不限于此。存储器703可以是独立存在,通过通信总线702与处理器701相连接。存储器703也可以和处理器701集成在一起。
可选地,存储器703用于存储执行本申请实施例提供的技术方案的程序代码或指令,并由处理器701来控制执行。处理器701用于执行存储器703中存储的程序代码或指令。程序代码中可以包括一个或多个软件模块。可选地,处理器701也可以存储执行本申请实施例提供的技术方案的程序代码或指令,在这种情况下处理器701不需要到存储器703中读取程序代码或指令。
网络接口704可以为收发器一类的装置,用于与其它设备或通信网络通信,通信网络可以为以太网、无线接入网(RAN)或无线局域网(Wireless Local Area Networks,WLAN)等。在本申请实施例中,网络接口704可以用于接收分段路由网络中的其他节点发送的报文,也可以向分段路由网络中的其他节点发送报文。网络接口704可以为以太接口(Ethernet)接口、快速以太(Fast Ethernet,FE)接口或千兆以太(Gigabit Ethernet,GE)接口等。
在具体实现中,作为一种实施例,设备700可以包括多个处理器,例如图7中所示的处理器701和处理器705。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。
图8是本申请实施例提供的一种设备800的结构示意图。图2中的各个设备可以通过 图8所示的设备来实现。参见图8所示的设备结构示意图,设备800包括主控板和一个或多个接口板。主控板与接口板通信连接。主控板也称为主处理单元(Main Processing Unit,MPU)或路由处理卡(Route Processor Card),主控板包括CPU和存储器,主控板负责对设备800中各个组件的控制和管理,包括路由计算、设备管理和维护功能。接口板也称为线处理单元(Line Processing Unit,LPU)或线卡(Line Card),用于接收和发送报文。在一些实施例中,主控板与接口板之间或接口板与接口板之间通过总线通信。在一些实施例中,接口板之间通过交换网板通信,在这种情况下设备800也包括交换网板,交换网板与主控板、接口板通信连接,交换网板用于转发接口板之间的数据,交换网板也可以称为交换网板单元(Switch Fabric Unit,SFU)。接口板包括CPU、存储器、转发引擎和接口卡(Interface Card,IC),其中接口卡可以包括一个或多个网络接口。网络接口可以为Ethernet接口、FE接口或GE接口等。CPU与存储器、转发引擎和接口卡分别通信连接。存储器用于存储转发表。转发引擎用于基于存储器中保存的转发表转发接收到的报文,如果接收到的报文的目的地址为设备800的IP地址,则将该报文发送给主控板或接口板的CPU进行处理;如果接收到的报文的目的地址不是设备800的IP地址,则根据该目的地查转发表,如果从转发表中查找到该目的地址对应的下一跳和出接口,将该报文转发到该目的地址对应的出接口。转发引擎可以是网络处理器(Network Processor,NP)。接口卡也称为子卡,可安装在接口板上,负责将光电信号转换为数据帧,并对数据帧进行合法性检查后转发给转发引擎处理或接口板CPU。在一些实施例中,CPU也可执行转发引擎的功能,比如基于通用CPU实现软转发,从而接口板中不需要转发引擎。在一些实施例中,转发引擎可以通过ASIC或现场可编程门阵列(Field Programmable Gate Array,FPGA)实现。在一些实施例中,存储转发表的存储器也可以集成到转发引擎中,作为转发引擎的一部分。
本申请实施例还提供一种芯片系统,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片系统实现上述图2所示实施例中第一设备执行的报文处理的方法,或使得该芯片系统实现上述图2所示实施例中第二设备执行的报文处理的方法。
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请并不限定。示例性的,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型,以及存储器与处理器的设置方式不作具体限定。
示例性的,该芯片系统可以是FPGA,可以是ASIC,还可以是系统芯片(System on Chip,SoC),还可以是CPU,还可以是NP,还可以是数字信号处理电路(Digital Signal Processor,DSP),还可以是微控制器(Micro Controller Unit,MCU),还可以是可编程控制器(Programmable Logic Device,PLD)或其他集成芯片。
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软 件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
本申请实施例还提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行以上方法实施例提供的、由第一设备执行的报文处理的方法,或使得计算机执行以上方法实施例提供的、由第二设备执行的报文处理的方法。
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行以上方法实施例提供的、由第一设备执行的报文处理的方法,或使得计算机执行以上方法实施例提供的、由第二设备执行的报文处理的方法。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑模块划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要获取其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各模块单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件模块单元的形式实现。
所述集成的单元如果以软件模块单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已。
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (43)

  1. 一种报文处理的方法,其特征在于,包括:
    第一设备获得转发表项,所述转发表项包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识;
    所述第一设备接收第一报文;
    所述第一设备确定所述第一报文包括与所述匹配项相匹配的扩展报文头;
    响应于确定所述第一报文包括与所述匹配项相匹配的扩展报文头,所述第一设备根据所述动作项处理所述第一报文。
  2. 根据权利要求1所述的方法,其特征在于,所述匹配项包括第一报文头信息集合,所述第一报文头信息集合包括一个或多个扩展报文头的标识,所述第一设备确定所述第一报文包括与匹配项相匹配的扩展报文头包括:
    所述第一设备确定第二报文头信息集合与所述第一报文头信息集合之间满足匹配条件,所述第二报文头信息集合包括所述第一报文包括的一个或多个扩展报文头的标识。
  3. 根据权利要求2所述的方法,其特征在于,所述第一设备确定第二报文头信息集合与所述第一报文头信息集合之间满足匹配条件包括:
    所述第一设备确定所述第二报文头信息集合包括所述第一报文头信息集合中的所有扩展报文头的标识;或,
    所述第一设备确定所述第二报文头信息集合包括所述第一报文头信息集合中的任一扩展报文头的标识;或,
    所述第一设备确定所述第二报文头信息集合不包括所述第一报文头信息集合中的任一扩展报文头的标识。
  4. 根据权利要求2所述的方法,其特征在于,所述第一报文包括第一扩展报文头,所述第一扩展报文头包括第一字段,所述第二报文头信息集合包括所述第一扩展报文头的标识和所述第一字段的标识,所述第一设备确定第二报文头信息集合与所述第一报文头信息集合之间满足匹配条件包括:
    所述第一设备确定所述第一报文头信息集合包括所述第一扩展报文头的标识和所述第一字段的标识。
  5. 根据权利要求2或4所述的方法,其特征在于,所述第一报文包括第二扩展报文头,所述第二报文头扩展头包括第二字段,所述第一报文的第二扩展报文头中第二字段的值为第一值,所述第二报文头信息集合包括所述第二扩展报文头的标识、所述第二字段的标识和所述第一值,所述第一设备确定第二报文头信息集合与所述第一报文头信息集合之间满足匹配条件包括:
    所述第一设备确定所述第一报文头信息集合包括所述第二扩展报文头的标识、所述第二字段的标识和所述第一值。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述第一设备根据所述动作项对所述第一报文进行处理包括:
    所述第一设备通过第一转发路径发送所述第一报文,所述第一转发路径上的设备具有 处理所述第一报文包括的扩展报文头的能力。
  7. 根据权利要求1-5任一项所述的方法,其特征在于,所述第一设备根据所述动作项对所述第一报文进行处理包括:
    所述第一设备对所述第一报文封装外层报文头获得第二报文,所述外层报文头的源地址为所述第一设备的地址,所述外层报文头的目的地址为所述第一报文的目的地址,或,所述外层报文头的目的地址为第一报文的目的设备的上N跳网络设备的地址,所述N为正整数;
    所述第一设备通过第二转发路径发送所述第二报文,所述第二转发路径包括不能处理所述第一报文包括的扩展报文头的设备。
  8. 根据权利要求7所述的方法,其特征在于,所述外层报文头包括第一标识,所述第一标识被所述第二转发路径上的设备用于确定不需要处理所述第二报文包含的扩展报文头。
  9. 根据权利要求8所述的方法,其特征在于,所述第一标识位于所述外层报文头的下一报文头Next Header字段。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述第一设备获得转发表项包括:
    所述第一设备接收第二设备发送的通告消息,所述通告消息的流规范FlowSpec字段包括所述动作项和所述匹配项;
    所述第一设备根据所述通告消息生成所述转发表项。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述扩展报文头包括以下扩展报文头中的一个或多个:互联网协议第六版IPv6扩展报文头、多协议标签交换MPLS扩展头和包括互联网协议第四版IPv4选项的IPv4报文头。
  12. 一种报文处理的方法,其特征在于,包括:
    第二设备生成通告消息,所述通告消息包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识;
    所述第二设备向第一设备发送所述通告消息,所述通告消息用于触发所述第一设备根据所述动作项处理包括与所述匹配项相匹配的扩展报文头的报文。
  13. 根据权利要求12所述的方法,其特征在于,所述通告消息用于所述第一设备生成转发表项,所述转发表项包括所述匹配项和所述动作项之间的对应关系。
  14. 根据权利要求12或13所述的方法,其特征在于,所述通告消息为边界网关协议BGP更新update消息,所述匹配项携带在所述通告消息的BGP流规范FlowSpec对应的网络层可达性信息NLRI字段中。
  15. 根据权利要求14所述的方法,其特征在于,所述动作项携带在所述通告消息的NLRI字段或路由属性信息字段中。
  16. 根据权利要求12或13所述的方法,其特征在于,所述通告消息为以下任意一种消息:
    路径计算发起PCInitiate消息、路径计算更新PCUpd消息和路径计算回复PCRep消息。
  17. 根据权利要求16所述的方法,其特征在于,所述匹配项携带在所述通告消息的流过滤Flow Filter类型长度值TLV字段中。
  18. 一种报文处理的方法,其特征在于,包括:
    第一设备获取通告消息,所述通告消息包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识,所述动作项用于指示所述第一设备对包括与所述匹配项相匹配的扩展报文头的报文进行处理;
    所述第一设备根据所述通告消息生成转发表项,所述转发表项包括所述匹配项和动作项之间的对应关系;
    所述第一设备根据所述动作项处理包括与所述匹配项相匹配的扩展报文头的报文。
  19. 根据权利要求18所述的方法,其特征在于,所述通告消息为边界网关协议BGP更新update消息,所述匹配项携带在所述通告消息的BGP流规范FlowSpec对应的网络层可达性信息NLRI字段中。
  20. 根据权利要求19所述的方法,其特征在于,所述动作项携带在所述通告消息的NLRI字段或路由属性信息字段中。
  21. 根据权利要求18所述的方法,其特征在于,所述通告消息为以下任意一种消息:
    路径计算发起PCInitiate消息、路径计算更新PCUpd消息和路径计算回复PCRep消息。
  22. 根据权利要求21所述的方法,其特征在于,所述匹配项携带在所述通告消息的流过滤Flow Filter类型长度值TLV字段中。
  23. 根据权利要求18-22任一项所述的方法,其特征在于,所述通告消息由第二设备生成,所述第二设备为网络设备或控制设备。
  24. 一种报文处理的装置,其特征在于,所述装置应用于第一设备,所述装置包括:
    获得单元,用于获得转发表项,所述转发表项包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识;
    接收单元,用于接收第一报文;
    处理单元,用于确定所述第一报文包括与所述匹配项相匹配的扩展报文头;响应于确定所述第一报文包括与所述匹配项相匹配的扩展报文头,根据所述动作项处理所述第一报文。
  25. 根据权利要求24所述的装置,其特征在于,所述匹配项包括第一报文头信息集合,所述第一报文头信息集合包括一个或多个扩展报文头的标识,
    所述处理单元,用于第二报文头信息集合与所述第一报文头信息集合之间满足匹配条件,所述第二报文头信息集合包括所述第一报文包括的一个或多个扩展报文头的标识。
  26. 根据权利要求25所述的装置,其特征在于,
    所述处理单元,用于确定所述第二报文头信息集合包括所述第一报文头信息集合中的所有扩展报文头的标识;或,确定所述第二报文头信息集合包括所述第一报文头信息集合中的任一扩展报文头的标识;或,确定所述第二报文头信息集合不包括所述第一报文头信息集合中的任一扩展报文头的标识。
  27. 根据权利要求25所述的装置,其特征在于,所述第一报文包括第一扩展报文头, 所述第一扩展报文头包括第一字段,所述第二报文头信息集合包括所述第一扩展报文头的标识和所述第一字段的标识,
    所述处理单元,用于确定所述第一报文头信息集合包括所述第一扩展报文头的标识和所述第一字段的标识。
  28. 根据权利要求26或27所述的装置,其特征在于,所述第一报文包括第二扩展报文头,所述第二报文头扩展头包括第二字段,所述第一报文的第二扩展报文头中第二字段的值为第一值,所述第二报文头信息集合包括所述第二扩展报文头的标识、所述第二字段的标识和所述第一值,
    所述处理单元,用于确定所述第一报文头信息集合包括所述第二扩展报文头的标识、所述第二字段的标识和所述第一值。
  29. 根据权利要求24-28任一项所述的装置,其特征在于,
    所述处理单元,用于通过第一转发路径发送所述第一报文,所述第一转发路径上的设备具有处理所述第一报文包括的扩展报文头的能力。
  30. 根据权利要求24-28任一项所述的装置,其特征在于,
    所述处理单元,用于对所述第一报文封装外层报文头获得第二报文,所述第一设备对所述第一报文封装外层报文头获得第二报文,所述外层报文头的源地址为所述第一设备的地址,所述外层报文头的目的地址为所述第一报文的目的地址,或,所述外层报文头的目的地址为第一报文的目的设备的上N跳网络设备的地址,N为正整数;通过第二转发路径发送所述第二报文,所述第二转发路径包括不能处理所述第一报文包括的扩展报文头的设备。
  31. 根据权利要求30所述的装置,其特征在于,所述外层报文头包括第一标识,所述第一标识被所述第二转发路径上的设备用于确定不需要处理所述第二报文包含的扩展报文头。
  32. 根据权利要求31所述的装置,其特征在于,所述第一标识位于所述外层报文头的下一报文头Next Header字段。
  33. 根据权利要求24-32任一项所述的装置,其特征在于,
    所述获得单元,用于接收第二设备发送的通告消息,所述通告消息的流规范FlowSpec字段包括所述动作项和所述匹配项;根据所述通告消息生成所述转发表项。
  34. 根据权利要求24-33任一项所述的装置,其特征在于,所述扩展报文头包括以下扩展报文头中的一个或多个:互联网协议第六版IPv6扩展报文头、多协议标签交换MPLS扩展头和包括互联网协议第四版IPv4选项的IPv4报文头。
  35. 一种报文处理的装置,其特征在于,所述装置应用于第二设备,所述装置包括:
    处理单元,用于生成通告消息,所述通告消息包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识;
    发送单元,用于向第一设备发送所述通告消息,所述通告消息用于触发所述第一设备根据所述动作项处理包括与所述匹配项相匹配的扩展报文头的报文。
  36. 根据权利要求35所述的装置,其特征在于,所述通告消息用于所述第一设备生成 转发表项,所述转发表项包括所述匹配项和所述动作项之间的对应关系。
  37. 根据权利要求35或36所述的装置,其特征在于,所述通告消息为边界网关协议BGP更新update消息,所述匹配项携带在所述通告消息的BGP流规范FlowSpec对应的网络层可达性信息NLRI字段中。
  38. 根据权利要求37所述的装置,其特征在于,所述动作项携带在所述通告消息的NLRI字段或路由属性信息字段中。
  39. 根据权利要求35或36所述的装置,其特征在于,所述通告消息为以下任意一种消息:
    路径计算发起PCInitiate消息、路径计算更新PCUpd消息和路径计算回复PCRep消息。
  40. 根据权利要求39所述的装置,其特征在于,所述匹配项携带在所述通告消息的流过滤Flow Filter类型长度值TLV字段中。
  41. 一种报文处理的装置,其特征在于,所述装置应用于第一设备,所述装置包括:
    获取单元,用于获取通告消息,所述通告消息包括匹配项和动作项,所述匹配项包括一个或多个扩展报文头的标识,所述动作项用于指示所述第一设备对包括与所述匹配项相匹配的扩展报文头的报文进行处理;
    处理单元,用于根据所述通告消息生成转发表项,所述转发表项包括所述匹配项和动作项之间的对应关系;所述第一设备根据所述动作项处理包括与所述匹配项相匹配的扩展报文头的报文。
  42. 根据权利要求41所述的装置,其特征在于,所述通告消息为边界网关协议BGP更新update消息,所述匹配项携带在所述通告消息的BGP流规范FlowSpec对应的网络层可达性信息NLRI字段中。
  43. 根据权利要求42所述的装置,其特征在于,所述动作项携带在所述通告消息的NLRI字段或路由属性信息字段中。
PCT/CN2022/127833 2021-11-04 2022-10-27 报文处理方法、装置及系统 WO2023078144A1 (zh)

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
CN202111300903 2021-11-04
CN202111300903.8 2021-11-04
CN202111554313.8 2021-12-17
CN202111554313 2021-12-17
CN202210270403.2A CN116074235A (zh) 2021-11-04 2022-03-18 报文处理方法、装置及系统
CN202210270403.2 2022-03-18

Publications (1)

Publication Number Publication Date
WO2023078144A1 true WO2023078144A1 (zh) 2023-05-11

Family

ID=86179207

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/127833 WO2023078144A1 (zh) 2021-11-04 2022-10-27 报文处理方法、装置及系统

Country Status (2)

Country Link
CN (1) CN116074235A (zh)
WO (1) WO2023078144A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150109902A1 (en) * 2013-10-18 2015-04-23 Cisco Technology, Inc. SCALABLE EDGE NODE PROTECTION USING IPv6 SEGMENT ROUTING EXTENSION HEADER
CN112491718A (zh) * 2020-08-31 2021-03-12 中兴通讯股份有限公司 报文头的处理方法及装置、存储介质、电子装置
CN113055289A (zh) * 2016-07-01 2021-06-29 华为技术有限公司 基于业务功能链sfc的报文转发方法、装置和系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150109902A1 (en) * 2013-10-18 2015-04-23 Cisco Technology, Inc. SCALABLE EDGE NODE PROTECTION USING IPv6 SEGMENT ROUTING EXTENSION HEADER
CN113055289A (zh) * 2016-07-01 2021-06-29 华为技术有限公司 基于业务功能链sfc的报文转发方法、装置和系统
CN112491718A (zh) * 2020-08-31 2021-03-12 中兴通讯股份有限公司 报文头的处理方法及装置、存储介质、电子装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Z. HU HUAWEI H. CHEN FUTUREWEI H. CHEN CHINA TELECOM P. WU HUAWEI M. TOY VERIZON C. CAO T. HE CHINA UNICOM L. LIU FUJITSU X. LIU V: "SRv6 Path Egress Protection; draft-ietf-rtgwg-srv6-egress-protection-01.txt", SRV6 PATH EGRESS PROTECTION; DRAFT-IETF-RTGWG-SRV6-EGRESS-PROTECTION-01.TXT; INTERNET-DRAFT: NETWORK WORKING GROUP, INTERNET ENGINEERING TASK FORCE, IETF; STANDARDWORKINGDRAFT, INTERNET SOCIETY (ISOC) 4, RUE DES FALAISES CH- 1205 GENEVA, SWITZERLAND, no. 01, 29 July 2020 (2020-07-29), Internet Society (ISOC) 4, rue des Falaises CH- 1205 Geneva, Switzerland , pages 1 - 17, XP015141211 *

Also Published As

Publication number Publication date
CN116074235A (zh) 2023-05-05

Similar Documents

Publication Publication Date Title
US20210218704A1 (en) Method, Device, and System for Obtaining SRV6 Tunnel Information
US10412008B2 (en) Packet processing method, apparatus, and system
JP2022550160A (ja) Bier転送項目構築方法、装置、およびシステム
EP3958521A1 (en) Method and apparatus for providing service for service flow
US9264341B2 (en) Method and system for dynamic routing and/or switching in a network
EP4113919A1 (en) Method for forwarding message in srv6 service function chain, sff and sf device
WO2012156852A1 (en) Label switched routing to connect low power network domains
WO2022062506A1 (zh) 一种数据处理方法、装置、存储介质及电子装置
CN111988266B (zh) 一种处理报文的方法
JP2022500915A (ja) 通信方法、デバイス、及びシステム
CN111371634B (zh) 一种通信方法、装置及系统
US20230370298A1 (en) Message header processing method and apparatus, storage medium and electronic device
US20220191138A1 (en) Method for Making Host Network Performance Requirement Programmable, Device, and System
US9467367B2 (en) Universal labels in internetworking
US20230291682A1 (en) Method and device for processing data packet, storage medium, and electronic device
WO2022042503A1 (zh) 一种报文传输方法、装置及系统
US11522792B2 (en) Method for discovering forwarding path and related device thereof
US20240048479A1 (en) Packet Forwarding Method and Apparatus, Network Device, and Storage Medium
US20240073128A1 (en) Message encapsulation and de-encapsulation method and device, storage medium, and electronic device
CN113765800B (zh) 传输报文的方法、装置、系统、设备及可读存储介质
JP2023529639A (ja) パケット処理方法、デバイス、およびシステム
US10686730B2 (en) Function-expandable wired network device
JP7273125B2 (ja) BIERv6パケットを送信するための方法および第1のネットワークデバイス
WO2023078144A1 (zh) 报文处理方法、装置及系统
JP2024504466A (ja) パケット転送方法、パケット処理方法、およびデバイス

Legal Events

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

Ref document number: 22889169

Country of ref document: EP

Kind code of ref document: A1