Message processing method, device and equipment and storage medium

By using the node jump field and SID offset calculation during SRv6 packet forwarding, the problem of chip bandwidth waste in SRv6 packet forwarding is solved, and efficient packet processing and forwarding are achieved.

CN119854194BActive Publication Date: 2025-11-21SUZHOU CENTEC COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510014853.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-11-21
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

During SRv6 packet forwarding, when the next n SIDs adjacent to the current SID need to be replaced in the target address field, n complete chip processing steps are required, resulting in wasted chip bandwidth and low packet processing efficiency.

Method used

Add a node jump field to the SID table of the node device to record the node jump number, and calculate the SID offset by using the SL value of the SL field and the node jump number to obtain the target SID. This avoids directly replacing the next n adjacent SIDs and only requires one chip processing step.

Benefits of technology

It saves chip bandwidth and improves message processing efficiency. Especially when the next-hop node device fails or the bandwidth load is too high, it can bypass abnormal devices and ensure that messages are forwarded smoothly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854194B_ABST
    Figure CN119854194B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a message processing method, device and equipment and a storage medium, wherein the method comprises: when a message is received, determining whether there is a SID in the SID table that matches the current SID stored in the target address field of the message; wherein the message is an SRv6 message or a G-SRv6 message or a U-SRv6 message; when there is a SID in the SID table that matches the current SID, calculating a SID offset according to the SL value of the SL field in the message and the number of node hops; obtaining a target SID from the message according to the SID offset; updating the current SID to the target SID, and obtaining a target message for forwarding to the target SID according to the number of node hops and the SL value. Thus, in a complete chip processing flow, any one SID after the current SID replaces the current SID in the target address field of the message, which can well reduce the bandwidth burden of the chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and more specifically, to a message processing method, apparatus, device, and storage medium. Background Technology

[0002] Segment Routing (SR) is a routing and forwarding mechanism that uses source node path selection. SRv6 (IPv6 SR) is an application of SR in IPv6 networks. When forwarding raw packets entering an SRv6 domain using SRv6, the device receiving the raw packet in the SRv6 domain acts as the source node for forwarding it. In this case, it needs to encapsulate the received raw packet with its SRH (Segment Routing Header) and SID List (Segment Identifier List) to obtain the SRv6 packet. (See [link to relevant documentation]). Figure 1 , Figure 1 This is a simplified diagram of the message structure of an SRv6 message. As can be seen, an SRv6 message includes the IPv6Header field, the SRH field, and the SID List field.

[0003] The IPv6 header includes at least the source address field encapsulated in SRv6 and the destination address field of the SRv6 packet. The SRH field contains seven fields, one of which is the Segment Left (SL) field, indicating the remaining number of unprocessed SIDs in the SID List field. It indicates the position of the next node's SID in the SID List field, initially set to n1 (where n represents the number of SIDs in the SID List field). The SL value in the SRv6 packet decreases by 1 for each node traversed. The SID List field stores the identifiers of the forwarding nodes along the forwarding path of the SRv6 packet. The SID List field contains multiple fields, each storing a SID (a 128-bit IP address) to identify a forwarding node. The SIDs in the SID List field are stored in reverse order, meaning the order in which the SIDs of each node are stored is the reverse of the order of the nodes traversed by the SRv6 packet in the forwarding path.

[0004] Therefore, during the forwarding of SRv6 packets, the SRv6 packet needs to be forwarded sequentially to each SID node according to all the SIDs recorded in the SID List field of the SRv6 packet. This means that each node can only obtain the SID of its adjacent next-hop node from the SID List field and replace the SID in the destination address field of the SRv6 packet with the SID of that next-hop node. This operation requires one complete chip processing cycle. In other words, one complete chip processing cycle can only replace the next adjacent SID in the destination address field. If it is necessary to replace the next n adjacent SIDs in the destination address field, n complete chip processing cycles are required, which leads to wasted chip bandwidth and is not conducive to improving the forwarding efficiency of SRv6 packets. G-SRv6 (Generalized SRv6) packets also have the same problem. Summary of the Invention

[0005] In view of this, in order to at least solve the technical problem in the related technology that when the next n SIDs adjacent to the current SID need to be replaced into the target address field, n complete chip processing steps are required, which leads to chip bandwidth waste and low packet processing efficiency, the purpose of this invention is to provide a packet processing method, apparatus, device and storage medium.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0007] A first aspect of this invention provides a message processing method applied to a node device, wherein the node device stores a SID table, the SID table storing the SID of the domain in which the node device resides, and the node hop count; the message processing method includes:

[0008] Upon receiving a message, determine whether there exists a SID in the SID table that matches the current SID stored in the target address field of the message; wherein the message is an SRv6 message, a G-SRv6 message, or a U-SRv6 message;

[0009] When a SID matching the current SID exists in the SID table, the SID offset is calculated based on the SL value of the SL field in the message and the node hop count.

[0010] Obtain the target SID from the message based on the SID offset;

[0011] The current SID is updated to the target SID, and the SL value is updated according to the node hop count to obtain the target packet for forwarding to the target SID.

[0012] A second aspect of the present invention provides a message processing apparatus applied to a node device, the node device storing a SID table, the SID table storing the SID of the domain in which the node device is located and the node hop count; the message processing apparatus includes:

[0013] The matching module is configured to: upon receiving a message, determine whether there exists a SID in the SID table that matches the current SID stored in the target address field of the message; wherein the message is an SRv6 message or a G-SRv6 message;

[0014] The calculation module is configured to: when there is a SID in the SID table that matches the current SID, calculate the SID offset based on the SL value of the SL field in the message and the node hop count;

[0015] The acquisition module is configured to: acquire the target SID from the packet based on the SID offset;

[0016] The editing module is configured to update the current SID to the target SID and update the SL value according to the node hop count to obtain the target packet for forwarding to the target SID.

