A message forwarding method and device
By using End.x SID type BSID and optimizing SID list in the SRv6-TE policy, the problem of the long header length when forwarding data packets across autonomous systems under the SRv6-TE policy is solved, and the forwarding efficiency and performance are improved. .
Patent Information
- Application Number
- CN202211038380.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-08-29
AI Technical Summary
Under the SRv6-TE strategy, when forwarding data packets across autonomous system domains, the message header length is too long, resulting in excessive consumption of network equipment processing resources, affecting forwarding efficiency.
Use BSID with SID type End.x SID instead of BSID of End.b6.Encaps type, optimize the SID list on the message forwarding path, reduce the SID configuration of the last network device, shorten the message header length, and in the forwarding process SRH header is gradually updated and popped up.
It improves the cross-domain forwarding efficiency of data packets, reduces the processing resource usage of network devices, and improves forwarding performance.
Smart Images

Figure CN115460123B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message forwarding method and device. Background Art
[0002] The SRv6-TE policy is a segment routing traffic engineering policy (SR-TE Policy) based on IPv6 segment routing (SR), which provides a flexible forwarding path selection method to meet different forwarding requirements of users. When there are multiple paths between the source node and the destination node in the SR network, the reasonable use of the SRv6-TE policy to select the forwarding path not only facilitates the administrator to manage and plan the network, but also effectively reduces the forwarding pressure of network devices.
[0003] At present, when forwarding data packets across autonomous system (AS) domains is implemented based on SRv6-TE policies, network devices usually use a binding segment identifier (Bing Segment Identifier, BSID) with a segment identifier (SID) type of End.b6.Encaps as the BSID of the corresponding SRv6-TE policy to implement forwarding of data packets across AS domains.
[0004] However, in this message forwarding process, the segment list corresponding to the SRv6-TE policy configured on the ingress node (i.e., the first network device on the forwarding path) on the forwarding path of the data message needs to include the BSID corresponding to the SRv6-TE policy corresponding to other AS domains except the AS domain to which the ingress node belongs (the corresponding SID type is End.b6.Encaps), and the SID (the corresponding SID type is End.SID) of the last network device in the last other AS domain on the forwarding path (also called the tail node on the forwarding path). This will cause the length of the message header of the SRv6 message encapsulated by the ingress node based on the data message to be longer, and in the subsequent cross-domain forwarding process, it will consume more processing resources of other network devices on the forwarding path, thereby affecting the forwarding efficiency of the data message. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present application provides a message forwarding method and device.
[0006] According to a first aspect of an embodiment of the present application, a message forwarding method is provided, the method being applied to a network device, the method comprising:
[0007] Receive messages;
[0008] When the message is a data message, if it is determined that the message needs to be forwarded through the first SRv6-TE policy, the message is encapsulated as a segment routing and Internet Protocol version 6 (Segment Routing Internet Protocol version 6, SRv6) message based on the segment identifier (Segment Identifier, SID) SID list corresponding to the first SRv6-TE policy, and the SRv6 message is forwarded to the next-hop network device, wherein the network device on the first forwarding path of the message is composed of a plurality of network devices in a plurality of different AS domains, and the SID list sequentially includes the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the BSID corresponding to the SRv6-TE policy corresponding to other AS domains except the AS domain to which the network device belongs, and the SID type of the BSID is End.x SID;
[0009] When the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the second SRv6-TE policy, the SID type of the BSID of the second SRv6-TE policy is End.x SID, and the Segment Left (SL) value in the Segment Routing Header (SRH) header of the message is greater than 1, then the SL value in the SRH header is reduced by 1, the destination address in the IPv6 header of the message is updated to the BSID indicated by the SL value in the current SRH header, and based on the SID list corresponding to the second SRv6-TE policy, a new IPv6 header and a new SRH header are added to the updated message, and the added message is forwarded to the next-hop network device;
[0010] If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the third SRv6-TE policy, the SID type of the BSID of the third SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first BSID in the SID list in the SRH header, the SRH header is popped up, and based on the SID list corresponding to the third SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device;
[0011] If the message includes only one layer of IPv6 header, the destination address in the IPv6 header of the message is the BSID of the fourth SRv6-TE policy, and the SID type of the BSID of the fourth SRv6-TE policy is End.xSID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the fourth SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device;
[0012] If the message includes only one layer of IPv6 header, and the destination address in the IPv6 header of the message is its own SID, pop up the IPv6 header of the message to obtain the original data message, and forward the original data message to the destination device of the original data message;
[0013] Wherein, when the message is an SRv6 message, the network device on the second forwarding path of the original data message carried in the message is composed of multiple network devices in multiple different AS domains, the BSID of the second SRv6-TE policy, the BSID of the third SRv6-TE policy, and the BSID of the fourth SRv6-TE policy are all encapsulated by the network device that receives the original data message on the second forwarding path, and the corresponding SID type is End.x SID, and the SID list corresponding to the second SRv6-TE policy, the SID list corresponding to the third SRv6-TE policy, and the SID list corresponding to the fourth SRv6-TE policy all sequentially include the SIDs of other network devices on the second forwarding path that are in the same AS domain as the network device.
[0014] According to a second aspect of an embodiment of the present application, a message forwarding device is provided, the device being applied to a network device, the device comprising:
[0015] A receiving module, used for receiving messages;
[0016] A first forwarding module, configured to, when the message is a data message, if it is determined that the message needs to be forwarded through a first SRv6-TE policy, encapsulate the message into an SRv6 message based on a SID list corresponding to the first SRv6-TE policy, and forward the SRv6 message to a next-hop network device, wherein the network devices on the first forwarding path of the message are composed of a plurality of network devices in a plurality of different AS domains, and the SID list sequentially includes SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and BSIDs corresponding to SRv6-TE policies corresponding to other AS domains except the AS domain to which the network device belongs, and the SID type of the BSID is End.xSID;
[0017] A second forwarding module, configured to, when the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the second SRv6-TE policy, the SID type of the BSID of the second SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is greater than 1, then reduce the SL value in the SRH header by 1, update the destination address in the IPv6 header of the message to the BSID indicated by the SL value in the current SRH header, and based on the SID list corresponding to the second SRv6-TE policy, add a new IPv6 header and a new SRH header to the updated message, and forward the added message to the next-hop network device;
[0018] If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the third SRv6-TE policy, the SID type of the BSID of the third SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first BSID in the SID list in the SRH header, the SRH header is popped up, and based on the SID list corresponding to the third SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device;
[0019] If the message includes only one layer of IPv6 header, the destination address in the IPv6 header of the message is the BSID of the fourth SRv6-TE policy, and the SID type of the BSID of the fourth SRv6-TE policy is End.xSID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the fourth SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device;
[0020] If the message includes only one layer of IPv6 header, and the destination address in the IPv6 header of the message is its own SID, pop up the IPv6 header of the message to obtain the original data message, and forward the original data message to the destination device of the original data message;
[0021] Wherein, when the message is an SRv6 message, the network device on the second forwarding path of the original data message carried in the message is composed of multiple network devices in multiple different AS domains, the BSID of the second SRv6-TE policy, the BSID of the third SRv6-TE policy, and the BSID of the fourth SRv6-TE policy are all encapsulated by the network device that receives the original data message on the second forwarding path, and the corresponding SID type is End.x SID, and the SID list corresponding to the second SRv6-TE policy, the SID list corresponding to the third SRv6-TE policy, and the SID list corresponding to the fourth SRv6-TE policy all sequentially include the SIDs of other network devices on the second forwarding path that are in the same AS domain as the network device.
[0022] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0023] In an embodiment of the present application, when forwarding data packets across AS domains is implemented based on the SRv6-TE policy, the BSID with the SID type End.b6.Encaps is no longer used as the BSID of the corresponding SRv6-TE policy. Instead, the BSID with the SID type End.x SID is used as the BSID of the corresponding SRv6-TE policy to implement forwarding of data packets across AS domains.
[0024] In this message forwarding process, the segment list corresponding to the SRv6-TE policy configured on the ingress node (i.e., the first network device on the forwarding path) on the forwarding path of the data message no longer includes the SID of the last network device in the last AS domain on the forwarding path. In this way, the length of the message header of the SRv6 message encapsulated based on the data message at the ingress node is shortened, and in the subsequent cross-domain forwarding process, the processing resources occupied by other network devices are reduced, thereby improving the forwarding efficiency of the data message.
[0025] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0027] Figure 1 One of the flow diagrams of a message forwarding method provided in an embodiment of the present application;
[0028] Figure 2A second flow chart of a message forwarding method provided in an embodiment of the present application;
[0029] Figure 3A A schematic diagram of the architecture of a network device through which a data message is forwarded provided in an embodiment of the present application;
[0030] Figure 3B One of the schematic diagrams of the format of the message forwarded by each network device on the forwarding path of the data message provided in the embodiment of the present application;
[0031] Figure 3C A second schematic diagram of the format of a message forwarded by each network device on the forwarding path of a data message provided in an embodiment of the present application;
[0032] Figure 4 One of the structural schematic diagrams of a message forwarding device provided in an embodiment of the present application;
[0033] Figure 5 A second structural diagram of a message forwarding device provided in an embodiment of the present application;
[0034] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0036] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0037] It should be understood that, although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" or "if" as used herein may be interpreted as "at the time of" or "when...".
[0038] Next, the embodiments of the present application are described in detail.
[0039] The present application embodiment provides a message forwarding method, which is applied to a network device, such as Figure 1 As shown, the method may include the following steps:
[0040] S11. Receive message.
[0041] S12: When the message is a data message, if it is determined that the message needs to be forwarded through the first SRv6-TE policy, the message is encapsulated as an SRv6 message based on the SID list corresponding to the first SRv6-TE policy, and the SRv6 message is forwarded to the next-hop network device.
[0042] In this step, the network device on the first forwarding path of the message is composed of multiple network devices in multiple different AS domains, and the SID list includes, in sequence, the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the BSID corresponding to the SRv6-TE policy corresponding to other AS domains except the AS domain to which the network device belongs, and the SID type of the BSID is End.x SID.
[0043] S13. When the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the second SRv6-TE policy, the SID type of the BSID of the second SRv6-TE policy is End.xSID, and the SL value in the SRH header of the message is greater than 1, then the SL value in the SRH header is reduced by 1, and the destination address in the IPv6 header of the message is updated to the BSID indicated by the SL value in the current SRH header, and based on the SID list corresponding to the second SRv6-TE policy, a new IPv6 header and a new SRH header are added to the updated message, and the added message is forwarded to the next-hop network device; if the message includes only one layer of IPv6 header and one layer of SRH header, and the IPv 6 header is the BSID of the third SRv6-TE policy, the SID type of the BSID of the third SRv6-TE policy is End.xSID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first BSID in the SID list in the SRH header, the SRH header is popped up, and based on the SID list corresponding to the third SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; if the message includes only one layer of IPv6 header, the destination address in the IPv6 header of the message is the BSID of the fourth SRv6-TE policy, and the SID type of the BSID of the fourth SRv6-TE policy is End.xSID, SID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the fourth SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; if the message includes only one layer of IPv6 header and the destination address in the IPv6 header of the message is its own SID, the IPv6 header of the message is popped up to obtain the original data message, and the original data message is forwarded to the destination device of the original data message.
[0044] In this step, when the message is an SRv6 message, the network device on the second forwarding path of the original data message carried in the message is composed of multiple network devices in multiple different AS domains, the BSID of the second SRv6-TE policy, the BSID of the third SRv6-TE policy, and the BSID of the fourth SRv6-TE policy are all encapsulated by the network device that receives the original data message on the second forwarding path, and the corresponding SID type is End.x SID, and the SID list corresponding to the second SRv6-TE policy, the SID list corresponding to the third SRv6-TE policy, and the SID list corresponding to the fourth SRv6-TE policy all include, in sequence, the SIDs of other network devices on the second forwarding path that are in the same AS domain as the network device.
[0045] It should be noted that, in the embodiment of the present application, the network device may determine that the message needs to be forwarded through the first SRv6-TE policy in the following manner:
[0046] Determine whether the destination address of the message is a BSID in all BSIDs of the locally configured SRv6-TE policies;
[0047] When the judgment result is yes, it is determined that the message needs to be forwarded through the first SRv6-TE policy corresponding to the destination address. Here, the SID type of the destination address is End.x SID.
[0048] It should be further explained that when the network device determines that the destination address of the message is not a BSID in the BSIDs of all SRv6-TE policies configured locally, it still forwards the message in the existing manner.
[0049] Specifically, in the above step S12, when the network device encapsulates the message into an SRv6 message based on the SID list corresponding to the first SRv6-TE policy, it can generate an SRv6 message carrying the message based on the SID list corresponding to the first SRv6-TE policy.
[0050] Among them, the source address in the IPv6 header of the SRv6 message is the SID of the network device, and the destination address is the SID of other network devices adjacent to the network device on the first forwarding path; the SL value in the SRH header of the SRv6 message is equal to N-1, and the content of the SID list in the SRH header of the SRv6 message is the same as the content of the SID list corresponding to the first SRv6-TE policy, but the arrangement order is reversed. Here, N is the total number of SIDs in the SID list corresponding to the first SRv6-TE policy, and the specific format of the SID list in the SRH header of the SRv6 message is the existing technology and will not be described in detail here.
[0051] It should be noted that the SRH header of the SRv6 message also includes other existing fields, which are not listed here one by one.
[0052] It should be further explained that the above step S12 is executed when the network device is an ingress node on the forwarding path of the message.
[0053] In the above step S13, when the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the second SRv6-TE policy, the SID type of the BSID of the second SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is greater than 1, the source address in the outermost IPv6 header of the added message is the SID of the network device, and the destination address is the first SID in the SID list corresponding to the second SRv6-TE policy (that is, the SIDs of other network devices adjacent to the network device on the above second forwarding path); the SL value in the outermost SRH header of the added message is equal to M-1, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to the second SRv6-TE policy, but the arrangement order is reversed. Wherein, M is the total number of SIDs in the SID list corresponding to the second SRv6-TE policy.
[0054] It should be noted that the relevant operations performed by the network device in this situation are performed when the network device is the first network device on the above-mentioned second forwarding path and is located in any AS domain except the first AS domain, the penultimate AS domain and the penultimate AS domain.
[0055] In the case where the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the third SRv6-TE policy, the SID type of the BSID of the third SRv6-TE policy is End.xSID, and the SL value in the SRH header of the message is equal to 1, the source address in the outermost IPv6 header of the message after adding is the SID of the network device, and the destination address is the first SID in the SID list corresponding to the third SRv6-TE policy; the SL value in the outermost SRH header of the message after adding is equal to P-1, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to the third SRv6-TE policy, but the arrangement order is reversed. Wherein, P is the total number of SIDs in the SID list corresponding to the third SRv6-TE policy.
[0056] It should be noted that the relevant operations performed by the network device in this situation are performed when the network device is the first network device located in the second to last AS domain on the second forwarding path.
[0057] In the case where the message includes only one layer of IPv6 header, the destination address in the IPv6 header of the message is the BSID of the fourth SRv6-TE policy, and the SID type of the BSID of the fourth SRv6-TE policy is End.x SID, the source address in the outermost IPv6 header of the message after adding is the SID of the network device, and the destination address is the first SID in the SID list corresponding to the fourth SRv6-TE policy; the SL value in the outermost SRH header of the message after adding is equal to Q-1, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to the fourth SRv6-TE policy, but the arrangement order is reversed. Among them, Q is the total number of SIDs in the SID list corresponding to the fourth SRv6-TE policy.
[0058] It should be noted that the relevant operations performed by the network device in this situation are performed when the network device is the first network device located in the last AS domain on the second forwarding path.
[0059] When the message includes only one layer of IPv6 header and the destination address in the IPv6 header of the message is its own SID, the relevant operations performed by the network device are performed when the network device is the last network device located in the penultimate AS domain on the above-mentioned second forwarding path.
[0060] Furthermore, in the embodiment of the present application, after receiving the message, the network device may also perform the following operations:
[0061] When the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is greater than 1, then the SL value in the SRH header is reduced by 1, the destination address in the IPv6 header of the message is updated to the SID indicated by the SL value in the current SRH header, and the updated message is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is any other network device other than the first network device in the first AS domain on the second forwarding path or any other network device other than the first network device, the last network device and the penultimate network device in the last AS domain;
[0062] If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the message after popping out is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is the second-to-last network device located in the first-to-last AS domain on the second forwarding path mentioned above;
[0063] If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the outermost SRH header of the message is greater than 1, then the SL value in the outermost SRH header of the message is reduced by 1, the destination address in the outermost IPv6 header of the message is updated to the SID indicated by the SL value in the current outermost SRH header, and the updated message is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is any other network device other than the first network device, the last network device and the penultimate network device in any AS domain other than the first AS domain, the penultimate AS domain and the penultimate AS domain on the above-mentioned second forwarding path;
[0064] If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the outermost IPv6 header of the message is updated to the first SID in the SID list in the outermost SRH header, the outermost SRH header is popped out, and the message after popping out is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is the second-to-last network device in any AS domain other than the first AS domain, the penultimate AS domain and the penultimate AS domain on the above-mentioned second forwarding path;
[0065] If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by an inner IPv6 header, and the destination address in the outermost IPv6 header of the message is its own SID, then the outermost IPv6 header is popped out, and the popped-out message is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is the last network device in any AS domain other than the first AS domain, the penultimate AS domain, and the penultimate AS domain on the second forwarding path;
[0066] If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the SRH header of the message is greater than 1, then the SL value in the SRH header is reduced by 1, the destination address in the outermost IPv6 header is updated to the SID indicated by the SL value in the current SRH header, and the updated message is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is any other network device except the first network device, the last network device and the penultimate network device located in the second to last AS domain on the second forwarding path mentioned above;
[0067] If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the outermost SRH header is equal to 1, then the destination address in the outermost IPv6 header is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the message after popping out is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is the second-to-last network device located in the second-to-last AS domain on the second forwarding path mentioned above;
[0068] If the message only includes two layers of IPv6 headers, and the destination address in the outermost IPv6 header of the message is its own SID, the outermost IPv6 header is popped out, and the popped-out message is forwarded to the next-hop network device; here, these operations performed by the network device are performed when the network device is the last network device in the second to last AS domain on the above-mentioned second forwarding path.
[0069] That is to say, in an embodiment of the present application, when it is necessary to forward relevant data packets across AS domains, the administrator can configure the corresponding SRv6-TE policy and the SID list corresponding to the corresponding SRv6-TE policy and its corresponding BSID (the corresponding SID type is End.x SID) on the first network device side in each different AS domain on the forwarding path of the relevant data packet in advance. The SID list corresponding to the corresponding SRv6-TE policy configured on the first network device side in the first AS domain includes the SIDs of other network devices on the forwarding path that are in the same AS domain as the first network device, and the BSIDs corresponding to the SRv6-TE policies of other AS domains; the SID list corresponding to the corresponding SRv6-TE policy configured on the first network device side in other AS domains includes the SIDs of other network devices on the forwarding path that are in the same AS domain as the first network device; and these BSIDs all support PenultimateSegment POP of the SRH (PSP).
[0070] In this way, in the process of forwarding related data messages across AS domains, the length of the message header of the SRv6 message encapsulated by the ingress node based on the related data message can be shortened, and in the subsequent forwarding process, the occupation of processing resources of other network devices is reduced, thereby improving the forwarding efficiency of the related data messages.
[0071] The present application also provides a message forwarding method, which is applied to a network device, such as Figure 2 As shown, the method may include the following steps:
[0072] S21. Receive a message.
[0073] S22: When the message is a data message, if it is determined that the message needs to be forwarded through the first SRv6-TE policy, the message is encapsulated as an SRv6 message based on the SID list corresponding to the first SRv6-TE policy, and the SRv6 message is forwarded to the next-hop network device.
[0074] In this step, the network devices on the first forwarding path of the message are composed of multiple network devices in multiple different AS domains, and the SID list includes in sequence the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain to which the network device belongs on the first forwarding path belongs, and the SID type of the BSID is End.x SID.;
[0075] S23. When the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is equal to 1, the destination address in the IPv6 header is updated to the first SID in the SID list in the SRH header, the SRH header is popped up, and the message after popping up is forwarded to the next-hop network device; if the message includes only a layer of IPv6 header, the destination address in the IPv6 header is the BSID of the second SRv6-TE policy, and the SID type of the BSID of the second SRv6-TE policy is End.x SID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the second SRv6-TE policy, a new IPv6 header and a new SRH header are added to the message after popping up, and the added message is forwarded to the next-hop network device; if the message includes only a layer of IPv6 header, and the destination address in the IPv6 header is its own SID, the IPv6 header is popped up to obtain the original data message, and the original data message is forwarded to the destination device of the original data message.
[0076] In this step, when the message is an SRv6 message, the network devices on the second forwarding path of the original data message carried in the message are composed of multiple network devices in multiple different AS domains, and the SID type of the BSID of the SRv6-TE policy corresponding to each AS domain is End.x SID, and the SID list of the SRv6-TE policy corresponding to each AS domain except the last AS domain on the second forwarding path includes, in sequence, the SIDs of other network devices except the first network device located in the AS domain on the second forwarding path, and the BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain belongs, and the SID list of the SRv6-TE policy corresponding to the last AS domain includes, in sequence, the SIDs of other network devices except the first network device located in the last AS domain on the second forwarding path.
[0077] It should be noted that, in the embodiment of the present application, the network device may determine that the message needs to be forwarded through the first SRv6-TE policy in the following manner:
[0078] Determine whether the destination address of the message is a BSID in all BSIDs of the locally configured SRv6-TE policies;
[0079] When the judgment result is yes, it is determined that the message needs to be forwarded through the first SRv6-TE policy corresponding to the destination address.
[0080] Here, the SID type of the destination address is End.x SID.
[0081] It should be further explained that when the network device determines that the destination address of the message is not a BSID in the BSIDs of all SRv6-TE policies configured locally, it still forwards the message in the existing manner.
[0082] Specifically, in the above step S22, when the network device encapsulates the message into an SRv6 message based on the SID list corresponding to the first SRv6-TE policy, it can generate an SRv6 message carrying the message based on the SID list corresponding to the first SRv6-TE policy.
[0083] Here, the source address in the IPv6 header of the SRv6 message is the SID of the network device, and the destination address is the SID of other network devices adjacent to the network device on the first forwarding path; the SL value in the SRH header of the SRv6 message is equal to E-1, and the content of the SID list in the SRH header of the SRv6 message is the same as the content of the SID list corresponding to the first SRv6-TE policy, but the arrangement order is reversed. Among them, E is the total number of SIDs in the SID list corresponding to the first SRv6-TE policy.
[0084] It should be noted that the SRH header of the SRv6 message also includes other existing fields, which are not listed here one by one.
[0085] It should be further explained that the above step S22 is executed when the network device is an ingress node on the forwarding path of the message.
[0086] In the above step S23, when the message includes a layer of IPv6 header and a layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is equal to 1, the relevant operations performed by the network device are performed when the network device is the last network device on the above-mentioned second forwarding path and is located in any AS domain except the last AS domain, or when the network device is the second to last network device on the above-mentioned second forwarding path and is located in an AS domain except the last AS domain.
[0087] In the case where the message includes only one layer of IPv6 header, the destination address in the IPv6 header is the BSID of the second SRv6-TE policy, and the SID type of the BSID of the second SRv6-TE policy is End.x SID, the source address in the IPv6 header of the message after adding is the SID of the network device, and the destination address is the first SID in the SID list corresponding to the second SRv6-TE policy (that is, the SIDs of other network devices adjacent to the network device on the above-mentioned second forwarding path); the SL value in the SRH header of the message after adding is equal to F-1, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to the second SRv6-TE policy, but the arrangement order is reversed. Among them, F is the total number of SIDs in the SID list corresponding to the second SRv6-TE policy.
[0088] It should be noted that the relevant operations performed by the network device in this situation are performed when the network device is the first network device located in any AS domain except the first AS domain on the second forwarding path.
[0089] When the message includes only one layer of IPv6 header and the destination address in the IPv6 header is its own SID, the relevant operations performed by the network device are performed when the network device is the last network device located in the penultimate AS domain on the above-mentioned second forwarding path.
[0090] Furthermore, in the embodiment of the present application, after receiving the message, the network device may also perform the following operations:
[0091] When the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is greater than 1, the SL value in the SRH header is reduced by 1, the destination address in the IPv6 header is updated to the SID indicated by the SL value in the current SRH header, and the updated message is forwarded to the next-hop network device.
[0092] Here, these operations performed by the network device are performed when the network device is any other network device except the first network device and the last network device located in any AS domain except the last AS domain on the above-mentioned second forwarding path, or when the network device is any other network device except the first network device, the second to last network device and the last network device located in the last AS domain on the above-mentioned second forwarding path.
[0093] That is to say, in an embodiment of the present application, when it is necessary to forward relevant data packets across AS domains, the administrator can configure the corresponding SRv6-TE policy and the SID list corresponding to the corresponding SRv6-TE policy and its corresponding BSID (the corresponding SID type is End.x SID) on the first network device side in each different AS domain on the forwarding path of the relevant data packet in advance. The SID list corresponding to the corresponding SRv6-TE policy configured on the first network device side in each AS domain includes the SIDs of other network devices on the forwarding path that are in the same AS domain as the first network device, and the BSID corresponding to the SRv6-TE policy corresponding to the adjacent AS domain; and these BSIDs all support Penultimate Segment POP of the SRH (PSP).
[0094] In this way, in the process of forwarding related data messages across AS domains, the length of the message header of the SRv6 message encapsulated by the ingress node based on the related data message can be shortened, and in the subsequent forwarding process, the occupation of processing resources of other network devices is reduced, thereby improving the forwarding efficiency of the related data messages. The above message forwarding method is described in detail below in conjunction with specific embodiments.
[0095] like Figure 3A As shown, it is assumed that data packet 1 needs to be sent from network device A to network device K, and it is also assumed that it needs to pass through three AS domains (for example, AS100, AS200 and AS300).
[0096] Assume that the network devices on the forwarding path of data packet 1 include network device B, network device C, network device D, network device E, network device F, network device G, network device H, network device I, and network device J. Among them, network device B, network device C, and network device D are located in AS100; network device E, network device F, and network device G are located in AS200; network device H, network device I, and network device J are located in AS300.
[0097] Assume that the SID of network device B is 10::1, the SID of network device C is 20::1, the SID of network device D is 30::1, the SID of network device E is 40::1, the SID of network device F is 50::1, the SID of network device G is 60::1, the SID of network device H is 70::1, the SID of network device I is 80::1, and the SID of network device J is 90::1.
[0098] In an example, the administrator configures SRv6-TE policy 1 on the network device B side in advance, the corresponding BSID is 10::FF, and the SID type of the BSID is End.x SID; the corresponding SID list is (20::1, 30::1, 40::FF, 70::FF). SRv6-TE policy 2 (also known as the SRv6-TE policy corresponding to AS200) is configured on the network device E side in advance, the corresponding BSID is 40::FF, and the SID type of the BSID is End.x SID; the corresponding SID list is (50::1, 60::1). SRv6-TE policy 3 (also known as the SRv6-TE policy corresponding to AS300) is configured on the network device H side in advance, the corresponding BSID is 70::FF, and the SID type of the BSID is End.x SID; the corresponding SID list is (80::1, 90::1).
[0099] In this case, when network device B receives data packet 1 sent by network device A, it finds that the destination address of data packet 1 is the BSID of SRv6-TE policy 1. At this time, network device B encapsulates the packet into SRv6 packet 1 based on the SID list corresponding to SRv6-TE policy 1, and forwards SRv6 packet 1 to the next-hop network device (i.e., network device C).
[0100] Here, the source address in the IPv6 header of SRv6 message 1 is the SID of network device B (i.e., 10::1), and the destination address (DA) is the SID of network device B (i.e., 20::1); the SL value in the SRH header of SRv6 message 1 is equal to 3, and the content of the SID list in the SRH header of SRv6 message 1 is the same as the content of the SID list corresponding to SRv6-TE policy 1, but the arrangement order is reversed. Part of the content in SRv6 message 1 can be as follows Figure 3B shown.
[0101] It should be noted that in Figure 3B In the figure, A represents network device A, B represents network device B, C represents network device C, D represents network device D, E represents network device E, F represents network device F, G represents network device G, H represents network device H, I represents network device I, and J represents network device J.
[0102] After receiving SRv6 message 1, network device C finds that SRv6 message 1 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of SRv6 message 1 is its own SID, and the SL value in the SRH header of SRv6 message 1 is greater than 1. At this time, network device C reduces the SL value in the SRH header by 1, updates the destination address in the IPv6 header to the SID (i.e., 30::1) indicated by the SL value (i.e., 2) in the current SRH header, and forwards the updated message (recorded as SRv6 message 2) to the next-hop network device (i.e., network device D). Here, part of the content in SRv6 message 2 can be shown as follows: Figure 3B shown.
[0103] After receiving SRv6 message 2, network device D finds that SRv6 message 2 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of SRv6 message 2 is its own SID, and the SL value in the SRH header of SRv6 message 2 is greater than 1. At this time, network device D reduces the SL value in the SRH header by 1, updates the destination address in the IPv6 header to the SID (i.e., 40::FF) indicated by the SL value (i.e., 1) in the current SRH header, and forwards the updated message (recorded as SRv6 message 3) to the next-hop network device (i.e., network device E). Here, part of the content in SRv6 message 3 can be shown as follows: Figure 3B shown.
[0104] After receiving SRv6 message 3, network device E finds that SRv6 message 3 includes only one IPv6 header and one SRH header, the destination address in the IPv6 header of SRv6 message 3 is the BSID of SRv6-TE policy 2, the SID type of the BSID of SRv6-TE policy 2 is End.x SID, and the SL value in the SRH header of SRv6 message 2 is equal to 1. At this time, network device E updates the destination address in the IPv6 header to the first BSID (i.e., 70::FF) in the SID list in the SRH header, pops up the SRH header, and based on the SID list corresponding to SRv6-TE policy 2, adds a new IPv6 header and a new SRH header to the popped message, and forwards the added message (recorded as SRv6 message 4) to the next-hop network device (i.e., network device F).
[0105] Here, the source address in the outermost IPv6 header of SRv6 message 4 is the SID of network device E (i.e., 40::1), and the destination address is the first SID in the SID list corresponding to SRv6-TE policy 2 (i.e., 50::1); the SL value in the outermost SRH header of SRv6 message 4 is equal to 1, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to SRv6-TE policy 2, but the arrangement order is reversed. Part of the content in SRv6 message 4 can be as follows Figure 3B shown.
[0106] After receiving SRv6 message 4, network device F finds that SRv6 message 4 includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the outermost SRH header is equal to 1. At this time, network device F updates the destination address in the outermost IPv6 header to the first SID in the SID list in the SRH header (i.e., 60::1), pops up the SRH header, and forwards the popped-up message (recorded as SRv6 message 5) to the next-hop network device (i.e., network device G). Here, part of the content in SRv6 message 5 can be shown as follows: Figure 3B shown.
[0107] After receiving SRv6 message 5, network device G finds that SRv6 message 5 includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the inner IPv6 header, and the destination address in the outermost IPv6 header of the message is its own SID, so it pops up the outermost IPv6 header and forwards the popped-up message (recorded as SRv6 message 6) to the next-hop network device (i.e., network device H). Here, part of the content in SRv6 message 6 can be as follows Figure 3B shown.
[0108] After receiving SRv6 message 6, network device H finds that SRv6 message 6 includes only one layer of IPv6 header, the destination address in the IPv6 header is the BSID of SRv6-TE policy 3, and the SID type of the BSID of SRv6-TE policy 3 is End.x SID. At this time, network device H pops up the IPv6 header, and based on the SID list corresponding to SRv6-TE policy 3, adds a new IPv6 header and a new SRH header to the popped message, and forwards the added message (recorded as SRv6 message 7) to the next-hop network device (i.e., network device I).
[0109] Here, the source address in the IPv6 header of SRv6 message 7 is the SID of network device H (i.e., 70::1), and the destination address is the first SID in the SID list corresponding to SRv6-TE policy 3 (i.e., 80::1); the SL value in the SRH header of SRv6 message 7 is equal to 1, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to SRv6-TE policy 3, but the arrangement order is reversed. Part of the content in SRv6 message 7 can be as follows Figure 3B shown.
[0110] After receiving SRv6 message 7, network device I finds that SRv6 message 7 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of SRv6 message 7 is its own SID, and the SL value in the SRH header of SRv6 message 7 is equal to 1. At this time, network device I updates the destination address in the IPv6 header to the first SID in the SID list in the SRH header (i.e., 90::1), pops up the SRH header, and forwards the popped-up message (recorded as SRv6 message 8) to the next-hop network device (i.e., network device J). Here, part of the content in SRv6 message 8 can be as follows Figure 3B shown.
[0111] After receiving SRv6 message 8, network device J finds that SRv6 message 8 includes only one layer of IPv6 header, and the destination address in the IPv6 header of SRv6 message 8 is its own SID. At this time, network device J pops up the IPv6 header, obtains data message 1, and forwards data message 1 to the destination device of data message 1 (that is, network device K), as shown in FIG. Figure 3B shown.
[0112] In another example, the administrator configures SRv6-TE policy 1 on the network device B side in advance, the corresponding BSID is 10::FF, and the SID type of the BSID is End.x SID; the corresponding SID list is (20::1, 30::1, 40::FF). SRv6-TE policy 2 (also called the SRv6-TE policy corresponding to AS200) is configured on the network device E side in advance, the corresponding BSID is 40::FF, and the SID type of the BSID is End.xSID; the corresponding SID list is (50::1, 60::1, 70::FF). SRv6-TE policy 3 (also called the SRv6-TE policy corresponding to AS300) is configured on the network device H side in advance, the corresponding BSID is 70::FF, and the SID type of the BSID is End.x SID; the corresponding SID list is (80::1, 90::1).
[0113] In this case, when network device B receives data packet 1 sent by network device A, it finds that the destination address of data packet 1 is the BSID of SRv6-TE policy 1. At this time, network device B encapsulates the packet into SRv6 packet 1 based on the SID list corresponding to SRv6-TE policy 1, and forwards SRv6 packet 1 to the next-hop network device (i.e., network device C).
[0114] Here, the source address in the IPv6 header of SRv6 message 1 is the SID of network device B (i.e., 10::1), and the destination address is the SID of network device B (i.e., 20::1); the SL value in the SRH header of SRv6 message 1 is equal to 2, and the content of the SID list in the SRH header of SRv6 message 1 is the same as the content of the SID list corresponding to SRv6-TE policy 1, but the arrangement order is reversed. Part of the content in SRv6 message 1 can be as follows Figure 3C shown.
[0115] It should be noted that in Figure 3C In the diagram, each letter represents a network device. Figure 3B The letters in the table represent the same network devices.
[0116] After receiving SRv6 message 1, network device C finds that SRv6 message 1 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of SRv6 message 1 is its own SID, and the SL value in the SRH header of SRv6 message 1 is greater than 1. At this time, network device C reduces the SL value in the SRH header by 1, updates the destination address in the IPv6 header to the SID (i.e., 30::1) indicated by the SL value (i.e., 1) in the current SRH header, and forwards the updated message (recorded as SRv6 message 2) to the next-hop network device (i.e., network device D). Here, part of the content in SRv6 message 2 can be shown as follows: Figure 3C shown.
[0117] After receiving SRv6 message 2, network device D finds that SRv6 message 2 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of SRv6 message 2 is its own SID, and the SL value in the SRH header of SRv6 message 2 is equal to 1. At this time, network device D updates the destination address in the IPv6 header to the first BSID (i.e., 40::FF) in the SID list in the SRH header, pops up the SRH header, and forwards the popped-up message (recorded as SRv6 message 3) to the next-hop network device (i.e., network device E). Here, part of the content in SRv6 message 3 can be shown as follows: Figure 3C shown.
[0118] After receiving SRv6 message 3, network device E finds that SRv6 message 3 includes only one layer of IPv6 header, the destination address in the IPv6 header is the BSID of SRv6-TE policy 2, and the SID type of the BSID of SRv6-TE policy 2 is End.x SID. At this time, network device E pops up the IPv6 header, and based on the SID list corresponding to SRv6-TE policy 2, adds a new IPv6 header and a new SRH header to the popped message, and forwards the added message (recorded as SRv6 message 4) to the next-hop network device (i.e., network device F).
[0119] Here, the source address in the IPv6 header of SRv6 message 4 is the SID of network device E (i.e., 40::1), and the destination address is the first SID in the SID list corresponding to SRv6-TE policy 2 (i.e., 50::1); the SL value in the SRH header of SRv6 message 4 is equal to 2, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to SRv6-TE policy 2, but the arrangement order is reversed. Part of the content in SRv6 message 4 can be as follows Figure 3C shown.
[0120] After receiving SRv6 message 4, network device F finds that SRv6 message 4 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of SRv6 message 4 is its own SID, and the SL value in the SRH header of SRv6 message 4 is greater than 1. At this time, network device C reduces the SL value in the SRH header by 1, updates the destination address in the IPv6 header to the SID (i.e., 60::1) indicated by the SL value (i.e., 1) in the current SRH header, and forwards the updated message (recorded as SRv6 message 5) to the next-hop network device (i.e., network device G). Here, part of the content in SRv6 message 5 can be shown as follows: Figure 3C shown.
[0121] After receiving SRv6 message 5, network device G finds that SRv6 message 5 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of SRv6 message 5 is its own SID, and the SL value in the SRH header of SRv6 message 5 is equal to 1. At this time, network device G updates the destination address in the IPv6 header to the first BSID (i.e., 70::FF) in the SID list in the SRH header, pops up the SRH header, and forwards the popped-up message (recorded as SRv6 message 6) to the next-hop network device (i.e., network device H). Here, part of the content in SRv6 message 6 can be as follows Figure 3C shown.
[0122] After receiving SRv6 message 6, network device H finds that SRv6 message 6 includes only one layer of IPv6 header, the destination address in the IPv6 header is the BSID of SRv6-TE policy 3, and the SID type of the BSID of SRv6-TE policy 3 is End.x SID. At this time, network device H pops up the IPv6 header, and based on the SID list corresponding to SRv6-TE policy 3, adds a new IPv6 header and a new SRH header to the popped message, and forwards the added message (recorded as SRv6 message 7) to the next-hop network device (i.e., network device I).
[0123] Here, the source address in the IPv6 header of SRv6 message 7 is the SID of network device H (i.e., 70::1), and the destination address is the first SID in the SID list corresponding to SRv6-TE policy 3 (i.e., 80::1); the SL value in the SRH header of SRv6 message 7 is equal to 1, and the content of the SID list in this SRH header is the same as the content of the SID list corresponding to SRv6-TE policy 3, but the arrangement order is reversed. Part of the content in SRv6 message 7 can be as follows Figure 3C shown.
[0124] After receiving SRv6 message 7, network device I finds that SRv6 message 7 only includes one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is equal to 1. At this time, network device I updates the destination address in the IPv6 header to the first SID in the SID list in the SRH header (i.e., 90::1), pops up the SRH header, and forwards the popped-up message (recorded as SRv6 message 8) to the next-hop network device (i.e., network device J). Here, part of the content in SRv6 message 8 can be as follows Figure 3C shown.
[0125] After receiving SRv6 message 8, network device J finds that SRv6 message 8 includes only one layer of IPv6 header, and the destination address in the IPv6 header of SRv6 message 8 is its own SID. At this time, network device J pops up the IPv6 header, obtains data message 1, and forwards data message 1 to the destination device of data message 1 (that is, network device K), as shown in FIG. Figure 3C shown.
[0126] It can be seen from the above technical solution that in the embodiment of the present application, when forwarding data packets across AS domains is implemented based on the SRv6-TE policy, the BSID with the SID type of End.b6.Encaps is no longer used as the BSID of the corresponding SRv6-TE policy. Instead, the BSID with the SID type of End.x SID is used as the BSID of the corresponding SRv6-TE policy to implement forwarding of data packets across AS domains.
[0127] In this message forwarding process, the segment list corresponding to the SRv6-TE policy configured on the ingress node (i.e., the first network device on the forwarding path) on the forwarding path of the data message no longer includes the SID of the last network device in the last AS domain on the forwarding path. In this way, the length of the message header of the SRv6 message encapsulated based on the data message at the ingress node is shortened, and in the subsequent cross-domain forwarding process, the processing resources occupied by other network devices are reduced, thereby improving the forwarding efficiency of the data message.
[0128] Based on the same inventive concept, the present application also provides a message forwarding device, which is applied to a network device, and its structural diagram is as follows: Figure 4 As shown, specifically including:
[0129] A receiving module 41, used for receiving a message;
[0130] A first forwarding module 42 is used for, when the message is a data message, if it is determined that the message needs to be forwarded through a first SRv6-TE policy, encapsulating the message into an SRv6 message based on a SID list corresponding to the first SRv6-TE policy, and forwarding the SRv6 message to a next-hop network device, wherein the network devices on the first forwarding path of the message are composed of a plurality of network devices in a plurality of different AS domains, and the SID list sequentially includes SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and BSIDs corresponding to SRv6-TE policies corresponding to other AS domains except the AS domain to which the network device belongs, and the SID type of the BSID is End.xSID;
[0131] A second forwarding module, configured to, when the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the second SRv6-TE policy, the SID type of the BSID of the second SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is greater than 1, then reduce the SL value in the SRH header by 1, update the destination address in the IPv6 header of the message to the BSID indicated by the SL value in the current SRH header, and based on the SID list corresponding to the second SRv6-TE policy, add a new IPv6 header and a new SRH header to the updated message, and forward the added message to the next-hop network device;
[0132] If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the third SRv6-TE policy, the SID type of the BSID of the third SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first BSID in the SID list in the SRH header, the SRH header is popped up, and based on the SID list corresponding to the third SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device;
[0133] If the message includes only one layer of IPv6 header, the destination address in the IPv6 header of the message is the BSID of the fourth SRv6-TE policy, and the SID type of the BSID of the fourth SRv6-TE policy is End.xSID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the fourth SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device;
[0134] If the message includes only one layer of IPv6 header, and the destination address in the IPv6 header of the message is its own SID, pop up the IPv6 header of the message to obtain the original data message, and forward the original data message to the destination device of the original data message;
[0135] Wherein, when the message is an SRv6 message, the network device on the second forwarding path of the original data message carried in the message is composed of multiple network devices in multiple different AS domains, the BSID of the second SRv6-TE policy, the BSID of the third SRv6-TE policy, and the BSID of the fourth SRv6-TE policy are all encapsulated by the network device that receives the original data message on the second forwarding path, and the corresponding SID type is End.x SID, and the SID list corresponding to the second SRv6-TE policy, the SID list corresponding to the third SRv6-TE policy, and the SID list corresponding to the fourth SRv6-TE policy all sequentially include the SIDs of other network devices on the second forwarding path that are in the same AS domain as the network device.
[0136] Preferably, the device further comprises:
[0137] Determine the module ( Figure 4 ), for determining that the message needs to be forwarded through the first SRv6-TE strategy in the following manner:
[0138] Determine whether the destination address of the message is a BSID among the BSIDs of all SRv6-TE policies configured locally;
[0139] When the judgment result is yes, it is determined that the message needs to be forwarded through the first SRv6-TE policy corresponding to the destination address; wherein the SID type of the destination address is End.x SID.
[0140] Preferably, the device further comprises:
[0141] The third forwarding module ( Figure 4 (not shown) is used for, after receiving the message, when the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is greater than 1, then subtracting 1 from the SL value in the SRH header, updating the destination address in the IPv6 header of the message to the SID indicated by the SL value in the current SRH header, and forwarding the updated message to the next-hop network device;
[0142] If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the popped-out message is forwarded to the next-hop network device;
[0143] If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the outermost SRH header of the message is greater than 1, then the SL value in the outermost SRH header of the message is reduced by 1, the destination address in the outermost IPv6 header of the message is updated to the SID indicated by the SL value in the current outermost SRH header, and the updated message is forwarded to the next-hop network device;
[0144] If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the outermost IPv6 header of the message is updated to the first SID in the SID list in the outermost SRH header, the outermost SRH header is popped out, and the popped-out message is forwarded to the next-hop network device;
[0145] If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by an inner IPv6 header, and the destination address in the outermost IPv6 header of the message is its own SID, then the outermost IPv6 header is popped out, and the popped-out message is forwarded to the next-hop network device;
[0146] If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the SRH header of the message is greater than 1, then reduce the SL value in the SRH header by 1, update the destination address in the outermost IPv6 header to the SID indicated by the SL value in the current SRH header, and forward the updated message to the next-hop network device;
[0147] If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the outermost SRH header is equal to 1, then the destination address in the outermost IPv6 header is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the popped-out message is forwarded to the next-hop network device;
[0148] If the message only includes two layers of IPv6 headers, and the destination address in the outermost IPv6 header of the message is its own SID, the outermost IPv6 header is popped out, and the popped out message is forwarded to the next-hop network device.
[0149] Based on the same inventive concept, the present application also provides a message forwarding device, which is applied to a network device, and its structural diagram is as follows: Figure 5 As shown, specifically including:
[0150] A receiving module 51, used for receiving a message;
[0151] A first forwarding module 52 is used for, when the message is a data message, if it is determined that the message needs to be forwarded through a first SRv6-TE policy, then based on the SID list corresponding to the first SRv6-TE policy, encapsulating the message into an SRv6 message, and forwarding the SRv6 message to a next-hop network device, wherein the network devices on the first forwarding path of the message are composed of a plurality of network devices in a plurality of different AS domains, and the SID list sequentially includes the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain to which the network device belongs on the first forwarding path belongs, and the SID type of the BSID is End.x SID;
[0152] The second forwarding module 53 is used for, when the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is equal to 1, then updating the destination address in the IPv6 header to the first SID in the SID list in the SRH header, popping up the SRH header, and forwarding the popped-up message to the next-hop network device;
[0153] If the message includes only one IPv6 header, the destination address in the IPv6 header is the BSID of the second SRv6-TE policy, and the SID type of the BSID of the second SRv6-TE policy is End.x SID, pop up the IPv6 header of the message, and based on the SID list corresponding to the second SRv6-TE policy, add a new IPv6 header and a new SRH header to the popped message, and forward the added message to the next-hop network device;
[0154] If the message includes only one layer of IPv6 header and the destination address in the IPv6 header is its own SID, pop up the IPv6 header to obtain the original data message, and forward the original data message to the destination device of the original data message;
[0155] Wherein, when the message is an SRv6 message, the network devices on the second forwarding path of the original data message carried in the message are composed of multiple network devices in multiple different AS domains, the SID type of the BSID of the SRv6-TE policy corresponding to each AS domain is End.x SID, and the SID list of the SRv6-TE policy corresponding to each AS domain except the last AS domain on the second forwarding path sequentially includes the SIDs of other network devices except the first network device located in the AS domain on the second forwarding path, and the BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain belongs, and the SID list of the SRv6-TE policy corresponding to the last AS domain sequentially includes the SIDs of other network devices except the first network device located in the last AS domain on the second forwarding path.
[0156] Preferably, the device further comprises:
[0157] Determine the module ( Figure 5 ), for determining that the message needs to be forwarded through the first SRv6-TE strategy in the following manner:
[0158] Determine whether the destination address of the message is a BSID among the BSIDs of all SRv6-TE policies configured locally;
[0159] When the judgment result is yes, it is determined that the message needs to be forwarded through the first SRv6-TE policy corresponding to the destination address; wherein the SID type of the destination address is End.x SID.
[0160] Preferably, the device further comprises:
[0161] The third forwarding module ( Figure 5 ), which is used for, after receiving the message, when the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is greater than 1, then reducing the SL value in the SRH header by 1, updating the destination address in the IPv6 header to the SID indicated by the SL value in the current SRH header, and forwarding the updated message to the next-hop network device.
[0162] It can be seen from the above technical solution that in the embodiment of the present application, when forwarding data packets across AS domains is implemented based on the SRv6-TE policy, the BSID with the SID type of End.b6.Encaps is no longer used as the BSID of the corresponding SRv6-TE policy. Instead, the BSID with the SID type of End.x SID is used as the BSID of the corresponding SRv6-TE policy to implement forwarding of data packets across AS domains.
[0163] In this message forwarding process, the segment list corresponding to the SRv6-TE policy configured on the ingress node (i.e., the first network device on the forwarding path) on the forwarding path of the data message no longer includes the SID of the last network device in the last AS domain on the forwarding path. In this way, the length of the message header of the SRv6 message encapsulated based on the data message at the ingress node is shortened, and in the subsequent cross-domain forwarding process, the processing resources occupied by other network devices are reduced, thereby improving the forwarding efficiency of the data message.
[0164] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 61 and a machine-readable storage medium 62, wherein the machine-readable storage medium 62 stores machine-executable instructions that can be executed by the processor 61, and the processor 61 is prompted by the machine-executable instructions to implement the steps of any of the above-mentioned message forwarding methods.
[0165] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned message forwarding methods are implemented.
[0166] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A message forwarding method, characterized in that: The method is applied to a network device, and the method comprises: Receive messages; When the message is a data message, if it is determined that the message needs to be forwarded through the first segment routing-traffic engineering SRv6-TE policy based on IPv6 segment routing, the message is encapsulated as a segment routing and Internet Protocol version 6 SRv6 message based on the segment identifier SID list corresponding to the first SRv6-TE policy, and the SRv6 message is forwarded to the next-hop network device, wherein the network devices on the first forwarding path of the message are composed of multiple network devices in multiple different autonomous system AS domains, and the SID list sequentially includes the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the binding segment identifier BSID corresponding to the SRv6-TE policy corresponding to other AS domains except the AS domain to which the network device belongs, and the SID type of the BSID is End.x SID; When the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of routing extension header SRH header, the destination address in the IPv6 header of the message is the BSID of the second SRv6-TE policy, the SID type of the BSID of the second SRv6-TE policy is End.x SID, and the remaining segment SL value in the SRH header of the message is greater than 1, then the SL value in the SRH header is reduced by 1, the destination address in the IPv6 header of the message is updated to the BSID indicated by the SL value in the current SRH header, and based on the SID list corresponding to the second SRv6-TE policy, a new IPv6 header and a new SRH header are added to the updated message, and the added message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the third SRv6-TE policy, the SID type of the BSID of the third SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first BSID in the SID list in the SRH header, the SRH header is popped up, and based on the SID list corresponding to the third SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header, the destination address in the IPv6 header of the message is the BSID of the fourth SRv6-TE policy, and the SID type of the BSID of the fourth SRv6-TE policy is End.xSID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the fourth SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header, and the destination address in the IPv6 header of the message is its own SID, pop up the IPv6 header of the message to obtain the original data message, and forward the original data message to the destination device of the original data message; Wherein, when the message is an SRv6 message, the network device on the second forwarding path of the original data message carried in the message is composed of multiple network devices in multiple different AS domains, the BSID of the second SRv6-TE policy, the BSID of the third SRv6-TE policy, and the BSID of the fourth SRv6-TE policy are all encapsulated by the network device that receives the original data message on the second forwarding path, and the corresponding SID type is End.x SID, and the SID list corresponding to the second SRv6-TE policy, the SID list corresponding to the third SRv6-TE policy, and the SID list corresponding to the fourth SRv6-TE policy all sequentially include the SIDs of other network devices on the second forwarding path that are in the same AS domain as the network device.
2. The method according to claim 1, characterized in that It is determined that the message needs to be forwarded through the first SRv6-TE policy in the following manner: Determine whether the destination address of the message is a BSID among the BSIDs of all SRv6-TE policies configured locally; When the judgment result is yes, determining that the message needs to be forwarded through the first SRv6-TE policy corresponding to the destination address; The SID type of the destination address is End.x SID.
3. The method according to claim 1, characterized in that The method further comprises: After receiving the message, when the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is greater than 1, then the SL value in the SRH header is reduced by 1, the destination address in the IPv6 header of the message is updated to the SID indicated by the SL value in the current SRH header, and the updated message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the outermost SRH header of the message is greater than 1, then the SL value in the outermost SRH header of the message is reduced by 1, the destination address in the outermost IPv6 header of the message is updated to the SID indicated by the SL value in the current outermost SRH header, and the updated message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the outermost IPv6 header of the message is updated to the first SID in the SID list in the outermost SRH header, the outermost SRH header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by an inner IPv6 header, and the destination address in the outermost IPv6 header of the message is its own SID, then the outermost IPv6 header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the SRH header of the message is greater than 1, then reduce the SL value in the SRH header by 1, update the destination address in the outermost IPv6 header to the SID indicated by the SL value in the current SRH header, and forward the updated message to the next-hop network device; If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the outermost SRH header is equal to 1, then the destination address in the outermost IPv6 header is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message only includes two layers of IPv6 headers, and the destination address in the outermost IPv6 header of the message is its own SID, the outermost IPv6 header is popped out, and the popped out message is forwarded to the next-hop network device.
4. A message forwarding method, characterized in that: The method is applied to a network device, and the method comprises: Receive messages; When the message is a data message, if it is determined that the message needs to be forwarded through the first segment routing-traffic engineering SRv6-TE policy based on IPv6 segment routing, the message is encapsulated as a segment routing and Internet Protocol version 6 SRv6 message based on the segment identifier SID list corresponding to the first SRv6-TE policy, and the SRv6 message is forwarded to the next-hop network device, wherein the network devices on the first forwarding path of the message are composed of multiple network devices in multiple different autonomous system AS domains, and the SID list sequentially includes the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the binding segment identifier BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain to which the network device belongs on the first forwarding path belongs, and the SID type of the BSID is End.x SID; When the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of routing extension header SRH header, the destination address in the IPv6 header is its own SID, and the remaining segment SL value in the SRH header is equal to 1, then the destination address in the IPv6 header is updated to the first SID in the SID list in the SRH header, the SRH header is popped up, and the popped-up message is forwarded to the next-hop network device; If the message includes only one IPv6 header, the destination address in the IPv6 header is the BSID of the second SRv6-TE policy, and the SID type of the BSID of the second SRv6-TE policy is End.x SID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the second SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header and the destination address in the IPv6 header is its own SID, pop up the IPv6 header to obtain the original data message, and forward the original data message to the destination device of the original data message; Wherein, when the message is an SRv6 message, the network devices on the second forwarding path of the original data message carried in the message are composed of multiple network devices in multiple different AS domains, the SID type of the BSID of the SRv6-TE policy corresponding to each AS domain is End.x SID, and the SID list of the SRv6-TE policy corresponding to each AS domain except the last AS domain on the second forwarding path sequentially includes the SIDs of other network devices except the first network device located in the AS domain on the second forwarding path, and the BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain belongs, and the SID list of the SRv6-TE policy corresponding to the last AS domain sequentially includes the SIDs of other network devices except the first network device located in the last AS domain on the second forwarding path.
5. The method according to claim 4, characterized in that It is determined that the message needs to be forwarded through the first SRv6-TE policy in the following manner: Determine whether the destination address of the message is a BSID among the BSIDs of all SRv6-TE policies configured locally; When the judgment result is yes, determining that the message needs to be forwarded through the first SRv6-TE policy corresponding to the destination address; The SID type of the destination address is End.x SID.
6. The method according to claim 4, characterized in that The method further comprises: After receiving the message, when the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is greater than 1, then the SL value in the SRH header is reduced by 1, the destination address in the IPv6 header is updated to the SID indicated by the SL value in the current SRH header, and the updated message is forwarded to the next-hop network device.
7. A message forwarding device, characterized in that: The device is applied to a network device, and the device comprises: A receiving module, used for receiving messages; A first forwarding module, configured to encapsulate the message into a segment routing and Internet Protocol Version 6 SRv6 message based on a segment identifier SID list corresponding to the first SRv6-TE policy when the message is a data message, and forward the SRv6 message to a next-hop network device, if it is determined that the message needs to be forwarded through a first segment routing-traffic engineering SRv6-TE policy based on IPv6 segment routing, and forward the SRv6 message to a next-hop network device, wherein the network devices on the first forwarding path of the message are composed of a plurality of network devices in a plurality of different autonomous system AS domains, and the SID list sequentially includes the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the binding segment identifier BSID corresponding to the SRv6-TE policy corresponding to other AS domains except the AS domain to which the network device belongs, and the SID type of the BSID is End.xSID; A second forwarding module, configured to, when the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of routing extension header SRH header, the destination address in the IPv6 header of the message is the BSID of the second SRv6-TE policy, the SID type of the BSID of the second SRv6-TE policy is End.xSID, and the remaining segment SL value in the SRH header of the message is greater than 1, then subtract 1 from the SL value in the SRH header, update the destination address in the IPv6 header of the message to the BSID indicated by the SL value in the current SRH header, and based on the SID list corresponding to the second SRv6-TE policy, add a new IPv6 header and a new SRH header to the updated message, and forward the added message to the next-hop network device; If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is the BSID of the third SRv6-TE policy, the SID type of the BSID of the third SRv6-TE policy is End.x SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first BSID in the SID list in the SRH header, the SRH header is popped up, and based on the SID list corresponding to the third SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header, the destination address in the IPv6 header of the message is the BSID of the fourth SRv6-TE policy, and the SID type of the BSID of the fourth SRv6-TE policy is End.xSID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the fourth SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header, and the destination address in the IPv6 header of the message is its own SID, pop up the IPv6 header of the message to obtain the original data message, and forward the original data message to the destination device of the original data message; Wherein, when the message is an SRv6 message, the network device on the second forwarding path of the original data message carried in the message is composed of multiple network devices in multiple different AS domains, the BSID of the second SRv6-TE policy, the BSID of the third SRv6-TE policy, and the BSID of the fourth SRv6-TE policy are all encapsulated by the network device that receives the original data message on the second forwarding path, and the corresponding SID type is End.x SID, and the SID list corresponding to the second SRv6-TE policy, the SID list corresponding to the third SRv6-TE policy, and the SID list corresponding to the fourth SRv6-TE policy all sequentially include the SIDs of other network devices on the second forwarding path that are in the same AS domain as the network device.
8. The device according to claim 7, characterized in that The device also includes: A third forwarding module is used for, after receiving the message, when the message is an SRv6 message, if the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is greater than 1, then subtracting 1 from the SL value in the SRH header, updating the destination address in the IPv6 header of the message to the SID indicated by the SL value in the current SRH header, and forwarding the updated message to the next-hop network device; If the message includes only one layer of IPv6 header and one layer of SRH header, the destination address in the IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the IPv6 header of the message is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the outermost SRH header of the message is greater than 1, then the SL value in the outermost SRH header of the message is reduced by 1, the destination address in the outermost IPv6 header of the message is updated to the SID indicated by the SL value in the current outermost SRH header, and the updated message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and two layers of SRH headers, the destination address in the outermost IPv6 header of the message is its own SID, and the SL value in the SRH header of the message is equal to 1, then the destination address in the outermost IPv6 header of the message is updated to the first SID in the SID list in the outermost SRH header, the outermost SRH header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by an inner IPv6 header, and the destination address in the outermost IPv6 header of the message is its own SID, then the outermost IPv6 header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the SRH header of the message is greater than 1, then reduce the SL value in the SRH header by 1, update the destination address in the outermost IPv6 header to the SID indicated by the SL value in the current SRH header, and forward the updated message to the next-hop network device; If the message includes two layers of IPv6 headers and one layer of SRH header, the outermost IPv6 header is followed by the outermost SRH header, the destination address in the outermost IPv6 header is its own SID, and the SL value in the outermost SRH header is equal to 1, then the destination address in the outermost IPv6 header is updated to the first SID in the SID list in the SRH header, the SRH header is popped out, and the popped-out message is forwarded to the next-hop network device; If the message only includes two layers of IPv6 headers, and the destination address in the outermost IPv6 header of the message is its own SID, the outermost IPv6 header is popped out, and the popped out message is forwarded to the next-hop network device.
9. A message forwarding device, characterized in that: The device is applied to a network device, and the device comprises: A receiving module, used for receiving messages; A first forwarding module, configured to encapsulate the message into a segment routing and Internet Protocol Version 6 SRv6 message based on a segment routing-traffic engineering SRv6-TE policy when the message is a data message, and forward the SRv6 message to a next-hop network device based on a segment identifier SID list corresponding to the first SRv6-TE policy, if it is determined that the message needs to be forwarded through the first IPv6 segment routing-traffic engineering SRv6-TE policy when the message is a data message, wherein the network devices on the first forwarding path of the message are composed of a plurality of network devices in a plurality of different autonomous system AS domains, and the SID list sequentially includes the SIDs of other network devices on the first forwarding path that are in the same AS domain as the network device, and the binding segment identifier BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain to which the network device belongs on the first forwarding path belongs, and the SID type of the BSID is End.xSID; A second forwarding module is used for, when the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of routing extension header SRH header, the destination address in the IPv6 header is its own SID, and the remaining segment SL value in the SRH header is equal to 1, then updating the destination address in the IPv6 header to the first SID in the SID list in the SRH header, popping up the SRH header, and forwarding the popped-up message to the next-hop network device; If the message includes only one IPv6 header, the destination address in the IPv6 header is the BSID of the second SRv6-TE policy, and the SID type of the BSID of the second SRv6-TE policy is End.x SID, the IPv6 header of the message is popped up, and based on the SID list corresponding to the second SRv6-TE policy, a new IPv6 header and a new SRH header are added to the popped-up message, and the added message is forwarded to the next-hop network device; If the message includes only one layer of IPv6 header and the destination address in the IPv6 header is its own SID, pop up the IPv6 header to obtain the original data message, and forward the original data message to the destination device of the original data message; Wherein, when the message is an SRv6 message, the network devices on the second forwarding path of the original data message carried in the message are composed of multiple network devices in multiple different AS domains, the SID type of the BSID of the SRv6-TE policy corresponding to each AS domain is End.x SID, and the SID list of the SRv6-TE policy corresponding to each AS domain except the last AS domain on the second forwarding path sequentially includes the SIDs of other network devices except the first network device located in the AS domain on the second forwarding path, and the BSID corresponding to the SRv6-TE policy corresponding to the AS domain to which the network device adjacent to the last network device in the AS domain belongs, and the SID list of the SRv6-TE policy corresponding to the last AS domain sequentially includes the SIDs of other network devices except the first network device located in the last AS domain on the second forwarding path.
10. The device according to claim 9, characterized in that The device also includes: The third forwarding module is used to, after receiving the message, when the message is an SRv6 message, if the message includes a layer of IPv6 header and a layer of SRH header, the destination address in the IPv6 header is its own SID, and the SL value in the SRH header is greater than 1, then reduce the SL value in the SRH header by 1, update the destination address in the IPv6 header to the SID indicated by the SL value in the current SRH header, and forward the updated message to the next-hop network device.
