WO2023134631A1 - 数据包处理方法、装置及网络设备 - Google Patents

数据包处理方法、装置及网络设备 Download PDF

Info

Publication number
WO2023134631A1
WO2023134631A1 PCT/CN2023/071351 CN2023071351W WO2023134631A1 WO 2023134631 A1 WO2023134631 A1 WO 2023134631A1 CN 2023071351 W CN2023071351 W CN 2023071351W WO 2023134631 A1 WO2023134631 A1 WO 2023134631A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
network device
functions
function
srh
Prior art date
Application number
PCT/CN2023/071351
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 WO2023134631A1 publication Critical patent/WO2023134631A1/zh

Links

Images

Classifications

    • 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/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Definitions

  • the present disclosure relates to the technical field of data packet processing, and in particular to a data packet processing method, device and network equipment.
  • Embodiments of the present disclosure provide a data packet processing method, device, and network equipment to solve the problem in the related art that one network equipment cannot process data packets multiple times.
  • an embodiment of the present disclosure provides a data packet processing method, executed by a first network device, including:
  • the acquiring function identification information of at least two functions to be performed by the first network device on the data packet according to the data packet information includes the following one:
  • the segment identifier corresponding to the first network device obtain the function identification information of at least two functions to be performed by the first network device on the data packet, and the segment corresponding to the first network device
  • the identifier is located in the segment routing packet header SRH in the data packet information;
  • the function identification information of at least two functions to be executed by the first network device for the data packet is acquired.
  • the function identification information of the at least two functions is indicated by using the same bit in the function field.
  • the flag field in the SRH in the data message information is used to indicate whether there is at least one segment identifier corresponding to multiple functions, and the flag field in the SRH in the data message information indicates that there is at least one In the case that the segment identifier corresponds to multiple functions, the label field in the data packet information is used to indicate the at least one segment identifier and the number of the corresponding multiple functions.
  • the SRH in the data packet information includes a function corresponding to the first network device At least two segment identifiers for ;
  • the preset value is the maximum value of the number of functions indicated by a segment identifier corresponding to the first network device.
  • An embodiment of the present disclosure also provides a network device, where the network device is a first network device and includes a memory, a transceiver, and a processor;
  • the memory is used to store computer programs; the transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer programs in the memory and perform the following operations:
  • a target action corresponding to the function identification information is determined in a preset flow table, and the target action is executed on the data packet.
  • the processor is configured to read the computer program in the memory and perform one of the following operations:
  • the segment identifier corresponding to the first network device obtain the function identification information of at least two functions to be performed by the first network device on the data packet, and the segment corresponding to the first network device
  • the identifier is located in the segment routing packet header SRH in the data packet information;
  • the function identification information of at least two functions to be executed by the first network device for the data packet is acquired.
  • the function identification information of the at least two functions is indicated by using the same bit in the function field.
  • the flag field in the SRH in the data message information is used to indicate whether there is at least one segment identifier corresponding to multiple functions, and the flag field in the SRH in the data message information indicates that there is at least one In the case that the segment identifier corresponds to multiple functions, the label field in the data packet information is used to indicate the at least one segment identifier and the number of the corresponding multiple functions.
  • the SRH in the data packet information includes a function corresponding to the first network device At least two segment identifiers for ;
  • the preset value is the maximum value of the number of functions indicated by a segment identifier corresponding to the first network device.
  • An embodiment of the present disclosure also provides a data packet processing apparatus applied to a first network device, including:
  • a receiving unit configured to receive data packet information sent by the second network device, where the data packet information carries a data packet
  • An obtaining unit configured to obtain function identification information of at least two functions to be executed by the first network device on the data packet according to the data packet information;
  • An execution unit configured to determine a target action corresponding to the function identification information in a preset flow table, and execute the target action on the data packet.
  • the acquisition unit is specifically used for:
  • the segment identifier corresponding to the first network device obtain the function identification information of at least two functions to be performed by the first network device on the data packet, and the segment corresponding to the first network device
  • the identifier is located in the segment routing packet header SRH in the data packet information;
  • the function identification information of at least two functions to be executed by the first network device for the data packet is obtained.
  • the function identification information of the at least two functions is indicated by using the same bit in the function field.
  • the flag field in the SRH in the data message information is used to indicate whether there is at least one segment identifier corresponding to multiple functions, and the flag field in the SRH in the data message information indicates that there is at least one In the case that the segment identifier corresponds to multiple functions, the label field in the data packet information is used to indicate the at least one segment identifier and the number of the corresponding multiple functions.
  • the SRH in the data packet information includes a function corresponding to the first network device At least two segment identifiers for ;
  • the preset value is the maximum value of the number of functions indicated by a segment identifier corresponding to the first network device.
  • An embodiment of the present disclosure further provides a processor-readable storage medium, where a computer program is stored in the processor-readable storage medium, and the computer program is configured to cause the processor to execute the above method.
  • At least one embodiment provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement method as above.
  • At least one embodiment provides a computer program product, the computer program product is stored in a non-volatile storage medium, and the computer program product is executed by at least one processor to implement the above the method described.
  • the above solution by carrying the function identification information of multiple functions in the data message information, enables a network device to perform multiple actions on the data packet, thereby achieving good flexibility, reducing costs, reducing delays, and saving overhead. Effect.
  • Figure 1 shows a schematic diagram of the format of the SRH extension header
  • Figure 2 shows a schematic diagram of the three-layer programming space in the SRH
  • FIG. 3 shows a schematic diagram of the format of the TLV
  • FIG. 4 shows a schematic flow diagram of a data packet processing method in an embodiment of the present disclosure
  • Fig. 5 represents the network topology diagram of specific application situations one and two;
  • Fig. 6 shows the data packet forwarding process of specific application situation 1 and the schematic diagram of the header change of each hop;
  • FIG. 7 shows a schematic diagram of the data packet forwarding process and the header change of each hop in the specific application case 2;
  • FIG. 8 shows a schematic unit diagram of a data packet processing device according to an embodiment of the present disclosure
  • FIG. 9 shows a structural diagram of a network device according to an embodiment of the present disclosure.
  • words such as “exemplary” or “for example” are used as examples, illustrations or illustrations. Any embodiment or design described as “exemplary” or “for example” in the embodiments of the present disclosure shall not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner.
  • the data packet processing method, device and network device provided by the embodiments of the present disclosure may be applied in a wireless communication system.
  • the wireless communication system may be a system using the fifth generation (5th Generation, 5G) mobile communication technology (hereinafter referred to as the 5G system).
  • 5G fifth generation
  • NR New Radio
  • IPv6 segment routing Segment Routing IPv6, SRv6
  • SRv6 is the application of Segment Routing (SR) technology in IPv6 network.
  • SRv6 inserts a routing extension header (Segment Routing Header, SRH) into the IPv6 message, and adds the segment identification (Segment ID, SID) of all segments that the path passes through, that is, SID List (List), to explicitly specify the forwarding path of the message.
  • SID Segment ID
  • SDN software-defined networking
  • SRv6 technology uses a 128-bit IPv6 address as the SID. With its extremely simple and programmable features, it realizes arbitrary access and arbitrary connection, which can flexibly meet various network service requirements, and at the same time provide higher reliability and scalability. Become the core technology of the new generation IP bearer network. In SRv6, SID is used to define a certain network function and represent a certain network command. The SRv6 SID takes the form of an IPv6 address, but does not correspond to an interface address on any device. Its format is shown in Table 1:
  • Locator is an identifier assigned to a network node for routing and forwarding data packets.
  • Locator is a variable-length part used to adapt to networks of different scales.
  • Function is used to express the forwarding action to be executed by the instruction, which is equivalent to the operation code of the computer instruction.
  • SRv6 network programming different forwarding behaviors are expressed by different Functions.
  • SRv6 SID node behavior (Endpoint Behaviors) is the SID in Function.
  • Arguments are the parameters required by the instruction when it is executed. These parameters may contain stream, service or any other relevant information. For example, if you define an instruction to fragment a network packet, you can carry the fragment length of the packet in Arguments.
  • an SRv6 node processes SRv6 packets through a locally defined behavior (Behavior).
  • SRv6 defines a variety of Endpoint Behaviors. Each node needs to instantiate them and assign SIDs, and publish them through routing protocols so that the outside world can understand the Behaviors that the nodes can provide.
  • Commonly used Endpoint Behaviors include END, END.X, END.DT4, END.DT6, End.B6.Encaps, H.Encaps, End.DX4, etc., to realize the underlying bearer network (Underlay) routing and overlay network (Overlay) services Bearer, traffic engineering, service chain and other functions. The processing logic corresponding to Endpoint Behavior will not be introduced here.
  • Segment Routing Header In order to implement Segment Routing based on the IPv6 forwarding plane, a new type is added to the IPv6 routing extension header, called the Segment Routing Header (SRH). This extension header specifies an IPv6 explicit path and stores IPv6 path constraint information (can be Segment List).
  • the source node adds an SRH extension header to the IPv6 message, and the transit node can forward according to the path information contained in the SRH extension header.
  • the format of the SRH extension header is shown in Figure 1.
  • the value of Next Header in the IPv6 basic header is 43, indicating that the next packet header is a routing extension header.
  • the value of the routing type field in the routing extension header is 4, indicating that the routing extension header is SRH.
  • SRH mainly includes the following parts, as shown in Table 2:
  • the first part is the path information composed of Segment List, which is programmable. It can combine multiple Segments to form an SRv6 path.
  • the second part is the use of 128 bits of SRv6 SID.
  • Each segment of SRv6 is 128 bits long, and can be flexibly divided into multiple segments, and the length of each segment can also be changed, thus enabling flexible programming.
  • the third part is the optional Type-Length-Value (Type-Length-Value, TLV) immediately following the Segment sequence.
  • TLV Type-Length-Value
  • SRv6 has a more powerful network programming capability through the three-layer programming space, which can better meet the needs of different network paths.
  • TLVs provide metadata for segment processing.
  • the only TLVs currently defined are Hash-based Message Authentication Code (HMAC) and padding TLVs. Additional TLVs may be defined in the future.
  • HMAC Hash-based Message Authentication Code
  • Additional TLVs may be defined in the future.
  • SIDs When processing defined SIDs, all TLVs are ignored unless otherwise specified by local configuration. Therefore, TLV and HMAC support are optional for any implementation. However, implementations that add or parse TLVs must support PAD TLVs. Other documents may define other TLVs and processing rules.
  • the TLV When processing TLVs at segment endpoints, the TLV MUST be fully contained within the SRH determined by Hdr Ext Len. Detection of a TLV beyond the SRH Hdr Ext Len boundary results in an Internet Control Message Protocol (ICMP) parameter problem code of 0, a message is sent to the source address, pointing to the SRH's Hdr Ext Len field, and the packet is dropped.
  • ICMP Internet Control Message Protocol
  • Type An 8-bit code point from the "Segment Routing Header TLV" IANA-SRHTLV, unrecognized types MUST be ignored when received.
  • Length The length (in bytes) of the variable-length data field.
  • Variable-length data Type-specific data.
  • Type Length Value (TLV) entries contain optional information that can be used by the node identified in the packet's Destination Address (DA).
  • DA Destination Address
  • Each TLV has its own length, type and semantics.
  • the code points assigned to each TLV type (by the Internet Assigned Numbers Authority (IANA)) define the type and semantics of the information carried in the TLV.
  • Multiple TLVs can be encoded in the same SRH.
  • bits 0 The most significant bit (bit 0) of a TLV type specifies whether TLV data of that type may change en route to the packet's final destination:
  • TLV data remains unchanged on the way
  • All TLVs specify their alignment requirements using the xn+y format.
  • the xn+y format is defined according to RFC8200.
  • the SR source node uses the TLV and fills the xn+y alignment requirements of the TLV.
  • the "length” field of the TLV is used to skip the TLV when checking the SRH in case the node does not support or recognize the type.
  • length defines the TLV length in bytes, excluding the "type" and "length” fields.
  • the delay is large. After being processed by multiple devices, the transmission delay of the data packet will be increased.
  • the overhead is high.
  • the data packet is processed by pressing multiple SIDs into the head node, which increases the overhead rate of the data packet.
  • the capacity of the flow table is limited. The number of flow tables that can be accommodated by the device is limited. If too many flow tables are delivered to the device, it will exceed the capacity range of the device.
  • Embodiments of the present disclosure provide a data packet processing method, device, and network device to solve the problem in the related art that a network device cannot process data packets multiple times, and solve the problem of multiple processing and transmission of data packets
  • This method has problems such as poor flexibility, high cost, large delay, high overhead, and limited flow table capacity.
  • the method and the device are conceived based on the same application. Since the principle of solving problems of the method and the device is similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
  • an embodiment of the present disclosure provides a data packet processing method, executed by a first network device, including:
  • Step S401 receiving data packet information sent by the second network device
  • the data packet information carries a data packet
  • Step S402 according to the data packet information, obtain function identification information of at least two functions to be executed by the first network device on the data packet;
  • the data packet information carries function identification information
  • the first network device can know what action (or what action to perform) it needs to perform on the data packet after searching the preset flow table according to the function identification information. operation, or what kind of functional processing to perform).
  • Step S403 determining a target action corresponding to the function identification information in a preset flow table, and executing the target action on the data packet.
  • the first network device may implement multiple functions, that is, the first network device can perform multiple functions, but in this service processing process, the first network device may only need to perform certain functions.
  • the data message information indicates the index of the function that the first network device needs to execute (that is, the function identification information), and the specific action corresponding to each function is defined by the preset flow table, and the preset flow
  • the table refers to a table sent by the controller to the first network device for defining the corresponding relationship between the index of the function and the action, that is to say, the preset flow table includes the index of the function and the action corresponding to the index. Specifically, after the first network device obtains the function identification information, it needs to look up the action corresponding to each function identification information in the preset flow table, and after obtaining the action corresponding to the function identification information, it executes the action on the data packet .
  • the first network device obtains two function identification information in the data packet information: function index A and function index B; the default flow table defines the action corresponding to index A as action 1, and the action corresponding to index B The action is action 2, and the action corresponding to index C is action 3.
  • the first network device determines that action 1 and action 2 need to be performed, then the first network device executes index A and function index B on the data packet corresponding to Action 1 and Action 2 respectively.
  • the actions mentioned in the embodiments of the present disclosure can be, for example, H.Encaps (that is, add IPv6 and SRH headers to the outer layer), End (that is, Segment Left minus 1, and update the purpose of IPv6 according to the Segment list address), End.DX4 (that is, strip the outer IPv6 header, and send the contained IPv4 data packet to the corresponding device), End.IDS (that is, perform intrusion detection on the data packet), etc.
  • H.Encaps that is, add IPv6 and SRH headers to the outer layer
  • End that is, Segment Left minus 1, and update the purpose of IPv6 according to the Segment list address
  • End.DX4 that is, strip the outer IPv6 header, and send the contained IPv4 data packet to the corresponding device
  • End.IDS that is, perform intrusion detection on the data packet
  • first network device and the second network device both refer to forwarding devices in the data packet forwarding process. These forwarding devices are all connected to a controller (for example, a software defined network (Software Defined Network, SDN) controller), and are uniformly managed by the controller.
  • a controller for example, a software defined network (Software Defined Network, SDN) controller
  • step S402 in at least one embodiment of the present disclosure may adopt the following one:
  • A11 In the function field in the segment identifier (SID) corresponding to the first network device, obtain the function identification information of at least two functions to be performed by the first network device on the data packet;
  • segment identifier corresponding to the first network device is located in a segment routing header (SRH) in the data packet information.
  • SSH segment routing header
  • the function identification information is indicated by the function (Function) field in the SID in the SRH.
  • different bits in the function field indicate function identification information of the at least two functions.
  • the flag (Flags) field in the SRH in the data message information is used to indicate whether there is at least one SID corresponding to multiple functions, and the Flags field in the SRH in the data message information indicates In the case that at least one SID corresponds to multiple functions, the tag (Tag) field in the data packet information is used to indicate the at least one segment identifier and the number of the corresponding multiple functions.
  • the Flags and Tag fields in the SRH header can be used to identify whether there are multiple Functions and the number of Functions: if the Flags field is 0, it means that all SIDs have only one Function; if it is 1, it means that a certain SID has multiple functions. Function; further, according to the value of Tag, it can be determined which SID has multiple Functions and the specific number of multiple Functions. If the data packet is processed according to multiple Functions, if additional parameters are required, they can be set in the Arguments field Define parameters. If there is a priority, the data packet will be processed according to the priority; if there is no priority, the data packet will be processed according to the defined execution order.
  • Table 3 The extended SRv6 SID format is shown in Table 3:
  • the forwarding device when the forwarding device (such as an SRv6 node) receives the IPv6 message, it will search for the SID according to the IPv6 destination address (Destination Address, DA). When the function identification information carried in the SID is obtained, it will search the flow table Execute the action corresponding to the function identification information; when the non-SRv6 forwarding device receives the IPv6 message, it will search the global routing table according to the IPv6 destination address (Destination Address, DA), and proceed according to the next hop indicated by the global routing table. Forwarding of IPv6 packets.
  • the forwarding device such as an SRv6 node
  • SRv6 SID Endpoint Behaviors that is, the Function in the SID, which is the forwarding processing logic and execution commands for data packets.
  • the application layer or SDN controller receives the service request of the data flow, it executes the following process: deliver or fill the flow table according to different configurations defined for different devices , the function identification information in the data message is matched with the flow table, when the function identification information in the data message matches the index in the flow table, enter the action field (it should be noted that the action field refers to a series of data
  • a collection of message processing actions which refers to the Function part of the SID defined in the SRv6 data packet in this disclosure), executes the SRv6 SID Endpoint Behaviors defined in the action domain.
  • the defined SRv6 SID Endpoint Behaviors may be the basic operation stipulated by the protocol,
  • the function identification information of the at least two functions is indicated by using the same bit in the function field, that is, in this case, a new number is assigned to the Function field in the SID, That is, a new number can represent multiple functions.
  • unallocated numbers in the protocol can be used in the Function field in the SID.
  • the unallocated numbers in the protocol are 40-32766, that is, use these
  • the assigned number identifies the processing and forwarding of multiple functions to be executed.
  • the number 40 can be used to identify 2 functions to be executed, the number 41 to be executed to 3 functions, etc.
  • the specific number to be used and the number of identified functions can be determined according to user needs Definition, use the new SRv6 SID format as shown in Table 4:
  • a list (list) of multiple Functions (list) (the list includes at least one function identifier corresponding to the function) can be defined through specific signaling (for example: by extending the BGP protocol of SRv6), and given The new numbers of the list of these Functions (such as the unassigned 40-32766 numbers mentioned above), that is, each new number corresponds to a Function list (the Function list includes at least two Functions), and this Function list defines the network equipment for data packets.
  • the processing logic sends the newly defined Function list to the network device through specific signaling, and the defined Function list sent to the network device can be multiple or a single Function list to be executed by the network device; Then when the data packet arrives at the network device, the new number of the Function list defined or configured in the network device is matched according to the new number carried in the Function field in the SID of the data packet. When the Function list corresponding to the new number is matched, the instruction The network device executes the corresponding Function list, that is, the network device looks up the corresponding action in the flow table according to the function identification information of each Function in the Function list, and then completes multiple processing of the data packet according to the requirement.
  • TLV Type Length Value
  • the function identification information is indicated by the TLV field in the SRH.
  • the TLV field defines a list of one or more function identification information
  • the function field in the SID refers to The number of the list of feature identification information.
  • the Function part in the SID indicates to obtain the details of the function list number in the optional TLV
  • the function list that should be executed and executed.
  • the TLV defined by the protocol is only HMAC and padding TLV.
  • multiple functions can be identified by defining a new TLV, for example, it can be called MFUN.
  • the TLV field in the SRH in the data message information in the TLV field in the SRH in the data message information, at least two of the data packets to be executed by the first network device are acquired Feature ID information for a feature.
  • the TLV field is an optional field, in this disclosure, when the SRH contains the TLV field, it means that the function identification information needs to be obtained in the TLV field.
  • the implementation method for determining whether there is a Type Length Value TLV field in the SRH is:
  • N1 is greater than (N2+1) ⁇ 2, it is determined that there is a Type Length Value TLV field in the SRH;
  • N1 is the length of the SRH header
  • N2 is the index of the last element of the segment list.
  • the network device needs to check the TLV field to obtain the function identification information.
  • the configuration instructs the network device to process the optional TLV in the SRH header, which can be passed through the length of the SRH header (Hdr Ext Len) in the SRH header and the last element of the segment list
  • the relationship of the index (Last Entry) of the index (Last Entry) identifies whether the SRH header contains TLV, that is, when the Hdr Ext Len is greater than (Last Entry+1) ⁇ 2, the TLV will be displayed, indicating that the network device needs to process the TLV; then the TLV field defines the relevant
  • the function list number 40-32766) and content (including which Functions and their execution order)
  • the network device matches the Function list defined in the TLV field according to the Function field in the SID, and executes the corresponding function list after the match is successful. Further, multiple processing of the data packet is completed.
  • the above description is based on the example that the number of Functions is less than 128 bits.
  • the SID corresponding to a forwarding device cannot represent all the functions to be executed.
  • the functions that cannot be accommodated by 128 bits can be represented by another SID.
  • another SID cannot represent all the remaining functions to be executed, another SID can be introduced again for representation.
  • a forwarding device will correspond to at least two SIDs.
  • the SRH in the data packet information includes At least two segment identifiers for ;
  • the preset value is the maximum value of the number of functions indicated by a segment identifier corresponding to the first network device.
  • related technologies can be used, that is, increasing the number of SIDs, defining the Hth Function with a separate SID, and then realizing the functions of the H Functions.
  • routers R1, R3, and R4 are routers that support SRv6 (that is, the forwarding device mentioned above), and R2 is a router that only supports IPv6. Static routing is implemented through static configuration, and interworking between routers is realized only through IPv6.
  • the purpose is to enable host a and host b to achieve IPv4 interworking, and let the data packets pass through the R3 router, and at the same time implement SRv6 data flow intrusion detection on the R3 router, so as to realize traffic engineering + intrusion detection.
  • the detailed data packet forwarding process and the header changes of each hop are shown in Figure 6.
  • the numbers on the packets in Figure 6 indicate the forwarding sequence of data packets in the network.
  • Segment list in Figure 6 is arranged in reverse order, that is, the first Segment in the list is the last hop on the path, and the last Segment in the list is the first hop in the path.
  • Step S11 first define the forwarding processing logic of the network device for the data packet, that is, define the processing logic of R1, R3, and R4 for the data packet, and send it to different network devices, and the SDN controller controls the network device to send flow table etc.
  • Step S12 when the data service flow sent by the host a arrives at the router R1 supporting SRv6, the controller sends it to R1 according to the service flow, and R1 encapsulates the matched data packet according to the configured operation
  • the matching field is: the IP address of host a
  • the execution action is: H.Encaps; that is, adding IPv6 and SRH headers on the outer layer, the source IP of the IPv6 header is the address of R1, and the destination address is the IP address of R3, where SRH
  • the header contains the SIDs corresponding to the addresses of R3 and R4 (that is, R3::a and R4::a), and performs normal IPv6 forwarding.
  • the data packet processed by R1 is forwarded to R2, and R2 will forward the matched data packet based on the destination IPv6 address according to the configured static route.
  • Step S13 when the data packet arrives at R3, R3 performs a defined action on the function identification information corresponding to the obtained data packet according to the issued flow table (specifically, R3 according to the received data message according to the destination address (the destination address is : R3’s IP address) matches the corresponding SID, and then obtains the function identification information according to the function field in the SID, and then determines the specific action by searching the flow table), the action is: End.IDS, and the SID corresponding to R3 is set to two One is the basic function, which is to reduce the Segment Left by 1, and update the IPv6 destination address according to the Segment list, and forward the data packet to the next hop R4; the other is to expand the function based on the End operation to complete the process
  • the SRv6 data packets matched by R3 are used for intrusion detection (Intrusion Detection System, IDS).
  • IDS Intrusion Detection System
  • Step S14 in the router R4 supporting SRv6, R4 performs a defined action on the function identification information corresponding to the obtained data packet according to the issued flow table, and the action is: End.DX4; that is, the outer IPv6 header is stripped, and the The contained IPv4 data packet is sent to host b to complete the forwarding process.
  • End.IDS is the defined SRv6Endpoint Behaviors after the End function is extended, and the End operation and intrusion detection are realized without adding devices, and which device is implemented Intrusion detection is not limited to R3 in this application, and can be designed according to the required networking.
  • H.Encaps, End, End.DX4 are the basic SRv6Endpoint Behaviors stipulated by the SRv6 protocol. The delivery or filling of the flow table involved in the above is performed by the application layer or the SDN controller.
  • routers R1, R3, and R4 are routers that support SRv6 (that is, the forwarding device mentioned above), and R2 is a router that only supports IPv6. Static routing is implemented through open source software, and interworking between routers is realized only through IPv6.
  • the purpose is to enable host a and host b to achieve IPv4 interworking, and let the data packets pass through the R4 router, and at the same time implement SRv6 data flow security encryption on the R4 router, thereby realizing traffic engineering + security encryption.
  • the detailed data packet forwarding process and the header changes of each hop are shown in Figure 7.
  • the numbers on the packets in Figure 7 indicate the forwarding sequence of data packets in the network.
  • Segment (SID) list in Figure 7 is arranged in reverse order, that is, the first Segment (SID) in the list is the last hop on the path, and the last Segment (SID) in the list is the first hop of the path.
  • Step S21 first define the forwarding processing logic of the network equipment for the data packet, that is, define the processing logic of R1, R3, and R4 for the data packet, and send it to different network equipment, and the SDN controller controls the network equipment, and sends flow table etc.
  • Step S22 when the data service flow sent by host a arrives at router R1 supporting SRv6, the controller sends a flow table to R1 according to the service flow of host a, and R1 will match the data packet according to the configured operation and
  • the flow table encapsulates the data packet, the matching field is: the IP address of the host a, and the execution action is: H.Encaps; that is, the IPv6 and SRH headers are added to the outer layer, and the source IP of the IPv6 header is the address and destination address of R1 It is the IP address of R3, wherein the header of the SRH contains the SIDs corresponding to the addresses of R3 and R4 (that is, R3::a and R4::a), and performs normal IPv6 forwarding.
  • the data packet processed by R1 is forwarded to R2, and R2 will forward the matched data packet based on the destination IPv6 address according to the configured static route.
  • Step S23 when the data packet arrives at R3, R3 performs a defined action on the function identification information corresponding to the obtained data packet according to the issued flow table, the action is: End; the Segment Left is about to be decremented by 1, and the IPv6 is updated according to the Segment list Destination address, forward the data packet to the next hop R4.
  • Step S24 on the router R4 supporting SRv6, R4 performs a defined action on the function identification information corresponding to the obtained data packet according to the issued flow table, and the action is: End.DX4SE; the SID corresponding to this R4 defines two Functions (s), one is the basic function, that is, stripping the outer IPv6 header; the other is based on the function extension of the End.
  • the contained IPv4 data packet is sent to host b to complete the forwarding process.
  • the execution sequence of the security encryption extension function and the basic functions of the SID if there is a priority when defining the function, it will be executed according to the priority; if there is no priority, it will be executed according to the sequence of the defined function.
  • End.DX4SE mentioned in this case is the defined SRv6Endpoint Behaviors after the function extension of End.DX4, which realizes security encryption without adding devices, and which device implements security Encryption is not limited to R4 in this application, and the network design can be carried out according to the requirements.
  • H.Encaps, End, and End.DX4 are the basic SRv6 Endpoint Behaviors specified in the SRv6 protocol. The delivery or filling of the flow table involved in the above is performed by the application layer or the SDN controller.
  • Multi-functional processing of data packets can be defined according to requirements.
  • an embodiment of the present disclosure provides a data packet processing apparatus 800, which is applied to a first network device, including:
  • a receiving unit 801 configured to receive data packet information sent by the second network device, where the data packet information carries a data packet;
  • An obtaining unit 802 configured to obtain function identification information of at least two functions to be performed by the first network device on the data packet according to the data packet information;
  • the execution unit 803 is configured to determine a target action corresponding to the function identification information in a preset flow table, and execute the target action on the data packet.
  • the acquiring unit 802 is configured to implement one of the following:
  • the segment identifier corresponding to the first network device obtain the function identification information of at least two functions to be performed by the first network device on the data packet, and the segment corresponding to the first network device
  • the identifier is located in the segment routing packet header SRH in the data packet information;
  • the function identification information of at least two functions to be executed by the first network device for the data packet is obtained.
  • the function identification information of the at least two functions is indicated by using the same bit in the function field.
  • the flag (Flags) field in the SRH in the data message information is used to indicate whether there is at least one segment identifier corresponding to multiple functions, and the Flags field in the SRH in the data message information indicates In the case that at least one segment identifier corresponds to multiple functions, the tag (Tag) field in the data packet information is used to indicate the at least one segment identifier and the number of the corresponding multiple functions.
  • the method of obtaining the function identification information of at least two functions to be executed by the first network device on the data packet in the Type Length Value TLV field in the SRH in the data packet information includes:
  • the TLV field in the SRH in the data message information in the TLV field in the SRH in the data message information, at least two of the data packets to be executed by the first network device are acquired Feature ID information for a feature.
  • N1 is greater than (N2+1) ⁇ 2, it is determined that there is a Type Length Value TLV field in the SRH;
  • N1 is the length of the SRH header
  • N2 is the index of the last element of the segment list.
  • the SRH in the data packet information includes a function corresponding to the first network device At least two segment identifiers for ;
  • the preset value is the maximum value of the number of functions indicated by a segment identifier corresponding to the first network device.
  • this device embodiment is a device that corresponds one-to-one to the above-mentioned method embodiments, and all the implementation methods in the above-mentioned method embodiments are applicable to this device embodiment, and can also achieve the same technical effect.
  • each functional unit in each embodiment of the present disclosure 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 functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a processor-readable storage medium.
  • the essence of the technical solution of the present disclosure or the part that contributes to the related technology 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.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • a processor processor
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
  • an embodiment of the present disclosure also provides a network device.
  • the network device is a first network device, including a processor 900, a transceiver 910, a memory 920, and a The program running on the processor 900; wherein the transceiver 910 is connected to the processor 900 and the memory 920 through a bus interface, wherein the processor 900 is used to read the program in the memory, and perform the following process:
  • a target action corresponding to the function identification information is determined in a preset flow table, and the target action is executed on the data packet.
  • the transceiver 910 is used for receiving and sending data under the control of the processor 900 .
  • the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by the processor 900 and various circuits of the memory represented by the memory 920 are linked together.
  • the bus architecture can also link together various other circuits such as peripherals, voltage regulators, and power management circuits, etc., which are well known in the art and therefore will not be further described herein.
  • the bus interface provides the interface.
  • Transceiver 910 may be a plurality of elements, including a transmitter and a receiver, providing a unit for communicating with various other devices over transmission media, including wireless channels, wired channels, optical cables, and other transmission media.
  • the processor 900 is responsible for managing the bus architecture and general processing, and the memory 920 can store data used by the processor 900 when performing operations.
  • the processor 900 may be a central processing unit (CPU), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA) or a complex programmable logic device (Complex Programmable Logic Device, CPLD), the processor can also adopt a multi-core architecture.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • FPGA field programmable gate array
  • CPLD Complex Programmable Logic Device
  • processor is configured to read the computer program in the memory and perform one of the following operations:
  • the segment identifier corresponding to the first network device obtain the function identification information of at least two functions to be performed by the first network device on the data packet, and the segment corresponding to the first network device
  • the identifier is located in the segment routing packet header SRH in the data packet information;
  • the function identification information of at least two functions to be executed by the first network device for the data packet is obtained.
  • different bits in the function field indicate the function identification information of the at least two functions.
  • the function identification information of the at least two functions is indicated by using the same bit in the function field.
  • the flag (Flags) field in the SRH in the data message information is used to indicate whether there is at least one segment identifier corresponding to multiple functions, and the Flags field in the SRH in the data message information indicates that there is In the case that at least one segment identifier corresponds to multiple functions, the tag (Tag) field in the data packet information is used to indicate the at least one segment identifier and the number of the corresponding multiple functions.
  • processor is configured to read the computer program in the memory and perform the following operations:
  • the TLV field in the SRH in the data message information in the TLV field in the SRH in the data message information, at least two of the data packets to be executed by the first network device are acquired Feature ID information for a feature.
  • processor is configured to read the computer program in the memory and perform the following operations:
  • N1 is greater than (N2+1) ⁇ 2, it is determined that there is a Type Length Value TLV field in the SRH;
  • N1 is the length of the SRH header
  • N2 is the index of the last element of the segment list.
  • the SRH in the data message information includes the corresponding function of the first network device At least two segment identifiers
  • the preset value is the maximum value of the number of functions indicated by a segment identifier corresponding to the first network device.
  • An embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the data packet processing method applied to the first network device are realized.
  • the processor-readable storage medium may be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical (magneto-optical, MO), etc.), Optical memory (such as CD, DVD, BD, HVD, etc.), and semiconductor memory (such as ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (Electrically Erasable Programmable read only memory, EEPROM), non-volatile memory (NAND FLASH), solid state drives (Solid State Drives, SSD)), etc.
  • magnetic storage such as floppy disk, hard disk, magnetic tape, magneto-optical (magneto-optical, MO), etc.
  • the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Accordingly, the present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) having computer-usable program code embodied therein.
  • processor-executable instructions may also be stored in a processor-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the processor-readable memory produce a manufacturing product, the instruction device realizes the functions specified in one or more procedures of the flow chart and/or one or more blocks of the block diagram.
  • processor-executable instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented
  • the executed instructions provide steps for implementing the functions specified in the procedure or procedures of the flowchart and/or the block or blocks of the block diagrams.
  • the division of the above modules is only a division of logical functions, and may be fully or partially integrated into a physical entity or physically separated during actual implementation.
  • these modules can all be implemented in the form of calling software through processing elements; they can also be implemented in the form of hardware; some modules can also be implemented in the form of calling software through processing elements, and some modules can be implemented in the form of hardware.
  • the determining module may be a separate processing element, or may be integrated into a certain chip of the above-mentioned device.
  • it may also be stored in the memory of the above-mentioned device in the form of program code, and a certain processing element of the above-mentioned device may Call and execute the functions of the modules identified above.
  • each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or an instruction in the form of software.
  • each module, unit, subunit or submodule may be one or more integrated circuits configured to implement the above method, for example: one or more specific integrated circuits (Application Specific Integrated Circuit, ASIC), or, one or Multiple microprocessors (digital signal processor, DSP), or, one or more field programmable gate arrays (Field Programmable Gate Array, FPGA), etc.
  • ASIC Application Specific Integrated Circuit
  • DSP digital signal processor
  • FPGA Field Programmable Gate Array
  • the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processors that can call program codes.
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip

Landscapes

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

Abstract

本公开提供了一种数据包处理方法、装置及网络设备,涉及数据包处理技术领域。该方法,由第一网络设备执行,包括:接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;在预设流表中确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。

Description

数据包处理方法、装置及网络设备
相关申请的交叉引用
本申请主张在2022年01月13日在中国提交的中国专利申请No.202210037301.6的优先权,其全部内容通过引用包含于此。
技术领域
本公开涉及数据包处理技术领域,特别涉及一种数据包处理方法、装置及网络设备。
背景技术
在使用互联网协议第6版(Internet Protocol Version 6,IPv6)分段路由(Segment Routing IPv6,SRv6)用户面技术时,由于分段标识(Segment ID,SID)字段功能(Function)的限制,其SID的单个Function无法满足某一设备对数据包处理两次或两次以上。当某一设备需要对数据包连续处理两次或多次以上时,SRv6的SID便不能完成对这些数据包的处理。如何基于相关SRv6用户面技术,实现某一设备对数据包的多次处理,是一个亟待解决的问题。
发明内容
本公开实施例提供一种数据包处理方法、装置及网络设备,以解决相关技术中无法实现一个网络设备对数据包的多次处理的问题。
为了解决上述技术问题,本公开实施例提供一种数据包处理方法,由第一网络设备执行,包括:
接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
在预设流表中确定与所述功能标识信息对应的目标动作,对所述数据包 执行所述目标动作。
可选地,所述根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,包括以下一项:
在所述第一网络设备对应的分段标识中的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息中的分段路由报文头SRH中;
在所述数据报文信息中的SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
可选地,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
可选地,所述数据报文信息中的SRH中的标志字段用于指示是否存在至少一个分段标识对应多个功能,在所述数据报文信息中的SRH中的标志字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签字段用于指示所述至少一个分段标识以及其对应的多个功能的个数。
可选地,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述数据报文信息中的SRH中包括与所述第一网络设备对应的至少两个分段标识;
其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
本公开实施例还提供一种网络设备,所述网络设备为第一网络设备,包括存储器,收发机,处理器;
存储器,用于存储计算机程序;收发机,用于在所述处理器的控制下收发数据;处理器,用于读取所述存储器中的计算机程序并执行以下操作:
通过收发机接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
在预设流表中确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
可选地,所述处理器,用于读取所述存储器中的计算机程序并执行以下操作中的一项:
在所述第一网络设备对应的分段标识中的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息中的分段路由报文头SRH中;
在所述数据报文信息中的SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
可选地,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
可选地,所述数据报文信息中的SRH中的标志字段用于指示是否存在至少一个分段标识对应多个功能,在所述数据报文信息中的SRH中的标志字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签字段用于指示所述至少一个分段标识以及其对应的多个功能的个数。
可选地,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述数据报文信息中的SRH中包括与所述第一网络设备对应的至少两个分段标识;
其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
本公开实施例还提供一种数据包处理装置,应用于第一网络设备,包括:
接收单元,用于接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
获取单元,用于根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
执行单元,用于在预设流表中确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
可选地,所述获取单元,具体用于:
在所述第一网络设备对应的分段标识中的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息中的分段路由报文头SRH中;
在所述数据报文信息中的SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
可选地,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
可选地,所述数据报文信息中的SRH中的标志字段用于指示是否存在至少一个分段标识对应多个功能,在所述数据报文信息中的SRH中的标志字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签字段用于指示所述至少一个分段标识以及其对应的多个功能的个数。
可选地,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述数据报文信息中的SRH中包括与所述第一网络设备对应的至少两个分段标识;
其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
本公开实施例还提供一种处理器可读存储介质,所述处理器可读存储介质存储有计算机程序,所述计算机程序用于使所述处理器执行上述的方法。
根据本公开的另一方面,至少一个实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如上所述的方法。
根据本公开的另一方面,至少一个实施例提供了一种计算机程序产品,所述计算机程序产品被存储在非易失的存储介质中,所述计算机程序产品被至少一个处理器执行以实现如上所述的方法。
本公开的有益效果是:
上述方案,通过在数据报文信息中携带多个功能的功能标识信息,使得 一个网络设备能够对数据包执行多次动作,从而能够实现灵活性好、降低成本、减少时延、节省开销等有益效果。
附图说明
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1表示SRH扩展头的格式示意图;
图2表示SRH中的三层编程空间示意图;
图3表示TLV的格式示意图;
图4表示本公开实施例的的数据包处理方法的流程示意图;
图5表示具体应用情况一和二的网络拓扑图;
图6表示具体应用情况一的数据包转发流程及每一跳的报头变化示意图;
图7表示具体应用情况二的数据包转发流程及每一跳的报头变化示意图;
图8表示本公开实施例的数据包处理装置的单元示意图;
图9表示本公开实施例的网络设备的结构图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
本公开的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例,例如除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元 的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
本公开实施例中术语“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本公开实施例中术语“多个”是指两个或两个以上,其它量词与之类似。
在本公开实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本公开实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
下面结合附图介绍本公开的实施例。本公开实施例提供的数据包处理方法、装置及网络设备可以应用于无线通信系统中。该无线通信系统可以为采用第五代(5th Generation,5G)移动通信技术的系统(以下均简称为5G系统),所述领域技术人员可以了解,5G新空口(New Radio,NR)系统仅为示例,不为限制。
首先对与本公开实施例相关的一些概念进行说明如下。
一、IPv6分段路由(Segment Routing IPv6,SRv6)
SRv6是分段路由(Segment Routing,SR)技术在IPv6网络的应用。SRv6通过在IPv6报文中插入一个路由扩展头分段路由报文头(Segment Routing Header,SRH),并在SRH中添加路径所要经过的所有段的分段标识(Segment ID,SID),即SID列表(List),来显式指定该报文的转发路径。SRv6的出现是一个巨大的创新,它结合软件定义网络(Software-defined networking,SDN)技术使能可编程的网络,这为云网时代的网络基础服务、增值网络服务提供了创新的土壤。
SRv6技术使用128bit的IPv6地址作为SID,以其极简可编程的特性,实现了任意接入和任意连接,可灵活满足各种网络业务需求,同时提供更高的可靠性和可扩展性,将成为新一代IP承载网的核心技术。在SRv6中,SID用来定义某种网络功能、代表某种网络指令。SRv6 SID采用IPv6地址形式, 但不与任何设备上的接口地址对应。其格式如表1所示:
表1 SRv6 SID格式
标识(Locator) 功能(Function) 参数(Arguments)
其中,Locator是分配给一个网络节点的标识,用于路由和转发数据包,在SRv6 SID中Locator是一个可变长的部分,用于适配不同规模的网络。Function是用来表达该指令要执行的转发动作,相当于计算机指令的操作码,在SRv6网络编程中,不同的转发行为由不同的Function来表达,SRv6 SID节点行为(Endpoint Behaviors)即SID中的Function。Arguments是指令在执行的时候所需要的参数。这些参数可能包含流,服务或任何其他相关的信息。例如:定义一个对网络报文进行报文分片的指令,就可以在Arguments携带报文的分片长度。
需要说明的是,只要保证Locator+Function+Arguments<=128即可,未规定每部分所占的位数。
二、SRv6节点(Endpoint)行为(Behaviors)
SRv6网络编程标准中,SRv6节点(Endpoint)通过本地定义的行为(Behavior)处理SRv6报文。SRv6定义了多种Endpoint Behavior,每个节点需要实例化它们和分配SID,并通过路由协议公布,以便外部了解节点所能提供的Behavior。常用的Endpoint Behavior有END、END.X、END.DT4、END.DT6、End.B6.Encaps、H.Encaps、End.DX4等,实现底层承载网(Underlay)选路、叠加网络(Overlay)业务承载、流量工程、服务链等功能。Endpoint Behavior对应的处理逻辑,这里不做具体介绍。
三、SRv6扩展头设计
为了基于IPv6转发平面实现Segment Routing,IPv6路由扩展报文头新增加一种类型,称为分段路由报文头(Segment Routing Header,SRH),该扩展报文头指定一个IPv6显式路径,存储IPv6的路径约束信息(可以为Segment List)。
源节点在IPv6报文中增加一个SRH扩展头,中转节点就可以按照SRH扩展头里包含的路径信息进行转发。SRH扩展头的格式如图1所示。
其中,IPv6基本头中Next Header取值为43,表明下一个报文头为路由 扩展头。路由扩展头的路由类型字段取值为4,表明该路由扩展头为SRH。SRH主要包含以下几个部分,如表2所示:
表2 SRH报文头部字段
Figure PCTCN2023071351-appb-000001
四、SRv6三层编程空间
SRv6的网络可编程性体现在SRH扩展头中。SRH中有三层编程空间如图2所示:
第一部分是由Segment List构成的路径信息,是可以编程的,它可以将多个Segment组合起来,形成SRv6路径。
第二部分是对SRv6 SID的128比特的运用。SRv6的每个Segment是128比特长,可以灵活分为多段,每段的长度也可以变化,由此具备灵活编程能力。
第三部分是紧接着Segment序列之后的可选类型-长度-数值(Type-Length-Value,TLV)。报文在网络中传送时,需要在转发面封装一些非规则的信息,它们可以通过SRH中TLV的灵活组合来完成。
SRv6通过三层编程空间,具备了更强大的网络编程能力,可以更好地满足不同的网络路径需求。
五、SRH TLVS
TLV提供用于段处理的元数据,目前定义的唯一TLV是基于散列的消息认证码(Hash-based Message Authentication Code,HMAC)和填充TLV,将来可能会定义其他TLV。在处理定义的SID时,除非本地配置另有说明,否则将忽略所有TLV。因此,对于任何实施方式,TLV和HMAC支持都是可选的。但是,添加或解析TLV的实现必须支持PAD TLVs。其他文档可能会定义其他TLV和处理规则。
当Hdr Ext Len大于(Last Entry+1)×2时,将显示TLV。
在段端点处处理TLV时,TLV MUST完全包含在Hdr Ext Len确定的SRH中。检测到超出SRH Hdr Ext Len边界的TLV会导致网络控制报文协议(Internet Control Message Protocol,ICMP)参数问题代码0,向源地址发送消息,指向SRH的Hdr Ext Len字段,并且数据包被丢弃。
TLV的格式的如图3所示。
Type:来自“分段路由头TLV”IANA-SRHTLV的8位代码点,无法识别的类型在收到时必须被忽略。
Length:可变长度数据字段的长度(以字节为单位)。
Variable-length data:类型专用的数据。
类型长度值(TLV)条目包含可选信息,该信息可以由数据包的目标地址(DA)中标识的节点使用。
每个TLV都有自己的长度,类型和语义。(由互联网数字分配机构(The Internet Assigned Numbers Authority,IANA))分配给每个TLV类型的代码点定义了TLV中携带的信息的类型和语义。多个TLV可以在同一SRH中进行编码。
TLV类型的最高位(bit 0)指定该类型的TLV数据是否可以在到达数据 包最终目的地的途中更改:
0:途中TLV数据不变;
1:TLV数据在途中确实发生了变化。
所有TLVs均使用xn+y格式指定其对齐要求。xn+y格式是根据RFC8200定义的。在构造SRH时,SR源节点使用TLV和填充TLV的xn+y对齐要求。
TLV的“长度”字段用于在检查SRH时跳过TLV,以防节点不支持或无法识别类型。长度以字节为单位定义TLV长度,不包括“类型”和“长度”字段。
当设备需要对数据包多次处理或多功能处理时,通常使用以下两种方法:
1)对设备下发多级流表,对数据包进行多次处理。
2)增加设备,经第三方设备处理后再转回到当前设备处理。
目前,相关技术一定程度上能满足对数据包的多次处理传输,但是其依然存在许多问题:
1、灵活性差,不能根据需求对数据包的转发处理进行调整。
2、成本高,需要额外的设备来满足对数据包不同的处理需求。
3、时延大,经多个设备处理后,会增大数据包的传输时延。
4、开销大,经过头节点压入多个SID实现对数据包的处理,增大了数据包的开销率。
5、流表容量有限,设备所能容纳的流表数量是有限的,如果对设备下发的流表过多,将超过设备的容量范围。
本公开实施例提供了一种数据包处理方法、装置及网络设备,用以解决相关技术中无法实现一个网络设备对数据包的多次处理的问题,且解决了对数据包的多次处理传输的方式存在灵活性差、成本高、时延大、开销大以及流表容量有限等问题。
其中,方法和装置是基于同一申请构思的,由于方法和装置解决问题的原理相似,因此装置和方法的实施可以相互参见,重复之处不再赘述。
如图4所示,本公开实施例提供一种数据包处理方法,由第一网络设备执行,包括:
步骤S401,接收第二网络设备发送的数据报文信息;
需要说明的是,所述数据报文信息中携带数据包;
步骤S402,根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
这里需要说明的是,该数据报文信息中携带功能标识信息,第一网络设备依据该功能标识信息在查找预设流表之后便可知道自己需要对数据包执行何种动作(或者执行何种操作、或执行何种功能处理)。
步骤S403,在预设流表中确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
这里需要说明的是,因第一网络设备上可能会实现多种功能,即第一网络设备能够执行多种功能,但是,在此次业务处理过程中,第一网络设备可能只需要执行某几个功能,数据报文信息中便指示第一网络设备需要执行的功能的索引(即功能标识信息),而对于每个功能具体对应何种动作是由预设流表定义的,该预设流表指的便是由控制器下发给第一网络设备,用于进行功能的索引与动作的对应关系的定义,也就是说,该预设流表包括功能的索引以及与索引对应的动作。具体地,第一网络设备在获取到功能标识信息后,需要在预设流表中查找每个功能标识信息对应的动作,在获取到功能标识信息对应的动作之后,便对数据包执行该动作。
例如,第一网络设备在数据报文信息中获取到两个功能标识信息分别为:功能索引A和功能索引B;预设流表中定义了索引A对应的动作为动作1,索引B对应的动作为动作2,索引C对应的动作为动作3,第一网络设备在查找预设流表后确定需要执行动作1和动作2,则第一网络设备便对数据包执行索引A和功能索引B分别对应的动作1和动作2。
需要说明的是,本公开实施例中所提到的动作例如可以为H.Encaps(即在外层加上IPv6以及SRH的报头)、End(即Segment Left减1,并根据Segment列表更新IPv6的目的地址)、End.DX4(即剥掉外层的IPv6报头,将内含的IPv4数据包发给对应的设备)、End.IDS(即对数据报文做入侵检测)等。
这里需要说明的是,该第一网络设备和第二网络设备均指的是数据包转发过程中的转发设备。这些转发设备均连接到控制器(例如,软件定义网络(Software Defined Network,SDN)控制器),由控制器进行统一管理。
可选地,本公开的至少一个实施例中步骤S402的实现方式可以采用如下 一项:
A11、在所述第一网络设备对应的分段标识(SID)中的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
需要说明的是,该第一网络设备对应的分段标识位于所述数据报文信息中的分段路由报文头(SRH)中。
也就是说,此种情况下,功能标识信息是由SRH中的SID中的功能(Function)字段指示的。
一种可选地情况下,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息。进一步需要说明的是,所述数据报文信息中的SRH中的标志(Flags)字段用于指示是否存在至少一个SID对应多个功能,在所述数据报文信息中的SRH中的Flags字段指示存在至少一个SID对应多个功能的情况下,所述数据报文信息中的标签(Tag)字段用于指示所述至少一个分段标识以及其对应的多个功能的个数。
例如,可通过SRH头部中的Flags和Tag字段标识是否存在多个Function以及Function的数量:如Flags字段为0,则表示所有的SID只有一个Function;若为1,则表示某个SID存在多个Function;进一步地,可根据Tag的值来确定哪个SID存在多个Function以及多个Function的具体数量,若按照多个Function处理数据包时,如果需要额外的参数,可以在参数(Arguments)字段定义参数。如有优先级,则按着优先级处理数据包;如没有优先级,则按照定义的执行顺序处理数据包。扩展后的SRv6 SID格式如表3所示:
表3功能扩展后的SRv6 SID格式
Figure PCTCN2023071351-appb-000002
此种情况下,指的是把SID原定义的一个Function根据功能以及数量需求定义为两个或多个Function(s),只要保证Locator+Function(s)+Arguments<=128比特,当三者的长度和小于128比特时,SID的其余位数可设置为0。
具体地,当转发设备(例如SRv6节点)收到IPv6报文之后,会根据IPv6目的地地址(Destination Adddress,DA)查找SID,当获取到SID中所携带 的功能标识信息时,则查找流表执行与功能标识信息对应的动作;当非SRv6的转发设备收到IPv6报文之后,会根据IPv6目的地地址(Destination Adddress,DA)查找全局路由表,根据全局路由表所指示的下一跳进行IPv6报文的转发。
此种情况的具体实现过程为:首先,定义SRv6 SID Endpoint Behaviors,即SID中的Function,是对数据包的转发处理逻辑和执行命令,对需要多次处理的数据报文的网络设备,通过在网络设备上配置或定义扩展的SRv6 SID Endpoint Behaviors;然后,应用层或SDN控制器等功能收到数据流的业务请求后,执行如下流程:根据对不同设备定义的不同配置下发或填充流表,数据报文中的功能标识信息与流表进行匹配,当数据报文中的功能标识信息匹配到流表中的索引时,进入动作域(需要说明的是,动作域指的是一系列数据报文处理动作的集合,本公开中指SRv6数据包中定义的SID的Function部分),执行动作域中定义的SRv6 SID Endpoint Behaviors。定义的SRv6 SID Endpoint Behaviors可能是协议规定的基本操作,也可能是对SID的Function扩展后的操作,实现了对数据包的基本功能加扩展功能处理,即多次处理。
另一种可选地情况下,通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息,也就是说,此种情况下,对SID中的Function字段赋予新编号,即一个新编号能够表示多个功能,对于需要执行多Function的网络设备,可在SID中的Function字段使用协议中未分配的编号,目前协议中未分配的编号为40-32766,即使用这些未分配的编号标识要执行多个Function的处理转发,例如:可使用编号40标识要执行2个Function,使用编号41要执行3个Function等等,具体使用哪个编号以及标识的Function数量可根据用户需求定义,使用新标识的SRv6 SID格式如表4所示:
表4未分配编号标识的SRv6 SID格式
标识(Locator) 功能(Function)(40-32766) 参数(Arguments)
此种情况的具体实现过程为:首先,可通过特定信令(比如:通过扩展SRv6的BGP协议)定义多个Function的列表(list)(list中包括至少一个功能对应的功能标识),并给予这些Function的list新编号(如上面说的未分配的40-32766编号),即每个新编号对应一个Function list(Function列表中包 括至少两个Function),此Function list定义了网络设备对数据包的处理逻辑,控制器通过特定信令把新定义的Function list下发到网络设备上,下发到网络设备上的定义Function list可以是多个也可以是此网络设备要执行的单个Function list;然后当数据包到达网络设备时,根据数据包的SID中Function字段携带的新编号进行网络设备中提前定义或配置的Function list的新编号的匹配,当匹配到新编号对应的Function list后,指示网络设备执行对应的Function list,即网络设备根据Function list中的每一个Function的功能标识信息在流表中查找相应的动作,进而根据需求完成对数据包的多次处理。
A12、在所述数据报文信息中的SRH中的类型长度取值(TLV)字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述数据报文信息中的SRH中的与所述第一网络设备对应的分段标识中的功能字段与所述TLV字段中的功能标识信息存在关联关系。
需要说明的是,此种情况下,功能标识信息是由SRH中的TLV字段指示的,可选地,因TLV字段中可能存在多个转发设备对应的功能标识信息,为了能够准确的将功能标识信息与转发设备对应,该TLV字段中的功能标识信息应当与SID中的功能字段是关联的,例如,TLV字段中定义了一个或多个功能标识信息的列表,SID中的功能字段中指的是功能标识信息的列表的编号。
例如,可通过在SRH头部的可选字段TLV中定义Function list编号及内容(包括哪些Function及其执行顺序),在SID里的Function部分指示去可选的TLV中获取该function list编号所具体应执行的function list并执行,目前协议定义的TLV只有HMAC和填充TLV,此情况可通过定义新的TLV来标识多个Function,例如可以叫作MFUN。
可选地,此种情况下的具体实现方式可以为:
根据所述数据报文信息中的SRH中的SRH头的长度与分段列表的最后一个元素的索引之间的关系,确定SRH中是否存在类型长度取值TLV字段;
在确定所述数据报文信息中的SRH中存在TLV字段的的情况下,在所述数据报文信息的SRH中的TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
需要说明的是,因TLV字段是可选字段,在本公开中当SRH中包含TLV字段便说明需要在TLV字段中获取功能标识信息,可选地,所述根据所述数据报文信息中的SRH中的SRH头的长度与分段列表的最后一个元素的索引之间的关系,确定SRH中是否存在类型长度取值TLV字段的实现方式为:
若N1大于(N2+1)×2,则确定SRH中存在类型长度取值TLV字段;
其中,N1为SRH头的长度,N2为分段列表的最后一个元素的索引。
也就是说,当满足上述条件时,网络设备便需要检查TLV字段,进而获取到功能标识信息。
此种情况的具体实现过程为:首先,配置指示网络设备要处理SRH头部中的可选部分TLV,可通过SRH头部中SRH头的长度(Hdr Ext Len)和分段列表的最后一个元素的索引(Last Entry)的关系标识SRH头部中是否包含TLV,即当Hdr Ext Len大于(Last Entry+1)×2时,将显示TLV,指示网络设备要处理TLV;然后TLV字段中定义相关的function list编号(40-32766)及内容(包括哪些Function及其执行顺序),网络设备根据SID中的Function字段指示去匹配TLV字段中定义的Function list,匹配成功后,执行对应的function list,进而完成对数据包的多次处理。
需要说明的是,上述是以Function数量较少未超过128比特为例进行说明的,当Function数量较多超过128比特时,即一个转发设备对应的SID不能表示其所有的待执行的功能的情况下,可以将128比特容置不了的功能用另外一个SID进行表示,当另外一个SID还不能表示其剩余的所有的待执行的功能的情况下,还可以再次引入另外一个SID进行表示,依此类推;也就是说此种情况下,一个转发设备会对应至少两个SID。
也就是说,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述数据报文信息中的SRH中包括与所述第一网络设备对应的至少两个分段标识;
其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
也就是说,针对Locator+Function+Arguments<=128比特的情况,可以支持在H-1个Function的情况下,保证SID总长度不大于128比特;但若要执 行H个Function,就会导致SID的总长度大于128比特,在这种情况下,可以使用相关技术,即增加SID的数量,把第H个Function用单独的SID定义,进而实现H个Function的功能。
下面对本公开的具体应用进行举例说明如下。
具体应用情况一、入侵检测
假设使两台仅支持IPv4的主机(主机a和b),通过SRv6实现流量工程和入侵检测,拓扑图如图5所示。
图5中路由器R1、R3和R4为支持SRv6的路由器(即上面提到的转发设备),R2为仅支持IPv6的路由器,通过静态配置实现静态路由,路由器与路由器之间仅通过IPv6实现互通。
在此种应用情况下,目的是让主机a与主机b实现IPv4互通,并让数据包经由R3路由器,同时在R3路由器实现SRv6数据流入侵检测,从而实现流量工程+入侵检测。详细的数据包转发流程及每一跳的报头变化如图6所示,图6中报文上的数字表示数据包在网络中的转发顺序。
需要说明的是,图6中的Segment列表是逆序排列的,即排在列表的第一个Segment是路径上的最后一跳,排在列表的最末位Segment是路径的第一跳。
详细实现过程为:
步骤S11、首先定义网络设备对数据包的转发处理逻辑,即定义了R1、R3、R4对数据包的处理逻辑,并下发到不同的网络设备中,由SDN控制器控制网络设备,下发流表等。
步骤S12、当主机a发出的数据业务流,到达支持SRv6的路由器R1时,控制器根据业务流对R1下发,R1会对匹配到的数据报文根据所配置的操作对数据包进行封装,匹配字段为:主机a的IP地址,执行动作为:H.Encaps;即在外层加上IPv6以及SRH的报头,IPv6头部的源IP为R1的地址、目的地址为R3的IP地址,其中SRH的报头中包含了对应R3、R4地址的SID(即R3::a和R4::a),并进行正常的IPv6转发。经R1处理后的数据包转发到R2,R2会对匹配到的数据报文,根据配置的静态路由,基于目的IPv6地址进行转发。
步骤S13、当数据包到达R3,R3对获取到的数据包对应的功能标识信息按照下发的流表执行定义的动作(具体地,R3根据接收到的数据报文按照目的地址(目的地址为:R3的IP地址)匹配到对应的SID,然后根据SID中的功能字段获取功能标识信息,之后通过查找流表确定具体的动作),动作为:End.IDS,此R3对应的SID定了两个Function(s),一是基本功能,即将Segment Left减1,并根据Segment列表更新IPv6的目的地址,将数据包转发至下一跳R4;二是基于对End操作做功能扩展,完成对经过R3匹配到的SRv6数据报文做入侵检测(Intrusion Detection System,IDS)。关于入侵检测扩展功能和SID的基本功能的先后执行顺序,如定义功能时有优先级,则按优先级执行;如无优先级则按定义功能的先后顺序执行。
步骤S14、在支持SRv6的路由器R4,R4对获取到的数据包对应的功能标识信息按照下发的流表执行定义的动作,动作为:End.DX4;即剥掉外层的IPv6报头,将内含的IPv4数据包发给主机b,完成转发流程。
需要注意的是,此种情况中提到的End.IDS是经定义后的对End功能扩展后的SRv6Endpoint Behaviors,在不增加设备的情况下实现了End操作和入侵检测,且具体在哪个设备实现入侵检测不限于此种应用情况中的R3,可根据需求组网进行设计。H.Encaps、End、End.DX4是SRv6协议规定的基本SRv6Endpoint Behaviors。以上涉及到的流表下发或填充皆由应用层或SDN控制器执行。
具体应用情况二、安全加密
假设使两台仅支持IPv4的主机(主机a和b),通过SRv6实现流量工程和安全加密,拓扑图如图5所示。
图5中路由器R1、R3和R4为支持SRv6的路由器(即上面提到的转发设备),R2为仅支持IPv6的路由器,通过开源软件实现静态路由,路由器与路由器之间仅通过IPv6实现互通。
在此种应用情况下,目的是让主机a与主机b实现IPv4互通,并让数据包经由R4路由器,同时在R4路由器实现SRv6数据流安全加密,从而实现流量工程+安全加密。详细的数据包转发流程及每一跳的报头变化如图7所示,图7中报文上的数字表示数据包在网络中的转发顺序。
需要说明的是,图7中的Segment(SID)列表是逆序排列的,即排在列表的第一个Segment(SID)是路径上的最后一跳,排在列表的最末位Segment(SID)是路径的第一跳。
详细实现过程为:
步骤S21、首先定义网络设备对数据包的转发处理逻辑,即定义了R1、R3、R4对数据包的处理逻辑,并下发到不同的网络设备中,由SDN控制器控制网络设备,下发流表等。
步骤S22、当主机a发出的数据业务流,到达支持SRv6的路由器R1时,控制器根据主机a的业务流对R1下发流表,R1会对匹配到的数据报文根据所配置的操作和流表对数据包进行封装,匹配字段为:主机a的IP地址,执行动作为:H.Encaps;即在外层加上IPv6以及SRH的报头,IPv6头部的源IP为R1的地址、目的地址为R3的IP地址,其中SRH的报头中包含了对应R3、R4地址的SID(即R3::a和R4::a),并进行正常的IPv6转发。经R1处理后的数据包转发到R2,R2会对匹配到的数据报文,根据配置的静态路由,基于目的IPv6地址进行转发。
步骤S23、当数据包到达R3,R3对获取到的数据包对应的功能标识信息按照下发的流表执行定义的动作,动作为:End;即将Segment Left减1,并根据Segment列表更新IPv6的目的地址,将数据包转发至下一跳R4。
步骤S24、在支持SRv6的路由器R4,R4对获取到的数据包对应的功能标识信息按照下发的流表执行定义的动作,动作为:End.DX4SE;此R4对应的SID定了两个Function(s),一是基本功能,即剥掉外层的IPv6报头;二是基于对End.DX4操作做功能扩展,完成对经过R4的SRv6数据流做IP层安全加密,将经过加密后的内含的IPv4数据包发给主机b,完成转发流程。关于安全加密扩展功能和SID的基本功能的先后执行顺序,如定义功能时有优先级,则按优先级执行;如无优先级则按定义功能的先后顺序执行。
需要注意的是,此种情况中提到的End.DX4SE是经定义后的对End.DX4功能扩展后的SRv6Endpoint Behaviors,在不增加设备的情况下实现了安全加密,且具体在哪个设备实现安全加密不限于此种应用情况中的R4,可根据需求进行组网设计。H.Encaps、End、End.DX4是SRv6协议规定的基本SRv6 Endpoint Behaviors。以上涉及到的流表下发或填充皆由应用层或SDN控制器执行。
需要说明的是,本公开实施例能够达到如下有益效果:
1、灵活性好:可根据需求对定义对数据包的多功能处理。
2、减少成本:此申请无需增加额外的设备资源即可完成对数据包的多次处理。
3、减少时延:当前设备对数据包连续多次处理相比于经过第三方设备处理后再回到当前设备处理大大减少了时延。
4、节省开销率:通过对SID功能的扩展,在完成相同处理需求的情况下减少了SID的数量,进而减少了数据包的开销,增大了数据包的有效利用率。
5、减少流表数量:下发一级流表即可完成对数据包的多次处理。
如图8所示,本公开实施例提供一种数据包处理装置800,应用于第一网络设备,包括:
接收单元801,用于接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
获取单元802,用于根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
执行单元803,用于在预设流表中确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
可选地,所述获取单元802,用于实现以下一项:
在所述第一网络设备对应的分段标识中的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息中的分段路由报文头SRH中;
在所述数据报文信息中的SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
可选地,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
可选地,所述数据报文信息中的SRH中的标志(Flags)字段用于指示是否存在至少一个分段标识对应多个功能,在所述数据报文信息中的SRH中的Flags字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签(Tag)字段用于指示所述至少一个分段标识以及其对应的多个功能的个数。
可选地,所述在所述数据报文信息中的SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息的实现方式,包括:
根据所述数据报文信息中的SRH中的SRH头的长度与分段列表的最后一个元素的索引之间的关系,确定SRH中是否存在类型长度取值TLV字段;
在确定所述数据报文信息中的SRH中存在TLV字段的的情况下,在所述数据报文信息的SRH中的TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
可选地,所述根据所述数据报文信息中的SRH中的SRH头的长度与分段列表的最后一个元素的索引之间的关系,确定SRH中是否存在类型长度取值TLV字段的实现方式,包括:
若N1大于(N2+1)×2,则确定SRH中存在类型长度取值TLV字段;
其中,N1为SRH头的长度,N2为分段列表的最后一个元素的索引。
可选地,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述数据报文信息中的SRH中包括与所述第一网络设备对应的至少两个分段标识;
其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
需要说明的是,该装置实施例是与上述方法实施例一一对应的装置,上述方法实施例中所有实现方式均适用于该装置的实施例中,也能达到相同的技术效果。
需要说明的是,本公开实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物 理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
如图9所示,本公开实施例还提供一种网络设备,所述网络设备为第一网络设备,包括处理器900、收发机910、存储器920及存储在所述存储器920上并可在所述处理器900上运行的程序;其中,收发机910通过总线接口与处理器900和存储器920连接,其中,所述处理器900用于读取存储器中的程序,执行下列过程:
通过收发机910接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
在预设流表中确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
收发机910,用于在处理器900的控制下接收和发送数据。
其中,在图9中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器900代表的一个或多个处理器和存储器920代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机910可以是多个元件,即包括发送机和接收机,提供用于在传输介质上与各种其他装置通信的单元, 这些传输介质包括无线信道、有线信道、光缆等传输介质。处理器900负责管理总线架构和通常的处理,存储器920可以存储处理器900在执行操作时所使用的数据。
处理器900可以是中央处理器(CPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD),处理器也可以采用多核架构。
进一步地,所述处理器,用于读取所述存储器中的计算机程序并执行以下操作中的一项:
在所述第一网络设备对应的分段标识中的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息中的分段路由报文头SRH中;
在所述数据报文信息中的SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
进一步地,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
进一步地,所述数据报文信息中的SRH中的标志(Flags)字段用于指示是否存在至少一个分段标识对应多个功能,在所述数据报文信息中的SRH中的Flags字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签(Tag)字段用于指示所述至少一个分段标识以及其对应的多个功能的个数。
进一步地,所述处理器,用于读取所述存储器中的计算机程序并执行以下操作:
根据所述数据报文信息中的SRH中的SRH头的长度与分段列表的最后一个元素的索引之间的关系,确定SRH中是否存在类型长度取值TLV字段;
在确定所述数据报文信息中的SRH中存在TLV字段的的情况下,在所述数据报文信息的SRH中的TLV字段中,获取第一网络设备对所述数据包 待执行的至少两个功能的功能标识信息。
进一步地,所述处理器,用于读取所述存储器中的计算机程序并执行以下操作:
若N1大于(N2+1)×2,则确定SRH中存在类型长度取值TLV字段;
其中,N1为SRH头的长度,N2为分段列表的最后一个元素的索引。
进一步地,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述数据报文信息中的SRH中包括与所述第一网络设备对应的至少两个分段标识;
其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
在此需要说明的是,本公开实施例提供的上述网络设备,能够实现上述方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现应用于第一网络设备的数据包处理方法的步骤。所述处理器可读存储介质可以是处理器能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器(例如软盘、硬盘、磁带、磁光盘(magneto-optical,MO)等)、光学存储器(例如CD、DVD、BD、HVD等)、以及半导体存储器(例如ROM、可擦编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、电可擦可编程只读存储器(Electrically Erasable Programmable read only memory,EEPROM)、非易失性存储器(NAND FLASH)、固态硬盘(Solid State Drives,SSD))等。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机可执行指令实现流程 图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机可执行指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些处理器可执行指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的处理器可读存储器中,使得存储在该处理器可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些处理器可执行指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
需要说明的是,应理解以上各个模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且这些模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块通过处理元件调用软件的形式实现,部分模块通过硬件的形式实现。例如,确定模块可以为单独设立的处理元件,也可以集成在上述装置的某一个芯片中实现,此外,也可以以程序代码的形式存储于上述装置的存储器中,由上述装置的某一个处理元件调用并执行以上确定模块的功能。其它模块的实现与之类似。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件可以是一种集成电路,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。
例如,各个模块、单元、子单元或子模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,ASIC),或,一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array, FPGA)等。再如,当以上某个模块通过处理元件调度程序代码的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,CPU)或其它可以调用程序代码的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。
本公开的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例,例如除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。此外,说明书以及权利要求中使用“和/或”表示所连接对象的至少其中之一,例如A和/或B和/或C,表示包含单独A,单独B,单独C,以及A和B都存在,B和C都存在,A和C都存在,以及A、B和C都存在的7种情况。类似地,本说明书以及权利要求中使用“A和B中的至少一个”应理解为“单独A,单独B,或A和B都存在”。
显然,本领域的技术人员可以对本公开进行各种改动和变型而不脱离本公开的精神和范围。这样,倘若本公开的这些修改和变型属于本公开权利要求及其等同技术的范围之内,则本公开也意图包含这些改动和变型在内。