[0017] A third aspect of the present invention provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the message processing method provided in the first aspect above.

[0018] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the message processing method provided in the first aspect described above.

[0019] The message processing method, apparatus, device, and storage medium provided in this invention add a node hop field to the SID table stored in the node device used for forwarding messages. This node hop field indicates the number of next-hop node devices that the node device needs to skip during message forwarding, and records the node hop count in this field. In other words, the SID table records not only the SID of the domain where the node device is located but also the node hop count. Therefore, when a node device receives a message and the SID table contains a matching SID to the current SID stored in the target address field of the message, it can calculate the SID offset based on the SL value of the SL field in the message and the node hop count. Then, the corresponding target SID can be obtained from the message based on the SID offset. Therefore, in this invention, the acquisition of the target SID depends on the SL value and the node hop count. That is, by using the node hop count, any desired SID after the current SID can be obtained from the message as the target SID. It is evident that the obtained target SID is not necessarily adjacent to the current SID.

[0020] Therefore, the message processing method, apparatus, device, and storage medium provided in this embodiment of the invention can, when it is necessary to replace the next n SIDs adjacent to the current SID in the target address field, for example, when a device in the next-hop node of a node device fails or a device with excessive bandwidth load causes the device to malfunction, the node hop number can be set to n (n is a positive integer) to guide the message to bypass the device that has failed or has excessive bandwidth load. Based on this, the node device only needs to perform one complete chip processing flow instead of n complete chip processing flows, which can save chip bandwidth and improve message processing efficiency.

[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A simplified diagram of the message structure of an SRv6 message is shown.

[0024] Figure 2 This diagram illustrates a structural block diagram of an electronic device provided by an embodiment of the present invention.

[0025] Figure 3 A flowchart of a message processing method provided by an embodiment of the present invention is shown;

[0026] Figure 4 This diagram illustrates the location of a target SID in an SRv6 message according to an embodiment of the present invention.

[0027] Figure 5 This diagram illustrates the location of a target SID in a G-SRv6 message according to an embodiment of the present invention.

[0028] Figure 6 This diagram illustrates the location of a target U-SID in a U-SRv6 message according to an embodiment of the present invention.

[0029] Figure 7 This is a schematic diagram of the destination address field and IP address field in a U-SRv6 message provided in an embodiment of the present invention;

[0030] Figure 8 A functional block diagram of a message processing device provided in an embodiment of the present invention is shown. Detailed Implementation

[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0032] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0033] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0034] To address the technical problem in related technologies where replacing the next n adjacent SIDs in the target address field requires n complete chip processing steps, leading to wasted chip bandwidth and low packet processing efficiency, this invention provides a packet processing method. This method adds a node hop field to the SID table stored in the node device forwarding the packet. This node hop field indicates the number of next-hop nodes the node device needs to skip during packet forwarding, and records the node hop count. In other words, the SID table records not only the SID of the node device's domain but also the node hop count. Therefore, when a node device receives a packet and a matching SID exists in the SID table that matches the current SID stored in the target address field of the packet, it can calculate the SID offset based on the SL value of the SL field in the packet and the node hop count. Then, the corresponding target SID can be retrieved from the packet based on the SID offset. Therefore, in this embodiment of the invention, the acquisition of the target SID depends on the SL value and the node hop count. That is, by using the node hop count, it is possible to obtain any desired SID after the current SID from the packet as the target SID. It can be seen that the obtained target SID is not necessarily adjacent to the current SID.

[0035] Therefore, the message processing method provided in this embodiment of the invention can replace the next n SIDs adjacent to the current SID in the target address field. For example, if a device in the next-hop node of a node device fails or its bandwidth load is too high, causing the device to malfunction, the message can be guided to bypass the device that has failed or has too high bandwidth load by simply setting the node hop number to n. Based on this, the node device only needs to perform one complete chip processing flow instead of n complete chip processing flows, which can save chip bandwidth and improve message processing efficiency.

[0036] The message processing method provided by this invention can be applied to electronic devices. Please refer to [link / reference]. Figure 2 This is a structural block diagram of an electronic device. The electronic device 200 includes a memory 210, a processor 220, and a communication module 230. The memory 210, processor 220, and communication module 230 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0037] The memory is used to store programs or data. The memory may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc.

[0038] The processor is used to read / write data or programs stored in memory and to perform the corresponding functions.

[0039] The communication module is used to establish communication connections between electronic devices and other communication terminals via a network, and to send and receive data via the network.

[0040] It should be understood that, Figure 2 The structure shown is only a schematic diagram of an electronic device; the electronic device may also include components that are larger than... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown. Figure 2 The components shown can be implemented using hardware, software, or a combination thereof.

[0041] In some embodiments, the electronic device may be an edge device of a service provider, such as a node device. This node device can process SRv6, G-SRv6, or U-SRv6 messages, including editing and forwarding.

[0042] The following combination Figure 3 The message processing method provided in the embodiments of the present invention will be described below. Figure 3 This is a flowchart of a message processing method provided in an embodiment of the present invention. The message processing method is applied in a node device, the node device storing a SID table, the SID table storing the SID of the domain where the node device is located, and the node hop count. The message processing method includes:

[0043] In step S100, when a message is received, it is determined whether there is a SID in the SID table that matches the current SID stored in the target address field of the message; wherein the message is an SRv6 message, a G-SRv6 message, or a U-SRv6 message;

[0044] In step S200, when there is a SID in the SID table that matches the current SID, the SID offset is calculated based on the SL value of the SL field in the message and the node hop count.

[0045] In step S300, the target SID is obtained from the message based on the SID offset;

[0046] In step S400, the current SID is updated to the target SID, and the SL value is updated according to the node hop count to obtain the target packet for forwarding to the target SID.

