A method and device for verifying SRv6 message
By using AH verification in the IPSec tunnel to verify the SRH of SRv6 messages, the security risks of SRv6 technology forwarding are solved, and resource saving and key negotiation security are achieved.
Patent Information
- Application Number
- CN202010476797.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-05-19
- Filing Date
- 2020-05-29
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-05-29
AI Technical Summary
There are security risks when using SRv6 technology for packet forwarding. Network hackers can conduct network attacks by tampering with or inserting new SRHs. HMAC verification consumes a lot of resources and does not support key negotiation and anti-replay attacks.
Use AH verification to verify SRv6 messages, and perform AH verification through the exit node in the IPSec tunnel. The verification range includes at least one SRH, supports key negotiation and prevents replay attacks, and prevents network hackers from adding new SRHs. attack.
It reduces SRH verification resource consumption, prevents network hackers from attacking by tampering or inserting new SRH, supports key negotiation and prevents replay attacks, and improves network security.
Smart Images

Figure CN113691490B_ABST
Abstract
Description
[0001] This application claims the priority of the Chinese patent application filed with the China Patent Office on May 19, 2020, with application number 202010424481.4 and invention name “A method for verifying SRv6 messages using AH”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communications, and in particular to a method and device for verifying an SRv6 message. Background Art
[0003] Segment Routing Internet Protocol Version 6 (SRv6) technology can apply segment routing (SR) technology to the forwarding of Internet Protocol Version 6 (IPv6) messages.
[0004] At present, there are certain security risks when using SRv6 technology to forward messages. Summary of the invention
[0005] The embodiments of the present application provide a method and device for verifying SRv6 messages, which can reduce the security risks when forwarding messages using SRv6 technology.
[0006] In the first aspect, an embodiment of the present application provides a method for verifying an SRv6 message, which can be executed by an egress node of an IPv6 Internet protocol security (IPSec) tunnel to verify whether the SRv6 message transmitted in the IPSec tunnel has been tampered with. Optionally, the egress node receives an SRv6 message, which is a message encapsulated in an IPSec transmission mode. The SRv6 message includes a segment routing header (SRH) and an authentication header (AH). In an embodiment of the present application, the SRv6 message carries a first indication information, and the first indication information is used to instruct the egress node to perform an AH check on the SRv6 message. After the egress node receives the SRv6 message, it can not only use the SRH to guide the forwarding of the SRv6 message, but also perform an AH check on the SRv6 message based on the first indication information and the AH. In an embodiment of the present application, the verification range of the AH check includes at least one SRH. It can be seen that, using the scheme of the application embodiment, the SRv6 message can be encapsulated in IPSec transmission mode, and at least one SRH of the SRv6 message can be verified using AH verification. Compared with the method of verifying SRH using HMAC verification, this method can reduce the resource consumption caused by verifying SRH, can prevent replay attacks and support key negotiation, and can prevent network hackers from launching network attacks by adding new SRHs. Compared with the method of verifying SRv6 messages encapsulated in IPSec tunnel mode using AH verification, at least one SRH of the SRv6 message can be verified on the premise of forwarding SRv6 messages using SRH. Compared with the traditional method of verifying IPv6 messages encapsulated in IPSec transmission mode using AH verification, this method can verify at least one SRH. Using this method, network hackers can be prevented from using SRH to launch network attacks. The network attacks using SRH mentioned here include tampering with SRH and / or inserting new SRH to launch network attacks.
[0007] In addition, using AH to verify SRH can also support key negotiation and prevent replay attacks.
[0008] In one implementation, the egress node of the IPSec tunnel is an intermediate node on the SRv6 message forwarding path.
[0009] In one implementation, in the IPSec tunnel, the SRv6 message is forwarded based on the SRH.
[0010] In one implementation, the first indication information in the SRv6 message may be carried by the SRH.
[0011] In one implementation, considering that the meanings of some reserved fields in the SRH are not clearly defined, the aforementioned first indication information can be carried in the reserved fields of the SRH. In addition, the SRH also has an extended TLV field for carrying information, so the aforementioned first indication information can also be carried in the extended TLV field of the SRH.
[0012] In one implementation, the flag field is a reserved field of the SRH, and the meaning of the flag field is not clearly defined, so the first indication information can be carried by the flag field of the SRH.
[0013] In one implementation, it is considered that when a node that receives an SRv6 message determines how to process an SRv6 message, it will parse the destination address of the SRv6 message. For example, if it is determined that the destination address is its own address, it will continue to parse the SRH header to determine the next hop to forward the message. For another example, if it is determined that the destination address is not its own address, it will continue to forward the message to the node indicated by the destination address. Therefore, the aforementioned first indication information can be carried in the destination address of the SRv6 message. In this way, the egress node can obtain the first indication information when parsing the destination address without parsing other fields.
[0014] In one implementation, for an SRv6 message, its destination address includes 128 bits, which may include three fields: locator, function, and arguments. Both the function and arguments fields are used to carry the behavior corresponding to the locator. Therefore, the arguments field or the function field of the destination address may be used to carry the first indication information.
[0015] In one implementation, the egress node stores a correspondence between the destination address and the first indication information, so as to achieve the purpose of carrying the first indication information through the destination address of the SRv6 message. The egress node can obtain the first indication information according to the correspondence.
[0016] In one implementation, the destination address of the SRv6 message is a first SID, and the first SID is a SID or BSID of the egress node. After receiving the SRv6 message, the egress node can determine whether there is a mapping relationship including the first SID locally to obtain the first indication information. Alternatively, the first indication information is obtained through the arguments field or function field of the first SID.
[0017] In one implementation, the destination address of the SRv6 message is a second SID, and the second SID is associated with the IPSec tunnel. As an example, the second SID is an exit IP address of the IPSec tunnel. After receiving the SRv6 message, the exit node can determine whether there is a mapping relationship including the second SID locally to obtain the first indication information. Alternatively, the first indication information is obtained through the arguments field or function field of the second SID.
[0018] In one implementation, the SRv6 message includes second indication information, and the second indication information is used to indicate that the verification range of the AH verification includes the SRH. After receiving the SRv6 message, the egress node can determine that the AH verification needs to be performed on the SRv6 message according to the first indication information, and determine that the verification range of the AH verification includes at least one SRH according to the second indication information.
[0019] In one implementation, the aforementioned second indication information may be carried by AH.
[0020] In one implementation, considering that the meanings of some reserved fields in AH are not clearly defined, the aforementioned second indication information may be carried in the reserved fields of AH.
[0021] In one implementation, the egress node performs an AH check on the SRv6 message according to the first indication information and the AH, including:
[0022] The egress node performs an AH check on the SRv6 message according to the first indication information, the second indication information and the AH.
[0023] In one implementation, the verification range of the AH verification may include the payload of the SRv6 message in addition to at least one SRH, so as to prevent network hackers from performing network attacks by tampering with the payload.
[0024] In one implementation, the verification range of the AH verification may include, in addition to at least one SRH, an IPv6 message header of the SRv6 message, so as to prevent network hackers from launching network attacks by tampering with the IPv6 message header.
[0025] In one implementation, the egress node of the IPSec tunnel is the ingress node of the SRv6 trust domain. In this case, the present solution can ensure the security of SRv6 messages forwarded to the trust domain, effectively preventing the trust domain from being attacked.
[0026] In one implementation, the SRv6 message includes multiple SRHs, and the scope of the AH verification includes the multiple SRHs. Since the verification scope of the AH verification includes all SRHs in the SRv6 message, it can effectively prevent network hackers from launching network attacks by adding new SRHs. It can also prevent network hackers from launching network attacks by tampering with the original SRHs.
[0027] In one implementation, when the egress node determines that the SRv6 message passes the AH check, it indicates that the security of the SRv6 message is guaranteed to a certain extent, at least the SRH has not been tampered with and the network hacker has not inserted a new SRH. Therefore, the egress node can continue to forward the SRv6 message. Correspondingly, if the SRv6 message fails the AH check, it indicates that the SRv6 message is an attack message. If the SRv6 message continues to be transmitted in the network, it will affect network security. Therefore, the egress node can discard the SRv6 message to ensure network security.
[0028] In the second aspect, an embodiment of the present application provides a method for verifying an SRv6 message. The method can be performed by an entry node of an IPSec tunnel. Specifically, the entry node can obtain an SRv6 message, which can be a message obtained after the entry node encapsulates the received initial message. The SRv6 message is a message encapsulated in the IPSec transmission mode, and the SRv6 message includes an SRH and an AH. The SRv6 message carries a first indication information, and the first indication information is used to instruct the egress node to perform an AH check on the SRv6 message, and the check range of the AH check includes the at least one SRH. After the entry node obtains the SRv6 message, the SRv6 message can be sent to the egress node of the IPSec tunnel. In this way, the egress node can perform an AH check on the SRv6 message according to the first indication information. Since the check range of the AH check includes all SRHs in the SRv6 message, network hackers can be prevented from using SRHs to carry out network attacks.
[0029] In one implementation, the ingress node of the IPSec tunnel is the head node on the SRv6 message forwarding path.
[0030] In one implementation manner, the SRH carries the first indication information.
[0031] In one implementation, a reserved field or an extended type length value TLV field in the SRH is used to carry the first indication information.
[0032] In one implementation, the reserved field is a flag field.
[0033] In one implementation manner, the destination address of the SRv6 message carries the first indication information.
[0034] In one implementation, the arguments field or the function field of the destination address carries the first indication information.
[0035] In one implementation manner, the egress node stores a correspondence between a destination address of the SRv6 message and the first indication information.
[0036] In one implementation, the destination address of the SRv6 message is a first segment identifier SID, and the first SID is a SID or BSID of the egress node.
[0037] In one implementation, the destination address of the SRv6 message is a second SID, and the second SID is associated with the IPSec tunnel.
[0038] In one implementation, the second SID is an egress IP address of the IPSec tunnel.
[0039] In one implementation, the SRv6 message includes second indication information, and the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
[0040] In one implementation manner, the AH includes the second indication information.
[0041] In one implementation manner, the second indication information is carried in a reserved field of the AH.
[0042] In one implementation, the verification range of the AH verification also includes the payload of the SRv6 message.
[0043] In one implementation, the verification scope of the AH verification also includes the IP packet header of the SRv6 packet.
[0044] In one implementation, the egress node of the IPSec tunnel is an ingress node of the SRv6 trust domain.
[0045] In one implementation, the SRv6 message includes multiple SRHs, and the range of the AH check includes the multiple SRHs.
[0046] In a third aspect, an embodiment of the present application provides a network device used as an exit node of an Internet Protocol security IPSec tunnel, the network node comprising:
[0047] communication interface; and
[0048] a processor connected to the communication interface;
[0049] According to the communication interface and the processor, the egress node is used to execute the method described in the aforementioned first aspect and any one of the first aspect.
[0050] In a fourth aspect, an embodiment of the present application further provides a network device, which is used as an entry node of an Internet Protocol security IPSec tunnel, and the network node includes:
[0051] communication interface; and
[0052] a processor connected to the communication interface;
[0053] According to the communication interface and the processor, the entry node is used to execute the method described in the aforementioned second aspect and any one of the second aspect.
[0054] In a fifth aspect, an embodiment of the present application provides a network device, which is used as an exit node of an Internet Protocol security IPSec tunnel, wherein the network node includes a memory and a processor;
[0055] The memory is used to store program codes;
[0056] The processor is used to run the instructions in the program code so that the egress node executes the method described in the first aspect and any one of the first aspects above.
[0057] In a sixth aspect, an embodiment of the present application provides a network device, which is used as an entry node of an Internet Protocol security IPSec tunnel, wherein the entry node includes a memory and a processor;
[0058] The memory is used to store program codes;
[0059] The processor is used to run the instructions in the program code so that the entry node executes the method described in the above second aspect and any one of the second aspects.
[0060] The network device provided in any aspect of the third to sixth aspects of the present application may be, for example, a router, a switch, a packet switching network PTN device or other network device. It may also be a single board, a line card or a chip for implementing the relevant method in the network device. The present application does not impose any specific restrictions on this.
[0061] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the method described in the first aspect and any one of the above first aspects, or enables the computer to execute the method described in the second aspect and any one of the above second aspects.
[0062] In an eighth aspect, an embodiment of the present application provides a communication system, comprising an ingress node of an Internet Protocol security IPSec tunnel and an egress node of the IPSec tunnel, wherein the egress node is used to execute the method described in the first aspect and any one of the first aspects above.
[0063] In the ninth aspect, an embodiment of the present application provides a communication system, comprising an ingress node of an Internet Protocol security IPSec tunnel and an egress node of the IPSec tunnel, wherein the ingress node is used to execute the method described in the second aspect and any one of the second aspects above.
[0064] In the tenth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is run on a computer, the computer executes the method described in the first aspect and any one of the above first aspects, or the computer executes the method described in the second aspect and any one of the above second aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 A schematic diagram of the structure of an SRv6 message provided in an embodiment of the present application;
[0067] Figure 2 A schematic diagram of the structure of another SRv6 message provided in an embodiment of the present application;
[0068] Figure 3 A schematic diagram of the structure of an IPSec message provided in an embodiment of the present application;
[0069] Figure 4 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;
[0070] Figure 5 A schematic diagram of the structure of an SRv6 message encapsulated in tunnel mode provided in an embodiment of the present application;
[0071] Figure 6 A schematic diagram of the structure of an SRv6 message encapsulated in a transport mode provided in an embodiment of the present application;
[0072] Figure 7 A signaling interaction diagram of a method for verifying an SRv6 message provided in an embodiment of the present application;
[0073] Figure 8a A schematic diagram of a SID list provided in an embodiment of the present application;
[0074] Figure 8b A schematic diagram of a SID list provided in an embodiment of the present application;
[0075] Figure 8c A schematic diagram of a SID list provided in an embodiment of the present application;
[0076] Figure 8d A schematic diagram of a SID list provided in an embodiment of the present application;
[0077] Fig. 9 A flowchart of a method for verifying an SRv6 message provided in an embodiment of the present application;
[0078] Fig.10 A flowchart of a method for verifying an SRv6 message provided in an embodiment of the present application;
[0079] Fig.11 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0080] Fig.12 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0081] Fig.13 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0082] Fig.14 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0083] Fig.15 A schematic diagram of the structure of a network device provided in an embodiment of the present application;
[0084] Fig.16 A schematic diagram of the structure of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0085] The embodiment of the present application provides a message forwarding method, which can reduce the security risks when using SRv6 technology to forward messages.
[0086] To facilitate understanding, we first briefly introduce the use of SRv6 technology for message forwarding.
[0087] When forwarding messages using SRv6 technology, the head node specifies the message forwarding path, and the intermediate nodes guide the message forwarding according to the forwarding path indicated by the head node until the message is forwarded to the destination node. Among them: the message forwarded using SRv6 technology can also be called SRv6 message. For details, please refer to Figure 1 To understand, Figure 1 A schematic diagram of the structure of an SRv6 message provided in an embodiment of the present application. Figure 1 As shown, the SRv6 message includes an IPv6 header (IPv6 Header) 101, SRH102 and a payload 103. Among them, SRH102 includes a segment identifier list (SID list) indicating the message forwarding path. In one implementation, the SID list can be composed of several node SIDs, for example, composed of several IPv6 addresses, and the node SID is used to indicate the nodes passed during the message forwarding process. In another implementation, the SIDlist can be composed of several adjacent link SIDs, and the adjacent link SID is used to indicate the adjacent link through which the message is forwarded. The so-called adjacent link refers to a link directly connected between two nodes. In another implementation, the SID list can also be composed of a node SID and an adjacent link SID.
[0088] When forwarding messages using SRv6 technology, the intermediate node forwards messages based on the SID list, and does not verify the SRH and payload. Therefore, network hackers can maliciously tamper with the payload or SRH to launch network attacks, affecting network security.
[0089] At present, the aforementioned network attacks can be prevented by defining an SRv6 trust domain. Among them, the trust domain is used to indicate the network range for preventing the aforementioned network attacks. The trust domain can be determined based on a variety of methods. For example, it can be determined based on the network scenario, such as specifying the core network part in the network as the trust domain; or, it can be determined based on the service type, such as determining the network range for transmitting a specific service message as the trust domain, and so on. Specifically, to ensure that the trust domain is not attacked, an access control list (ACL) traffic filtering policy can be configured on the edge node or intermediate node of the trust domain. For example, the edge node of the trust domain verifies the received SRv6 message. If the destination address of the SRv6 message is the address of a node within the trust domain, the SRv6 message is discarded. For another example, the edge node or intermediate node of the trust domain verifies the received SRv6 message. If the source address of the SRv6 message is the address of a node outside the trust domain, the SRv6 message is discarded. Through the above method, it is possible to prevent SRv6 messages generated outside the trust domain from being transmitted to the trust domain, and to prevent SRv6 messages generated within the trust domain from being forwarded outside the trust domain. This allows only SRv6 messages generated within the trust domain to be forwarded, thus preventing the trust domain from being attacked. The edge node of the trust domain refers to a node that directly communicates with a node outside the trust domain, and the intermediate node of the trust domain refers to other nodes except the edge node.
[0090] However, in some scenarios, SRv6 messages need to be forwarded across trust domains. For example, SRv6 messages outside a trust domain need to be forwarded to a trust domain, or SRv6 messages generated in a first domain need to be forwarded to a second domain via a trust domain, and the first domain and the second domain are different from the trust domain.
[0091] In order to ensure network security when SRv6 messages are forwarded across trust domains, the inventors of this application have discovered that a key-related hashed message authentication code (HMAC) check can be deployed on the intermediate nodes (such as the edge nodes of the trust domain) that forward SRv6 messages, thereby preventing network attacks caused by tampering with the SRH. The HMAC operation can take the key and data as input and compress the data into a data digest of a fixed length. Specifically, see Figure 2 To understand, Figure 2 A structural diagram of another SRv6 message provided in an embodiment of the present application. Figure 2As shown, the SRH includes an HMAC type length value (TLV), and the HMAC TLV includes an HMACKey ID field and an HMAC field. The HMAC Key ID field is used to identify the key and hash algorithm used for HMAC verification, and the field includes 4 bytes; the HMAC field is used to indicate the data summary of a specific field in the SRv6 message, and the field includes 32 bytes.
[0092] Regarding the specific fields involved in HMAC calculation, Figure 2 The meaning of each field shown and the specific verification method of HMAC are not described in detail here. Please refer to the relevant description part of request for comments (RFC) 8754.
[0093] Although the above method can verify whether the SRH of the received SRv6 message has been tampered with, the HMAC check consumes more resources, which will accordingly affect the performance of the node that performs the HMAC check.
[0094] Moreover, HMAC verification only supports the current SRH (such as Figure 1 102) shown in the figure is used for verification. If a network hacker Figure 1 If a new SRH is inserted after the SRH 102 shown, the HMAC check will not check the newly inserted SRH. A network hacker can still conduct a network attack by tampering with the newly inserted SRH, thus affecting network security.
[0095] The HMAC check range does not include the payload, so network hackers can launch network attacks by tampering with the payload.
[0096] HMAC verification does not support key negotiation, so there is a possibility of key leakage. Therefore, a specific key protection method is needed to ensure the security of the key. If there is no specific key protection scheme, the key security cannot be guaranteed. Accordingly, the result of HMAC verification is also unreliable. The execution of the key protection method will occupy the system resources of the node executing the HMAC verification, affecting the performance of the node executing the HMAC verification. At present, HMAC verification does not support anti-replay attack, so network hackers can send a large number of replay attack messages to consume network resources.
[0097] In summary, deploying HMAC verification on network nodes that forward SRv6 packets cannot effectively ensure network security.
[0098] The inventor of the present application also discovered that IPSec technology uses a secure tunnel to protect data transmission in a network, and IPv6 IPSec technology supports key negotiation and resistance to replay attacks.
[0099] Specifically, an IPSec tunnel may be deployed between two nodes. When a message is transmitted in the IPSec tunnel, an AH check may be used to determine whether the message transmitted in the IPSec tunnel is tampered with.
[0100] See also Figure 3 , which is a schematic diagram of the structure of an IPSec message provided in an embodiment of the present application.
[0101] like Figure 3 As shown, the IPv6 message includes an IPv6 header, an AH header and an IPv6 payload.
[0102] The fields in the IPv6 header are not described in detail here.
[0103] The AH header includes the Next Header field, the Hdr Ext Len field, the Reserve field, the Security Parameter Index field, the Sequence Number field, and the Authentication Data ICV field. Among them:
[0104] The Next Header field consists of 8 bits and is used to carry the next message header type;
[0105] The Hdr Ext Len field includes 8 bits and is used to carry the message length;
[0106] The Reserve field includes 16 bits and is a reserved field;
[0107] The Security Parameter Index (SPI) field includes 32 bits, which is used to carry the security parameter index, which can be used to determine the key and encryption algorithm. The node that generates the IPSec message can negotiate the key with the node that performs the AH check. After the negotiation is completed, the specific value of the security parameter index is determined, and the specific value is encapsulated in the IPSec message and sent to the node that performs the AH check. In the key negotiation method, the key is determined by the parameters generated by the nodes participating in the negotiation. For example, node A and node B negotiate the key, node A generates parameter A1, and node B generates parameter B1. By performing corresponding operations on parameters A1 and B1, the key used for AH check is obtained. Therefore, the possibility of key leakage is low and the security is high. There is no need to use an additional key protection scheme to protect the security of the key used for HMAC check like HMAC check. Therefore, compared with HMAC check, the use of IPSEC technology for AH check can reduce the resource consumption of the node because there is no need to use an additional key protection scheme to protect the key security.
[0108] The Sequence Number field can be used to carry the message sequence number. Based on the message sequence number, anti-replay attack can be implemented.
[0109] The Authentication Data integrity check value (ICV) field is used to carry the check value of the AH check. The length of this field is not fixed and is an integer multiple of 32 bits.
[0110] In a specific example, using AH verification to ensure the security of message transmission in the IPSec tunnel can be achieved in the following way: the ingress node of the IPSec tunnel can encapsulate the IPv6 message with an AH header, and the resulting message structure is as follows: Figure 3 As shown, the value of the Authentication Data ICV field is Figure 3 The shaded fields shown in the figure are used to calculate the ICV. Figure 3 When the IPv6 message shown in the figure is sent, the ICV calculation can be performed on the shaded field, and the calculated value can be compared with the value of the Authentication Data ICV field. If the two are the same, it is determined that the message has not been tampered with and the message continues to be forwarded. If the two are different, it is determined that the message has been tampered with and the message is discarded. In this way, the security of the IPv6 message transmitted in the IPSec tunnel can be guaranteed.
[0111] The above-mentioned AH verification method is only a specific example and does not constitute a limitation on the embodiments of the present application.
[0112] Since the AH check can ensure the security of IPv6 message transmission in the IPSec tunnel, in some embodiments, the AH check can also be applied to the transmission process of the SRv6 message to ensure the security of SRv6 message transmission in the IPSec tunnel.
[0113] See also Figure 4 To understand, Figure 4 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application.
[0114] like Figure 4 As shown, node R0 needs to forward the message to node R6 through node R1, node R2, node R3, node R4 and node R5 in sequence. Among them, an SRv6 tunnel is deployed between node R1 and node R5. Node R2, node R3 and node R4 belong to the SRv6 trust domain 100. After node R1 receives the original message from node R0, it can encapsulate the original message to obtain an SRv6 message. In order to ensure the security of the SRv6 message forwarded to the trust domain, an IPSec tunnel can be deployed between node R1 and node R2. And use AH verification to ensure the security of the SRv6 message transmitted in the IPSec tunnel.
[0115] It should be noted that Figure 4 This is only for the convenience of understanding and does not constitute a limitation on the embodiments of the present application. Figure 4 The entry node of the IPSec tunnel is the same as the entry node of the SRv6 tunnel. The entry node of the IPSec tunnel can also be the intermediate node of the SRv6 tunnel. Figure 4 The illustrated node is an edge node of the trust domain. The egress node of the IPSec tunnel may also be an intermediate node of the trust domain.
[0116] In the following embodiments, the egress node of the IPSec tunnel is taken as an edge node of the trust domain for illustration, but this is only for the convenience of illustrating the implementation method of the embodiments of the present application and does not constitute a limitation on the embodiments of the present application.
[0117] When an SRv6 message with AH checksum applied is transmitted in an IPSec tunnel, its message encapsulation format may include tunnel mode encapsulation and transport mode encapsulation. Next, the message structure using tunnel mode encapsulation and the message structure using transport mode encapsulation are introduced respectively.
[0118] See also Figure 5, which is a schematic diagram of the structure of an SRv6 message encapsulated in tunnel mode provided in an embodiment of the present application.
[0119] like Figure 5 As shown, Figure 5 The SRv6 message shown includes New IP Header, AH Header, IP Header, SRH and Payload.
[0120] Among them: New IP Header is a newly added IP message header, which can include the entry node address of the IPSec tunnel and the exit node address of the IPSec tunnel, which is used to guide the message to be forwarded in the IPSec tunnel. Figure 3 The description part will not be described in detail here.
[0121] for Figure 5 In the SRv6 message shown, the value of the Authentication Data ICV field in the AH Header is obtained by performing ICV calculation on the fields in the New IP Header, AH Header, IP Header, SRH, and Payload. In other words, both SRH and Payload participate in the ICV calculation. Therefore, if the AH verification of the SRv6 message passes, it means that the SRH and Payload of the SRv6 message have not been tampered with, ensuring the security of the SRv6 message transmitted in the IPSec tunnel.
[0122] according to Figure 5 From the message structure shown, it can be seen that the New IP Header can guide the forwarding of the SRv6 message in the IPSec tunnel. In addition, the security of the SRv6 message transmitted in the IPSec tunnel can be guaranteed by AH verification. However, since the SRH is encapsulated in the inner layer, when the SRv6 message is forwarded in the IPSec tunnel, the forwarding node does not parse the SRH, and therefore, the message cannot be forwarded according to the SRH. In other words, when the SRv6 message is forwarded in the IPSec tunnel, the SRH cannot be used to guide the message forwarding. Only when the SRv6 message leaves the IPSec tunnel and the New IP Header and AH Header are stripped off, can the SRH be used to guide the message forwarding. Regarding the encapsulation format of the IPSec transport mode message, please refer to the relevant description of RFC4302. It will not be described in detail here. RFC4302 is incorporated into this application by reference in its entirety.
[0123] But in some scenarios, such as above Figure 4As shown in FIG. 1 , the IPSec tunnel is part of the SRv6 tunnel, and it is often required that when SRv6 packets are forwarded in the IPSec tunnel, the SRH can also be used to guide the packet forwarding. Therefore, tunnel mode encapsulation is not applicable in some scenarios.
[0124] See also Figure 6 , which is a schematic diagram of the structure of an SRv6 message encapsulated in a transmission mode provided in an embodiment of the present application.
[0125] like Figure 6 As shown, Figure 6 The SRv6 message shown includes an IP header, an SRH, an AH Header, and a Payload. The SRH mentioned here may also be referred to as SRH. The AH Header mentioned here may also be referred to as AH.
[0126] from Figure 6 It can be seen that Figure 5 Different, here the AH Header is encapsulated in the inner layer, and the SRH is encapsulated in the outer layer of the AH Header. Since the AH Header is encapsulated in the inner layer of the SRH, the AH Header will be processed only after the SRH is processed. In other words, for the intermediate node forwarding using SRv6, it forwards according to the SRH and does not parse the AH Header. Only after the tail node forwarding using SRH, that is, the last node indicated by the SID list in the SRH, strips off the SRH, will the AH Header be parsed. In some network scenarios, the IPSec tunnel is part of the SRv6 tunnel. That is, the egress node of the IPSec tunnel is the intermediate node forwarding using SRv6. This results in that when the SRv6 message is forwarded in the IPSec tunnel, although the SRH can be used to guide the message forwarding, the AH check cannot be used to ensure the security of the message transmission. Because the egress node of the IPSec tunnel does not perform integrity check on the SRH, even if the SRH is tampered with, or a network hacker maliciously inserts a new SRH, the message will continue to be forwarded in the network. Moreover, since the sequence number field in AH is used to prevent replay attacks, the egress node of the IPSec tunnel does not perform the AH verification step, which results in the SRv6 message being unable to prevent replay attacks when transmitted in the IPSec tunnel.
[0127] In order to solve the above problems, an embodiment of the present application provides a method for verifying SRv6 messages, which can encapsulate SRv6 messages in IPSec transmission mode, and verify at least one SRH of the SRv6 message using AH verification. Compared with the method of verifying SRH using HMAC verification, this method can reduce the resource consumption caused by verifying SRH, can prevent replay attacks and support key negotiation, and can prevent network hackers from launching network attacks by adding new SRHs. Compared with the method of verifying SRv6 messages encapsulated in IPSec tunnel mode using AH verification, this method can verify at least one SRH of the SRv6 message on the premise of forwarding SRv6 messages using SRH. Compared with the traditional method of verifying SRv6 messages encapsulated in IPSec transmission mode using AH verification, this method can verify the SRH in the message.
[0128] Next, combine Figure 4 The application scenario shown introduces the message forwarding method provided by the embodiment of the present application. Figure 7 , this figure is a signaling interaction diagram of a method for verifying SRv6 messages provided in an embodiment of the present application. Figure 7 The method 100 for checking an SRv6 message shown can be implemented through the following S101-S104.
[0129] S101: Node R1 obtains message 1, which is an SRv6 message. Message 1 includes an AH and at least one SRH. Message 1 carries indication information 1, which is used to instruct node R2 to perform an AH check on message 1.
[0130] like Figure 4 As shown, node R1 is the ingress node of the IPSec tunnel, and node R2 is the egress node of the IPSec tunnel.
[0131] In the embodiment of the present application, message 1 may be a message obtained by encapsulating the acquired initial message by node R1. As an example, node R1 may receive message 2 from node R0, and encapsulate message 2 to obtain message 1. For example, node R1 receives an IPv4 message or an IPv6 message from node R0, and then node R1 re-encapsulates the message, adds SRH and AH to the message, and obtains message 1.
[0132] In the embodiment of the present application, node R1 uses the transmission mode to encapsulate the obtained initial message. For the message encapsulation format of the IPSec transmission mode, reference can be made to the relevant part of RFC4302, which will not be described in detail here. As an example, the message structure of message 1 can be as follows: Figure 6 The message structure shown.
[0133] In the embodiment of the present application, when node R1 re-encapsulates the received original message, it can add indication information 1, so as to obtain message 1 including indication information 1. The indication information 1 is used to instruct node R2 to perform AH verification on message 1. Moreover, in order to prevent SRH from being tampered with or network hackers from adding new SRH to the message to cause network attacks, the AH verification range includes the at least one SRH. Therefore, even if Figure 6 As shown, the AH Header is encapsulated in the inner layer of the SRH. The egress node R2 of the IPSec tunnel is an intermediate node forwarded using SRv6. Node R2 can also perform AH verification on message 1 according to indication information 1, and the verification range includes the at least one SRH. This prevents network hackers from using SRH to attack the network. The use of SRH mentioned here includes but is not limited to tampering with SRH or inserting a new SRH.
[0134] In the present application, the AH check range may include one SRH or multiple SRHs.
[0135] In the embodiment of the present application, the indication information 1 may be carried by one of the fields in the message 1. The embodiment of the present application does not specifically limit the field. The field used to carry the indication information 1 may be, but is not limited to, the following fields.
[0136] As an example, the field may be one of the fields in the SRH. In other words, the aforementioned indication information 1 may be carried in the SRH. For example, the indication information 1 may be carried in a reserved field or an extended TLV field of the SRH. Considering that the meaning of the flag field in the SRH is not clearly defined at present, the flags field may be considered as a reserved field of the SRH. Therefore, the flags field in the SRH may be used to carry the indication information 1.
[0137] As another example, considering that in actual applications, after node R1 obtains message 1, it will modify the destination address in the IPv6 header of message 1 to the address of node R2, so as to send message 1 to node R2. The node that receives message 1 will determine whether the destination address is its own address. If so, it will perform the next step, for example, continue to parse the SRH segment routing header, and so on. If the destination address is not its own address, it will continue to forward the message to the node corresponding to the destination address. In other words, when node R2 receives message 1, it will inevitably parse the destination address of message 1. Therefore, in an embodiment of the present application, the field used to carry indication information 1 can be a destination address field. In other words, the aforementioned indication information 1 can be carried in the destination address of message 1.
[0138] Considering that in actual applications, for an SRv6 message, its destination address includes 128 bits, and the 128 bits may include three fields: locator, function, and arguments. Among them, the locator field is used to carry the network segment address and the subnet address; the function and arguments fields are both used to carry the behavior corresponding to the locator. For example, when the destination address is a binding segment ID (BSID), the behavior indicated by the function is to expand the BSID into a SIDlist. Among them, the BSID can be used to identify a forwarding path, and the forwarding path can be indicated by the SID list. Therefore, in one implementation method of an embodiment of the present application, the function field or the arguments field of the destination address may be used to carry the aforementioned indication information 1. For example, a new function type (such as END.AH mentioned below) may be added, and the function type is used to carry the aforementioned indication information 1, which is used to instruct the node corresponding to the destination address to perform an AH check. For another example, when the function field is already in use, the arguments field is used to carry the aforementioned indication information 1. In yet another implementation, the node R2 may store the correspondence between the destination address of the message 1 and the indication information 1 , so as to achieve the purpose of carrying the indication information 1 through the destination address of the message 1 .
[0139] Regarding the destination address of message 1, it should be noted that the node indicated by the destination address is node R2. The embodiment of the present application does not specifically limit the destination address. As an example, the destination address may be R2.SID, that is, the destination address may be the segment identifier of the R2 node. As another example, the destination address may be R2.BSID, that is, the destination address is the binding segment identifier of the R2 node, which is used to identify a path starting from node R2. When the destination address of message 1 is R2.SID, the SID list of message 1 is as follows: Figure 8a When the destination address of message 1 is R2.BSID, the SID list of message 1 is as follows: Figure 8b About Figure 8a and Figure 8bAs shown in R5.VPN and R5.END, it should be noted that R5.END is used to indicate the R5 node, which is used to indicate the node R4 to forward the message 1 to the node R5, and R5.VPN is used for a specific virtual private network (VPN) instance deployed on the corresponding node R5. As another example, the destination address can be associated with the IPSec tunnel. For example, the destination address of message 1 can be the exit IP address R2.END.AH of the IPSec tunnel. In this case, the exit IP address can be associated with the node R2 in advance, and the route can be published to the node R1, so that when the destination address of message 1 is the exit IP address of the IPSec tunnel, the message 1 can be forwarded to the node R2. When the destination address of message 1 is the exit IP address of the IPSec tunnel, the SID list of message 1 can be as follows Figure 8c As shown in FIG. 1 , R2.BSID is used to indicate a forwarding path. It is used to instruct node R2 to forward the received message 1. Of course, if BSID is not used to access the trust domain, the SID list of message 1 can be as follows: Figure 8d shown.
[0140] In the embodiment of the present application, if the destination address of message 1 is R2.BSID, the BSID may be generated by node R2 or the control management device. In this case, the out-of-domain node sets the destination address of the SRv6 message forwarded to the trust domain to BSID, which can prevent the network topology in the trust domain from being leaked.
[0141] In some embodiments, an IPSec tunnel may be associated with a VPN instance. Generally, an IPSec tunnel may be associated with one or more VPN instances. That is, the IPSec tunnel is used to transmit messages corresponding to the VPN instance associated with it. In addition, a BSID may also be associated with an IPSec tunnel, and one BSID may correspond to one IPSec tunnel.
[0142] In the embodiment of the present application, if the destination address of message 1 is the exit IP address of the IPSec tunnel or R2.SID, the IPSec tunnel can be associated with multiple VPN instances for transmitting messages corresponding to multiple VPN instances. If the destination address of message 1 is R2.BSID, the IPSec tunnel can be associated with a VPN instance, which is the VPN instance associated with R2.BSID.
[0143] From the previous article Figure 3It can be seen from the description that currently, the verification range of AH verification does not include SRH. In the present application, in order to avoid network attacks caused by tampering of SRH, the AH verification range includes at least one SRH. Specifically, in one implementation, the aforementioned indication information 1 is used not only to instruct the egress node of the IPSec tunnel to perform AH verification, but also to indicate that the verification range of AH verification includes at least one SRH. In another implementation, when node R1 re-encapsulates the received original message, in addition to adding indication information 1, it can also add indication information 2, thereby obtaining message 1 including indication information 1 and indication information 2. Among them, the indication information 2 is used to indicate that the verification range of AH verification includes at least one SRH. For this case, indication information 1 is used to instruct the egress node of the IPSec tunnel to perform AH verification, and indication information 2 is used to indicate that the verification range of AH verification includes at least one SRH.
[0144] In the embodiment of the present application, the indication information 2 may be carried by one of the fields in the message 1. The embodiment of the present application does not specifically limit the field. Several possible fields for carrying the indication information 2 are introduced below.
[0145] Considering that the AH check needs to be combined with the relevant content in the AH for check, therefore, in one implementation, the indication information 2 can be carried by the AH. For example, the indication information 2 can be carried in a reserved field of the AH. For example, one bit of the Reserve field in the AH can be used to carry the indication information 2. Of course, the indication information 2 can also be carried by other fields in the message 1, for example, by the reserved field of the SRH or the extended TLV field.
[0146] It can be understood that, through the indication information 1, the indication information 2 and the AH, the node R2 can perform the AH check on the received message 1, and the check range of the AH check includes the SRH.
[0147] In one implementation of the embodiment of the present application, the verification range of the AH verification of message 1 may also include the payload of message 1. When the verification range of the AH verification includes the payload, the solution provided by the embodiment of the present application can prevent network hackers from using the payload to carry out network attacks compared to the solution using the HMAC verification. The network attack using the payload mentioned here may, for example, include tampering with the payload so that the attack message is transmitted in the network, which not only consumes network resources, but also has certain security risks.
[0148] In one implementation of the embodiment of the present application, considering that SRv6 message processing includes not only SRH and payload, but also IP message header, the IP message header also carries some important information, such as the final destination address of the message (such as the destination address after exiting the SRv6 tunnel). If the IP message header is tampered with, there will also be certain security risks. Therefore, in some embodiments, the verification scope of AH verification of message 1 can also include the IP message header of message 1.
[0149] Of course, the scope of the AH check for message 1 may include both the IP message header of message 1 and the payload of message 1, thereby implementing integrity check for message 1. The IP message header mentioned here may be, for example, the aforementioned IPv6 header.
[0150] like Figure 3 As shown, the AH includes an Authentication Data ICV field, and the value of this field can be obtained by node R1 performing ICV calculation on a specific field in message 1. Among them, the fields involved in the ICV calculation are related to the verification range of the AH verification. If the verification range of the AH verification includes SRH, the fields involved in the ICV calculation can be fields in the SRH. If the verification range of the AH verification includes SRH and payload, the fields involved in the ICV calculation can be SRH and payload. If the verification range of the AH verification includes SRH and IP header, the fields involved in the ICV calculation can be SRH and IP header. If the verification range of the AH verification includes SRH, IP header and payload, the fields involved in the ICV calculation can be SRH, IP header and payload. In one implementation of the application embodiment, if message 1 includes indication information 2, the scope of the AH verification can be indicated by the value of the indication information 2. For example, when the value of indication information 2 is A, the scope of AH verification includes SRH and payload, when the value of indication information 2 is B, the scope of AH verification includes SRH and IP header, and when the value of indication information 2 is C, the scope of AH verification includes SRH, payload and IP header.
[0151] When node R2 performs AH verification on the received message 1, it also calculates ICV for specific fields in message 1 and compares the calculated value with the value carried by the Authentication Data ICV field of message 1 to determine whether message 1 has been tampered with. In actual applications, during the forwarding process of message 1, the values of some fields remain unchanged (immutable), while the values of some fields change. The fields whose values change can be divided into two categories, namely mutable but predictable and mutable but unpredictable. The mutable but unpredictable class can be referred to as the mutable class. Among them, the mutable but predictable class means that the value of the field can be predetermined when node R2 receives message 1, and the mutable class means that the value of the field cannot be predetermined when node R2 receives message 1.
[0152] In order to make the result of the AH check correctly indicate whether the message 1 has been tampered with, in the embodiment of the present application, when calculating the value of the Authentication Data ICV field, the node R1 can take the value of the variable field as a preset value such as 0, and determine the value of the variable but predictable field as the predicted value of the field to perform ICV calculation. The predicted value mentioned here refers to the value of the field when the node R2 receives the message 1.
[0153] The types of the fields in the SRv6 message may be as shown in Table 1 below.
[0154] Table 1
[0155]
[0156] The specific meanings of the fields shown in Table 1 are not described in detail here.
[0157] In addition, the IPv6 payload of the SRv6 message is an invariant field.
[0158] It should be noted that when node R1 calculates the value of the Authentication Data ICV field, the value of the Destination Address field of the IPv6 header is the exit address of the IPSec tunnel, and the exit address of the IPSec tunnel can be the R2.SID, R2.BSID or R2.AH.SID mentioned above. The value of Segment Left is the corresponding value when node R2 receives message 1. In an embodiment of the present application, if the target address carries indication information 1, when node R2 receives message 1, it can parse the destination address field, obtain the indication information 1, and perform an AH check based on the indication information 1. Among them, if the destination address is R2.SID, the indication information 1 can be carried in the function field of R2.SID; if the destination address is R2.BSID, the indication information 1 can be carried in the arguments field of R2.BSID; if the destination address is R2.AH.SID, the indication information 1 can be carried in the function field or the arguments field of R2.AH.SID.
[0159] S102: Node R1 sends message 1 to node R2.
[0160] S103: Node R2 receives message 1.
[0161] After node R1 receives message 1, it can forward message 1 to node R2. Node R2 can receive message 1 sent by node R1. Figure 4 As shown, node R2 is an edge node of the trust domain.
[0162] S104: Node R2 performs an AH check on message 1 according to indication information 1 and AH, and the check range of the AH check includes at least one SRH.
[0163] After receiving the message 1, the node R2 first determines that the destination address of the message 1 is the address of the node R2. Then, the node R2 obtains the indication information 1, and according to the indication information 1, the node R2 can perform the step of performing AH verification on the message 1. Specifically, the node R2 can parse the AH, and determine the ICV algorithm and key used for the AH verification according to the Security Parameter Index field in the AH. In addition, if the indication information 1 is used to indicate that the egress node of the IPSec tunnel performs the AH verification, and can also be used to indicate that the verification range of the AH verification includes at least one SRH, the node R2 can perform the AH verification on the message 1 according to the indication information 1, and the verification range of the AH verification includes at least one SRH. If the indication information 1 is used to indicate that the egress node of the IPSec tunnel performs the AH verification, and the indication information 2 is used to indicate that the verification range of the AH verification includes at least one SRH, the node R2 can also determine that the verification range of the AH verification includes the SRH according to the indication information 2. For the indication information 1 and the indication information 2, reference can be made to the description of the indication information 1 and the indication information 2 in S101, which will not be described in detail here.
[0164] In a specific example, node R2 can perform AH verification on message 1 in the following manner: node R2 can perform ICV calculation on a specific field in message 1. For the changed field in the specific field, the value of the changed field can be regarded as a preset value, such as 0, for calculation. The specific field mentioned here may include SRH, or SRH and payload, or SRH, IP message header and payload. After node R2 performs ICV calculation on the specific field in message 1, the calculated value can be compared with the value carried by the Authentication Data ICV field in message 1. If the two are the same, it means that message 1 has not been tampered with. Further, node R2 strips off AH and further forwards the message according to SRH. If the two are not the same, it means that message 1 has been tampered with. In this case, in order to avoid attacks on the network, such as the trust domain, node R2 can discard message 1.
[0165] Regarding the specific implementation manner in which the node R2 forwards the message according to the SRH, for example, the next hop destination node for message forwarding may be determined according to the value of the SRH and the segment left (SL) field, which is not described in detail here.
[0166] In the embodiment of the present application, the scope of AH verification includes at least one SRH. In one embodiment, node R2 can verify all SRHs in message 1. In this way, if there is an SRH added by a network hacker in the SRHs involved in the verification, the AH verification fails, so that it can be determined that message 1 is a tampered message. It can be seen that the use of this solution can prevent network hackers from launching network attacks by adding SRHs.
[0167] As mentioned above, Figure 3 It can be seen from the description that AH includes the SPI field, so the use of AH verification has the advantage of supporting key negotiation compared to the use of HMAC verification. It is precisely because AH verification supports key negotiation that the security of AH keys is higher, and no additional key protection scheme is required to protect the security of AH keys, which can reduce the resource consumption of node R2. Moreover, AH includes a sequence number field, which can prevent network hackers from repeatedly sending the same message, that is, the solution of the embodiment of the present application also supports anti-replay attacks compared to the use of HMAC verification, and prevents the same message from being transmitted in the network and occupying network resources.
[0168] From the above description, it can be known that by utilizing the solution of the embodiment of the present application, the AH verification can be used to verify whether message 1 has been tampered with during transmission in the IPSec tunnel. Message 1 will only be forwarded if the verification is passed, otherwise message 1 will be discarded. In the scenario where node R2 is an edge node of the trust domain, this method can ensure the security of the SRv6 message forwarded to the trust domain and effectively prevent the trust domain from being attacked. In the scenario where node R2 is not an edge node of the trust domain, by utilizing the solution of the embodiment of the present application, it is also possible to prevent the tampered SRv6 message from continuing to be transmitted in the network, prevent the tampered message from occupying network resources, and eliminate the security risks caused by the tampered SRv6 message continuing to be transmitted in the network.
[0169] It should be noted that the IPSec tunnel in the embodiment of the present application can be established between nodes with higher security protection requirements. Figure 4 As shown, in order to ensure that the trust domain is not attacked, the legitimacy of the SRv6 message from outside the trust domain must be guaranteed, so an IPSec tunnel is deployed between the edge node R2 of the trust domain and the node R1 outside the domain. Alternatively, it can also be established between nodes without other security protection measures. Of course, only two possible scenarios for establishing an IPSec tunnel are pointed out here, which does not constitute a limitation on the embodiments of the present application.
[0170] The present application also provides a method 200 for verifying an SRv6 message. Fig. 9 , Fig. 9A flowchart of a method for verifying an SRv6 message provided in an embodiment of the present application is provided. Fig. 9 This method will be described. Fig. 9 The method shown can be implemented, for example, through S201 - S201 .
[0171] S201: The egress node of the IPSec tunnel receives an SRv6 message, where the SRv6 message is a message encapsulated in IPSec transmission mode, and the SRv6 message includes an AH and at least one SRH. The SRv6 message carries first indication information, and the first indication information is used to instruct the egress node to perform an AH check on the SRv6 message.
[0172] S202: The egress node performs an AH check on the SRv6 message according to the first indication information and the AH, where a check range of the AH check includes the at least one SRH.
[0173] Method 200 can be used to implement S103 and S104 executed by node R2 in method 100 mentioned in the above embodiment. When method 200 is used to implement S103 and S104 executed by node R2 in method 100 mentioned in the above embodiment, the exit node of the IPSec tunnel corresponds to node R2 in method 100, the SRv6 message corresponds to message 1 in method 100, and the first indication information corresponds to indication information 1 in method 100.
[0174] In one implementation manner, the SRH carries the first indication information.
[0175] In one implementation, the reserved field or extended TLV field in the SRH is used to carry the first indication information.
[0176] In one implementation, the reserved field is a flag field.
[0177] In one implementation manner, the destination address of the SRv6 message carries the first indication information.
[0178] In one implementation, the arguments field or the function field of the destination address carries the first indication information.
[0179] In one implementation, the egress node stores a correspondence between the destination address and the first indication information.
[0180] In one implementation, the destination address of the SRv6 message is a first segment identifier SID, and the first SID is the SID or BSID of the egress node. The SID of the egress node may correspond to R2.SID in method 100, and the BSID of the egress node may correspond to R2.BSID in method 100.
[0181] In one implementation, the destination address of the SRv6 message is a second SID, and the second SID is associated with the IPSec tunnel.
[0182] In one implementation, the second SID is an egress IP address of the IPSec tunnel. The egress IP address of the IPSec tunnel may correspond to the R2.AH.SID in method 100.
[0183] In one implementation, the SRv6 message includes second indication information, and the second indication information is used to indicate that the verification range of the AH verification includes the SRH. The second indication information may correspond to indication information 2 in method 100.
[0184] In one implementation manner, the AH includes the second indication information.
[0185] In one implementation manner, the second indication information is carried in a reserved field of the AH.
[0186] In one implementation, the egress node performs an AH check on the SRv6 message according to the first indication information and the AH, including:
[0187] The egress node performs an AH check on the SRv6 message according to the first indication information, the second indication information and the AH.
[0188] In one implementation, the verification range of the AH verification also includes the payload of the SRv6 message.
[0189] In one implementation, the verification scope of the AH verification also includes the IPv6 message header of the SRv6 message.
[0190] In one implementation, the egress node of the IPSec tunnel is an ingress node of the SRv6 trust domain.
[0191] In one implementation, the SRv6 message includes multiple SRHs, and the range of the AH check includes the multiple SRHs.
[0192] In one implementation, the method further includes:
[0193] The egress node forwards the SRv6 message that passes the AH check; or,
[0194] The egress node discards the SRv6 message that fails the AH check.
[0195] For the specific implementation of method 200, reference may be made to the above description of S103 and S104 in method 100, which will not be repeated here.
[0196] The present application also provides a method 300 for verifying an SRv6 message. Fig.10 , Fig.10 A flowchart of a method for verifying SRv6 messages provided in an embodiment of the present application is provided. Fig.10 This method will be described. Fig.10 The method shown can be implemented, for example, through S301 - S301 .
[0197] S301: The ingress node of the IPSec tunnel obtains an SRv6 message, where the SRv6 message is a message encapsulated in IPSec transmission mode, and the SRv6 message includes an AH and at least one SRH. The SRv6 message carries first indication information, and the first indication information is used to instruct the egress node of the IPSec tunnel to perform an AH check on the SRv6 message, and the check range of the AH check includes the at least one SRH.
[0198] S302: The ingress node sends the SRv6 message to the egress node.
[0199] Method 200 can be used to implement S101 and S102 executed by node R1 in method 100 mentioned in the above embodiment. When method 200 is used to implement S101 and S102 executed by node R1 in method 100 mentioned in the above embodiment, the entry node of the IPSec tunnel corresponds to node R1 in method 100, the exit node of the IPSec tunnel corresponds to node R2 in method 100, the SRv6 message corresponds to message 1 in method 100, and the first indication information corresponds to indication information 1 in method 100.
[0200] In one implementation manner, the SRH carries the first indication information.
[0201] In one implementation, the reserved field or TLV field in the SRH is used to carry the first indication information.
[0202] In one implementation, the reserved field is a flag field.
[0203] In one implementation manner, the destination address of the SRv6 message carries the first indication information.
[0204] In one implementation, the arguments field or the function field of the destination address carries the first indication information.
[0205] In one implementation manner, the egress node stores a correspondence between a destination address of the SRv6 message and the first indication information.
[0206] In one implementation, the destination address of the SRv6 message is a first segment identifier SID, and the first SID is the SID or BSID of the egress node. The SID of the egress node may correspond to R2.SID in method 100, and the BSID of the egress node may correspond to R2.BSID in method 100.
[0207] In one implementation, the destination address of the SRv6 message is a second SID, and the second SID is associated with the IPSec tunnel.
[0208] In one implementation, the second SID is an egress IP address of the IPSec tunnel. The egress IP address of the IPSec tunnel may correspond to the R2.AH.SID in method 100.
[0209] In one implementation, the SRv6 message includes second indication information, and the second indication information is used to indicate that the verification range of the AH verification includes the SRH. The second indication information may correspond to indication information 2 in method 100.
[0210] In one implementation manner, the AH includes the second indication information.
[0211] In one implementation manner, the second indication information is carried in a reserved field of the AH.
[0212] In one implementation, the verification range of the AH verification also includes the payload of the SRv6 message.
[0213] In one implementation, the verification scope of the AH verification also includes the IP packet header of the SRv6 packet.
[0214] In one implementation, the egress node of the IPSec tunnel is an ingress node of the SRv6 trust domain.
[0215] In one implementation, the SRv6 message includes multiple SRHs, and the range of the AH check includes the multiple SRHs.
[0216] For the specific implementation of method 300 , reference may be made to the above description of S101 and S102 in method 100 , which will not be repeated here.
[0217] In addition, the present application embodiment also provides a network device 1100, which is used as an egress node of an IPSec tunnel. Fig.11 shown. Fig.11 A schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device 1100 includes a transceiver unit 1101 and a processing unit 1102. The transceiver unit 1101 is used to perform the transceiver operation performed by the egress node of the IPSec tunnel in the above embodiment. The processing unit 1102 is used to perform operations other than the transceiver operation performed by the egress node of the IPSec tunnel mentioned in the above embodiment. For example, the transceiver unit 1101 is used to receive an SRv6 message, and the processing unit 1102 is used to perform an AH check on the SRv6 message according to the first indication information and AH carried by the SRv6 message.
[0218] In addition, the embodiment of the present application further provides a network device 1200, which is used as an entry node of an IPSec tunnel, see Fig.12 shown. Fig.12 A schematic diagram of the structure of a network device 1200 provided in an embodiment of the present application. The network device 1200 includes a transceiver unit 1201 and a processing unit 1202. The transceiver unit 1201 is used to perform the transceiver operation performed by the ingress node of the IPSec tunnel in the above embodiment. The processing unit 1202 is used to perform operations other than the transceiver operation performed by the ingress node of the IPSec tunnel mentioned in the above embodiment. For example, the processing unit 1202 is used to obtain an SRv6 message, and the transceiver unit 1201 is used to send the SRv6 message to the egress node of the IPSec tunnel.
[0219] In addition, the embodiment of the present application further provides a network device 1300, which is used as an exit node of an IPSec tunnel. Fig.13 As shown, Fig.13 A schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device 1300 includes a communication interface 1301 and a processor 1302 connected to the communication interface 1301. Among them, the communication interface 1301 is used for the sending and receiving operations performed by the egress node of the IPSec tunnel in the above embodiment; the processor 1302 is used for other operations except the sending and receiving operations performed by the egress node of the IPSec tunnel in the above embodiment. For example: the communication interface 1301 is used to execute the step of receiving SRV6; the processor 1302 is used to execute the step of performing AH verification on the SRv6 message according to the first indication information and AH carried by the SRv6 message.
[0220] In addition, the embodiment of the present application further provides a network device 1400, which is used as an entry node of an IPSec tunnel, see Fig.14 As shown, Fig.14 A schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device 1400 includes a communication interface 1401 and a processor 1402 connected to the communication interface 1401. The communication interface 1401 is used to perform the sending and receiving operations performed by the entry node of the IPSec tunnel in the above embodiment; the processor 1402 is used to perform other operations except the sending and receiving operations performed by the entry node of the IPSec tunnel in the above embodiment. For example, the processor 1402 is used to obtain an SRv6 message, and the communication interface 1401 is used to send the SRv6 message to the exit node of the IPSec tunnel.
[0221] In addition, the embodiment of the present application also provides a network device 1500, which is used as an exit node of an IPSec tunnel. Fig.15 As shown, Fig.15 A schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device 1500 includes a memory 1501 and a processor 1502. The memory 1501 is used to store program codes; the processor 1502 is used to run instructions in the program codes, so that the egress node of the IPSec tunnel executes the steps executed by the egress node of the IPSec tunnel in the above embodiment.
[0222] In addition, the embodiment of the present application further provides a network device 1600, which is used as an entry node of an IPSec tunnel, see Fig.16 As shown, Fig.16 A schematic diagram of the structure of a network device provided in an embodiment of the present application. The network device 1600 includes a memory 1601 and a processor 1602. The memory 1601 is used to store program codes; the processor 1602 is used to run instructions in the program codes, so that the entry node of the IPSec tunnel executes the steps executed by the entry node of the IPSec tunnel in the above embodiment.
[0223] An embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer is caused to execute the steps executed by the egress node of the IPSec tunnel in the above embodiment.
[0224] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer is caused to execute the steps performed by the entry node of the IPSec tunnel in the above embodiment.
[0225] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is run on a computer, it enables the computer to execute the steps performed by the ingress node of the IPSec tunnel or by the egress node of the IPSec tunnel in the above embodiment.
[0226] The processor mentioned in the present application can be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and a NP. The processor can also be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor can refer to one processor or include multiple processors.
[0227] The memory mentioned in the present application may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM); the memory may also include non-volatile memory (English: non-volatile memory), such as read-only memory (English: read-only memory, abbreviated: ROM), flash memory (English: flash memory), hard disk drive (English: hard disk drive, abbreviated: HDD) or solid-state drive (English: solid-state drive, abbreviated: SSD); the memory may also include a combination of the above-mentioned types of memory. The memory may refer to one memory or include multiple memories.
[0228] In a specific embodiment, the memory mentioned in the present application stores computer-readable instructions, and the computer-readable instructions include multiple software modules, such as a transceiver module and a processing module. After the processor executes each software module, it can perform corresponding operations according to the instructions of each software module. In this embodiment, the operation performed by a software module actually refers to the operation performed by the processor according to the instructions of the software module. For example, in the method 200 described in the embodiment of the present application, the transceiver module can be used to implement the related receiving or sending operations in the method 200, for example, the transceiver module is used to perform the operation of receiving the SRv6 message in S201. The processing module is used to perform the operation of processing the transceiver, for example, the processing module is used to perform the operation of performing AH check on the SRv6 message according to the first indication information and the AH in S202.
[0229] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0230] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0231] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical business division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0232] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0233] In addition, each business unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software business units.
[0234] If the integrated unit is implemented in the form of a software business unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0235] Those skilled in the art will appreciate that in one or more of the above examples, the services described in the present invention may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, the services may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media may be any available media that can be accessed by a general-purpose or special-purpose computer.
[0236] The above specific implementation modes further describe the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation modes of the present invention.
[0237] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for verifying an SRv6 message, characterized in that: The method comprises: An egress node of an Internet Protocol security (IPSec) tunnel receives an Internet Protocol version 6 (SRv6) segment routing (SRv6) message, where the SRv6 message is a message encapsulated in IPSec transport mode, the SRv6 message includes an authentication header (AH) and at least one segment routing header (SRH), and the SRv6 message carries first indication information, where the first indication information is used to instruct the egress node to perform an AH check on the SRv6 message. The egress node performs an AH check on the SRv6 message according to the first indication information and the AH, where a check range of the AH check includes the at least one SRH.
2. The method according to claim 1, characterized in that The SRH carries the first indication information.
3. The method according to claim 2, characterized in that The reserved field or extended type length value TLV field in the SRH is used to carry the first indication information.
4. The method according to claim 3, characterized in that The reserved field is a flag field.
5. The method according to claim 1, wherein The destination address of the SRv6 message carries the first indication information.
6. The method according to claim 5, characterized in that The arguments field or function field of the destination address carries the first indication information.
7. The method according to claim 5, characterized in that The egress node stores a correspondence between the destination address and the first indication information.
8. The method according to any one of claims 1 to 7, characterized in that The destination address of the SRv6 message is the first segment identifier SID, and the first segment identifier SID is the SID or BSID of the egress node.
9. The method according to any one of claims 1 to 7, characterized in that: The destination address of the SRv6 message is a second SID, and the second SID is associated with the IPSec tunnel.
10. The method according to claim 9, characterized in that The second SID is the egress IP address of the IPSec tunnel.
11. The method according to any one of claims 1 to 7, characterized in that: The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
12. The method according to claim 11, characterized in that The AH includes the second indication information.
13. The method according to claim 12, characterized in that The reserved field of the AH carries the second indication information.
14. The method according to claim 8, characterized in that The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
15. The method according to claim 9, characterized in that The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
16. The method according to claim 10, characterized in that The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
17. The method according to claim 11, characterized in that The egress node performs AH verification on the SRv6 message according to the first indication information and the AH, including: The egress node performs an AH check on the SRv6 message according to the first indication information, the second indication information, and the AH.
18. The method according to claim 12, characterized in that The egress node performs AH verification on the SRv6 message according to the first indication information and the AH, including: The egress node performs an AH check on the SRv6 message according to the first indication information, the second indication information, and the AH.
19. The method according to claim 13, wherein The egress node performs AH verification on the SRv6 message according to the first indication information and the AH, including: The egress node performs an AH check on the SRv6 message according to the first indication information, the second indication information, and the AH.
20. The method according to any one of claims 1 to 7, characterized in that: The verification range of the AH verification also includes the payload of the SRv6 message.
21. The method according to claim 8, characterized in that The verification range of the AH verification also includes the payload of the SRv6 message.
22. The method according to claim 9, characterized in that The verification range of the AH verification also includes the payload of the SRv6 message.
23. The method according to claim 11, wherein The verification range of the AH verification also includes the payload of the SRv6 message.
24. The method according to any one of claims 10 or 12-19, characterized in that: The verification range of the AH verification also includes the payload of the SRv6 message.
25. The method according to any one of claims 1 to 7, characterized in that The verification scope of the AH verification also includes the IPv6 message header of the SRv6 message.
26. The method according to claim 8, characterized in that The verification scope of the AH verification also includes the IPv6 message header of the SRv6 message.
27. The method according to claim 9, characterized in that The verification scope of the AH verification also includes the IPv6 message header of the SRv6 message.
28. The method according to claim 11, characterized in that The verification scope of the AH verification also includes the IPv6 message header of the SRv6 message.
29. The method according to claim 20, characterized in that The verification scope of the AH verification also includes the IPv6 message header of the SRv6 message.
30. The method according to any one of claims 10 or 12-19, characterized in that: The verification scope of the AH verification also includes the IPv6 message header of the SRv6 message.
31. The method according to any one of claims 1 to 7, 10, 12 to 19, 21 to 23, or 26 to 29, wherein: The egress node of the IPSec tunnel is the ingress node of the SRv6 trust domain.
32. The method according to any one of claims 1-7, 10, 12-19, 21-23, or 26-29, wherein: The SRv6 message includes multiple SRHs, and the range of the AH check includes the multiple SRHs.
33. The method according to any one of claims 1-7, 10, 12-19, 21-23, or 26-29, wherein: The method further comprises: The egress node forwards the SRv6 message that passes the AH check; or The egress node discards the SRv6 message that fails the AH check.
34. A method for verifying an SRv6 message, characterized in that: The method comprises: An ingress node of an Internet Protocol security (IPSec) tunnel obtains an Internet Protocol version 6 (Internet Protocol) segment routing (SRv6) message, where the SRv6 message is a message encapsulated in IPSec transport mode, the SRv6 message includes an authentication header (AH) and at least one segment routing header (SRH), and the SRv6 message carries first indication information, where the first indication information is used to instruct the egress node of the IPSec tunnel to perform an AH check on the SRv6 message, where a check range of the AH check includes the at least one SRH. The ingress node sends the SRv6 message to the egress node.
35. The method according to claim 34, wherein The SRH carries the first indication information.
36. The method according to claim 35, characterized in that The reserved field or extended type length value TLV field in the SRH is used to carry the first indication information.
37. The method according to claim 36, wherein The reserved field is a flag field.
38. The method according to claim 34, wherein The destination address of the SRv6 message carries the first indication information.
39. The method according to claim 38, characterized in that The arguments field or function field of the destination address carries the first indication information.
40. The method according to claim 38, wherein The egress node stores a correspondence between the destination address of the SRv6 message and the first indication information.
41. The method according to any one of claims 34 to 40, wherein: The destination address of the SRv6 message is the first segment identifier SID, and the first segment identifier SID is the SID or BSID of the egress node.
42. The method according to any one of claims 34 to 40, wherein: The destination address of the SRv6 message is a second SID, and the second SID is associated with the IPSec tunnel.
43. The method according to claim 42, wherein The second SID is the egress IP address of the IPSec tunnel.
44. The method according to any one of claims 34 to 40, wherein: The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
45. The method according to claim 44, wherein The AH includes the second indication information.
46. The method according to claim 45, characterized in that The reserved field of the AH carries the second indication information.
47. The method according to claim 41, wherein The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
48. The method according to claim 42, wherein The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
49. The method according to claim 43, wherein The SRv6 message includes second indication information, where the second indication information is used to indicate that a verification range of the AH verification includes the SRH.
50. The method according to any one of claims 34-40 or 43 or any one of claims 45-49, characterized in that: The verification range of the AH verification also includes the payload of the SRv6 message.
51. The method according to claim 41, wherein The verification range of the AH verification also includes the payload of the SRv6 message.
52. The method according to claim 42, wherein The verification range of the AH verification also includes the payload of the SRv6 message.
53. The method according to claim 44, wherein The verification range of the AH verification also includes the payload of the SRv6 message.
54. The method according to any one of claims 34-40 or 43 or any one of 45-49 or any one of 51-53, characterized in that: The verification scope of the AH verification also includes the IP header of the SRv6 message.
55. The method according to claim 41, wherein The verification scope of the AH verification also includes the IP header of the SRv6 message.
56. The method according to claim 42, wherein The verification scope of the AH verification also includes the IP header of the SRv6 message.
57. The method according to claim 44, wherein The verification scope of the AH verification also includes the IP header of the SRv6 message.
58. The method according to claim 50, wherein The verification scope of the AH verification also includes the IP header of the SRv6 message.
59. The method according to any one of claims 34-40 or 43 or any one of claims 45-49 or any one of claims 51-53 or any one of claims 55-58, characterized in that: The egress node of the IPSec tunnel is the ingress node of the SRv6 trust domain.
60. The method according to any one of claims 34-40 or 43 or any one of claims 45-49 or any one of claims 51-53 or any one of claims 55-58, characterized in that: The SRv6 message includes multiple SRHs, and the range of the AH check includes the multiple SRHs.
61. A network device used as an exit node of an Internet Protocol Security (IPSec) tunnel, characterized in that: include: Communication interface; and a processor connected to the communication interface; According to the communication interface and the processor, the egress node is configured to execute the method according to any one of claims 1 to 33.
62. A network device used as an entry node of an Internet Protocol Security (IPSec) tunnel, characterized in that: include: Communication interface; and a processor connected to the communication interface; According to the communication interface and the processor, the entry node is configured to execute the method according to any one of claims 34 to 60.
63. A network device used as an exit node of an Internet Protocol Security (IPSec) tunnel, characterized in that: The egress node includes a memory and a processor; The memory is used to store program code; The processor is configured to execute instructions in the program code so that the egress node executes the method according to any one of claims 1 to 33.
64. A network device used as an entry node of an Internet Protocol Security (IPSec) tunnel, characterized in that: The entry node includes a memory and a processor; The memory is used to store program code; The processor is configured to execute instructions in the program code so that the entry node executes the method described in any one of claims 34 to 60.
65. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 33 or claims 34 to 60.
66. A communication system, characterized in that Includes the network device described in claim 61 or 63 and the network device described in claim 62 or 64.