Claims (16)

  1. 一种数据包处理方法,由第一网络设备执行,其中,所述方法包括:
    接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
    根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
    确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
  2. 根据权利要求1所述的方法,其中,所述根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,包括以下一项:
    在所述第一网络设备对应的分段标识的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息的分段路由报文头SRH中;
    在所述SRH的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
  3. 根据权利要求2所述的方法,其中,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
    通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
  4. 根据权利要求3所述的方法,其中,所述SRH中的标志字段用于指示是否存在至少一个分段标识对应多个功能,在所述SRH中的标志字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签字段用于指示所述至少一个分段标识以及所述至少一个分段标识对应的多个功能的个数。
  5. 根据权利要求1所述的方法,其中,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述SRH中包括与所述第一网络设备对应的至少两个分段标识;
    其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
  6. 一种网络设备,所述网络设备为第一网络设备,其中,所述网络设备包括存储器,收发机,处理器;
    存储器,用于存储计算机程序;收发机,用于在所述处理器的控制下收发数据;处理器,用于读取所述存储器中的计算机程序并执行以下操作:
    通过收发机接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
    根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
    确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
  7. 根据权利要求6所述的网络设备,其中,所述处理器,用于读取所述存储器中的计算机程序并执行以下操作中的一项:
    在所述第一网络设备对应的分段标识的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息的分段路由报文头SRH中;
    在所述SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
  8. 根据权利要求7所述的网络设备,其中,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
    通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
  9. 根据权利要求8所述的网络设备,其中,所述SRH中的标志字段用于指示是否存在至少一个分段标识对应多个功能,在所述SRH中的标志字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签字段用于指示所述至少一个分段标识以及所述至少一个分段标识对应的多个功能的个数。
  10. 根据权利要求6所述的网络设备,其中,在所述第一网络设备对所述数 据包待执行的功能的个数大于预设值的情况下,所述SRH中包括与所述第一网络设备对应的至少两个分段标识;
    其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
  11. 一种数据包处理装置,应用于第一网络设备,其中,所述装置包括:
    接收单元,用于接收第二网络设备发送的数据报文信息,所述数据报文信息中携带数据包;
    获取单元,用于根据所述数据报文信息,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息;
    执行单元,用于确定与所述功能标识信息对应的目标动作,对所述数据包执行所述目标动作。
  12. 根据权利要求11所述的装置,其中,所述获取单元,具体用于:
    在所述第一网络设备对应的分段标识的功能字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息,所述第一网络设备对应的分段标识位于所述数据报文信息的分段路由报文头SRH中;
    在所述SRH中的类型长度取值TLV字段中,获取第一网络设备对所述数据包待执行的至少两个功能的功能标识信息。
  13. 根据权利要求12所述的装置,其中,通过所述功能字段中的不同比特位指示所述至少两个功能的功能标识信息;或者
    通过所述功能字段中的相同比特位指示所述至少两个功能的功能标识信息。
  14. 根据权利要求13所述的装置,其中,所述SRH中的标志字段用于指示是否存在至少一个分段标识对应多个功能,在所述SRH中的标志字段指示存在至少一个分段标识对应多个功能的情况下,所述数据报文信息中的标签字段用于指示所述至少一个分段标识以及所述至少一个分段标识对应的多个功能的个数。
  15. 根据权利要求11所述的装置,其中,在所述第一网络设备对所述数据包待执行的功能的个数大于预设值的情况下,所述SRH中包括与所述第一网络设备对应的至少两个分段标识;
    其中,所述预设值为所述第一网络设备对应的一个分段标识所指示的功能的个数的最大值。
  16. 一种处理器可读存储介质,所述处理器可读存储介质存储有计算机程序,其中,所述计算机程序用于使所述处理器执行权利要求1至5任一项所述的方法。