[0047] During packet forwarding, there may be a need to forward packets to the next n SIDs adjacent to the current SID. Generally, such needs can be generated by relevant personnel on the server side based on actual requirements, or they can be caused by the failure or excessive workload of the next or next n SIDs adjacent to the current SID. For example, the bandwidth load rate of a device in the next-hop node of the current node device may be too high, or a device may have failed. The excessive load rate may indicate that the bandwidth load rate exceeds the set load rate threshold, while the device failure may indicate that the device is disconnected or has an internal fault that prevents it from working properly. In these cases, a node hop field can be configured in the SID table stored in the current node device to record the number of node hops. This will guide the current node device to skip the corresponding number of SIDs after the current SID in the packet, directly obtain the required target SID, and perform the corresponding update and forwarding processing on the packet.

[0048] In the above, the node hop count can be any number greater than or equal to 0. However, for SRv6 messages, it cannot exceed the SL-1 value in the SL field of the message; otherwise, SL-1-n will be less than 0, resulting in a message error. Similarly, for G-SRv6 messages, the node hop count cannot exceed SL×4+SI-1. The meanings of SL and SI are detailed below. For U-SRv6 messages, the node hop count cannot exceed the number of all SIDs following the current SID in the SIDList field, which can be understood as the number of remaining SIDs. Otherwise, the target SID cannot be found among the remaining SIDs, resulting in a message error.

[0049] As can be seen, the node jump count can be determined based on the operational status of all node devices within the domain of the current node device. The operational status includes at least one of the following: the bandwidth load rate of the node device, and whether the node device is faulty. For example, if the next node device after the current node device is in an abnormal operational status, the node jump count can be set to 1; if the next three nodes after the current node device are in an abnormal operational status, the node jump count can be set to 3, and so on. If the next n nodes after the current node device are in an abnormal operational status, the node jump count can be set to n. Furthermore, to update the node jump count promptly based on changes in the operational status of node devices, in some examples, the operational status of all the aforementioned node devices can be obtained in real-time or periodically, and the node jump count can be updated based on the currently obtained operational status. For example, assuming the next node device after the current node device has recovered from an abnormal state, the node jump count, originally set to 1, can be updated to 0. This improves the timeliness and accuracy of the node jump count, which is beneficial for further improving the reliability and effectiveness of packet forwarding.

[0050] As can be seen from the above, the node device using the message processing method provided in this embodiment of the invention can replace any SID after the current SID in the target address field of the message in a complete chip processing flow, which effectively saves chip bandwidth and improves message processing efficiency to a certain extent. The following describes the process of the node device processing messages in conjunction with steps S100 to S400:

[0051] When a node device receives a packet, it executes step S100. First, it retrieves the current SID from the packet's destination address field. The current SID can represent an IPv6 address. Then, it checks the SID table to see if a matching SID exists. If no matching SID exists in the SID table, the packet cannot be forwarded normally and is discarded. If a matching SID exists in the SID table, step S200 is executed to calculate the SID offset based on the SL value in the SL field of the packet and the node hop count.

[0052] For SRv6 messages, G-SRv6 messages, and U-SRv6 messages, this embodiment of the invention provides different SID offset calculation methods, namely:

[0053] When the message is an SRv6 message, the step S200 above, which calculates the SID offset based on the SL value of the SL field in the message and the node hop count, includes:

[0054] In step S211, the SID offset is obtained by subtracting the sum of the node jump number and 1 from the SL value.

[0055] Assuming the node jump number is n and the SID offset is D, the calculation principle of step S211 can be expressed by the following formula (1):

[0056] D = SL - n - 1 Formula (1)

[0057] When the message is a G-SRv6 message, the SID offset includes the SI offset and the SL offset. In this case, the step S200 above, which calculates the SID offset based on the SL value of the SL field in the message and the node hop count, includes:

[0058] In step S221, the SI value of the SI field in the message is subtracted from the sum of the node jump number and 1 to obtain the initial SI offset;

[0059] In step S222, if the initial SI offset is less than zero, the SL offset is obtained by subtracting the quotient of the difference between the node jump number and the SI value and 4 from the difference between the SL value and 1; and the SI offset is obtained by subtracting the remainder of the difference between the node jump number and the SI value and 4 from 3.

[0060] In step S223, if the initial SI offset is greater than or equal to zero, the initial SI offset is used as the SI offset, and the SL offset is set to the SL value. It should be noted that the SL value is still the SL value recorded in the original message.

[0061] As can be seen from step S221, the initial offset D of SI is... SI =SI-1-n; where the SI (SIDIndex) field of the G-SRv6 message is an additional pointer used in combination with the SL field to point to the current G-SID. As can be seen from step S222, in D... SI When <0, the SL offset D11 = SL-1 - (n-SI) / 4, and the SI offset D12 = 3 - (n-SI)%4.

[0062] As can be seen from step S223, in D SI When ≥0, SL offset D21 = SL value, SI offset D22 = D SI =SI-1-n. As can be seen from the above, for SRv6 messages, the SID offset has only one value; while for G-SRv6 messages, the SID offset has two values, namely the SI offset and the SL offset.

[0063] In the case of a U-SRv6 message, please refer to Figure 6 , Figure 6This is a schematic diagram of the location of a target U-SID in a U-SRv6 message provided by an embodiment of the present invention. The SID List field in the U-SRv6 message includes multiple groups of U-SIDs. Each group of U-SIDs includes a prefix field and multiple U-SID fields. The information of the prefix field of U-SIDs in the same group is the same, while the information of the prefix field of U-SIDs in different groups is different. For example, for the group of U-SIDs Pefix[1], the information of its prefix field is the information referred to by Pefix[1], and its multiple U-SID fields are uSID[1][4], uSID[1][3], uSID[1][2], uSID[1][1], and uSID[1][0]. It can be seen that in uSID[i][j], i indicates the label of the corresponding prefix information, and j represents the j-th uSID in a group of U-SIDs. Here, the label refers to the value of i in Pefix[i]. For example, the label of Pefix[1] is 1. In this way, among multiple uSID[i][j], uSID[i][j] with the same value of i also have the same prefix information and belong to the same group of U-SIDs.

