WO2024000137A1 - 报文处理 - Google Patents

报文处理 Download PDF

Info

Publication number
WO2024000137A1
WO2024000137A1 PCT/CN2022/101722 CN2022101722W WO2024000137A1 WO 2024000137 A1 WO2024000137 A1 WO 2024000137A1 CN 2022101722 W CN2022101722 W CN 2022101722W WO 2024000137 A1 WO2024000137 A1 WO 2024000137A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
srh
value
ipv6 header
tag information
Prior art date
Application number
PCT/CN2022/101722
Other languages
English (en)
French (fr)
Inventor
李�昊
Original Assignee
新华三技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 新华三技术有限公司 filed Critical 新华三技术有限公司
Priority to CN202280001936.9A priority Critical patent/CN117643016A/zh
Priority to PCT/CN2022/101722 priority patent/WO2024000137A1/zh
Publication of WO2024000137A1 publication Critical patent/WO2024000137A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks

Definitions

  • This application relates to the field of communication technology, especially message processing.
  • SRv6 Internet Protocol Version 6 Segment Routing
  • traffic engineering can be implemented through SRv6 policies.
  • the head node of the SRv6 network can encapsulate a segment routing header (Segment Routing Header, SRH) in the outer layer of the service message based on the SRv6 policy.
  • the SRH includes a segment list (Segment List), and the segment list Including the forwarding path of the service message in the SRv6 network, and then the nodes in the SRv6 network can forward the encapsulated service message based on the forwarding path.
  • the segment list of SRH may include the binding segment identifier (BSID) of other endpoint nodes.
  • BSID binding segment identifier
  • the intermediate node in the SRv6 network needs to obtain the original message included in the service packet.
  • the intermediate node cannot determine how many layers of SRH and IPv6 headers to remove. The original message is restored, causing the intermediate node to be unable to accurately obtain the original message.
  • the purpose of the embodiments of this application is to process packets so that the intermediate node can accurately obtain the original packets.
  • the specific technical solutions are as follows:
  • embodiments of the present application provide a message processing method, the method is applied to a first network device, and the method includes:
  • the second message includes a first segment routing header SRH and the first message
  • the first SRH includes tag information
  • the tag information indicates the encapsulation basis of the first SRH .
  • the value of the mark information is a first value or a second value
  • the tag information When the value of the tag information is the first value, it indicates that the first SRH is an SRH encapsulated by BSID;
  • the tag information When the value of the tag information is the second value, it indicates that the first SRH is not an SRH encapsulated by BSID.
  • the method before forwarding the second message, the method further includes:
  • the IPv6 header and the first SRH are encapsulated in the outer layer of the first message to obtain the second message.
  • SRH includes tag information, the value of the tag information is the first value; or,
  • the IPv6 header and the first SRH are encapsulated in the outer layer of the first message to obtain the second message.
  • An SRH includes tag information, and the value of the tag information is the second value.
  • the first SRH includes a flags field, and 1 bit in the flags field carries the flag information.
  • the method further includes:
  • the tag information included in the SRH is identified layer by layer, until the second SRH whose tag information is the second value is identified, the portion subsequent to the second SRH in the third message is determined to be the original message.
  • the first network device is connected to a service function node; after determining that the subsequent part of the second SRH in the third message is an original message, the method further includes:
  • the destination address of the outermost IPv6 header of the third message is a locally configured static proxy SID or dynamic proxy SID, forward the original message to the service function node; or,
  • the destination address of the outermost IPv6 header of the third message is the locally configured pseudo proxy SID, then update the destination address of the outermost IPv6 header to the last network of the forwarding path indicated by the second SRH.
  • the address of the device is obtained, the fourth message is obtained, and the fourth message is forwarded to the service function node.
  • the method further includes:
  • the sixth message is forwarded on the forwarding path indicated by the outermost SRH.
  • the method further includes:
  • the method further includes:
  • the source address of the outermost IPv6 header of the fifth message is exchanged with the source address of the IPv6 header of the same layer of the second SRH.
  • the third message is a route tracing message; after determining that the portion subsequent to the second SRH in the third message is an original message, the method further includes:
  • embodiments of the present application provide a packet processing device, the device is applied to a first network device, and the device includes:
  • the receiving module is used to receive the first message
  • Forwarding module configured to forward a second message, the second message includes a first segment routing header SRH and the first message, the first SRH includes tag information, and the tag information indicates the first segment routing header SRH. 1. SRH packaging basis.
  • the value of the mark information is a first value or a second value
  • the tag information When the value of the tag information is the first value, it indicates that the first SRH is an SRH encapsulated by BSID;
  • the tag information When the value of the tag information is the second value, it indicates that the first SRH is not an SRH encapsulated by BSID.
  • the device further includes: a packaging module;
  • the encapsulation module is used to encapsulate the IPv6 header and the first SRH in the outer layer of the first message if the destination address of the first message is a locally configured binding segment identifier BSID, to obtain the second message, the first SRH includes tag information, and the value of the tag information is the first value; or,
  • the encapsulation module is configured to encapsulate the IPv6 header and the first SRH in the outer layer of the first message if the next hop of the routing table entry matched by the first message is an SRv6 policy, to obtain the third In the second message, the first SRH includes tag information, and the value of the tag information is the second value.
  • the first SRH includes a flags field, and 1 bit in the flags field carries the flag information.
  • the device further includes: a determining module
  • the receiving module is also used to receive a third message sent by the second network device.
  • the third message includes at least one layer of SRH and IPv6 header, and each layer of SRH includes tag information;
  • the determination module is configured to identify the tag information included in the SRH layer by layer, starting from the outermost SRH, until the second SRH whose tag information is the second value is identified, and determine the subsequent sequence of the second SRH in the third message.
  • the part is the original message.
  • the first network device is connected to a service function node; the forwarding module is also used to:
  • the destination address of the outermost IPv6 header of the third message is a locally configured static proxy SID or dynamic proxy SID, forward the original message to the service function node; or,
  • the destination address of the outermost IPv6 header of the third message is the locally configured pseudo proxy SID, then update the destination address of the outermost IPv6 header to the last network of the forwarding path indicated by the second SRH.
  • the address of the device is obtained, the fourth message is obtained, and the fourth message is forwarded to the service function node.
  • the receiving module is also used to receive the fifth message sent by the service function node;
  • the forwarding module is also used to:
  • the sixth message is forwarded on the forwarding path indicated by the outermost SRH.
  • the forwarding module is also used to:
  • the source address of the outermost IPv6 header of the fifth message is exchanged with the source address of the IPv6 header of the same layer of the second SRH.
  • the forwarding module is also configured to send a time-to-live TTL timeout message to the second network device, where the destination address of the TTL timeout message is the source address of the IPv6 header of the same layer as the second SRH.
  • embodiments of the present application provide a network device, where the network device includes:
  • a machine-readable storage medium that stores machine-executable instructions that can be executed by the processor; the machine-executable instructions cause the processor to perform the following steps:
  • a second message is forwarded through the transceiver.
  • the second message includes a first segment routing header SRH and the first message.
  • the first SRH includes tag information, and the tag information indicates the first segment routing header. 1. SRH packaging basis.
  • the value of the mark information is a first value or a second value
  • the tag information When the value of the tag information is the first value, it indicates that the first SRH is an SRH encapsulated by BSID;
  • the tag information When the value of the tag information is the second value, it indicates that the first SRH is not an SRH encapsulated by BSID.
  • machine-executable instructions also cause the processor to perform the following steps:
  • the IPv6 header and the first SRH are encapsulated in the outer layer of the first message to obtain the second message.
  • SRH includes tag information, the value of the tag information is the first value; or,
  • the IPv6 header and the first SRH are encapsulated in the outer layer of the first message to obtain the second message.
  • An SRH includes tag information, and the value of the tag information is the second value.
  • the first SRH includes a flags field, and 1 bit in the flags field carries the flag information.
  • machine-executable instructions also cause the processor to perform the following steps:
  • the tag information included in the SRH is identified layer by layer, until the second SRH whose tag information is the second value is identified, the portion subsequent to the second SRH in the third message is determined to be the original message.
  • machine-executable instructions also cause the processor to perform the following steps:
  • the destination address of the outermost IPv6 header of the third message is a locally configured static proxy SID or dynamic proxy SID, then forward the original message to the service function node through the transceiver; or,
  • the destination address of the outermost IPv6 header of the third message is the locally configured pseudo proxy SID, then update the destination address of the outermost IPv6 header to the last network of the forwarding path indicated by the second SRH.
  • the address of the device is obtained, the fourth message is obtained, and the fourth message is forwarded to the service function node through the transceiver.
  • machine-executable instructions also cause the processor to perform the following steps:
  • the sixth message is forwarded through the transceiver on the forwarding path indicated by the outermost SRH.
  • machine-executable instructions also cause the processor to perform the following steps:
  • the source address of the outermost IPv6 header of the fifth message is exchanged with the source address of the IPv6 header of the same layer of the second SRH.
  • the third message is a route tracing message; the machine executable instructions also prompt the processor to perform the following steps:
  • a time-to-live TTL timeout message is sent to the second network device through the transceiver, and the destination address of the TTL timeout message is the source address of the IPv6 header of the same layer as the second SRH.
  • embodiments of the present application provide a machine-readable storage medium that stores machine-executable instructions. When called and executed by a processor, the machine-executable instructions prompt the processor to: implement the first step above. method steps described in this aspect.
  • embodiments of the present application provide a computer program product, which causes the processor to: implement the method steps described in the first aspect.
  • the first network device after receiving the first message, forwards the second message including the first SRH and the first message, because the mark information included in the first SRH indicates that the first SRH
  • An SRH encapsulation basis enables the intermediate node that receives the second message to distinguish the SRH encapsulated by the BSID based on the tag information in the SRH, so that the original message included in the second message can be accurately obtained.
  • Figure 1 is a schematic diagram of a scenario where a service chain function is combined with SRv6 provided by an embodiment of the present application;
  • Figure 2 is a schematic diagram of cross-domain forwarding of messages provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of another cross-domain forwarding of messages provided by an embodiment of the present application.
  • Figure 4 is a schematic flowchart of a message processing method provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of the first SRH provided by the embodiment of the present application.
  • Figure 6 is an exemplary schematic diagram of the Flags field provided by the embodiment of the present application.
  • Figure 7 is a schematic diagram of a message encapsulation provided by an embodiment of the present application.
  • Figure 8 is a schematic flow chart of another message processing method provided by an embodiment of the present application.
  • Figure 9 is a schematic diagram of message destination address update and source address exchange provided by the embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a message processing device provided by an embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a network device provided by an embodiment of the present application.
  • SRv6 is a source routing technology.
  • the head node of the SRv6 network can add SRH encapsulation to the traffic and guide the traffic to be forwarded according to the prescribed path through the Segment List in the SRH header.
  • the service chain function means that in the process of traffic forwarding, the Service Function Forwarder (SFF) node sends the traffic to the Service Function (SF) node in the planned order, so that the SF node processes the traffic, SF
  • SFF Service Function Forwarder
  • SF Service Function
  • nodes can implement accounting functions, firewall functions, etc.
  • the service chain function can be combined with SRv6, that is, the service chain function can be implemented in the SRv6 network and the service chain can be orchestrated through the Segment List of SRv6.
  • the head node i.e., Classifier in the service chain function scenario
  • IPv6 Internet Protocol Version 6
  • the source address of the IPv6 header is the source address of the original service packet, and the destination address is SFF1.
  • the Segment List included in SRH is SFF1::SF1, SFF2::SF2, SFF3.
  • SFF1::SF1 is the segment ID (SID) of SFF1.
  • the type can be End.AD, End.AS or End.AM, which is used to guide SF1 to send the message to SF1;
  • SFF2::SF2 is the SID of SFF2.
  • the type can be End.AD, End.AS or End.AM. It is used to guide SFF2 to send the message to SF2;
  • SFF3 is the SID of SFF3, and the type can be a common End type.
  • the head node can forward the packet encapsulated with IPv6 header and SRH to SFF1. If the type of SFF1 is End.AD or End.AS, SFF1 can forward the original message to SF1. After SF1 processes the original message, it sends the processed original message to SFF1, and then SFF1 becomes the processed original message again.
  • the packet is encapsulated with an IPv6 header and SRH and sent to SFF2.
  • SFF2 processes packets similarly to SFF1 and will not be described again here.
  • the above End.AD is an SRv6 SID, which is used to indicate that the node to which End.AD belongs serves as an SR proxy (Segment Routing Proxy).
  • SR proxy Segment Routing Proxy
  • the IPv6 header and SRH of the message are temporarily deleted. , and then forwarded to the SF node.
  • the node to which End.AD belongs can be used as a dynamic proxy node and maintain a dynamic cache for each service chain in the dynamic cache.
  • End.AS is another SRv6 SID, used to represent the node to which End.AS belongs as an SR proxy (SR Proxy), which can implement message processing functions similar to End.AD.
  • SR Proxy SR proxy
  • the difference from End.AD is that End.
  • the node to which the AS belongs re-encapsulates IPv6 headers and SRH for packets through static configuration information, and does not need to maintain a dynamic cache.
  • End.AM is another SRv6 SID, used to indicate that the SFF node to which End.AM belongs serves as an SR Proxy and can connect to SF nodes with the ability to identify SRH.
  • service chain paths may be connected through binding SID (BSID).
  • BSID binding SID
  • FIG. 2 is a schematic diagram of cross-domain forwarding of messages provided by the embodiment of the present application.
  • device A wants to send a service message to device B.
  • the forwarding path of the service message spans the first autonomous system (Autonomous System). , AS) and the second AS.
  • AS autonomous System
  • the first AS includes PE1, P1 and P2
  • the second AS includes: P3, P4, P5 and PE2, and P4 is connected to SF.
  • PE1 After PE1 receives the Original Packet (original message) from device A, it needs to encapsulate the IPv6 header and SRH1 in the outer layer of the original message.
  • the SID list included in SRH1 is: P1.SID, P2.SID, P3.SID , PE2.SID, where P3.SID is the BSID.
  • P3 After P3 receives the service packet, it determines that the destination address of the service packet is P3.SID, which is the locally configured BSID. Then P3 needs to encapsulate an IPv6 header and SRH2 for the service packet according to the path associated with the BSID; among them, SRH2 The included SID list is P4.SID, P5.SID.
  • the outer layer of the original packet is encapsulated with two IPv6 headers and two layers of SRH. If the SID type of P4 is End.AD or End.AS, P4 needs to remove both SRH and IPv6 headers and send the original packet to SF. However, the P4 node cannot determine how many layers of SRH and IPv6 headers are encapsulated in the outer layer of the received service message, so it cannot accurately remove the SRH and IPv6 headers, resulting in the P4 node being unable to accurately obtain the Original Packet (original message).
  • FIG. 3 is a schematic diagram of a message forwarding in a metropolitan area network provided by an embodiment of the present application.
  • the message sent from network device A to network device E needs to be processed by the SF in the edge DC.
  • the entire The forwarding path is orchestrated through SRv6 policies.
  • the edge DC deploys an SRv6-based service chain path internally, and creates a BSID associated with the service chain path in DC-B (Data Center-boarder). Metropolitan area network traffic enters the edge DC through the BSID of DC-B.
  • DC-B Data Center-boarder
  • DC-B when DC-B receives a message sent by device C, DC-B encapsulates SRH in the outer layer of the message according to the path associated with the BSID, and then forwards it to DC-Spine, which then forwards it to DC-leaf. .
  • DC-leaf As an SFF node, DC-leaf needs to forward the received message to the SF node.
  • DC-leaf cannot identify how many layers of SRH are encapsulated in the received message, so it cannot accurately restore the original message and forward it to the SF node. Send the original message.
  • the final destination address is encapsulated in the inner SRH, and the SFF node cannot identify which layer of SRH encapsulates the final destination address, resulting in the inability to accurately update the destination address of the message.
  • the service function node can also be deployed on the forwarding path as an endpoint node, that is, the service function node is a node in the forwarding path indicated by the Segment List.
  • the service function node For service function nodes deployed on the SRv6 forwarding path, when the service function node receives a message with multiple layers of SRH encapsulated in the outer layer, the service function node cannot extract the original message across multiple layers of SRH.
  • the head node can detect the Layer 3 devices on the path indicated by the SRv6 policy through the traceroute function.
  • the PEI can send the original traceroute message. If the original traceroute message is forwarded to P3, P3 will encapsulate the original traceroute message with an SRH and IPv6 header. The source address of the IPv6 header is the address of P3, and the IPv6 header will inherit the original traceroute message. Hoplimit (hop limit) of the IPv6 header.
  • P4 and P5 as intermediate nodes in the second AS, can also detect whether the Hoplimit is illegal after receiving the traceroute message, and reply to the ICMPv6 message if the Hoplimit is determined to be illegal.
  • the destination address of the ICMPv6 message generated by the intermediate node is the source address of the traceroute message received by the intermediate node, which is the address of P3.
  • the ICMPv6 message cannot be sent to the head node PE1 that initiated the traceroute operation.
  • the intermediate nodes of the SRv6 network need to monitor the traffic through packet monitoring tools and analyze the traffic. Since the outer layer of the packet is encapsulated with multiple layers of SRH and IPv6 headers, it is impossible to quickly extract the contents of the packet. Original payload included.
  • this method include:
  • the first packet may be a service packet, a BFD packet, a traceroute packet, or any other packet that can be transmitted in an SRv6 network where a service chain is deployed.
  • the second message includes the first segment routing header SRH and the first message.
  • the first SRH includes tag information, and the tag information indicates the encapsulation basis of the first SRH.
  • the first network device forwards the second message including the first SRH and the first message. Since the tag information included in the first SRH indicates the encapsulation basis of the first SRH, so that The node that receives the second message can distinguish how the SRH is encapsulated based on the encapsulation basis indicated by the mark information. Furthermore, even if the second message includes multiple layers of SRH, the node that receives the second message can also distinguish based on each layer. The SRH encapsulation basis accurately obtains the original message included in the second message.
  • the encapsulation basis may include: encapsulation by BSID and encapsulation not by BSID.
  • the value of the mark information is the first value or the second value.
  • the first value can be 1 and the second value can be 0.
  • the tag information When the value of the tag information is the first value, it indicates that the first SRH is an SRH encapsulated through the BSID.
  • the tag information When the value of the tag information is the second value, it indicates that the first SRH is not an SRH encapsulated through the BSID.
  • the first SRH includes a flags field, and 1 bit in the flags field carries flag information.
  • Figure 5 is a schematic structural diagram of an SRH provided by an embodiment of the present application.
  • the SRH includes the following fields:
  • Next Header (Next Header), 8 bits in length, is used to identify the type of the next header.
  • SRH length (Hdr Ext Len) the length is 8 bits, indicating the length of the SRH header in 8 bytes, excluding the first 8 bytes.
  • Routing Type the length is 8 bits, and the value is 4, which means it carries SRH.
  • Segment index (Segments Left, SL), with a length of 8 bits, is the number of the next segment list to be processed.
  • Last Entry the length is 8 bits, and the value is the number of the first SID of the actual forwarding path of the packet in the SRH header.
  • Flags 8 bits in length, are flag bit information.
  • Tag 16 bits in length, is used to mark a group of packets with the same characteristics.
  • Segment List is a SID list, arranged in order from far to near nodes on the message forwarding path, that is, Segment List[0] represents the last SID of the path, and Segment List[1] represents the penultimate SID of the path. Two SIDs, and so on. Each SID can be a 128-bit IPv6 address. SRv6 messages are forwarded sequentially according to the IPv6 addresses in the Segments List, where Segments List[0] represents the address of the last network device on the forwarding path.
  • Figure 5 shows the complete uncompressed SID.
  • the Segment List can also carry the compressed SID.
  • Figure 6 is an exemplary schematic diagram of the Flags field in Figure 5.
  • the embodiment of the present application can occupy the third bit in the Flags field to carry tag information.
  • the tag information can specifically be a binding SID. Encapsulation flag (Binging SID Encapsulation Flag, BE Flag).
  • the BE Flag is set, that is, the value of the BE Flag is 1, it indicates that the first SRH is the SRH encapsulated through the BSID; if the BE Flag is not set, that is, the value of the BE Flag is 0, it indicates that the first SRH is encapsulated by the BSID.
  • An SRH is not an SRH encapsulated by BSID.
  • the first network device before forwarding the second message in S402, the first network device needs to generate a second message, which specifically includes the following two situations:
  • Case 1 If the destination address of the first message is the locally configured binding segment identifier BSID, then the IPv6 header and the first SRH are encapsulated in the outer layer of the first message to obtain the second message.
  • the first SRH includes tag information.
  • the value of the mark information is the first value.
  • the destination address of the first message is a locally configured BSID
  • the first network device needs to encapsulate an additional layer of IPv6 header and SRH in the outer layer of the first message.
  • the tag information in the encapsulated SRH can be set to 1, indicating that the SRH is encapsulated based on the BSID.
  • the first network device may be P3 in Figure 2, or DC-B in Figure 3.
  • Case 2 If the next hop of the routing table entry matched by the first message is an SRv6 policy, encapsulate the IPv6 header and the first SRH in the outer layer of the first message to obtain the second message.
  • the first SRH includes tag information.
  • the value of the mark information is the second value.
  • the first network After receiving the first message, the first network matches the first message with its own stored routing table entry. If the next hop of the matched routing table entry is an SRv6 policy, it means that the first network device is the head node. , in this case, the first packet may be a service packet from the CE device.
  • the first network device encapsulates the first SRH based on the SRv6 policy, and sets the tag information in the first SRH to 0, indicating that the first SRH is not obtained through BSID encapsulation.
  • the first network device may be PE1 in Figure 2, or device A in Figure 3.
  • FIG 7 is a schematic diagram of the packet encapsulation by the PE1 node and the P3 node in Figure 2.
  • PE1 receives the Original Packet ( After receiving the original packet), it is determined that the original packet matches the SRv6 policy, and the packet is directed to the SRv6 policy destined for PE2.
  • PE1 can add IPv6 header and SRH encapsulation to the packet according to the Segment list (P1.SID, P2.SID, P3.SID, PE2.SID) in the SRv6 policy, and forward the packet according to the path indicated by the Segment list.
  • the source address of the IPv6 header is the SID of PE1
  • BE-FLAG in the SRH 0, that is, BE-FLAG is not set, indicating that the SRH is not encapsulated through BSID.
  • P3 when P3 receives the packet encapsulated by PE1, it recognizes that the destination address in the IPv6 header of the packet is the same as the locally configured BSID, and obtains the Segment list (P5.SID, P4::SF) associated with the locally configured BSID. ), the message is encapsulated according to the Segment list, that is, the IPv6 header and SRH are encapsulated in the outer layer of the message.
  • the first network device After receiving the first message, the first network device sets tag information with a value of the first value in the encapsulated SRH when the destination address of the first message is a locally configured BSID.
  • tag information with a value of the second value is set in the encapsulated SRH. This allows subsequent network devices to determine whether the first SRH is obtained through BSID encapsulation based on the value of the tag information, and thereby accurately identify the original message from the multi-layer encapsulated message.
  • the above-mentioned first network device can also be used as an intermediate node on other forwarding paths that needs to identify the original message, or it can also be a packet monitoring device that can capture the messages transmitted on the forwarding path.
  • Equipment as shown in Figure 8, the method also includes:
  • the third message includes at least one layer of SRH and IPv6 header, and each layer of SRH includes tag information.
  • S802 Starting from the outermost SRH, identify the tag information included in the SRH layer by layer until the second SRH whose tag information is the second value is identified, determine that the subsequent part of the second SRH in the third message is the original message.
  • each SRH layer of the third message includes tag information.
  • the second SRH is identified, it is determined that the value of the tag information included in the second SRH is the second value, and it is determined that the second SRH is not encapsulated through BSID. Obtained, the subsequent part of the second SRH is the original message.
  • the first network device can identify whether the BE Flag in the SRH is set layer by layer starting from the outermost SRH of the third message until the second SRH including the unset BE Flag is identified. Then it is determined that the subsequent part of the second SRH is the original message.
  • the first network device can identify the tag information included in the multi-layer SRH of the third message layer by layer.
  • the tag information indicates that the second SRH is not obtained through BSID encapsulation, so it can be determined that the subsequent part of the second SRH is the original message, and the first network device can accurately extract the original message.
  • the first network device may also be connected to the service function node, that is, the first network device may serve as an SFF.
  • the first network device is P4 in Figure 2 or DC-leaf in Figure 3 .
  • the tag information included in the SRH is identified layer by layer until the second SRH whose tag information is the second value is identified, the second SRH in the third message is determined. After the subsequent part of SRH is the original message, it can be implemented according to the following method 1 or 2.
  • Method 1 If the destination address of the outermost IPv6 header of the third message is the locally configured static proxy SID or dynamic proxy SID, forward the original message to the service function node;
  • the first network device can start from Starting from the outermost SRH of the third message, the SRH and IPv6 are deleted layer by layer until the second SRH and the outer IPv6 header of the second SRH are deleted, and the original message is obtained.
  • the first network device sends the original message to the service function node, so that the service function node can process the original message normally, which can avoid the first network device being unable to identify the original message, causing the first network device to be unable to send the message to the service function node.
  • the problem of forwarding the correct original message can avoid the first network device being unable to identify the original message, causing the first network device to be unable to send the message to the service function node.
  • Method 2 If the destination address of the outermost IPv6 header of the third message is the locally configured pseudo-proxy SID, update the destination address of the outermost IPv6 header to the address of the last network device in the forwarding path indicated by the second SRH. , obtain the fourth message, and forward the fourth message to the service function node.
  • the destination address of the outermost IPv6 header of the third message is the locally configured pseudo proxy SID, it means that the SID of the first network device is End.AM SID, and the first network device needs to change the destination address of the outermost IPv6 header.
  • the first network device also needs to update the source address of the outermost IPv6 header to the actual source address of the forwarding path. That is, before obtaining the fourth message, the source address of the outermost IPv6 header of the third message may be exchanged with the source address included in the IPv6 header of the same layer of the second SRH.
  • the destination address of the outermost IPv6 header of the third message is updated to the address of the last network device on the forwarding path indicated by the second SRH, and the source address of the outermost IPv6 header is the same as that of the second SRH.
  • the source address included in the IPv6 header of the IP layer is exchanged, and the fourth message is obtained.
  • the IPv6 header in the same layer as the second SRH is an IPv6 header in the outer layer of the second SRH and adjacent to the second SRH.
  • the third packet including two layers of SRH and two IPv6 headers as an example.
  • the source of IPv6 header 1 The address (Source address, Scr) is PE1.
  • SRH2 and IPv6 header 2 are encapsulated by the P3 node in Figure 2.
  • the source address of IPv6 header 2 is P3.
  • the last destination address of the forwarding path indicated by SRH1 is PE2.SID, so the destination address (Dst) of IPv6 header 2 needs to be updated to PE2.SID, after exchanging the source addresses of IPv6 header 2 and IPv6 header 1 , the fourth message is obtained.
  • the source address of IPv6 header 1 of the fourth message is P3, and the source address of IPv6 header 2 is PE1.
  • IPv6 header 1 is located in the outer layer of SRH1 and is adjacent to SRH1.
  • IPv6 header 1 and SRH1 are on the same layer.
  • IPv6 header 2 is located on the outer layer of SRH2 and is adjacent to SRH2.
  • IPv6 header 2 and SRH2 are on the same layer.
  • a fifth message is obtained, and all parts of the fifth message except the original message are consistent with the fourth message.
  • the service function node replies the fifth message to the first network device.
  • the first network device receives the fifth message sent by the service function node, updates the destination address of the outermost IPv6 header of the fifth message to the address of the next network device on the forwarding path indicated by the outermost SRH, and obtains the sixth message. message; forward the sixth message on the forwarding path indicated by the outermost SRH.
  • the first network device After the first network device receives the fifth message, since the destination address of the outermost IPv6 header of the fifth message is consistent with the destination address of the fourth message, which is the final destination address, in order to forward the fifth message to The next device on the path needs to change the destination address in the outermost IPv6 header of the fifth message to the address of the next network device on the forwarding path so that the message can continue to be transmitted along the forwarding path.
  • SF returns the processed packet to P4.
  • the destination address of the outermost IPv6 header of the packet returned to P4 is still the address of PE2.
  • P4 needs to change the outermost IPv6 header of the packet to P4. The address is changed to that of P5 so that the packet is forwarded to P5.
  • the service function node needs to match the forwarding policy based on the source address and destination address of the message, and the first network device exchanges the source address of the third message, then before the first network device obtains the sixth message, It is necessary to exchange the source address of the outermost IPv6 header of the fifth packet with the source address included in the IPv6 header of the same layer of the second SRH.
  • the destination address of the outermost IPv6 header of the fifth message is updated to the address of the next network device on the forwarding path indicated by the outermost SRH, and the source address of the outermost IPv6 header of the fifth message is changed.
  • the address is exchanged with the source address of the IPv6 header of the same layer of the second SRH to obtain the sixth message.
  • the first network device exchanges the source address of the fifth message in the same manner as the above-mentioned method of exchanging the source address of the third message, which will not be described again here.
  • the third service message may also be a traceroute message.
  • the first network device After determining that the part subsequent to the second SRH in the third message is the original message, the first network device also A Time To Live (TTL) time-to-live (TTL) timeout message may be sent to the second network device.
  • TTL time-to-live (TTL) timeout message The destination address of the TTL timeout message is the source address of the IPv6 header at the same layer as the second SRH.
  • the TTL timeout message is an Internet Control Message Protocol version 6 (ICMPv6) message.
  • ICMPv6 Internet Control Message Protocol version 6
  • PE1 can also send a route tracing message through the trace route function to detect the number of network devices between it and PE2.
  • the route tracing message The outer layer is encapsulated by PE1 and P3 with two layers of SRH and two IPv6 headers. P4 needs to set the destination address of the TTL expired message to the source address in the IPv6 header of the second SRH of the same layer of the route tracing message, that is PE1, sends a TTL timeout message to PE1.
  • sending a TTL timeout message whose destination address is set to the source address of the IPv6 header of the same layer as the second SRH, that is, the real source address of the third message, can be sent to the second network device, so that the TTL timeout message can be Correctly forwarded to the network device that initiated the traceroute function detection.
  • embodiments of the present application also provide a message processing device, which is applied to the first network device.
  • the device includes:
  • the forwarding module 1002 is configured to forward the second message.
  • the second message includes the first segment routing header SRH and the first message.
  • the first SRH includes tag information, and the tag information indicates the encapsulation basis of the first SRH.
  • the value of the mark information is the first value or the second value
  • the tag information When the value of the tag information is the first value, it indicates that the first SRH is an SRH encapsulated through the BSID;
  • the tag information When the value of the tag information is the second value, it indicates that the first SRH is not an SRH encapsulated through the BSID.
  • the device also includes: a packaging module;
  • An encapsulation module used to encapsulate the IPv6 header and the first SRH in the outer layer of the first message to obtain the second message if the destination address of the first message is the locally configured binding segment identifier BSID.
  • the first SRH includes a tag information, the value of the mark information is the first value; or,
  • the encapsulation module is used to encapsulate the IPv6 header and the first SRH in the outer layer of the first message if the next hop of the routing table entry matched by the first message is the SRv6 policy, and obtain the second message.
  • the first SRH includes Mark information, the value of the mark information is the second value.
  • the first SRH includes a flags field, and 1 bit in the flags field carries flag information.
  • the device also includes: a determination module;
  • the receiving module 1001 is also used to receive the third message sent by the second network device.
  • the third message includes at least one layer of SRH and IPv6 header, and each layer of SRH includes tag information;
  • the determination module is used to identify the tag information included in the SRH layer by layer starting from the outermost SRH, until the second SRH whose tag information is the second value is identified, and determine that the subsequent part of the second SRH in the third message is the original message.
  • the first network device is connected to the service function node; the forwarding module 1002 is also used to:
  • the destination address of the outermost IPv6 header of the third message is the locally configured static proxy SID or dynamic proxy SID, forward the original message to the service function node; or,
  • the destination address of the outermost IPv6 header of the third message is the locally configured pseudo-proxy SID, then update the destination address of the outermost IPv6 header to the address of the last network device in the forwarding path indicated by the second SRH to obtain the second four messages, and forwards the fourth message to the service function node.
  • the receiving module 1001 is also used to receive the fifth message sent by the service function node;
  • the forwarding module 1002 is also used to update the destination address of the outermost IPv6 header of the fifth message to the address of the next network device on the forwarding path indicated by the outermost SRH to obtain the sixth message;
  • the sixth message is forwarded on the forwarding path indicated by the outermost SRH.
  • forwarding module 1002 is also used for:
  • the forwarding module 1002 is also configured to send a time-to-live TTL timeout message to the second network device.
  • the destination address of the TTL timeout message is the source address of the IPv6 header of the same layer as the second SRH.
  • An embodiment of the present application also provides a network device.
  • the network device includes:
  • transceiver 1104
  • Machine-readable storage medium 1102. stores machine-executable instructions that can be executed by the processor 1101; the machine-executable instructions cause the processor 1101 to perform the following steps:
  • the second message is forwarded through the transceiver 1104.
  • the second message includes the first segment routing header SRH and the first message.
  • the first SRH includes tag information, and the tag information indicates the encapsulation basis of the first SRH.
  • the value of the mark information is the first value or the second value
  • the tag information When the value of the tag information is the first value, it indicates that the first SRH is an SRH encapsulated through the BSID;
  • the tag information When the value of the tag information is the second value, it indicates that the first SRH is not an SRH encapsulated through the BSID.
  • machine executable instructions also cause the processor 1101 to perform the following steps:
  • the IPv6 header and the first SRH are encapsulated in the outer layer of the first message to obtain the second message.
  • the first SRH includes tag information, and the tag information is value is the first value; or,
  • the IPv6 header and the first SRH are encapsulated in the outer layer of the first message to obtain the second message.
  • the first SRH includes tag information.
  • the value is the second value.
  • the first SRH includes a flags field, and 1 bit in the flags field carries flag information.
  • machine executable instructions also cause the processor 1101 to perform the following steps:
  • the third message includes at least one layer of SRH and IPv6 header, and each layer of SRH includes tag information;
  • the tag information included in the SRH is identified layer by layer until the second SRH whose tag information is the second value is identified, and the subsequent part of the second SRH in the third message is determined to be the original message.
  • machine executable instructions also cause the processor 1101 to perform the following steps:
  • the original message is forwarded to the service function node through the transceiver 1104; or,
  • the destination address of the outermost IPv6 header of the third message is the locally configured pseudo-proxy SID, then update the destination address of the outermost IPv6 header to the address of the last network device in the forwarding path indicated by the second SRH to obtain the second four messages, and forwards the fourth message to the service function node through the transceiver 1104.
  • machine executable instructions also cause the processor 1101 to perform the following steps:
  • the sixth message is forwarded through the transceiver 1104 on the forwarding path indicated by the outermost SRH.
  • machine executable instructions also cause the processor 1101 to perform the following steps:
  • the third message is a route tracing message; the machine executable instructions also cause the processor 1101 to perform the following steps:
  • the transceiver 1104 sends a time-to-live TTL timeout message to the second network device.
  • the destination address of the TTL timeout message is the source address of the IPv6 header of the same layer as the second SRH.
  • the network device may also include a communication bus 1103.
  • the processor 1101, the machine-readable storage medium 1102 and the transceiver 1104 complete mutual communication through the communication bus 1103.
  • the communication bus 1103 can be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard structure. (Extended Industry Standard Architecture, EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA Extended Industry Standard Architecture
  • the communication bus 1103 can be divided into an address bus, a data bus, a control bus, etc.
  • the transceiver 1104 may be a wireless communication module. Under the control of the processor 1101, the transceiver 1104 performs data interaction with other devices.
  • the machine-readable storage medium 1102 may include random access memory (Random Access Memory, RAM) or non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory.
  • RAM Random Access Memory
  • NVM Non-Volatile Memory
  • the machine-readable storage medium 1102 may also be at least one storage device located remotely from the aforementioned processor.
  • the processor 1101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP) or an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU central processing unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the embodiments of the present application also provide a machine-readable storage medium.
  • the machine-readable storage medium stores machine-executable information that can be executed by the processor. instruction.
  • the processor is caused by machine-executable instructions to implement the steps of any of the above message processing methods.
  • a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the steps of any of the message processing methods in the above embodiments.

