Message Forwarding Method and Apparatus, Storage Medium, and Electronic Device
By building a path identification sequence in SRv6 TE messages and forwarding, the problems of low bandwidth utilization and poor network security during cross-border domain forwarding are solved, and more efficient bandwidth utilization and stronger network security management are achieved.
Patent Information
- Application Number
- CN202111544991.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-12-16
AI Technical Summary
When SRv6 TE packets are forwarded across network domains, the prior art leads to low bandwidth utilization and poor network security, especially because the segment list in SRH is too long, the bandwidth utilization is low, and detailed network path information is required to pass on, affecting network security management.
By obtaining user messages and encapsulating them, a target message is generated, which contains network path information for forwarding user messages. When the target function field is identified, a path identification sequence is constructed based on the field and network path information, and the target message is forwarded according to the sequence, and finally decapsulated to obtain the user message.
This method reduces the number of nodes in the target message, improves bandwidth utilization, and enhances network security by hiding network domain information, and facilitates cross-domain forwarding management.
Smart Images

Figure CN116266822B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technologies, and in particular, to a method and apparatus for packet forwarding, a computer-readable storage medium, and an electronic device. Background Art
[0002] When a packet is encapsulated into an SRv6 TE (Segment Routing IPv6 Traffic Engineering Policy) packet, the SRv6 TE packet can be forwarded using SRv6 TE technology in the SRv6 network domain. In the scenario of cross-domain forwarding of SRv6 TE packets, the SRv6 TE packet is decapsulated and then re-encapsulated on the router at the intersection of the network domains.
[0003] When the SRv6 TE packet is forwarded in the network domain, each SRv6 node on the end-to-end path needs to be explicitly specified in the segment list in the SRH (Segment Routing Header, an IPv6 extension header), and each node occupies 16 bytes of space in the SRH. Therefore, the more nodes the SRv6 SRH contains, the longer the header, and the lower the bandwidth utilization rate. In addition, when the SRv6 TE packet is forwarded across network domains, path information of different network domains needs to be loaded in the packet header, and detailed network path information needs to be transmitted between different operators, which is not conducive to network security management.
[0004] In view of this, there is an urgent need in the art to develop a new packet forwarding method and apparatus.
[0005] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present disclosure, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0006] The purpose of the present disclosure is to provide a method and apparatus for packet forwarding, a computer-readable storage medium, and an electronic device, so as to at least overcome to some extent the technical problems of low bandwidth utilization rate and poor security caused by the limitations of related technologies.
[0007] Other features and advantages of the present disclosure will become apparent through the following detailed description, or will be partially learned through the practice of the present disclosure.
[0008] According to the first aspect of the embodiments of the present invention, a method for packet forwarding is provided, the method including:
[0009] Obtain a user packet, and perform encapsulation processing on the user packet to obtain a target packet, where the target packet includes network path information for forwarding the user packet;
[0010] When the target function field is identified in the target message, construct a path identification sequence according to the target function field and the network path information;
[0011] Forward the target message according to the network path information represented by the path identification sequence, and perform decapsulation processing on the forwarded target message to obtain the user message.
[0012] In an exemplary embodiment of the present invention, the target function field includes a target function field composed of a first field and a second field.
[0013] In an exemplary embodiment of the present invention, the first field includes end.SRH, and the second field includes BSID, where BSID refers to the target path information in the network path information.
[0014] In an exemplary embodiment of the present invention, the step of constructing a path identification sequence according to the target function field and the network path information when the target function field is identified in the target message includes:
[0015] Construct the segment identifier in the network path information according to the end.SRH and the BSID;
[0016] Use the segment identifier to identify the target function field in the network path information for forwarding the target message, and construct a path identification sequence according to the target function field and the network path information.
[0017] In an exemplary embodiment of the present invention, the method further includes:
[0018] When the target function field is not identified in the network path information for forwarding the target message by using the segment identifier, continue to forward the target message according to the network path information.
[0019] In an exemplary embodiment of the present invention, the step of constructing a path identification sequence according to the target function field and the network path information includes:
[0020] Determine the target path information referred to by the BSID in the network path information, and determine other path information before the target path information in the network path information;
[0021] Use the target path information to replace the other path information to generate a path identification sequence represented by the target path information.
[0022] In an exemplary embodiment of the present invention, forwarding the target packet according to the network path information characterized by the path identification sequence includes:
[0023] Forwarding the target packet according to the target path information in the path identification sequence.
[0024] According to a second aspect of the embodiments of the present invention, there is provided a packet forwarding device, including:
[0025] A packet encapsulation module, configured to obtain a user packet and perform encapsulation processing on the user packet to obtain a target packet, where the target packet includes network path information for forwarding the user packet;
[0026] A sequence construction module, configured to construct a path identification sequence according to the target function field and the network path information when a target function field is recognized in the target packet;
[0027] A packet forwarding module, configured to forward the target packet according to the network path information characterized by the path identification sequence, and perform decapsulation processing on the forwarded target packet to obtain the user packet.
[0028] According to a third aspect of the embodiments of the present invention, there is provided an electronic device, including: a processor and a memory; wherein, computer-readable instructions are stored on the memory, and when the computer-readable instructions are executed by the processor, the packet forwarding method in any of the above exemplary embodiments is implemented.
[0029] According to a fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the packet forwarding method in any of the above exemplary embodiments is implemented.
[0030] It can be seen from the above technical solutions that the packet forwarding method, packet forwarding device, computer storage medium, and electronic device in the exemplary embodiments of the present disclosure at least have the following advantages and positive effects:
[0031] In the method and device provided in the exemplary embodiments of the present disclosure, a path identification sequence is constructed using the target function field and network path information for forwarding, which can reduce the number of nodes in the target packet, improve the utilization rate of the bandwidth, and furthermore, hide the information of different network domains during the forwarding process of the target packet, reduce the cross-domain propagation of each node information in the network path information, and ensure network security. Further, it is convenient to manage the target packet during cross-domain forwarding, and enhances the cross-domain control of the target packet.
[0032] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the present disclosure. Description of the Drawings
[0033] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0034] Figure 1 Schematic structural diagram showing the encapsulation of an IPv4 packet into an SRv6 TE packet in the related art;
[0035] Figure 2 Schematic format diagram showing the packet encapsulation of an SRv6 TE packet in the related art;
[0036] Figure 3 Schematic diagram showing the forwarding process in the scenario of cross-network domain forwarding of an SRv6 TE packet in the related art;
[0037] Figure 4 Schematic interface diagram showing the cross-SRv6 network domain forwarding of an IPv4 packet through SRv6 TE technology in the related art;
[0038] Figure 5 Schematic diagram showing the process of a packet forwarding method in an exemplary embodiment of the present disclosure;
[0039] Figure 6 Schematic diagram showing the process of a method for constructing a path identifier sequence in an exemplary embodiment of the present disclosure;
[0040] Figure 7 Schematic structural diagram showing the segment identifier in the network path information in an exemplary embodiment of the present disclosure;
[0041] Figure 8 Schematic diagram showing the process of a further method for constructing a path identifier sequence in an exemplary embodiment of the present disclosure;
[0042] Figure 9 Schematic interface diagram showing the packet forwarding method in an application scenario in an exemplary embodiment of the present disclosure;
[0043] Figure 10 Schematic structural diagram showing a packet forwarding device in an exemplary embodiment of the present disclosure;
[0044] Figure 11Schematically illustrate an electronic device for implementing a packet forwarding method in an exemplary embodiment of the present disclosure;
[0045] Figure 12 Schematically illustrate a computer-readable storage medium for implementing a packet forwarding method in an exemplary embodiment of the present disclosure. Detailed implementation manners
[0046] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that one or more of the specific details may be omitted, or other methods, components, devices, steps, etc. may be used. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.
[0047] As used in this specification, the terms "a", "an", "the", and "said" are used to denote the presence of one or more elements / components / etc.; the terms "comprising" and "having" are used to mean an open inclusion and mean that there may be additional elements / components / etc. in addition to the listed elements / components / etc.; the terms "first" and "second", etc. are used only as labels and are not a limitation on the quantity of their objects.
[0048] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0049] When a packet is encapsulated into an SRv6 TE packet, the SRv6 TE packet can be forwarded using SRv6 TE technology in the network domain.
[0050] Figure 1 The structural schematic diagram of encapsulating an IPv4 packet into an SRv6 TE packet is shown, as Figure 1 shown, when an IPv4 (Internet Protocol version 4) packet enters the SRv6 network domain, the IPv4 packet can be encapsulated into an SRv6 TE packet. Among them, the encapsulated IPv6 header is used for packet forwarding.
[0051] The SRv6 TE packet contains the IPv6 extension header SRH. The SRH contains a series of information for the forwarding of the SRv6 TE packet. The segment list (sorted combination) therein refers to the SRv6 nodes through which the SRv6 TE packet is forwarded and the processing method at the corresponding nodes.
[0052] Among them, the SRH is a type of IPv6 extension header. The value of the next header in the IPv6 packet corresponds to 43, and the routing type value in the extension header is 4. It internally contains information such as the segment list for packet forwarding in the SRv6 VPN.
[0053] Figure 2 The format schematic diagram of the packet encapsulation of the SRv6 TE packet is shown. As Figure 2 shown, the dark gray part in the upper half is the IPv6 packet header, the light gray part in the middle is the SRH, and the white part in the bottom row is the user data of the packet payload.
[0054] In the related art, Figure 3 The schematic diagram of the forwarding process in the scenario of SRv6 TE packet forwarding across network domains is shown. As Figure 3 shown, if the SRv6 TE packet is decapsulated on the router at the network domain intersection and then encapsulated, the corresponding new SRv6 packet can be obtained.
[0055] When the SRv6 TE packet is forwarded in the network, each SRv6 node on the end-to-end path needs to be specified in the segment list in the SRH. Each node occupies 16 bytes of space in the SRH. Therefore, the more nodes the SRv6 SRH contains, the longer the header, and the lower the bandwidth utilization rate.
[0056] Figure 4 The interface schematic diagram of IPv4 packet forwarding across the SRv6 network domain through the SRv6 TE technology is shown. As Figure 4As shown in the figure, this interface schematic diagram represents an example of encapsulation of user packets carried by SRv6 TE through multiple network domains. Among them, during the forwarding process of SRv6 TE packets across network domains, path information of different network domains is loaded in the packet header. Based on this, the more nodes included in the SID (segment ID) list in the end-to-end SRv6 TE packet, the longer the packet header, which reduces the effective bandwidth utilization rate of SRv6 TE. Moreover, when SRv6 TE packets are forwarded across network domains, path information of different network domains needs to be loaded in the packet header, and detailed network path information is transmitted between different operators, which is not conducive to network security management. In addition, it is difficult to manage SRv6 TE packets in terms of filtering, rate limiting, and QoS (Quality of Service) at cross-domain nodes.
[0057] Among them, an SID is a 128-bit identifier for an SRv6 node. The content of this SID consists of three parts: the locator that identifies the current node, the function func of this node, and the argument argu carried by this SID. Each part has an indefinite length according to the implementation, and the total length is 128 bits.
[0058] In view of the problems existing in the related technologies, the present disclosure proposes a packet forwarding method. Figure 5 The flowchart of the packet forwarding method is shown, as Figure 5 shown, the packet forwarding method at least includes the following steps:
[0059] Step S510. Obtain a user packet, and perform encapsulation processing on the user packet to obtain a target packet, where the target packet includes network path information for forwarding the user packet.
[0060] Step S520. When a target function field is recognized in the target packet, construct a path identifier sequence according to the target function field and the network path information.
[0061] Step S530. Forward the target packet according to the network path information represented by the path identifier sequence, and perform decapsulation processing on the forwarded target packet to obtain the user packet.
[0062] In an exemplary embodiment of the present disclosure, constructing a path identifier sequence using the target function field and the network path information for forwarding can reduce the number of nodes in the target packet, improve the bandwidth utilization rate, and moreover, hide information of different network domains during the forwarding process of the target packet, reduce the cross-domain propagation of node information in the network path information, and ensure network security. Furthermore, it is convenient to manage the target packet during cross-domain forwarding, enhancing the cross-domain control of the target packet.
[0063] The following details each step of the packet forwarding method.
[0064] In step S510, a user message is obtained, and the user message is encapsulated to obtain a target message, where the target message includes network path information for forwarding the user message.
[0065] In an exemplary embodiment of the present disclosure, the user message may be an IPv4 message or a message in other forms, and this exemplary embodiment does not make special limitations thereto.
[0066] After the user message is obtained, the user message can be encapsulated to obtain an SRv6TE message, that is, the target message.
[0067] After encapsulating the user message into an SRv6 TE message, the user message can be carried by SRv6TE and pass through multiple network domains.
[0068] Therefore, the target message may further include network path information for forwarding the user message. When the target message is an SRv6 TE message, the network path information may be shown in the segment list in the SRv6 SRH.
[0069] Among them, to implement the SR technology based on the IPv6 forwarding plane, an SRH extension header is newly added to the IPv6 routing extension header. This extension header specifies an explicit path of IPv6 and stores IPv6 Segment List information. The Segment List is a forwarding path obtained by arranging segments and network nodes in an orderly manner. When a message is forwarded, the IPv6 destination address (IPv6 DA) information is jointly determined by the Segments Left (index) and the Segment List field, so as to guide the forwarding path and behavior of the message.
[0070] Among them, Segments Left is a field in the SRH, indicating the index of the SID in the currently used SID list, and segment left - 1 for each SRv6 node passed through.
[0071] The SR technology is a product under the competitive pressure of SDN. Its core idea is to cut the message forwarding path into different segments, and insert segment information into the message at the starting point of the path. Intermediate nodes only need to forward according to the segment information carried in the message. Such a path segment is called a "Segment" and is identified by an SID (Segment Identifier).
[0072] The key points of the SR technology are two points, segmenting the path (Segment) and sorting and combining the path at the starting node (Segment List) to determine the forwarding path, that is, the network path information.
[0073] In step S520, when the target function field is recognized in the target message, a path identification sequence is constructed based on the target function field and the network path information.
[0074] In an exemplary embodiment of the present disclosure, when forwarding the target message according to the message forwarding path characterized by the network path information, the target function field can be recognized at each SRv6 node.
[0075] In an alternative embodiment, the target function field includes a target function field composed of a first field and a second field.
[0076] Therefore, the target function field can be composed of the contents of two fields.
[0077] In an alternative embodiment, the first field includes end.SRH, and the second field includes BSID, where BSID refers to the target path information in the network path information.
[0078] Specifically, the first field constituting the target function field can be end.SRH, and the second field constituting the target function field can be BSID. That is, the target function field can be end.SRH BSID. In addition, the target function field can also be composed of other first fields and other second fields, and this exemplary embodiment does not make special limitations thereto.
[0079] BSID refers to the routing policy of the SRv6 nodes passed by the SRv6 message forwarding. The information of this routing policy will be written into the SRH, and its representation form in the SRH is a segment list.
[0080] In an alternative embodiment, Figure 6 shows a flowchart of a method for constructing a path identification sequence, as Figure 6 shown, the method at least includes the following steps: In step S610, a segment identifier in the network path information is constituted according to end.SRH and BSID.
[0081] The segment identifier SID of SRv6 can be composed of three parts, namely Locator, Function, and Arguments.
[0082] Among them, Locator has a positioning function and provides the routing ability of IPv6. The message realizes addressing and forwarding through this field. In addition, the routing corresponding to Locator is also aggregatable.
[0083] Function is used to express the forwarding action to be executed by the device instruction, and different forwarding behaviors are expressed by different Functions.
[0084] Arguments is an optional field that supplements the Function. It is the parameter corresponding to the instruction during execution. These parameters may include streams, services, or any other relevant information.
[0085] Each segment identifier of SRv6 is 128 bits and can be flexibly divided into multiple segments. The function and length of each segment can be customized, thus having the ability of flexible programming, that is, the service can be edited.
[0086] Figure 7 The structural schematic diagram of the segment identifier in the network path information is shown, such as Figure 7 As shown, the Function field of the segment identifier in the network path information corresponds to end.SRH, and the Arguments field of the segment identifier in the network path information corresponds to BSID.
[0087] When end.SRH is implemented in the Function part of the segment identifier, a certain number of bits can be used, that is, 128 bits to represent the encapsulation function of the target packet across the network domain technology. And the BSID of the carried parameter Arguments represents the routing policy of SRv6 TE in the new SRv6 network domain carried by this encapsulation function. This routing policy can be the target path information composed of part of the network path information.
[0088] In step S620, the target function field is identified in the network path information of the target packet forwarding by using the segment identifier, and the path identifier sequence is constructed according to the target function field and the network path information.
[0089] During the process of forwarding the target packet according to the network path information, the router can identify the target function field end.SRH BSID in the segment identifier according to the destination address of the IPv6 header on the SRv6 TE packet.
[0090] Specifically, the target function field of the SRv6 node is identified according to the Function field end.SRH and the Arguments field BS ID of the segment identifier. Therefore, the path identifier sequence can be constructed according to the target function field and the network path information.
[0091] In an alternative embodiment, Figure 8 The flow schematic diagram of the method for further constructing the path identifier sequence is shown, such as Figure 8 As shown, the method at least includes the following steps: In step S810, the target path information referred to by BSID is determined in the network path information, and other path information before the target path information is determined in the network path information.
[0092] For example, when the network path information includes SRv6 node 2, SRv6 node 3, SRv6 node 4, SRv6 node 5, SRv6 node 6, and SRv6 node 7, and the SRv6 node of the target function field is identified as SRv6 node 4, the target path information referred to by the BSID includes SRv6 node 5, SRv6 node 6, and SRv6 node 7. Then, the other path information before the target path information includes SRv6 node 2, SRv6 node 3, and SRv6 node 4. The SRv6 nodes 2, 3, and 4 in the other path information are the SRv6 nodes that the target packet has been forwarded through. At this time, the SRv6 nodes 2, 3, and 4 are stored in the IPv6 header of the SRv6 TE packet.
[0093] In step S820, the other path information is replaced with the target path information to generate a path identifier sequence represented by the target path information.
[0094] After determining the target path information and the other path information in the network path information, the other path information stored in the IPv6 header of the SRv6 TE packet can be replaced with the target path information, and a new SRH can be constructed according to the target path information to obtain a path identifier sequence.
[0095] In this exemplary embodiment, a new identifier sequence can be constructed according to the provided target function field, reducing the number of nodes in the target packet's extension header, lowering the depth requirement of the target packet's label stack, and improving bandwidth utilization. Moreover, it can also reduce the cross-domain propagation of node information in the network domain, ensuring network security.
[0096] When the target function field cannot be identified in the network path information for forwarding the target packet using the segment identifier, it indicates that at the current SRv6 node in the network path information, there is no need to split the SRv6 nodes stored in the IPv6 header of the SRv6 TE packet. Therefore, the packet can continue to be forwarded according to the target path information.
[0097] In an alternative embodiment, when the target function field is not identified in the network path information for forwarding the target packet using the segment identifier, the target packet is forwarded continuously according to the network path information.
[0098] For example, when the network path information includes SRv6 node 2, SRv6 node 3, SR v6 node 4, SRv6 node 5, SRv6 node 6, and SRv6 node 7, and the SRv6 node with the set target function field is SRv6 node 4, then when the target packet is forwarded to SRv6 node 2 or SRv6 node 3, the target function field cannot be identified using the segment identifier. Therefore, the target packet can be continuously forwarded at SRv6 node 2 and SRv6 node 3.
[0099] In step S530, the target packet is forwarded according to the network path information represented by the path identifier sequence, and the forwarded target packet is decapsulated to obtain the user packet.
[0100] In an exemplary embodiment of the present disclosure, after constructing the path identifier sequence, the target packet can be forwarded according to the network path information represented by the path identifier sequence.
[0101] In an alternative embodiment, the target packet is forwarded according to the target path information in the path identifier sequence.
[0102] When the network path information includes SRv6 node 2, SRv6 node 3, SRv6 node 4, SRv6 node 5, SRv6 node 6, and SRv6 node 7, and the SRv6 node that identifies the target function field is SRv6 node 4, the target path information referred to by the BSID includes SRv6 node 5, SRv6 node 6, and SRv6 node 7. Therefore, a corresponding path identifier sequence can be constructed based on SRv6 node 5, SRv6 node 6, and SRv6 node 7.
[0103] Moreover, the target path information represented by this path identifier sequence is to forward the target packet from SRv6 node 5 to SRv6 node 6, and then forward the target packet from SRv6 node 6 to SRv6 node 7. Therefore, it can be forwarded according to the target path information represented by this path identifier sequence.
[0104] When forwarding to the last SRv6 node, the target packet can be forwarded from the last SRv6 node to another user side to decapsulate the target packet at this user side to obtain the original user packet, such as an IPv4 packet, thus completing the forwarding process of the user packet.
[0105] The following elaborates on the packet forwarding method in the embodiments of the present disclosure in combination with an application scenario.
[0106] Figure 9 Shows the interface schematic diagram of the packet forwarding method in the application scenario, as Figure 9As shown, obtain a user message, and perform encapsulation processing on the user message to obtain a target message, where the target message includes network path information for forwarding the user message.
[0107] The user message can be an IPv4 message or a message in other forms, and this exemplary embodiment does not make special limitations on this.
[0108] After the user message is obtained at user site 1, the user message can be encapsulated to obtain an SRv6 TE message, that is, the target message.
[0109] After encapsulating the user message into an SRv6 TE message, the user message can be carried by SRv6 TE and pass through the SRv6 network domain. Among them, the SRH of an SRv6 TE message can only indicate one SRv6 network domain.
[0110] Therefore, the target message can also include network path information for forwarding the user message. When the target message is an SRv6 TE message, the network path information can be shown in the segment list in the SRv6 SRH.
[0111] When forwarding the target message according to the message forwarding path characterized by the network path information, the target function field can be recognized at each SRv6 node.
[0112] Among them, the target function field includes a target function field composed of a first field and a second field.
[0113] Therefore, the target function field can be composed of the contents of two fields.
[0114] Specifically, the first field includes end.SRH, and the second field includes BSID. BSID refers to the target path information in the network path information.
[0115] Specifically, the first field constituting the target function field can be end.SRH, and the second field constituting the target function field can be BSID. That is, the target function field can be end.SRH BSID. In addition, the target function field can also be composed of other first fields and other second fields, and this exemplary embodiment does not make special limitations on this.
[0116] BSID refers to the routing policy of the SRv6 node passed by the SRv6 message forwarding. The information of this routing policy will be written into the SRH and is in the form of a segment list in the SRH.
[0117] According to end.SRH and BSID, the segment identifier in the network path information is formed.
[0118] The Segment Identifier (SID) of SRv6 can be composed of three parts, namely Locator, Function, and Arguments.
[0119] Among them, Locator has a positioning function, provides IPv6 routing capabilities, and packets achieve addressing and forwarding through this field. In addition, the corresponding route of Locator is also aggregatable.
[0120] Function is used to express the forwarding action to be performed by the device instruction, and different forwarding behaviors are expressed by different Functions.
[0121] Arguments is an optional field, which is a supplement to Function and is the parameter corresponding to the instruction when it is executed. These parameters may include flow, service, or any other relevant information.
[0122] Each segment identifier of SRv6 is 128 bits and can be flexibly divided into multiple segments. The function and length of each segment can be customized, thus having the ability of flexible programming, that is, the service can be edited.
[0123] The Function field of the segment identifier in the network path information corresponds to end.SRH, and the Arguments field of the segment identifier in the network path information corresponds to BSID.
[0124] When implementing the Function part of the segment identifier, end.SRH can use a certain number of bits, that is, 128 bits to represent the encapsulation function of the target packet across the network domain technology. And the BSID of the carried parameter Arguments represents the routing policy of SRv6 TE carried by this encapsulation function in the new SRv6 network domain. This routing policy can be the target path information composed of part of the network path information.
[0125] Use the segment identifier to identify the target function field in the network path information of the target packet forwarding, and construct a path identifier sequence according to the target function field and the network path information.
[0126] In the process of forwarding the target packet according to the network path information, the router can identify the target function field end.SRH BSID in the segment identifier according to the destination address of the IPv6 header on the SRv6 TE packet.
[0127] Specifically, the target function field of the SRv6 node is identified according to the Function field end.SRH and the Arguments field BSID of the segment identifier. Therefore, a path identifier sequence can be constructed according to this target function field and the network path information.
[0128] Determine the target path information referred to by the BSID in the network path information, and determine other path information before the target path information in the network path information.
[0129] When the network path information includes SRv6 node 2, SRv6 node 3, SRv6 node 4, SRv6 node 5, SRv6 node 6, and SRv6 node 7, and the SRv6 node of the target function field is identified as SRv6 node 4, the target path information referred to by the BSID includes SRv6 node 5, SRv6 node 6, and SRv6 node 7. Then, other path information before the target path information includes SRv6 node 2, SRv6 node 3, and SRv6 node 4. The SRv6 nodes 2, 3, and 4 in this other path information are the SRv6 nodes that the target packet has been forwarded through. At this time, the SRv6 nodes 2, 3, and 4 are stored in the IPv6 header of the SRv6 TE packet.
[0130] Use the target path information to replace the other path information to generate a path identifier sequence represented by the target path information.
[0131] After determining the target path information and other path information in the network path information, the other path information stored in the IPv6 header of the SRv6 TE packet can be replaced with the target path information, and a new SRH can be constructed according to the target path information to obtain a path identifier sequence.
[0132] When the target function field of SRv6 cannot be recognized by the routing node where the target packet is currently forwarded using the segment identifier, the current node is an IPv6 node, and the packet can be forwarded according to the IPv6 header of the target packet.
[0133] Specifically, in the SRv6 technology, the destination address (DA) of the outer IPv6 header of the SRv6 packet is encapsulated according to the SID corresponding to the segment list, indicating the value of segment left, the index of the SID in the segment list. Every time it passes through a hop of the SRv6 node, segment left is decremented by 1, and the current segment list SID[segment left] is filled into the DA of the outer IPv6 header of the SRv6 packet for forwarding.
[0134] After constructing the path identifier sequence, the target packet can be forwarded according to the network path information represented by the path identifier sequence.
[0135] When the network path information includes SRv6 node 2, SRv6 node 3, SRv6 node 4, SRv6 node 5, SRv6 node 6, and SRv6 node 7, and the SRv6 node that recognizes the target function field is SRv6 node 4, the target path information referred to by BSID includes SRv6 node 5, SRv6 node 6, and SRv6 node 7. Therefore, the corresponding path identifier sequence can be constructed based on SRv6 node 5, SRv6 node 6, and SRv6 node 7.
[0136] Moreover, the target path information represented by this path identifier sequence is to forward the target packet from SRv6 node 5 to SRv6 node 6, and then forward the target packet from SRv6 node 6 to SRv6 node 7. Therefore, it can be forwarded according to the target path information represented by this path identifier sequence.
[0137] When forwarding to the last SRv6 node, the target packet can be forwarded from the last SRv6 node to another user side, so as to perform decapsulation on the target packet at this user side to obtain the original user packet, such as an IPv4 packet, and complete the forwarding process of the user packet.
[0138] Among them, on the router, the pseudo-code for converting the SRv6 TE packet into a new SRv6 TE packet can be:
[0139] if(segment left == 0){
[0140] Search for the new SRv6 TE path information according to BSID
[0141] Pop up the original SID list in the SRv6 packet
[0142] Use the query result of 2 as the new SID list to construct the new SID list of Srv6
[0143] SRH's segment left = segment left - 1
[0144] IPv6 forwarding header DA = SID list[segment left]
[0145] }
[0146] Among them, when segment left == 0, it indicates that the target packet is forwarded to SRv6 node 4. Therefore, search for the target path information referred to according to the target function field BSID, and delete the original SID list in the SRv6 packet, that is, SRv6 node 2, SRv6 node 3, and SRv6 node 4, so as to form a path identifier sequence with SRv6 node 5, SRv6 node 6, and SRv6 node 7 in the target path information.
[0147] In addition, the index of the SID can be segment left-1 to point to the next SRv6 node. Moreover, the destination address of the IPv6 forwarding header points to the position of SID list length - 1, so that the SID corresponding to SRv6 node 5 replaces the SID of SRv6 node 4. In the packet forwarding method in this application scenario, a path identifier sequence is constructed using the target function field and network path information for forwarding, reducing the length of the segment list in the SRv6 SRH, lowering the depth requirement of the SRv6 label stack, improving the bandwidth utilization rate, and hiding the information of different network domains during the forwarding of the target packet, reducing the cross-domain propagation of node information in the network path information and ensuring network security. Furthermore, it facilitates the management of SRv6 TE packets during cross-domain forwarding and enhances the cross-domain control of SRv6 TE packets.
[0148] Figure 10 shows a schematic structural diagram of a packet forwarding device, as Figure 10 shown, the packet forwarding device 1000 may include: a packet encapsulation module 1010, a sequence construction module 1020, and a packet forwarding module 1030. Among them:
[0149] The packet encapsulation module 1010 is configured to obtain a user packet and perform encapsulation processing on the user packet to obtain a target packet, where the target packet includes network path information for forwarding the user packet;
[0150] The sequence construction module 1020 is configured to construct a path identifier sequence according to the target function field and the network path information when a target function field is recognized in the target packet;
[0151] The packet forwarding module 1030 is configured to forward the target packet according to the network path information represented by the path identifier sequence and perform decapsulation processing on the forwarded target packet to obtain the user packet.
[0152] In an exemplary embodiment of the present invention, the target function field includes a target function field composed of a first field and a second field.
[0153] In an exemplary embodiment of the present invention, the first field includes end.SRH, and the second field includes BSID, where the BSID refers to the target path information in the network path information.
[0154] In an exemplary embodiment of the present invention, the step of constructing a path identifier sequence according to the target function field and the network path information when a target function field is recognized in the target packet includes:
[0155] Construct a segment identifier in the network path information according to the described end.SRH and the BSID;
[0156] Use the segment identifier to identify a target function field in the network path information for forwarding the target message, and construct a path identifier sequence according to the target function field and the network path information.
[0157] In an exemplary embodiment of the present invention, the method further includes:
[0158] When the target function field is not identified in the network path information for forwarding the target message by using the segment identifier, continue to forward the target message according to the network path information.
[0159] In an exemplary embodiment of the present invention, the constructing a path identifier sequence according to the target function field and the network path information includes:
[0160] Determine the target path information referred to by the BSID in the network path information, and determine other path information before the target path information in the network path information;
[0161] Use the target path information to replace the other path information to generate a path identifier sequence represented by the target path information.
[0162] In an exemplary embodiment of the present invention, the forwarding the target message according to the network path information represented by the path identifier sequence includes:
[0163] Forward the target message according to the target path information in the path identifier sequence.
[0164] The specific details of the above message forwarding device 1000 have been described in detail in the corresponding message forwarding method, so they will not be elaborated here.
[0165] It should be noted that although several modules or units of the message forwarding device 1000 are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0166] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0167] Next, refer toFigure 11 Describe the electronic device 1100 according to such an embodiment of the present invention. Figure 11 The displayed electronic device 1100 is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present invention.
[0168] As Figure 11 shown, the electronic device 1100 is presented in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: at least one of the above-mentioned processing units 1110, at least one of the above-mentioned storage units 1120, a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110), and a display unit 1140.
[0169] Among them, the storage unit stores program code, and the program code can be executed by the processing unit 1110, so that the processing unit 1110 executes the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification.
[0170] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 1121 and / or a cache storage unit 1122, and may further include a read-only storage unit (ROM) 1123.
[0171] The storage unit 1120 may further include a program / utility 1124 having a set (at least one) of program modules 1125. Such program modules 1125 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.
[0172] The bus 1130 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any bus structure in a variety of bus structures.
[0173] The electronic device 1100 can also communicate with one or more external devices 1300 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (such as routers, modems, etc.). Such communication can be carried out through the input / output (I / O) interface 1150. Moreover, the electronic device 1100 can also communicate with one or more networks (such as local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through the network adapter 1160. As shown in the figure, the network adapter 1160 communicates with other modules of the electronic device 1100 through the bus 1130. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0174] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, and the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0175] In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium on which a program product capable of implementing the above method of this specification is stored. In some possible embodiments, various aspects of the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification.
[0176] Reference Figure 12 As shown, a program product 1200 for implementing the above method according to an embodiment of the present invention is described. It can adopt a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.
[0177] The program product may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0178] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
[0179] The program code contained on the readable medium may be transmitted with any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0180] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computing device, partly on the user's device, executed as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0181] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.
Claims
1. A message forwarding method, characterized in that, the method includes: obtaining a user message, and performing encapsulation processing on the user message to obtain a target message, where the target message includes network path information for forwarding the user message; when a target function field is identified in the target message, constructing a path identifier sequence according to the target function field and the network path information; the target function field includes a target function field composed of a first field and a second field; the first field includes end.SRH, and end.SRH refers to the Function field of the segment identifier in the network path information, and the second field includes BSID, and BSID refers to the target path information in the network path information; the constructing a path identifier sequence according to the target function field and the network path information includes: determining the target path information referred to by the BSID in the network path information, and determining other path information before the target path information in the network path information; using the target path information to replace the other path information to generate a path identifier sequence represented by the target path information; forwarding the target message according to the network path information represented by the path identifier sequence, and performing decapsulation processing on the forwarded target message to obtain the user message.
2. The message forwarding method according to claim 1, characterized in that, the when a target function field is identified in the target message, constructing a path identifier sequence according to the target function field and the network path information includes: constituting the segment identifier in the network path information according to the end.SRH and the BSID; identifying a target function field in the network path information for forwarding the target message by using the segment identifier, and constructing a path identifier sequence according to the target function field and the network path information.
3. The message forwarding method according to claim 2, characterized in that, the method further includes: when the target function field is not identified in the network path information for forwarding the target message by using the segment identifier, continuing to forward the target message according to the network path information.
4. The message forwarding method according to claim 1, characterized in that, the forwarding the target message according to the network path information represented by the path identifier sequence includes: forwarding the target message according to the target path information in the path identifier sequence.
5. A message forwarding device, characterized in that, including: a message encapsulation module, configured to obtain a user message, and perform encapsulation processing on the user message to obtain a target message, where the target message includes network path information for forwarding the user message; a sequence construction module, configured to construct a path identifier sequence according to the target function field and the network path information when a target function field is identified in the target message; The target function field includes a target function field composed of a first field and a second field. The first field includes end.SRH, and the end.SRH refers to the Function field of the segment identifier in the network path information. The second field includes BSID, and the BSID refers to the target path information in the network path information. The sequence construction module is configured to determine the target path information referred to by the BSID in the network path information, and determine other path information before the target path information in the network path information. Replace the other path information with the target path information to generate a path identifier sequence represented by the target path information. The packet forwarding module is configured to forward the target packet according to the network path information represented by the path identifier sequence, and perform de-encapsulation processing on the forwarded target packet to obtain the user packet.
6. A computer-readable storage medium, on which a computer program is stored, characterized in that when the computer program is executed by a processor, it implements the packet forwarding method according to any one of claims 1-4.
7. An electronic device, characterized in that comprising: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the packet forwarding method according to any one of claims 1-4 by executing the executable instructions.
Citation Information
Patent Citations
Message forwarding method and device, and equipment
CN113411259A