[0064] Unlike the two types of messages mentioned above, the U-SRv6 message includes an IP address field in addition to the IPv6 Header, SRH, and SIDList fields. The current SID of the U-SRv6 message is formed by the current prefix information and the current uSID, such as... Figure 6 The target address field shown has a current SID of Pefix[3]+uSID[3][4].

[0065] Furthermore, the IP address field is configured between the destination address field and the SRH field, and the U-SID stored in the IP address field belongs to the same group as the U-SID stored in the destination address field. For example... Figure 6 As shown, the IP address field is located between the field where the current SID is located (i.e., the field where DestAddress(Pefix[3]) is located and the field where uSID[3][4] is located) and the NextHeader field. The IP address field records other uSIDs that are the same as the current prefix field information and are located after the current uSID (uSID[3][4]) - uSID[3][3], uSID[3][2], uSID[3][1], and uSID[3][0].

[0066] Accordingly, in step S200 above, the step of calculating the SID offset based on the SL value of the SL field in the message and the node hop count includes:

[0067] In step S231, if the number of node jumps is less than or equal to 3 and the U-SID corresponding to the number of node jumps is non-zero, the sum of twice the sum of the number of node jumps and 1 and the sum of 6 is used as the SID offset.

[0068] In step S232, if the node hop count is greater than 3 or the U-SID corresponding to the node hop count is zero, the SID offset is calculated based on the SL value, the node hop count, and the starting position of the last non-zero U-SID in the IP address field.

[0069] As can be seen from steps S231 and S232 above, for U-SRv6 messages, the SID offset can be calculated in two cases:

[0070] In the first case, when the node hop count is less than or equal to 3 and the corresponding U-SID is non-zero, the sum of twice the sum of the node hop count and 1, plus 6, is used as the SID offset. That is, D1 = 2 × (n + 1) + 6, where D1 is the SID offset in bytes, and n is the node hop count. Therefore, the SL value is not needed to calculate the SID offset D1 in this case. A non-zero U-SID corresponding to the node hop count indicates that the U-SID is valid, ensuring normal packet forwarding.

[0071] In the above, the U-SID corresponding to the node hop count is the U-SID located in the range of (63-n×16, 48-n×16) in the IP address field. It can be seen that the length of a U-SID is 16 bits. For ease of description, the U-SID corresponding to the node hop count n is denoted as uSID(63-n×16, 48-n×16).

[0072] by Figure 7 As shown in the example, Figure 7 This is a schematic diagram of the destination address field and IP address field in a U-SRv6 message provided in an embodiment of the present invention, wherein the IP address field is... Figure 7 Bits 63 to 0 are used to store uSID[3][3], bits 47 to 32 are used to store uSID[3][2], bits 31 to 16 are used to store uSID[3][1], and bits 15 to 0 are used to store uSID[3][0]. Based on this, assuming n = 2, uSID(63-n×16, 48-n×16) is the content recorded in the byte segment from bit 31 to bit 16 in the IP address field, that is, Figure 7 The IP address field shown contains uSID[3][2].

[0073] The second scenario: When the node hop count is greater than 3 or the U-SID corresponding to the node hop count is zero, the process of calculating the SID offset based on the SL value, the node hop count, and the starting position of the last non-zero U-SID in the IP address field can be expressed by the following formula (2):

[0074]

[0075] In formula (2), D2 is the SID offset in bytes; SL is the SL value in the packet; n is the node hop count; X represents the bit value corresponding to the starting position of the last non-zero U-SID in the IP address field, for example, with Figure 7 For example, assuming uSID[3][3], uSID[3][2], and uSID[3][1] are all non-zero, while uSID[3][0] is zero, it can be seen that the last non-zero U-SID in the IP address field is uSID[3][1], and its starting position is recorded as 31 in the IP address field. Based on this, the value of X is 31. It can be seen that in the second case, the SID offset D2 needs to be calculated using the SL value and the node hop count.

[0076] After calculating the SID offset, step S300 can be executed to obtain the target SID from the packet based on the SID offset. Since the offset calculation methods for SRv6 packets, G-SRv6 packets, and U-SRv6 packets are different, and the packet information also differs, this embodiment of the invention also provides corresponding target SID acquisition schemes for these three types of packets, namely:

[0077] When the message is an SRv6 message, the SID List field of the SRv6 message includes multiple SID fields, all of which have the same length. Accordingly, step S300 above, the step of obtaining the target SID from the message based on the SID offset, includes:

[0078] In step S311, the starting position of the table in the SID List field of the message is obtained;

[0079] In step S312, the starting position of the target SID is determined based on the table starting position and the SID offset;

[0080] In step S313, the target SID is obtained based on the starting position and field length of the target SID.

[0081] The following example illustrates the principles behind steps S311 to S313:

[0082] Please see Figure 4 , Figure 4This is a schematic diagram of the location of the target SID in an SRv6 packet provided by an embodiment of the present invention. The SID List field shown in the figure contains four SIDs, namely SID[3], SID[2], SID[1] and SID[0], with SL value = 3. The current SID in the Dest Address field is SID[3]. For this structure of SRv6 packet, the starting position EditBase of the table can be obtained by the calculation method of the starting position of the SID List field of SRv6 packet in related technologies. For example, the length L1 from the beginning of the packet to the beginning of the IPv6 basic header can be obtained by related technologies, and then the sum of the length L1, the length of the IPv6 basic header and the length of the SRH header (i.e., the SRH field) can be calculated to obtain the starting position EditBase of the table. The starting position EditBase of the table is calculated in bytes.