Landscapes

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

Abstract

本申请提供报文处理,涉及通信技术领域,本申请方案包括:接收第一报文;转发第二报文,所述第二报文包括第一分段路由头SRH和第一报文,第一SRH包括标记信息,标记信息指示第一SRH的封装依据。可以使得中间节点准确获取原始报文。

Description

报文处理 技术领域
本申请涉及通信技术领域,特别涉及报文处理。
背景技术
在互联网协议第6版段路由(Segment Routing Internet Protocol Version 6,SRv6)网络中,可以通过SRv6策略实现流量工程。SRv6网络的头节点在接收到原始业务报文后,可基于SRv6策略在业务报文的外层封装段路由头(Segment Routing Header,SRH),SRH中包括段列表(Segment List),段列表中包括该业务报文在SRv6网络中的转发路径,进而SRv6网络中的节点可以基于该转发路径转发封装后的业务报文。
SRH的段列表中可能包括其他端点(endpoint)节点的绑定段标识(Binging segment identifier,BSID),SRv6网络中的endpoint节点接收到封装有SRH的业务报文后,如果确定业务报文的目的地址为自身的BSID,则会为业务报文再封装一个IPv6头和一个SRH,然后可按照此次封装的SRH指示的转发路径转发业务报文。
在一些场景中,SRv6网络中的中间节点需要获取业务报文包括的原始报文,在业务报文具有多层SRH和IPv6头的情况下,中间节点无法确定去除多少层SRH和IPv6头才能够恢复出原始报文,导致中间节点无法准确获取到原始报文。
发明内容
本申请实施例的目的在于报文处理,以使得中间节点可以准确获取原始报文。具体技术方案如下:
第一方面,本申请实施例提供了一种报文处理方法,所述方法应用于第一网络设备,所述方法包括:
接收第一报文;
转发第二报文,所述第二报文包括第一分段路由头SRH和所述第一报文,所述第一SRH包括标记信息,所述标记信息指示所述第一SRH的封装依据。
在一种可能的实现方式中,所述标记信息的取值为第一值或第二值;
当所述标记信息取值为所述第一值时,指示所述第一SRH是通过BSID封装的SRH;
当所述标记信息取值为所述第二值时,指示所述第一SRH不是通过BSID封装的SRH。
在一种可能的实现方式中,在所述转发第二报文之前,所述方法还包括:
若所述第一报文的目的地址为本地配置的绑定段标识BSID,则在所述第一报文外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第一值;或者,
若所述第一报文匹配的路由表项的下一跳为SRv6策略,则在所述第一报文的外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第二值。
在一种可能的实现方式中,所述第一SRH包括标记位flags字段,所述flags字段内的1个比特位承载所述标记信息。
在一种可能的实现方式中,所述方法还包括:
接收第二网络设备发送的第三报文,所述第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定所述第三报文中第二SRH后续的部分为原始报文。
在一种可能的实现方式中,所述第一网络设备与服务功能节点连接;在所述确定所述第三报文中第二SRH后续的部分为原始报文之后,所述方法还包括:
若所述第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则向所述服务功能节点转发所述原始报文;或者,
若所述第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将所述最外层IPv6头的目的地址更新为所述第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并向所述服务功能节点转发所述第四报文。
在一种可能的实现方式中,在所述向所述服务功能节点转发所述第四报文之后,所述方法还包括:
接收所述服务功能节点发送的所述第五报文;
将所述第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
在所述最外层SRH指示的转发路径上转发所述第六报文。
在一种可能的实现方式中,若所述第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,所述方法还包括:
将所述第三报文的最外层IPv6头的源地址与所述第二SRH同层的IPv6头包括的源地址互换;
所述接收所述服务功能节点发送的所述第五报文之后,所述方法还包括:
将所述第五报文最外层IPv6头的源地址与所述第二SRH同层的IPv6头的源地址互换。
在一种可能的实现方式中,所述第三报文为路由追踪报文;在所述确定所述第三报文中第二SRH后续的部分为原始报文之后,所述方法还包括:
向所述第二网络设备发送生存时间TTL超时报文,所述TTL超时报文的目的地址为与所述第二SRH同层的IPv6头的源地址。
第二方面,本申请实施例提供了一种报文处理装置,所述装置应用于第一网络设备,所述装置包括:
接收模块,用于接收第一报文;
转发模块,用于转发第二报文,所述第二报文包括第一分段路由头SRH和所述第一报文,所述第一SRH包括标记信息,所述标记信息指示所述第一SRH的封装依据。
在一种可能的实现方式中,所述标记信息的取值为第一值或第二值;
当所述标记信息取值为所述第一值时,指示所述第一SRH是通过BSID封装的SRH;
当所述标记信息取值为所述第二值时,指示所述第一SRH不是通过BSID封装的SRH。
在一种可能的实现方式中,所述装置还包括:封装模块;
所述封装模块,用于若所述第一报文的目的地址为本地配置的绑定段标识BSID,则在所述第一报文外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第一值;或者,
所述封装模块,用于若所述第一报文匹配的路由表项的下一跳为SRv6策略,则在所述第一报文的外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第二值。
在一种可能的实现方式中,所述第一SRH包括标记位flags字段,所述flags字段内的1个比特位承载所述标记信息。
在一种可能的实现方式中,所述装置还包括:确定模块;
所述接收模块,还用于接收第二网络设备发送的第三报文,所述第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
所述确定模块,用于从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定所述第三报文中第二SRH后续的部分为原始报文。
在一种可能的实现方式中,所述第一网络设备与服务功能节点连接;所述转发模块,还用于:
若所述第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则向所述服务功能节点转发所述原始报文;或者,
若所述第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将所述最外层IPv6头的目的地址更新为所述第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并向所述服务功能节点转发所述第四报文。
在一种可能的实现方式中,
所述接收模块,还用于接收所述服务功能节点发送的所述第五报文;
所述转发模块,还用于:
将所述第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
在所述最外层SRH指示的转发路径上转发所述第六报文。
在一种可能的实现方式中,所述转发模块,还用于:
将所述第三报文的最外层IPv6头的源地址与所述第二SRH同层的IPv6头包括的源地址互换;
将所述第五报文最外层IPv6头的源地址与所述第二SRH同层的IPv6头的源地址互换。
在一种可能的实现方式中,
所述转发模块,还用于向所述第二网络设备发送生存时间TTL超时报文,所述TTL超时报文的目的地址为与所述第二SRH同层的IPv6头的源地址。
第三方面,本申请实施例提供了一种网络设备,所述网络设备包括:
处理器;
收发器;
机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述机器可执行指令促使所述处理器执行以下步骤:
通过所述收发器接收第一报文;
通过所述收发器转发第二报文,所述第二报文包括第一分段路由头SRH和所述第一报文,所述第一SRH包括标记信息,所述标记信息指示所述第一SRH的封装依据。
在一种可能的实现方式中,所述标记信息的取值为第一值或第二值;
当所述标记信息取值为所述第一值时,指示所述第一SRH是通过BSID封装的SRH;
当所述标记信息取值为所述第二值时,指示所述第一SRH不是通过BSID封装的SRH。
在一种可能的实现方式中,所述机器可执行指令还促使所述处理器执行以下步骤:
若所述第一报文的目的地址为本地配置的绑定段标识BSID,则在所述第一报文外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第一值;或者,
若所述第一报文匹配的路由表项的下一跳为SRv6策略,则在所述第一报文的外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第二值。
在一种可能的实现方式中,所述第一SRH包括标记位flags字段,所述flags字段内的1个比特位承载所述标记信息。
在一种可能的实现方式中,所述机器可执行指令还促使所述处理器执行以下步骤:
通过所述收发器接收第二网络设备发送的第三报文,所述第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定所述第三报文中第二SRH后续的部分为原始报文。
在一种可能的实现方式中,所述机器可执行指令还促使所述处理器执行以下步骤:
若所述第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则通过所述收发器向所述服务功能节点转发所述原始报文;或者,
若所述第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将所述最外层IPv6头的目的地址更新为所述第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并通过所述收发器向所述服务功能节点转发所述第四报文。
在一种可能的实现方式中,所述机器可执行指令还促使所述处理器执行以下步骤:
通过所述收发器接收所述服务功能节点发送的所述第五报文;
将所述第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
通过所述收发器在所述最外层SRH指示的转发路径上转发所述第六报文。
在一种可能的实现方式中,所述机器可执行指令还促使所述处理器执行以下步骤:
将所述第三报文的最外层IPv6头的源地址与所述第二SRH同层的IPv6头包括的源地 址互换;
将所述第五报文最外层IPv6头的源地址与所述第二SRH同层的IPv6头的源地址互换。
在一种可能的实现方式中,所述第三报文为路由追踪报文;所述机器可执行指令还促使所述处理器执行以下步骤:
通过所述收发器向所述第二网络设备发送生存时间TTL超时报文,所述TTL超时报文的目的地址为与所述第二SRH同层的IPv6头的源地址。
第四方面,本申请实施例提供了一种机器可读存储介质,存储有机器可执行指令,在被处理器调用和执行时,所述机器可执行指令促使所述处理器:实现上述第一方面所述的方法步骤。
第五方面,本申请实施例提供了一种计算机程序产品,所述计算机程序产品促使所述处理器:实现上述第一方面所述的方法步骤。
本申请实施例提供的报文处理方法,第一网络设备在接收到第一报文之后,转发包括第一SRH和第一报文的第二报文,由于第一SRH包括的标记信息指示第一SRH的封装依据,使得接收到第二报文的中间节点可以根据SRH中的标记信息,区分出通过BSID封装的SRH,从而可以准确获取第二报文包括的原始报文。
附图说明
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。
图1为本申请实施例提供的一种服务链功能与SRv6结合场景的示意图;
图2为本申请实施例提供的一种报文跨域转发示意图;
图3为本申请实施例提供的另一种报文跨域转发示意图;
图4为本申请实施例提供的一种报文处理方法的流程示意图;
图5为本申请实施例提供的第一SRH的示意图;
图6为本申请实施例提供的Flags字段的示例性示意图;
图7为本申请实施例提供的一种报文封装示意图;
图8为本申请实施例提供的另一种报文处理方法流程示意图;
图9为本申请实施例提供的一种报文目的地址更新、源地址互换示意图;
图10为本申请实施例提供的一种报文处理装置的结构示意图;
图11为本申请实施例提供的一种网络设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为方便描述,对下面对本申请实施例涉及到的相关概念进行解释说明。
SRv6是一种源路由技术,SRv6网络的头节点可以为流量增加SRH封装,通过SRH头中的Segment List引导流量按照规定的路径转发。
服务链功能是指在流量转发的过程中,使得服务功能转发代理(Service Function Forwarder,SFF)节点按照规划的顺序将流量发送给服务功能(Service Function,SF)节点,使得SF节点处理流量,SF节点具体可以实现计费功能、防火墙功能等。
目前,服务链功能可以与SRv6结合,即可以在SRv6网络中实现服务链功能,通过SRv6的Segment List编排服务链。如图1所示,头节点(即服务链功能场景中的Classifier)接收到Original Packet(原始报文)后,在原始报文的外层封装互联网协议第6版(Internet Protocol Version 6,IPv6)头和SRH。
该IPv6头的源地址为原始业务报文的源地址,目的地址为SFF1。
SRH中包括的Segment List为SFF1::SF1,SFF2::SF2,SFF3。
其中,SFF1::SF1为SFF1的段标识(Segment ID,SID),类型可以为End.AD、End.AS或End.AM,用于指导SF1将报文发送给SF1;
SFF2::SF2为SFF2的SID,类型可以为End.AD、End.AS或End.AM,用于指导SFF2将报文发送给SF2;
SFF3为SFF3的SID,类型可以为普通的End类型。
头节点可以将封装IPv6头和SRH的报文转发给SFF1。若SFF1的类型为End.AD或End.AS,则SFF1可以将原始报文转发给SF1,SF1处理该原始报文后,向SFF1发送处理后的原始报文,进而SFF1重新为处理后的原始报文封装IPv6头和SRH,并向SFF2发送。SFF2对报文的处理与SFF1类似,此处不再赘述。
上述End.AD为一种SRv6 SID,用于表示End.AD所属的节点作为SR代理(Segment Routing Proxy),在把报文转发给SF节点处理之前,将报文的IPv6头和SRH暂时删除后,再转发给SF节点。在接收到SF节点处理后的报文后,基于动态缓存中缓存的IPv6头和SRH的信息,重新为报文封装IPv6头和SRH。也就是说,End.AD所属的节点可以作为动态代理节点,在动态缓存中为每条服务链维护一个动态缓存。
End.AS为另一种SRv6 SID,用于表示End.AS所属的节点作为SR代理(SR Proxy),可以实现类似End.AD类似的报文处理功能,与End.AD区别之处在于End.AS所属的节点通过静态配置信息重新为报文封装IPv6头和SRH,不需要维护动态缓存。
End.AM为又一种SRv6 SID,用于表示End.AM所属的SFF节点作为SR代理(SR Proxy),可以连接具有识别SRH能力的SF节点。End.AM所属的SFF节点在将报文转发给SF节点之前,会将报文的目的地址更新为SL=0的segment(段),即报文最终的目的地址,进而SF节点处理该报文之后,会基于目的地址再将处理后的报文返回给该SFF节点,进而SFF节点将报文的目的地址更新为SRH中当前SL指示的segment,使得报文被继续沿Segment List指示的路径转发。
在实际应用中,服务链路径可能是通过绑定SID(binding SID,BSID)衔接的,例如,以下给出了两种通过BSID衔接服务链路径的场景,分别是跨域场景和城域网场景。
图2为本申请实施例提供的一种报文跨域转发示意图,如图2所示,设备A要向设备 B发送业务报文,业务报文的转发路径跨越了第一自治系统(Autonomous System,AS)和第二AS。其中,第一AS中包括PE1、P1和P2,第二AS中包括:P3、P4、P5和PE2,P4与SF连接。
PE1接收到来自设备A的Original Packet(原始报文)后,需要在原始报文的外层封装IPv6头和SRH1,其中,SRH1包括的SID列表为:P1.SID,P2.SID,P3.SID,PE2.SID,其中,P3.SID为BSID。
当P3接收到业务报文后,确定业务报文的目的地址为P3.SID,是本地配置的BSID,则P3需要根据BSID关联的路径为业务报文再封装一个IPv6头和SRH2;其中,SRH2包括的SID列表为P4.SID,P5.SID。
当P4接收到业务报文时,原始报文的外层封装了两个IPv6头和两层SRH。若P4的SID类型为End.AD或End.AS,则P4需要将两层SRH和IPv6头都去除掉,将原始报文发送到SF。但是P4节点无法确定接收到业务报文外层封装了多少层SRH和IPv6头,也就无法准确去除SRH和IPv6头,导致P4节点无法准确获取到Original Packet(原始报文)。
在城域网场景中,城域网连接边缘数据中心(Edge-Data Center,Edge-DC),服务功能节点SF被部署在边缘DC中。在城域网上转发的流量,需要被引导至边缘DC内部,由边缘DC内部的SF节点处理后,才能继续在城域网转发。如图3所示,图3为本申请实施例提供的一种报文在城域网转发的示意图,从网络设备A发送到网络设备E的报文需要经过边缘DC中的SF的处理,整个转发路径通过SRv6策略编排,边缘DC内部部署基于SRv6的服务链路径,且在DC-B(Data Center-boarder)创建BSID与服务链路径关联。城域网的流量通过DC-B的BSID进入边缘DC。
具体的,当DC-B接收到设备C发送的报文时,DC-B根据BSID关联的路径在报文外层封装SRH,然后转发给DC-Spine,再由DC-Spine转发给DC-leaf。DC-leaf作为SFF节点,需要将接收到的报文转发给SF节点,而DC-leaf无法识别出接收到报文封装了多少层SRH,也就无法准确还原出原始报文,并向SF节点发送原始报文。
另外,在SFF节点的SID为End.AM类型的情况下,SFF节点需将报文的目的地址更新为SL=0的segment,也就是报文在SRv6网络中传输的最终目的地址,但是由于存在多层封装,最外层SRH中SL=0的segment并不是报文在SRv6网络中传输的最终目的地址。该最终目的地址被封装在内层的SRH中,而SFF节点无法识别出哪一层SRH中封装有该最终目的地址,导致无法准确地更新报文的目的地址。
可选地,服务功能节点还可以作为endpoint节点被部署在转发路径上,即服务功能节点为Segment List指示的转发路径中的一个节点。对于部署在SRv6转发路径上的服务功能节点,当该服务功能节点接收到外层封装有多层SRH的报文时,该服务功能节点无法跨越多层SRH提取原始报文。
例如,假设将图2中第二AS内的中间节点P5作为服务功能节点,P4将包括两层SRH的报文转发到P5,此时P5无法识别出报文中的原始报文。
在上述两种场景中,头节点可以通过路由追踪(traceroute)功能检测SRv6策略指示的路径上的三层设备,以图2为例,PEI可以发送原始traceroute报文。如果该原始traceroute 报文被转发到P3,则P3会再为该原始traceroute报文封装一层SRH和IPv6头,该IPv6头的源地址为P3的地址,且该IPv6头会继承原始traceroute报文的IPv6头的Hoplimit(跳数限制)。如此P4和P5作为第二AS内的中间节点,在接收到traceroute报文后,也可检测Hoplimit是否非法,并在确定Hoplimit非法的情况下回复ICMPv6报文。而中间节点生成的ICMPv6报文的目的地址是中间节点接收到的traceroute报文的源地址,也就是P3的地址,导致该ICMPv6报文不能被发送到发起traceroute操作的头节点PE1。
此外,在另一些场景中,SRv6网络的中间节点需要通过包监控工具监控流量,并对流量进行分析,由于报文的外层封装了多层SRH和IPv6头,则无法快速提取出报文中包括的原始有效载荷。
为了解决无法从具有多层SRH封装的报文中识别原始报文的问题,本申请实施例提供了一种报文处理方法,该方法应用于第一网络设备,如图4所示,该方法包括:
S401、接收第一报文。
其中,第一报文可以为业务报文、BFD报文或traceroute报文等任意可以在部署有服务链的SRv6网络中传输的报文。
S402、转发第二报文,第二报文包括第一分段路由头SRH和第一报文,第一SRH包括标记信息,标记信息指示第一SRH的封装依据。
采用该方法,第一网络设备在接收到第一报文之后,转发包括第一SRH和第一报文的第二报文,由于第一SRH包括的标记信息指示第一SRH的封装依据,使得接收到第二报文的节点可以根据标记信息指示的封装依据区分出SRH是如何被封装的,进而即使第二报文中包括多层SRH,接收到第二报文的节点也可基于各层SRH的封装依据准确获取第二报文包括的原始报文。
在本申请实施例中,封装依据可以包括:通过BSID进行的封装以及不是通过BSID进行的封装。相应地,标记信息的取值为第一值或第二值。
例如,第一值可以为1,第二值可以为0。
当标记信息取值为第一值时,指示第一SRH是通过BSID封装的SRH。
当标记信息取值为第二值时,指示第一SRH不是通过BSID封装的SRH。
可选的,第一SRH包括标记位flags字段,flags字段内的1个比特位承载标记信息。
例如,如图5所示,图5为本申请实施例提供的SRH结构示意图,SRH包括以下字段:
下一个报头(Next Header),长度为8bits,用于标识下一个报文头的类型。
SRH长度(Hdr Ext Len),长度为8bits,表示以8个字节为单位的SRH头的长度,不包括第一个8个字节。
路由类型(Routing Type),长度为8bits,取值为4,表示携带的是SRH。
段索引(Segments Left,SL),长度为8bits,为下一个要处理的段列表的编号。
最后一跳(Last Entry),长度为8bits,取值为SRH头中报文实际转发路径的第一个SID的编号。
标志位(Flags),长度为8bits,为标记位信息。
标签(Tag),长度为16bits,用于标记具有相同特性的一组报文。
段列表(Segment List),为SID列表,按照报文转发路径上节点从远到近的顺序进行排列,即Segment List[0]表示路径的最后一个SID,Segment List[1]表示路径的倒数第二个SID,以此类推。每个SID均可以为一个128bit的IPv6地址。SRv6报文按照Segments List的IPv6地址被依次转发,其中Segments List[0]表示转发路径上最后一个网络设备的地址。
Optional Type Length Value objects()variable,可选类型长度值对象变量。
图5示出的是未压缩的完整的SID,本申请实施例中,Segment List也可以携带压缩后的SID。
如图6所示,图6为图5中的Flags字段示例性示意图,作为示例,本申请实施例可以占用Flags字段中的第3个比特位承载标记信息,该标记信息具体可以为绑定SID封装标志(Binging SID Encapsulation Flag,BE Flag)。
可选的,若BE Flag被置位,即BE Flag的取值为1,则指示第一SRH是通过BSID封装的SRH;若BE Flag未置位,即BE Flag取值为0,则指示第一SRH不是通过BSID封装的SRH。
在本申请的一个实施例中,在图4对应实施例的基础上,在S402、转发第二报文之前,第一网络设备还需生成第二报文,具体包括以下两种情况:
情况一、若第一报文的目的地址为本地配置的绑定段标识BSID,则在第一报文外层封装IPv6头和第一SRH,得到第二报文,第一SRH包括标记信息,标记信息取值为第一值。
其中,若第一报文的目的地址为本地配置的BSID,则说明第一报文中已经包括BSID,第一网络设备需要在第一报文外层额外封装一层IPv6头和SRH,此时封装的SRH中的标记信息可以置为1,表示该SRH的封装依据为通过BSID进行的封装。
作为示例,在这种情况下,第一网络设备可以为图2中的P3,或者为图3中的DC-B。
情况二、若第一报文匹配的路由表项的下一跳为SRv6策略,则在第一报文的外层封装IPv6头和第一SRH,得到第二报文,第一SRH包括标记信息,标记信息取值为第二值。
第一网络接收到第一报文后,将第一报文与自身存储的路由表项进行匹配,若匹配到的路由表项的下一跳为SRv6策略,则说明第一网络设备为头节点,这种情况下,第一报文可以为来自CE设备的业务报文。
进而,第一网络设备基于SRv6策略封装第一SRH,并将第一SRH中的标记信息置为0,指示第一SRH不是通过BSID封装得到的。
作为示例,这种情况下,第一网络设备可以为图2中的PE1,或者为图3中的设备A。
以图2的场景为例对上述两种封装情况进行说明,如图7所示,图7为图2中PE1节点和P3节点对报文的封装示意图,PE1接收到设备A发送的Original Packet(原始报文)后,确定该原始报文与SRv6策略匹配,该报文被引流至去往PE2的SRv6策略。PE1可以根据SRv6策略中的Segment list(P1.SID,P2.SID,P3.SID,PE2.SID)为报文增加IPv6 头和SRH封装,并按照Segment list指示的路径转发该报文。其中,IPv6头的源地址为PE1的SID,SRH中的BE-FLAG=0,即BE-FLAG未置位,表示该SRH不是通过BSID封装。
后续当P3接收到PE1封装过的报文时,识别到报文的IPv6头中的目的地址与本地配置的BSID相同,则获取本地配置的BSID关联的Segment list(P5.SID,P4::SF),根据该Segment list对报文进行加封装,即在报文的外层封装IPv6头和SRH。其中,该IPv6头的源地址为P3的SID,该SRH中的BE-FLAG=1,BE-FLAG置位,表示该SRH是通过BSID封装的。
以上仅以报文的转发路径经过两个AS为例进行说明,实际报文可能经过多个AS,则报文中包括多个SRH和IPv6头。
采用该方法,第一网络设备在接收到第一报文后,在第一报文的目的地址为本地配置的BSID情况下,在封装的SRH中设置取值为第一值的标记信息。在第一报文的路由表项的下一跳为SRv6策略的情况下,在封装的SRH中设置取值为第二值的标记信息。如此可以使得后续网络设备根据标记信息的取值判断出第一SRH是否是通过BSID封装得到的,进而可以准确从经过多层封装的报文中识别出原始报文。
在本申请另一实施例中,上述第一网络设备还可以作为其他转发路径上的需要识别原始报文的中间节点,或者也可以为包监控设备等能够抓取转发路径上传输的报文的设备,如图8所示,该方法还包括:
S801、接收第二网络设备发送的第三报文。
其中,第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息。
S802、从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定第三报文中第二SRH后续的部分为原始报文。
本申请实施例中,第三报文每一层SRH均包括标记信息,当识别到第二SRH时,确定二SRH包括的标记信息取值为第二值,则确定第二SRH不是通过BSID封装得到的,第二SRH的后续部分为原始报文。
一种实现方式中,第一网络设备可以从第三报文的最外层SRH开始,逐层识别SRH中的BE Flag是否置位,直至识别到包括未置位的BE Flag的第二SRH,则确定第二SRH的后续部分为原始报文。
例如,以图7中最右侧的报文为例,可以先识别外层SRH的BE Flag为1,则继续识别内层的SRH,识别到内层的SRH的BE Flag为0,则可确定该内层的SRH的后续部分为原始报文。
采用该方法,第一网络设备可以逐层识别第三报文的多层SRH包括的标记信息,当识别到取值为第二值的标记信息的第二SRH时,由于取值为第二值的标记信息指示第二SRH不是通过BSID封装得到的,所以可以确定第二SRH的后续部分为原始报文,第一网络设备可以准确提取原始报文。
在另一实施例中,第一网络设备还可以与服务功能节点连接,即第一网络设备可作为SFF。例如,第一网络设备为图2中的P4或者图3中的DC-leaf。
在这种实现场景下,在上述S802、从最外层SRH开始,逐层识别SRH包括的标记信 息,直至识别到标记信息为第二值的第二SRH时,确定第三报文中第二SRH后续的部分为原始报文之后,可以按照以下方式一或方式二实现。
方式一、若第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则向服务功能节点转发原始报文;
本申请实施例中,若第三报文最外层IPv6头的目的地址为本地配置的静态代理SID(End.AS SID)或者动态代理SID(End.AD SID),则第一网络设备可以从第三报文的最外层SRH开始,逐层删除SRH和IPv6,直至将第二SRH以及第二SRH外层的IPv6头删除,得到原始报文。
进而,第一网络设备将原始报文发送到服务功能节点,使得服务功能节点可以正常处理原始报文,可以避免第一网络设备无法出识别原始报文,导致第一网络设备无法向服务功能节点转发正确的原始报文的问题。
方式二、若第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将最外层IPv6头的目的地址更新为第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并向服务功能节点转发第四报文。
其中,若第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则说明第一网络设备的SID为End.AM SID,第一网络设备需将最外层IPv6头的目的地址更新为SL=0的segment,也就是最终的目的地址。
可以理解的是,通过BSID封装的SRH中SL=0的segment中不是最终的目的地址,最终目的地址实际在头节点封装的SRH中,也就是上述第二SRH中。所以,第一网络设备将最外层IPv6头的目的地址更新为第二SRH中SL=0的segment,得到第四报文。如此,可以使得服务功能节点处理完第四报文后,正确地进行转发。
可选地,如果服务功能节点需要根据报文的源地址和目的地址匹配转发策略,则第一网络设备还需将最外层IPv6头的源地址更新为转发路径实际的源地址。即,在上述得到第四报文之前,还可以将第三报文的最外层IPv6头的源地址与第二SRH同层的IPv6头包括的源地址互换。
也就是说,将第三报文的最外层IPv6头的目的地址更新为第二SRH指示的转发路径的最后一个网络设备的地址,并将最外层IPv6头的源地址与第二SRH同层的IPv6头包括的源地址互换,进而得到第四报文。
其中,与第二SRH同层的IPv6头为在第二SRH外层且与第二SRH邻近的IPv6头。
如图9所示,以第三报文包括两层SRH和两个IPv6头为例进行说明,假设第三报文的SRH1以及IPv6头1是图2中PE1节点封装的,IPv6头1的源地址(Source address,Scr)为PE1。SRH2和IPv6头2为图2中P3节点封装的。IPv6头2的源地址为P3。SRH1指示的转发路径的最后一个目的地址为PE2.SID,所以IPv6头2的目的地址(Destination address,Dst)需要被更新为PE2.SID,将IPv6头2和IPv6头1的源地址互换之后,得到第四报文,第四报文的IPv6头1的源地址为P3,IPv6头2的源地址为PE1。
上述IPv6头1位于SRH1的外层,且和SRH1邻近,IPv6头1和SRH1是同层的;IPv6头2位于SRH2的外层,且和SRH2邻近,IPv6头2和SRH2是同层的。
当服务功能节点对第四报文处理完成之后,得到第五报文,第五报文中除原始报文以外的部分都与第四报文一致。服务功能节点将第五报文回复给第一网络设备。
第一网络设备接收服务功能节点发送的第五报文,将第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;在最外层SRH指示的转发路径上转发第六报文。
第一网络设备接收到第五报文之后,由于第五报文的最外层IPv6头的目的地址和第四报文的目的地址一致,为最终目的地址,为了将第五报文转发到转发路径上的下一设备,需要将第五报文最外层的IPv6头中的目的地址更改为转发路径上的下一网络设备的地址,以使得报文可以沿转发路径继续传输。
如图2所示,SF将处理完成的报文返回到P4,此时返回到P4的报文的最外层IPv6头的目的地址仍然为PE2的地址,P4需要将最外层IPv6头中的地址改为P5的地址,以使得报文被转发到P5。
如果服务功能节点需要根据报文的源地址和目的地址匹配转发策略,第一网络设备将第三报文的源地址进行了互换,那么在第一网络设备在得到第六报文之前,还需要将第五报文的最外层IPv6头的源地址与第二SRH同层的IPv6头包括的源地址互换。
也就是说,将第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径上的下一网络设备的地址,并将第五报文最外层IPv6头的源地址与第二SRH同层的IPv6头的源地址互换,得到第六报文。
第一网络设备互换第五报文的源地址的方式与上述互换第三报文源地址的方式相同,此处不再赘述。
在本申请另一实施例中,上述第三业务报文还可以为路由追踪(traceroute)报文,在确定第三报文中第二SRH后续的部分为原始报文之后,第一网络设备还可以向第二网络设备发送生存时间(Time To Live,TTL)超时报文,TTL超时报文的目的地址为与第二SRH同层的IPv6头的源地址。
其中,TTL超时报文为互联网控制信息协议版本六(Internet Control Message Protocol version 6,ICMPv6)报文,第一网络设备接收到路由追踪报文后,若根据路由追踪报文确定TTL超时,则向第二网络设备发送TTL超时报文。
如图2所示,PE1还可以通过追踪路由功能发送路由追踪报文,以此来探测和PE2之间的网络设备数量,当第一网络设备P4接收到路由追踪报文时,路由追踪报文的外层被PE1和P3封装了两层SRH和两个IPv6头,P4需要将将TTL超时报文的目的地址设置为路由追踪报文的第二SRH同层的IPv6头中的源地址,即PE1,向PE1发送TTL超时报文。
采用该方法,向第二网络设备发送目的地址设置为与第二SRH同层的IPv6头的源地址的TTL超时报文,即第三报文的真实源地址,可以使得TTL超时报文可以被正确转发到发起traceroute功能探测的网络设备。
基于相同的发明构思,本申请实施例还提供了一种报文处理装置,该装置应用于第一网络设备,如图10所示,该装置包括:
接收模块1001,用于接收第一报文;
转发模块1002,用于转发第二报文,第二报文包括第一分段路由头SRH和第一报文,第一SRH包括标记信息,标记信息指示第一SRH的封装依据。
可选的,标记信息的取值为第一值或第二值;
当标记信息取值为第一值时,指示第一SRH是通过BSID封装的SRH;
当标记信息取值为第二值时,指示第一SRH不是通过BSID封装的SRH。
可选的,该装置还包括:封装模块;
封装模块,用于若第一报文的目的地址为本地配置的绑定段标识BSID,则在第一报文外层封装IPv6头和第一SRH,得到第二报文,第一SRH包括标记信息,标记信息取值为第一值;或者,
封装模块,用于若第一报文匹配的路由表项的下一跳为SRv6策略,则在第一报文的外层封装IPv6头和第一SRH,得到第二报文,第一SRH包括标记信息,标记信息取值为第二值。
可选的,第一SRH包括标记位flags字段,flags字段内的1个比特位承载标记信息。
可选的,该装置还包括:确定模块;
接收模块1001,还用于接收第二网络设备发送的第三报文,第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
确定模块,用于从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定第三报文中第二SRH后续的部分为原始报文。
可选的,第一网络设备与服务功能节点连接;转发模块1002,还用于:
若第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则向服务功能节点转发原始报文;或者,
若第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将最外层IPv6头的目的地址更新为第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并向服务功能节点转发第四报文。
可选的,
接收模块1001,还用于接收服务功能节点发送的第五报文;
转发模块1002,还用于将第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
在最外层SRH指示的转发路径上转发第六报文。
可选的,转发模块1002,还用于:
将第三报文的最外层IPv6头的源地址与第二SRH同层的IPv6头包括的源地址互换;
将第五报文最外层IPv6头的源地址与第二SRH同层的IPv6头的源地址互换。
可选的,转发模块1002,还用于向第二网络设备发送生存时间TTL超时报文,TTL超时报文的目的地址为与第二SRH同层的IPv6头的源地址。
本申请实施例还提供了一种网络设备,如图11所示,该网络设备包括:
处理器1101;
收发器1104;
机器可读存储介质1102,机器可读存储介质1102存储有能够被处理器1101执行的机器可执行指令;机器可执行指令促使处理器1101执行以下步骤:
通过收发器1104接收第一报文;
通过收发器1104转发第二报文,第二报文包括第一分段路由头SRH和第一报文,第一SRH包括标记信息,标记信息指示第一SRH的封装依据。
可选的,标记信息的取值为第一值或第二值;
当标记信息取值为第一值时,指示第一SRH是通过BSID封装的SRH;
当标记信息取值为第二值时,指示第一SRH不是通过BSID封装的SRH。
可选的,机器可执行指令还促使处理器1101执行以下步骤:
若第一报文的目的地址为本地配置的绑定段标识BSID,则在第一报文外层封装IPv6头和第一SRH,得到第二报文,第一SRH包括标记信息,标记信息取值为第一值;或者,
若第一报文匹配的路由表项的下一跳为SRv6策略,则在第一报文的外层封装IPv6头和第一SRH,得到第二报文,第一SRH包括标记信息,标记信息取值为第二值。
可选的,第一SRH包括标记位flags字段,flags字段内的1个比特位承载标记信息。
可选的,机器可执行指令还促使处理器1101执行以下步骤:
通过收发器1104接收第二网络设备发送的第三报文,第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定第三报文中第二SRH后续的部分为原始报文。
可选的,机器可执行指令还促使处理器1101执行以下步骤:
若第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则通过收发器1104向服务功能节点转发原始报文;或者,
若第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将最外层IPv6头的目的地址更新为第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并通过收发器1104向服务功能节点转发第四报文。
可选的,机器可执行指令还促使处理器1101执行以下步骤:
通过收发器1104接收服务功能节点发送的第五报文;
将第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
通过收发器1104在最外层SRH指示的转发路径上转发第六报文。
可选的,机器可执行指令还促使处理器1101执行以下步骤:
将第三报文的最外层IPv6头的源地址与第二SRH同层的IPv6头包括的源地址互换;
将第五报文最外层IPv6头的源地址与第二SRH同层的IPv6头的源地址互换。
可选的,第三报文为路由追踪报文;机器可执行指令还促使处理器1101执行以下步骤:
通过收发器1104向第二网络设备发送生存时间TTL超时报文,TTL超时报文的目的地址为与第二SRH同层的IPv6头的源地址。
如图11所示,网络设备还可以包括通信总线1103。处理器1101、机器可读存储介质1102及收发器1104之间通过通信总线1103完成相互间的通信,通信总线1103可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线1103可以分为地址总线、数据总线、控制总线等。
收发器1104可以为无线通信模块,收发器1104在处理器1101的控制下,与其他设备进行数据交互。
机器可读存储介质1102可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。另外,机器可读存储介质1102还可以是至少一个位于远离前述处理器的存储装置。
处理器1101可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
基于同一种发明构思,根据上述本申请实施例提供的报文处理方法,本申请实施例还提供了一种机器可读存储介质,机器可读存储介质存储有能够被处理器执行的机器可执行指令。处理器被机器可执行指令促使实现上述任一报文处理方法的步骤。
在本申请提供的又一实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例中任一报文处理方法的步骤。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (29)

  1. 一种报文处理方法,其特征在于,所述方法应用于第一网络设备,所述方法包括:
    接收第一报文;
    转发第二报文,所述第二报文包括第一分段路由头SRH和所述第一报文,所述第一SRH包括标记信息,所述标记信息指示所述第一SRH的封装依据。
  2. 根据权利要求1所述的方法,其特征在于,所述标记信息的取值为第一值或第二值;
    当所述标记信息取值为所述第一值时,指示所述第一SRH是通过BSID封装的SRH;
    当所述标记信息取值为所述第二值时,指示所述第一SRH不是通过BSID封装的SRH。
  3. 根据权利要求2所述的方法,其特征在于,在所述转发第二报文之前,所述方法还包括:
    若所述第一报文的目的地址为本地配置的绑定段标识BSID,则在所述第一报文外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第一值;或者,
    若所述第一报文匹配的路由表项的下一跳为SRv6策略,则在所述第一报文的外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第二值。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一SRH包括标记位flags字段,所述flags字段内的1个比特位承载所述标记信息。
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    接收第二网络设备发送的第三报文,所述第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
    从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定所述第三报文中第二SRH后续的部分为原始报文。
  6. 根据权利要求5所述的方法,其特征在于,所述第一网络设备与服务功能节点连接;在所述确定所述第三报文中第二SRH后续的部分为原始报文之后,所述方法还包括:
    若所述第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则向所述服务功能节点转发所述原始报文;或者,
    若所述第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将所述最外层IPv6头的目的地址更新为所述第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并向所述服务功能节点转发所述第四报文。
  7. 根据权利要求6所述的方法,其特征在于,在所述向所述服务功能节点转发所述第四报文之后,所述方法还包括:
    接收所述服务功能节点发送的所述第五报文;
    将所述第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
    在所述最外层SRH指示的转发路径上转发所述第六报文。
  8. 根据权利要求7所述的方法,其特征在于,
    在所述得到第四报文之前,所述方法还包括:
    将所述第三报文的最外层IPv6头的源地址与所述第二SRH同层的IPv6头包括的源地址互换;
    在所述得到第六报文之前,所述方法还包括:
    将所述第五报文最外层IPv6头的源地址与所述第二SRH同层的IPv6头的源地址互换。
  9. 根据权利要求5所述的方法,其特征在于,所述第三报文为路由追踪报文;在所述确定所述第三报文中第二SRH后续的部分为原始报文之后,所述方法还包括:
    向所述第二网络设备发送生存时间TTL超时报文,所述TTL超时报文的目的地址为与所述第二SRH同层的IPv6头的源地址。
  10. 一种报文处理装置,其特征在于,所述装置应用于第一网络设备,所述装置包括:
    接收模块,用于接收第一报文;
    转发模块,用于转发第二报文,所述第二报文包括第一分段路由头SRH和所述第一报文,所述第一SRH包括标记信息,所述标记信息指示所述第一SRH的封装依据。
  11. 根据权利要求10所述的装置,其特征在于,所述标记信息的取值为第一值或第二值;
    当所述标记信息取值为所述第一值时,指示所述第一SRH是通过BSID封装的SRH;
    当所述标记信息取值为所述第二值时,指示所述第一SRH不是通过BSID封装的SRH。
  12. 根据权利要求11所述的装置,其特征在于,所述装置还包括:封装模块;
    所述封装模块,用于若所述第一报文的目的地址为本地配置的绑定段标识BSID,则在所述第一报文外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第一值;或者,
    所述封装模块,用于若所述第一报文匹配的路由表项的下一跳为SRv6策略,则在所述第一报文的外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第二值。
  13. 根据权利要求10-12任一项所述的装置,其特征在于,所述第一SRH包括标记位flags字段,所述flags字段内的1个比特位承载所述标记信息。
  14. 根据权利要求10所述的装置,其特征在于,所述装置还包括:确定模块;
    所述接收模块,还用于接收第二网络设备发送的第三报文,所述第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
    所述确定模块,用于从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定所述第三报文中第二SRH后续的部分为原始报文。
  15. 根据权利要求14所述的装置,其特征在于,所述第一网络设备与服务功能节点连接;所述转发模块,还用于:
    若所述第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则向所述服务功能节点转发所述原始报文;或者,
    若所述第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将所述最外层IPv6头的目的地址更新为所述第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并向所述服务功能节点转发所述第四报文。
  16. 根据权利要求15所述的装置,其特征在于,
    所述接收模块,还用于接收所述服务功能节点发送的所述第五报文;
    所述转发模块,还用于:
    将所述第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
    在所述最外层SRH指示的转发路径上转发所述第六报文。
  17. 根据权利要求16所述的装置,其特征在于,所述转发模块,还用于:
    将所述第三报文的最外层IPv6头的源地址与所述第二SRH同层的IPv6头包括的源地址互换;
    将所述第五报文最外层IPv6头的源地址与所述第二SRH同层的IPv6头的源地址互换。
  18. 根据权利要求14所述的装置,其特征在于,
    所述转发模块,还用于向所述第二网络设备发送生存时间TTL超时报文,所述TTL超时报文的目的地址为与所述第二SRH同层的IPv6头的源地址。
  19. 一种网络设备,其特征在于,所述网络设备包括:
    处理器;
    收发器;
    机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述机器可执行指令促使所述处理器执行以下步骤:
    通过所述收发器接收第一报文;
    通过所述收发器转发第二报文,所述第二报文包括第一分段路由头SRH和所述第一报文,所述第一SRH包括标记信息,所述标记信息指示所述第一SRH的封装依据。
  20. 根据权利要求19所述的网络设备,其特征在于,所述标记信息的取值为第一值或第二值;
    当所述标记信息取值为所述第一值时,指示所述第一SRH是通过BSID封装的SRH;
    当所述标记信息取值为所述第二值时,指示所述第一SRH不是通过BSID封装的SRH。
  21. 根据权利要求20所述的网络设备,其特征在于,所述机器可执行指令还促使所述处理器执行以下步骤:
    若所述第一报文的目的地址为本地配置的绑定段标识BSID,则在所述第一报文外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第一值;或者,
    若所述第一报文匹配的路由表项的下一跳为SRv6策略,则在所述第一报文的外层封装IPv6头和第一SRH,得到所述第二报文,所述第一SRH包括标记信息,所述标记信息取值为所述第二值。
  22. 根据权利要求19-21任一项所述的网络设备,其特征在于,所述第一SRH包括标 记位flags字段,所述flags字段内的1个比特位承载所述标记信息。
  23. 根据权利要求19所述的网络设备,其特征在于,所述机器可执行指令还促使所述处理器执行以下步骤:
    通过所述收发器接收第二网络设备发送的第三报文,所述第三报文包括至少一层SRH和IPv6头,每一层SRH均包括标记信息;
    从最外层SRH开始,逐层识别SRH包括的标记信息,直至识别到标记信息为第二值的第二SRH时,确定所述第三报文中第二SRH后续的部分为原始报文。
  24. 根据权利要求23所述的网络设备,其特征在于,所述机器可执行指令还促使所述处理器执行以下步骤:
    若所述第三报文最外层IPv6头的目的地址为本地配置的静态代理SID或者动态代理SID,则通过所述收发器向所述服务功能节点转发所述原始报文;或者,
    若所述第三报文最外层IPv6头的目的地址为本地配置的伪代理SID,则将所述最外层IPv6头的目的地址更新为所述第二SRH指示的转发路径的最后一个网络设备的地址,得到第四报文,并通过所述收发器向所述服务功能节点转发所述第四报文。
  25. 根据权利要求24所述的网络设备,其特征在于,所述机器可执行指令还促使所述处理器执行以下步骤:
    通过所述收发器接收所述服务功能节点发送的所述第五报文;
    将所述第五报文的最外层IPv6头的目的地址更新为最外层SRH指示的转发路径的下一个网络设备的地址,得到第六报文;
    通过所述收发器在所述最外层SRH指示的转发路径上转发所述第六报文。
  26. 根据权利要求25所述的网络设备,其特征在于,所述机器可执行指令还促使所述处理器执行以下步骤:
    将所述第三报文的最外层IPv6头的源地址与所述第二SRH同层的IPv6头包括的源地址互换;
    将所述第五报文最外层IPv6头的源地址与所述第二SRH同层的IPv6头的源地址互换。
  27. 根据权利要求23所述的网络设备,其特征在于,所述第三报文为路由追踪报文;所述机器可执行指令还促使所述处理器执行以下步骤:
    通过所述收发器向所述第二网络设备发送生存时间TTL超时报文,所述TTL超时报文的目的地址为与所述第二SRH同层的IPv6头的源地址。
  28. 一种机器可读存储介质,其特征在于,存储有机器可执行指令,在被处理器调用和执行时,所述机器可执行指令促使所述处理器:实现权利要求1-9任一所述的方法步骤。
  29. 一种计算机程序产品,其特征在于,所述计算机程序产品促使所述处理器:实现权利要求1-9任一所述的方法步骤。