PCT/CN2023/071351 2022-01-13 2023-01-09 数据包处理方法、装置及网络设备 WO2023134631A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210037301.6 2022-01-13
CN202210037301.6A CN116489237A (zh) 2022-01-13 2022-01-13 数据包处理方法、装置及网络设备

Publications (1)

Publication Number Publication Date
WO2023134631A1 true WO2023134631A1 (zh) 2023-07-20

Family

ID=87225479

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/071351 WO2023134631A1 (zh) 2022-01-13 2023-01-09 数据包处理方法、装置及网络设备

Country Status (2)

Country Link
CN (1) CN116489237A (zh)
WO (1) WO2023134631A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117729274A (zh) * 2024-02-07 2024-03-19 之江实验室 报文处理的方法、装置、设备及可读存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110832813A (zh) * 2017-06-27 2020-02-21 思科技术公司 使用分段路由的以太网虚拟专用网
CN111107004A (zh) * 2018-10-27 2020-05-05 华为技术有限公司 报文处理方法、相关设备及计算机存储介质
CN111510386A (zh) * 2019-01-30 2020-08-07 华为技术有限公司 用于处理报文的方法和装置
CN112468396A (zh) * 2019-09-06 2021-03-09 华为技术有限公司 主机网络性能需求可编程化的方法、设备和系统
WO2021155759A1 (zh) * 2020-02-07 2021-08-12 中国移动通信有限公司研究院 分段标识的处理方法及设备
CN113438161A (zh) * 2020-03-23 2021-09-24 华为技术有限公司 一种生成段标识sid的方法和网络设备
CN113497760A (zh) * 2020-04-07 2021-10-12 中兴通讯股份有限公司 分段路由头压缩方法、业务处理方法及装置
CN113542125A (zh) * 2018-03-31 2021-10-22 华为技术有限公司 一种基于集成流表转发报文的方法及装置
CN113839871A (zh) * 2017-09-25 2021-12-24 华为技术有限公司 一种报文转发的方法及网络设备

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110832813A (zh) * 2017-06-27 2020-02-21 思科技术公司 使用分段路由的以太网虚拟专用网
CN113839871A (zh) * 2017-09-25 2021-12-24 华为技术有限公司 一种报文转发的方法及网络设备
CN113542125A (zh) * 2018-03-31 2021-10-22 华为技术有限公司 一种基于集成流表转发报文的方法及装置
CN111107004A (zh) * 2018-10-27 2020-05-05 华为技术有限公司 报文处理方法、相关设备及计算机存储介质
CN111510386A (zh) * 2019-01-30 2020-08-07 华为技术有限公司 用于处理报文的方法和装置
CN112468396A (zh) * 2019-09-06 2021-03-09 华为技术有限公司 主机网络性能需求可编程化的方法、设备和系统
WO2021155759A1 (zh) * 2020-02-07 2021-08-12 中国移动通信有限公司研究院 分段标识的处理方法及设备
CN113438161A (zh) * 2020-03-23 2021-09-24 华为技术有限公司 一种生成段标识sid的方法和网络设备
CN113497760A (zh) * 2020-04-07 2021-10-12 中兴通讯股份有限公司 分段路由头压缩方法、业务处理方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117729274A (zh) * 2024-02-07 2024-03-19 之江实验室 报文处理的方法、装置、设备及可读存储介质