[0083] After obtaining the table start position EditBase, step S312 can be executed to calculate the target SID start position EditOffset based on the table start position EditBase and the SID offset. Assuming the node jump number n = 1, then EditOffset = EditBase + D × EditLength = EditBase + (SL - n - 1) × EditLength = EditBase + (3 - 1 - 1) × EditLength = EditBase + EditLength, where EditLength is the field length of a SID. For SRv6 messages, EditLength is generally 16 bytes. Thus, the target SID start position EditOffset can be obtained. In the above example, EditOffset points to the start position of SID[1]. The target SID start position EditOffset is calculated in bytes.

[0084] After obtaining the starting position EditOffset of the target SID, step S313 can be executed. Starting from the starting position EditOffset of the target SID, information of length EditLength is obtained from the message, thus obtaining the information of the target SID. Continuing with the above example, the target SID at this time is SID[1].

[0085] As can be seen from the above, the target SID is essentially the SID whose number is the current SID minus the sum of the node jump count and 1. Under normal circumstances, the current SID's number is the same as the SL value. Therefore, from... Figure 4As can be seen from the surface level, the target SID to be obtained is SL-n-1. The number can be understood as 3, 2, 1 and 0 in SID[3], SID[2], SID[1] and SID[0].

[0086] Based on a similar principle, when the message is a G-SRv6 message, the SID List field of the G-SRv6 message includes multiple G-SID fields, all of which have the same length. Accordingly, in step S300 above, obtaining the target SID from the message based on the SID offset includes:

[0087] In step S321, the starting position of the table in the SID List field of the message is obtained;

[0088] In step S322, the starting position of the target SID is determined based on the table starting position, the SL offset, and the SI offset.

[0089] In step S323, the target SID is obtained based on the starting position and field length of the target SID.

[0090] The following example illustrates the principles behind steps S321 to S322:

[0091] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating the location of the target SID in a G-SRv6 message provided in an embodiment of the present invention. The G-SID List field shown in the diagram contains 13 SIDs, namely SID[3][3], SID[3][2], SID[3][1], SID[3][0], SID[2][3], SID[2][2], SID[2][1], SID[2][0], SID[1][3], SID[1][2], SID[1][1], SID[1][0], and SID[0]. The SL value is 3, the SI value is 3, and the current SID in the Dest Address field is G-SID[3][3]. For ease of description below, 'a' in G-SID[a][b] is referred to as the SL number, and 'b' is referred to as the SI number. For this structure of G-SRv6 message, the starting position of the table can be obtained by using the calculation method of the starting position of the G-SID List field of G-SRv6 message in related technologies. The starting position of the G-SID List field is calculated in bytes.

[0092] After obtaining the starting position of the G-SID List field, the technical principle for obtaining the target SID through steps S322-S323 is similar to that in steps S312-S313 above. The difference is that G-SID has an additional pointer SI. Therefore, it is necessary to combine the SL offset and the SI offset to locate the target SID. The technical principle involved in the location can utilize relevant technologies based on... Figure 5 As can be seen from the relevant records of steps S312 to S313, they will not be repeated here.

[0093] Similar to the location of the target SID, in D SI When <0, the SL number of the target SID is the difference between the SL number of the current G-SID and 1, minus the quotient of the difference between the node jump number and the SI value and 4. The obtained value is the SL offset D11 in step S222 above, that is, the SL number of the target SID = SL-1-(n-SI) / 4, and the SI number of the target SID is the SI offset in step S222 above, that is, the SI number of the target SID = D12 = 3-(n-SI)%4.

[0094] Conversely, in D SI When ≥0, the SL number of the target SID is the same as the SL number of the current G-SID, which is equal to the SL offset D21 of the SL value in the SL field. The SI number of the target SID is the difference between the SI number of the current G-SID and 1, minus the node jump number. This value is the SI offset D22 in step S222 above, that is, the SI number of the target SID = D SI =SI-1-n.

[0095] As can be seen, both SRv6 and G-SRv6 messages can use the final calculated offset as the target SID number, thus allowing for quick identification of the specific target SID.

[0096] Based on a similar principle, when the message is a U-SRv6 message, the corresponding step S300 above, obtaining the target SID from the message according to the SID offset, includes:

[0097] In step S331, if the number of node hops is less than or equal to 3 and the U-SID corresponding to the number of node hops is non-zero, the starting position of the target address field in the message is taken as the starting position of the table; or, if the number of node hops is greater than 3 or the U-SID corresponding to the number of node hops is zero, the starting position of the SID List field in the message is taken as the starting position of the table.

[0098] In step S332, the starting position of the target U-SID is determined based on the table starting position and the SID offset;

[0099] In step S333, the target SID is obtained based on the starting position of the target U-SID and its field length.

[0100] The following example illustrates the principles behind steps S331 to S333:

[0101] by Figure 6 The U-SRv6 message shown is an example. The SID List field shown in the figure includes three sets of U-SIDs, namely Prefix[1], Prefix[2] and Prefix[3]. The U-SID set Prefix[1] includes the prefix field information Prefix[1] and 5 U-SIDs, which are uSID[1][4], uSID[1][3], uSID[1][2], uSID[1][1], and uSID[1][0]. The other two sets of U-SID Prefix[2] and Prefix[3] also contain the prefix field information and 5 U-SIDs. The principle is the same as that of Prefix[1], and will not be described in detail here.

[0102] Figure 6 The target address field shown includes prefix information Prefix[3] and uSID[3][4], that is, the current SID is Prefix[3]+uSID[3][4]. Since the IP address field is used to store U-SIDs that belong to the same group as the current SID and are located after the current SID, taking the current SID as Prefix[3]+uSID[3][4] as an example, it can be seen that the current SID is the first U-SID in Prefix[3], and there are a total of 5 U-SIDs in Prefix[3]. Figure 6 The IP address field shown includes four U-SIDs: uSID[3][3], uSID[3][2], uSID[3][1], and uSID[3][0].