PCT/CN2022/101722 2022-06-28 2022-06-28 报文处理 WO2024000137A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202280001936.9A CN117643016A (zh) 2022-06-28 2022-06-28 报文处理
PCT/CN2022/101722 WO2024000137A1 (zh) 2022-06-28 2022-06-28 报文处理

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/101722 WO2024000137A1 (zh) 2022-06-28 2022-06-28 报文处理

Publications (1)

Publication Number Publication Date
WO2024000137A1 true WO2024000137A1 (zh) 2024-01-04

Family

ID=89383684

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/101722 WO2024000137A1 (zh) 2022-06-28 2022-06-28 报文处理

Country Status (2)

Country Link
CN (1) CN117643016A (zh)
WO (1) WO2024000137A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117896177A (zh) * 2024-03-12 2024-04-16 明阳产业技术研究院(沈阳)有限公司 一种基于IPv6密码标识的SRv6通信方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020086570A1 (en) * 2018-10-22 2020-04-30 Cisco Technology, Inc. Packet network interworking including segment routing
CN112787921A (zh) * 2019-11-08 2021-05-11 华为技术有限公司 报文传输方法、代理节点及存储介质
CN113746729A (zh) * 2020-05-28 2021-12-03 华为技术有限公司 绑定段标识的处理方法及设备
CN113794637A (zh) * 2021-08-20 2021-12-14 新华三信息安全技术有限公司 Sid列表的处理方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020086570A1 (en) * 2018-10-22 2020-04-30 Cisco Technology, Inc. Packet network interworking including segment routing
CN112787921A (zh) * 2019-11-08 2021-05-11 华为技术有限公司 报文传输方法、代理节点及存储介质
CN113746729A (zh) * 2020-05-28 2021-12-03 华为技术有限公司 绑定段标识的处理方法及设备
CN113794637A (zh) * 2021-08-20 2021-12-14 新华三信息安全技术有限公司 Sid列表的处理方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117896177A (zh) * 2024-03-12 2024-04-16 明阳产业技术研究院(沈阳)有限公司 一种基于IPv6密码标识的SRv6通信方法及系统
CN117896177B (zh) * 2024-03-12 2024-05-14 明阳产业技术研究院(沈阳)有限公司 一种基于IPv6密码标识的SRv6通信方法及系统