Also Published As

Publication number Publication date
CN116489237A (zh) 2023-07-25

Similar Documents

Publication Publication Date Title
US10931580B2 (en) Packet processing method and network device
CN113411243B (zh) 数据传输方法及装置
WO2020156166A1 (zh) 用于处理报文的方法和装置
US20230300070A1 (en) Packet Sending Method, Device, and System
WO2021151381A1 (zh) 分段标识的处理方法及设备
WO2023134631A1 (zh) 数据包处理方法、装置及网络设备
WO2021057530A1 (zh) 确定路由前缀与分段标识间映射关系的方法、装置及系统
WO2022222750A1 (zh) 报文转发方法、装置、网络设备及存储介质
WO2022057810A1 (zh) 业务报文的转发方法、sr策略的发送方法、设备及系统
WO2022007550A1 (zh) 一种负载均衡方法、装置、网络设备及系统
CN113630316B (zh) 一种数据传输方法及通信装置
CN113726652B (zh) 一种通告信息的处理方法、装置及存储介质
US20230388223A1 (en) Packet forwarding method, apparatus, and system
CN111464443B (zh) 基于服务功能链的报文转发方法、装置、设备及存储介质
CN109995636A (zh) 混合组网方法、装置、系统、设备及介质
US20220263751A1 (en) Packet Processing Method, Apparatus, and System
US20220224638A1 (en) Preventing generation of duplicate network routes in a software defined wide area network
CN109347734A (zh) 一种报文发送方法、装置、网络设备和计算机可读介质
CN107995084B (zh) 隧道选择方法及装置
CN114079634A (zh) 一种报文转发方法、装置及计算机可读存储介质
CN113132230A (zh) 发送报文的方法、设备及计算机存储介质
CN116980975A (zh) 一种基于SRv6协议的数据传输方法、装置及设备
CN112787923B (zh) 一种报文的处理方法,装置和系统
CN112104539B (zh) 分段ngmvpn中的信息交互方法、装置和系统
WO2023231431A1 (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: 23739973

Country of ref document: EP

Kind code of ref document: A1