[0103] also, Figure 6 In the U-SRv6 message shown, SL=3, indicating that the current SID belongs to the Prefix[3] group of U-SIDs. That is to say, the value of SL is the same as the value of i in Prefix[i] in the target address field, and SL has the function of a pointer.

[0104] In the process of obtaining the target U-SID, we first determine whether the node hop count n is less than or equal to 3, and whether the U-SID corresponding to the node hop count n is non-zero. As can be seen from the relevant records above, the U-SID corresponding to the node hop count n is uSID(63-n×16, 48-n×16).

[0105] If the node hop count is less than or equal to 3 and uSID(63-n×16, 48-n×16) is non-zero, it means that the target U-SID can be found in the target SID field. Therefore, the starting position of the target address field in the packet is used as the starting position of the table EditBase, such as... Figure 6 As shown. However, if the node hop count is greater than 3 or uSID (63-n×16, 48-n×16) is zero, it indicates that the target U-SID cannot be found in the IP address field and must be searched in the SID List field. Therefore, the starting position of the SID List field in the message is used as the starting position of the table, i.e., the starting position of SID[0] is used as the starting position of the table, such as... Figure 6 As shown. The table start position EditBase and EditBase' are both calculated in bytes.

[0106] After obtaining the starting position of the table, the starting position of the target U-SID can be determined through step S332, which also includes two cases:

[0107] The first scenario: For the starting position EditBase of the table, that is, when n≤3 and uSID(63-n×16, 48-n×16)! = 0, EditOffset = EditBase + D1 = EditBase + 2×(n+1) + 6. From this, we can obtain the starting position EditOffset of the target U-SID in this scenario. The meaning of each letter in the formula can be found in the relevant records above, and will not be repeated here.

[0108] The second scenario: For the table's starting position EditBase', that is, when n > 3 or uSID(63-n×16, 48-n×16) = 0, This allows us to obtain the starting position of the target U-SID, EditOffset', in this case. The meaning of each letter in the formula can be found in the relevant documentation above, and will not be repeated here.

[0109] In the above, the starting positions EditOffse and EditOffset' of the target U-SID are both calculated in bytes.

[0110] After obtaining the starting position of the target U-SID, step S333 can be executed to obtain the target SID based on the starting position and field length of the target U-SID. The target SID is obtained in two scenarios:

[0111] The first scenario: When the starting position of the target U-SID is EditOffset, it means that the target U-SID exists in the IP address field. The target U-SID can be obtained from the IP address field by a left shift operation: First, shift the position of the target U-SID in the IP address field to the left to position (79, 64), that is, move it to the current position of the U-SID in the target address field. Figure 7 As shown, the target U-SID is moved to the position of uSID[3][4]. At the same time, other U-SIDs in the IP address field also move to the left as the target U-SID moves to the left. For example, continuing with... Figure 7 For example, assuming the starting position of the target U-SID is the starting position of uSID[3][2] in the IP address field, then uSID[3][2] can be considered as the target U-SID, which needs to be updated in the target address field to replace uSID[3][4]. Therefore, a left shift operation can be used to shift all uSIDs in the IP address field to the left until uSID[3][2] moves to the position of uSID[3][4], thereby updating uSID[3][4] to uSID[3][2]. Correspondingly, uSID[3][1] is located at the original position of uSID[3][3], uSID[3][0] is located at the original position of uSID[3][2], and the 32 bits after uSID[3][0] are all set to 0.

[0112] After moving the target U-SID to the U-SID field of the target address field using the left shift operation described above, the starting position of the target U-SID now changes to the starting position of the U-SID field in the target address field. Since a U-SID is 2 bytes long, the target U-SID is obtained by starting from the starting position of the target U-SID field in the target address field and obtaining information with a field length of 2 bytes (Editlength) as the target U-SID. Accordingly, the target SID is the target prefix information + the target U-SID, where the target prefix information is the current prefix information in the original message.

[0113] The second scenario: If the target U-SID starts at 'EditOffset', it means the target U-SID does not exist in the IP address field. Therefore, it needs to be retrieved from the SID List field. First, retrieve information with a length of 16 bytes starting from 'EditOffset'. This information includes the target U-SID. Then, copy this information to the target address field and the IP address field to update their information. For example, using... Figure 6 Taking the U-SRv6 message shown as an example, it can be seen that the current U-SID recorded in the target address field of the message is uSID[3][4]. Assuming the node hop count n = 10, it means that 10 nodes need to be skipped starting from uSID[3][4] to obtain the target U-SID. That is, the 11th node after uSID[3][4], uSID[1][3], is the target U-SID. It can be seen that the starting position of uSID[1][3] falls into the Prefix[1] group of U-SIDs. Therefore, in order to correctly update the IP address field to obtain the correct target SID, the Prefix[1] group of U-SIDs should be completely replaced with all the information originally recorded in the target address field and IP address field. That is, the target address field and IP address field should be completely replaced with all the information recorded in the Prefix[1] group of U-SIDs. Figure 6 The DestAddress(Prefix[3]) shown is updated to DestAddress(Prefix[1]), the uSID[3][4] in the target address field is updated to uSID[1][4], and the uSID[3][3] in the IP address field is updated to uSID[1][3], uSID[3][2] is updated to uSID[1][2], uSID[3][1] is updated to uSID[1][1], and uSID[3][0] is updated to uSID[1][0]. This achieves the updating of information in the target address field and the IP address field.

[0114] Continuing with the example above, uSID[1][3] is the target U-SID. The U-SIDs recorded in the updated IP address field are uSID[1][3], uSID[1][2], uSID[1][1], and uSID[1][0]. Based on this, each uSID in the updated IP address field is shifted left by 16 bits to move the target U-SID—uSID[1][3]—to the target address field. Then, starting from the beginning position of the target U-SID field in the target address field, information with a field length of 2 bytes (Editlength) is obtained as the target U-SID. Accordingly, the target SID is the target prefix information + the target U-SID, where the target prefix information is the prefix information stored in the updated target address field. Continuing with the example above, the target prefix information at this time is the information represented by Prefix[1].