Also Published As

Publication number Publication date
CN117643016A (zh) 2024-03-01

Similar Documents

Publication Publication Date Title
US11374862B2 (en) Packet sending and processing method and apparatus, PE node, and node
US11979322B2 (en) Method and apparatus for providing service for traffic flow
US11374848B2 (en) Explicit routing with network function encoding
US10158568B2 (en) Method and apparatus for service function forwarding in a service domain
CN107211048B (zh) 使用源路由的业务链接
US20190356594A1 (en) Packet Processing Method, Apparatus, and System
US10862793B2 (en) Centralized error telemetry using segment routing header tunneling
KR101258015B1 (ko) Ndp 중재 방법 및 데이터 통신 수행 방법
CN105577416B (zh) 一种业务功能链操作、管理和维护方法及节点设备
WO2024000137A1 (zh) 报文处理
JP4778594B2 (ja) パケット中継装置、パケット中継方法およびプログラム
CN113950811B (zh) 扩展bgp保护以用于sr路径入口保护
US20230327983A1 (en) Performance measurement in a segment routing network
CN108282404B (zh) 一种路由生成方法、装置及系统
WO2024000140A1 (zh) 报文发送
CN112737889B (zh) 流量处理方法、流量监控方法、装置、系统及存储介质
CN116132555A (zh) 一种报文处理方法和系统
WO2024000139A1 (zh) 报文转发
CN113055268A (zh) 隧道流量负载均衡的方法、装置、设备及介质
US20240223496A1 (en) Packet transmission method, apparatus, and system, network device, and storage medium
EP4333382A1 (en) Packet transmission method, apparatus and system, network device, and storage medium
WO2024000136A1 (zh) 报文发送
US20240171510A1 (en) Packet transmission method and related device
WO2022199486A1 (zh) 路径跟踪方法、设备和存储介质
CN116366300A (zh) 数据传输方法、设备和数据传输系统

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: 22948260

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022948260

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022948260

Country of ref document: EP

Effective date: 20240530