[0115] After obtaining the target SID of the SRv6 message, G-SRv6 message, or U-SRv6 message through the above implementation method, step S400 is executed to edit the message, that is, to update the current SID stored in the target address field of the message to the target SID, and to update the SL value according to the node hop count, so as to obtain the target message for forwarding to the target SID.

[0116] The above process of updating the current SID stored in the destination address field of the message to the destination SID includes: for SRv6 and G-SRv6 messages, replacing the current SID with the destination SID. For U-SRv6 messages, replacing the current SID with the destination SID and updating the information in the IP address field. The update principle can be found in the relevant descriptions above and will not be repeated here.

[0117] The process of updating the SL value based on the node hop count includes: for SRv6 packets, using the SID offset as the updated SL value; for G-SRv6 packets, the SI value needs to be updated as needed, or both the SI and SL values ​​need to be updated. If the SL offset and SL value are different, the SL value needs to be updated; if they are the same, no update is required. Furthermore, the updated SI value is the SI offset, and the updated SL value is the SL offset; for U-SRv6 packets, where n ≤ 3 and uSID (63 - n × 16, 48 - n × 16) is used. When n = 0, since the target SID exists in the IP address field, the prefix information of U-SID in the target SID is consistent with that of the current U-SID, and the SL value is the same as the i value in the prefix information Prefix[i]. Therefore, there is no need to update the SL value. However, when n > 3 or uSID(63-n×16, 48-n×16) = 0, since the target SID does not exist in the IP address field, the prefix information of U-SID in the target SID is inconsistent with that of the current U-SID. The SL value needs to be updated according to the node hop count to make the SL value the same as the i value in the target prefix information Prefix[i]. In this case, the SL value is updated to...

[0118] Therefore, through any of the above embodiments, it is possible to replace the current SID in the target address field of the message with any SID following the current SID in a complete chip processing flow, which can effectively reduce the bandwidth burden on the chip. It is worth noting that the technical features or solutions in any of the above embodiments of the present invention can be combined with each other, as long as there is no contradiction in the combination.

[0119] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a message processing apparatus is given below. Optionally, the message processing apparatus may employ the methods described above. Figure 2 The device structure of the electronic device is shown. Further, please refer to... Figure 8 , Figure 8 This is a functional block diagram of a message processing device provided in an embodiment of the present invention. It should be noted that the message processing device provided in this embodiment has the same basic principle and technical effects as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. This message processing device is applied to a node device, which stores a SID table containing the SID of the domain where the node device is located and the node hop count. The message processing device 600 includes:

[0120] The matching module 610 is configured to: upon receiving a message, determine whether there exists a SID in the SID table that matches the current SID stored in the target address field of the message; wherein the message is an SRv6 message, a G-SRv6 message, or a U-SRv6 message;

[0121] The calculation module 620 is configured to: when there is a SID in the SID table that matches the current SID, calculate the SID offset based on the SL value of the SL field in the message and the node hop count;

[0122] The acquisition module 630 is configured to: acquire the target SID from the packet based on the SID offset;

[0123] The editing module 640 is configured to update the current SID to the target SID and update the SL value according to the node hop count to obtain a target packet for forwarding to the target SID.

[0124] In some embodiments, the message is an SRv6 message; the process by which the calculation module 620 calculates the SID offset based on the SL value of the SL field in the message and the node hop count is configured as follows:

[0125] Subtract the sum of the node jump number and 1 from the SL value to obtain the SID offset.

[0126] In some embodiments, the message is an SRv6 message; the SID List field includes multiple SID fields. Accordingly, the process by which the acquisition module 630 obtains the target SID from the message based on the SID offset is configured as follows:

[0127] Obtain the starting position of the table in the SID List field of the message;

[0128] The starting position of the target SID is determined based on the table's starting position and the SID offset.

[0129] The target SID is obtained based on its starting position and field length.

[0130] In some embodiments, the message is a G-SRv6 message, and the SID offset includes an SI offset and an SL offset. Accordingly, the calculation module 620 calculates the SID offset based on the SL value of the SL field in the message and the node hop count, and is configured as follows:

[0131] Subtract the sum of the node hop number and 1 from the SI value in the SI field of the message to obtain the initial SI offset;

[0132] If the initial SI offset is less than zero, the SL offset is obtained by subtracting the quotient of the difference between the node jump number and the SI value and 4 from the difference between the SL value and 1; and the SI offset is obtained by subtracting the remainder of the difference between the node jump number and the SI value and 4 from 3.

[0133] If the initial SI offset is greater than or equal to zero, the initial SI offset is used as the SI offset, and the SL offset is set to the SL value.

[0134] In some embodiments, based on the previous embodiment, the message is a G-SRv6 message; correspondingly, the process by which the acquisition module 630 obtains the target SID from the message according to the SID offset is configured as follows:

[0135] Obtain the starting position of the table in the SID List field of the message;

[0136] The starting position of the target SID is determined based on the table start position, the SL offset, and the SI offset.

[0137] The target SID is obtained based on its starting position and field length.

[0138] In some embodiments, the message is a U-SRv6 message; the SID List field includes multiple groups of U-SIDs, each group of U-SIDs includes a prefix field and multiple U-SID fields, the prefix field information of U-SIDs in the same group is the same, and the prefix field information of U-SIDs in different groups is different; the U-SRv6 message also includes an IP address field configured between the destination address field and the SRH field; the U-SID stored in the IP address field and the U-SID stored in the destination address field belong to the same group of U-SIDs. Correspondingly, the process by which the calculation module 620 calculates the SID offset based on the SL value of the SL field in the message and the node hop count is configured as follows:

[0139] If the number of node jumps is less than or equal to 3 and the U-SID corresponding to the number of node jumps is non-zero, the sum of twice the sum of the number of node jumps and 1 and the sum of 6 is taken as the SID offset.

[0140] If the node hop count is greater than 3 or the U-SID corresponding to the node hop count is zero, the SID offset is calculated based on the SL value, the node hop count, and the starting position of the last non-zero U-SID in the IP address field.

[0141] Based on the previous embodiment, in some embodiments, the process by which the acquisition module 630 obtains the target SID from the SID List field of the packet according to the SID offset is configured as follows:

[0142] When the node hop count is less than or equal to 3 and the U-SID corresponding to the node hop count is non-zero, the starting position of the target address field in the message is taken as the starting position of the table; or, when the node hop count is greater than 3 or the U-SID corresponding to the node hop count is zero, the starting position of the SID List field in the message is taken as the starting position of the table.

[0143] The starting position of the target U-SID is determined based on the starting position of the table and the SID offset.

[0144] The target SID is obtained based on the starting position and field length of the target U-SID.

[0145] Optionally, the above-mentioned modules can be stored in the memory shown in the figure in the form of software or firmware, or embedded in the operating system (OS) of the electronic device, and can be controlled by... Figure 2 The processor executes the commands. Meanwhile, the data and program code required to execute these modules can be stored in memory.

[0146] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0147] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0148] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0149] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method of processing a packet, the method comprising: The method is applied to a node device, the node device stores a SID table, the SID table stores a SID of a domain where the node device is located and a node hop number; the method comprises the following steps: When a packet is received, it is determined whether there is a SID in the SID table that matches a current SID stored in a target address field of the packet; wherein the packet is an SRv6 packet or a G-SRv6 packet or a U-SRv6 packet; When there is a SID in the SID table that matches the current SID, a SID offset is calculated according to a SL value of a SL field in the packet and the node hop number; A target SID is obtained from the packet according to the SID offset; The current SID is updated to the target SID, and the SL value is updated according to the node hop number to obtain a target packet for forwarding to the target SID.

2. The method of claim 1, wherein, The packet is an SRv6 packet; the step of calculating the SID offset according to the SL value of the SL field in the packet and the node hop number comprises the following steps: The SL value is subtracted by the sum of the node hop number and 1 to obtain the SID offset.

3. The method of claim 2, wherein, The SID List field comprises a plurality of SID fields; the step of obtaining the target SID from the packet according to the SID offset comprises the following steps: The starting position of the SID List field in the packet is obtained; The starting position of the target SID is determined according to the starting position and the SID offset; The target SID is obtained according to the starting position and the field length of the target SID.

4. The method of claim 1, wherein, The packet is a G-SRv6 packet, and the SID offset comprises a SI offset and a SL offset; the step of calculating the SID offset according to the SL value of the SL field in the packet and the node hop number comprises the following steps: The SI value of the SI field in the packet is subtracted by the sum of the node hop number and 1 to obtain an SI initial offset; In the case that the SI initial offset is less than zero, the difference between the SL value and 1 is subtracted by the quotient of the difference between the node hop number and the SI value and 4 to obtain the SL offset; and 3 is subtracted by the remainder of the difference between the node hop number and the SI value and 4 to obtain the SI offset; In the case that the SI initial offset is greater than or equal to zero, the SI initial offset is taken as the SI offset, and the SL offset is set as the SL value.

5. The method of claim 4, wherein, The step of obtaining the target SID from the packet according to the SID offset comprises the following steps: The starting position of the SID List field in the packet is obtained; The starting position of the target SID is determined according to the starting position, the SL offset and the SI offset; The target SID is obtained according to the starting position and the field length of the target SID.

6. The method of claim 1, wherein, The message is a U-SRv6 message; the SID List field includes multiple groups of U-SIDs, each group of U-SIDs includes a prefix field and multiple U-SID fields, the prefix fields of U-SIDs in the same group have the same information, and the prefix fields of U-SIDs in different groups have different information; the U-SRv6 message further includes an IP address field arranged between the target address field and the SRH field; the U-SID stored in the IP address field and the U-SID stored in the target address field belong to the same group of U-SIDs; The step of calculating the SID offset according to the SL value of the SL field in the message and the node hop number includes: In the case that the node hop number is less than or equal to 3 and the U-SID corresponding to the node hop number is non-zero, taking twice the sum of the node hop number and 1 and the sum of 6 as the SID offset; In the case that the node hop number is greater than 3 or the U-SID corresponding to the node hop number is zero, calculating the SID offset according to the SL value, the node hop number, and the starting position of the last non-zero U-SID in the IP address field.

7. The method of claim 6, wherein, The step of obtaining the target SID from the message according to the SID offset includes: In the case that the node hop number is less than or equal to 3 and the U-SID corresponding to the node hop number is non-zero, taking the starting position of the target address field in the message as the table starting position, or in the case that the node hop number is greater than 3 or the U-SID corresponding to the node hop number is zero, taking the starting position of the SID List field in the message as the table starting position; Determining the starting position of the target U-SID according to the table starting position and the SID offset; Obtaining the target SID according to the starting position of the target U-SID and the field length thereof.

8. A packet processing device, characterized by, The node device stores a SID table, and the SID table stores the SID of the domain where the node device is located and the node hop number; the device includes: A matching module configured to, when a message is received, determine whether there is a SID in the SID table that matches a current SID stored in a target address field in the message; wherein the message is an SRv6 message or a G-SRv6 message; A calculation module configured to, when there is a SID in the SID table that matches the current SID, calculate a SID offset according to an SL value of an SL field in the message and the node hop number; An acquisition module configured to obtain a target SID from the message according to the SID offset; An editing module configured to update the current SID to the target SID and update the SL value according to the node hop number to obtain a target message for forwarding to the target SID.

9. An electronic device, comprising: The processor and the memory, the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the method in any one of claims 1-7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Message processing method and related device

    CN114697254A

  • Node protection method and device, electronic equipment and medium

    CN118251871A