Message processing method and device, equipment and storage medium

By adding node jump fields to the SID table of the node device and calculating the SID offset using the SL value and node jump number, the chip bandwidth waste and inefficiency in SRv6 and G-SRv6 packet forwarding is solved, and efficient message processing is achieved.

CN119854194AActive Publication Date: 2025-04-18SUZHOU CENTEC COMM CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

During the forwarding of SRv6 and G-SRv6 packets, when the next n SIDs adjacent to the current SID need to be replaced into the target address field, n complete chip processing processes need to be performed n times, resulting in waste of chip bandwidth and inefficient packet processing.

Method used

Add a node jump field to the SID table of the node device, record the number of node jumps, calculate the SID offset by the SL value and node jumps of the SL field, so as to obtain the required SID after the current SID as the target SID in a complete chip processing flow.

Benefits of technology

It is realized that without increasing the number of chip processing flows, obtaining any SID after the current SID as the target SID, saving chip bandwidth and improving packet processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854194A_ABST
    Figure CN119854194A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message processing method and device, equipment and a storage medium, and the method comprises the steps: determining whether an SID matched with a current SID stored in a target address field in a message exists in an SID table or not when the message is received; wherein the message is an SRv6 message or a G-SRv6 message or a U-SRv6 message; when the SID matched with the current SID exists in the SID table, calculating the SID offset according to the SL value of the SL field in the message and the node jump number; obtaining a target SID from the message according to the SID offset; and updating the current SID to the target SID, and obtaining a target message for forwarding to the target SID according to the node jump number and the SL value. Therefore, in a complete chip processing flow, the current SID of the target address field in the message is replaced by any one SID after the current SID, and the bandwidth burden of the chip can be well reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a message processing method, device, equipment and storage medium. Background Art

[0002] SR technology (Segment Routing) is a routing forwarding mechanism that uses source node path selection. SRv6 (IPv6 SR, IPv6 Segment Routing) technology is an application of SR technology in IPv6 networks. When SRv6 technology is used to forward the original message entering the SRv6 domain, the device that receives the original message in the SRv6 domain serves as the source node for forwarding the original message. At this time, it is necessary to encapsulate the received original message with the SRH (Segment Routing Header) and SID List (Segment Identifier List) of the original message to obtain the SRv6 message. Please refer to Figure 1 , Figure 1 This is a simplified diagram of the message structure of an SRv6 message. It can be seen that the SRv6 message includes an IPv6 Header (IPv6 basic header) field, an SRH field, and a SID List field.

[0003] The IPv6 Header at least includes the source address field of the SRv6 encapsulation and the destination address field of the SRv6 message. The SRH field contains 7 fields, one of which is the Segment Left (SL) field, which indicates the remaining number of SIDs that have not been processed in the SID List field. It is used to indicate the position of the SID of the next node in the SID List field. The initial value is n1 (n represents the number of SIDs in the SID List field). Every time a node is passed, the value of SL in the SRv6 message decreases by 1. The SID List field stores the identifier of the forwarding node of the SRv6 message on the forwarding path. The SID List field contains multiple fields, each of which is used to store a SID, that is, a 128-bit IP address, to identify a forwarding node. The SIDs stored in the SID List field are stored in reverse order. The reverse order here means that the storage order of the SIDs of each node is opposite to the order of the nodes traversed by the SRv6 message in the forwarding path.

[0004] Therefore, in the process of forwarding SRv6 messages, it is necessary to forward SRv6 messages to SID nodes one by one in sequence according to all SIDs recorded in the SID List field in the SRv6 message. This determines that each node can only obtain the SID of the next hop node adjacent to it from the SID List field, and replace the SID in the target address field of the SRv6 message with the SID of the next hop node. This operation requires a complete chip processing flow. In other words, a complete chip processing flow can only replace the next SID adjacent to the current SID into the target address field. If the next n SIDs adjacent to the current SID need to be replaced into the target address field, n complete chip processing flows need to be performed, which leads to a waste of chip bandwidth and is not conducive to improving the forwarding efficiency of SRv6 messages. The same problem also exists in G-SRv6 (Generalized SRv6) messages. Summary of the invention

[0005] In view of this, in order to at least solve the technical problem in the related art that when the next n SIDs adjacent to the current SID need to be replaced into the target address field, n complete chip processing flows need to be performed, thereby resulting in waste of chip bandwidth and low message processing efficiency, the purpose of the present invention is to provide a message processing method, device, equipment and storage medium.

[0006] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:

[0007] A first aspect of an embodiment of the present invention provides a message processing method, which is applied to a node device, wherein 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 number of node jumps; the message processing method comprises:

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

[0009] When there is a SID matching the current SID in the SID table, the SID offset is calculated according to the SL value of the SL field in the message and the number of node hops;

[0010] Obtaining a target SID from the message according to the SID offset;

[0011] The current SID is updated to the target SID, and the SL value is updated according to the number of node hops to obtain a target message for forwarding to the target SID.

[0012] According to a second aspect of an embodiment of the present invention, a message processing device is provided, which is applied to a node device, wherein the node device stores a SID table, wherein the SID table stores a SID of a domain where the node device is located and a number of node jumps; the message processing device comprises:

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

[0014] A calculation module is configured to: when there is a SID matching the current SID in the SID table, calculate the SID offset according to the SL value of the SL field in the message and the number of node hops;

[0015] An acquisition module is configured to: acquire a target SID from the message according to 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 number of node hops to obtain a target message for forwarding to the target SID.

[0017] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising 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] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the message processing method provided in the first aspect is implemented.

[0019] The message processing method, device, equipment and storage medium provided by the embodiment of the present invention, by adding a node jump field for indicating the number of next-hop node devices that the node device needs to skip in message forwarding in the SID table stored in the node device for forwarding the message, and recording the number of node jumps in the node jump field, that is, in the SID table, not only the SID of the domain where the node device is located is recorded, but also the number of node jumps. Therefore, when the node device receives the message and there is a SID in the SID table that matches the current SID stored in the target address field in the message, the SID offset can be calculated according to the SL value of the SL field in the message and the number of node jumps, and then the corresponding target SID can be obtained from the message according to the SID offset. Therefore, in the embodiment of the present invention, the acquisition of the target SID depends on the SL value and the number of node jumps, that is, through the number of node jumps, it is possible to obtain any required SID after the current SID from the message as the target SID, and it can be seen 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 by the embodiments of the present invention, when it is necessary to replace the next n SIDs adjacent to the current SID into the target address field, for example, for the next-hop node device of the node device, a device fails or the bandwidth load rate of a device is too high, resulting in the device being unable to operate normally, etc., at this time, it is only necessary to set the number of node jumps to n (n is a positive integer) to guide the message to bypass the device that has failed or the device with excessive bandwidth load rate. Based on this, the node device only needs to perform a complete chip processing flow once, and there is no need to perform n complete chip processing flows, which can well save chip bandwidth and improve message processing efficiency.

[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

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

[0024] Figure 2 A structural block diagram of an electronic device provided by an embodiment of the present invention is shown;

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

[0026] Figure 4 A schematic diagram of positioning a target SID in an SRv6 message provided by an embodiment of the present invention is shown;

[0027] Figure 5 A schematic diagram of positioning a target SID in a G-SRv6 message provided by an embodiment of the present invention is shown;

[0028] Figure 6 A schematic diagram of positioning a target U-SID in a U-SRv6 message provided by an embodiment of the present invention is shown;

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

[0030] Figure 8 A functional module diagram of a message processing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0031] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0032] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0033] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0034] In order to at least solve the technical problem in the related art that when the next n SIDs adjacent to the current SID need to be replaced into the target address field, the chip processing flow needs to be completed n times, which leads to the waste of chip bandwidth and low message processing efficiency, the present invention provides a message processing method, by adding a node jump field for indicating the number of next-hop node devices that the node device needs to skip in message forwarding in the SID table stored in the node device for forwarding the message, and recording the number of node jumps in the node jump field, that is, the SID table not only records the SID of the domain where the node device is located, but also records the number of node jumps. Therefore, when the node device receives the message and there is a SID in the SID table that matches the current SID stored in the target address field in the message, the SID offset can be calculated according to the SL value of the SL field in the message and the number of node jumps, and then the corresponding target SID can be obtained from the message according to the SID offset. Therefore, in the embodiment of the present invention, the acquisition of the target SID depends on the SL value and the number of node hops, that is, through the number of node hops, it is possible to obtain any required SID after the current SID from the message 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 the embodiment of the present invention, when it is necessary to replace the next n SIDs adjacent to the current SID into the target address field, for example, for the next-hop node device of the node device, a device fails or the bandwidth load rate of a device is too high, resulting in the device being unable to operate normally, etc., at this time, it is only necessary to set the number of node jumps to n to guide the message to bypass the device that has failed or the device with excessive bandwidth load rate. Based on this, the node device only needs to perform a complete chip processing flow once, and there is no need to perform a complete chip processing flow n times, which can well save chip bandwidth and improve message processing efficiency.

[0036] The message processing method provided by the present invention can be applied to electronic devices. Figure 2 , is a block diagram of the structure of an electronic device. The electronic device 200 includes a memory 210, a processor 220 and a communication module 230. The memory 210, the processor 220 and the communication module 230 are electrically connected to each other directly or indirectly to achieve 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, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

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

[0039] The communication module is used to establish a communication connection between the electronic device and other communication terminals through a network, and is used to send and receive data through the network.

[0040] It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the electronic device, and the electronic device may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by 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. The node device may edit and forward SRv6 messages, G-SRv6 messages, or U-SRv6 messages.

[0042] The following combination Figure 3 The message processing method provided by the embodiment of the present invention is described. Figure 3 1 is a flow chart of a message processing method provided by an embodiment of the present invention. The message processing method is applied to a node device. The node device stores a SID table. The SID table stores the SID of the domain where the node device is located and the number of node jumps. 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 in the message; wherein the message is an SRv6 message or a G-SRv6 message or a U-SRv6 message;

[0044] In step S200, when there is a SID matching the current SID in the SID table, the SID offset is calculated according to the SL value of the SL field in the message and the number of node hops;

[0045] In step S300, a target SID is obtained from the message according to 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 number of node hops to obtain a target message for forwarding to the target SID.

[0047] During the message forwarding process, when there is a need to forward the message to the next n SIDs adjacent to the current SID, generally speaking, such a demand can be generated by relevant personnel on the server side according to actual needs, or it can be generated because of the failure of the next or next n SIDs adjacent to the current SID or excessive workload. For example, the bandwidth load rate of a device in the next-hop node device of the current node device is too large or a device fails. The excessive load rate can indicate that the bandwidth load rate exceeds the set load rate threshold, and the device failure can indicate that the device is disconnected or a fault occurs inside the device, causing the device to fail to work normally. For these situations, a node jump field for recording the number of node jumps can be configured in the SID table stored in the current node device to guide the current node device to skip the corresponding number of SIDs after the current SID in the message, directly obtain the required target SID at one time, and perform corresponding update and forwarding processing on the message.

[0048] In the above, the number of node hops can be any number greater than or equal to 0, but when the message is an SRv6 message, it cannot exceed the SL-1 value of the SL field of the message, otherwise it will cause SL-1-n in the following text to be less than 0, resulting in a message error. Similarly, when the message is a G-SRv6 message, the number of node hops cannot be greater than SL×4+SI-1, where the relevant meanings of SL and SI can be found in the relevant records below. In the case where the message is a U-SRv6 message, the number of node hops cannot exceed the number of all SIDs after the current SID in the SIDList field, which can be understood as the number of remaining SIDs, otherwise it will result in the inability to find the target SID in the remaining SIDs, resulting in a message error.

[0049] It can be seen that the number of node jumps can be determined based on the operating status of all node devices contained in the domain where the node device is located; the operating status includes at least one of the following: the bandwidth load rate of the node device, whether the node device is faulty. For example, when the operating status of the next node device of the current node device is abnormal, the number of node jumps can be set to 1, and when the operating status of the next three node devices of the current node device is abnormal, the number of node jumps can be set to 3, and so on. When the operating status of the next n node devices of the current node device is abnormal, the number of node jumps can be set to n. In addition, in order to be able to update the number of node jumps in time according to the changes in the operating status of the node device, in some examples, the operating status of all the above-mentioned node devices can be obtained in real time or at a fixed time, and it is determined whether to update the number of node jumps according to the currently obtained operating status. For example, assuming that the next node device of the current node device has recovered from abnormality to normal, the number of node jumps originally set to 1 can be updated to 0. This can improve the immediacy and accuracy of the number of node jumps, which is conducive to further improving the reliability and effectiveness of message forwarding.

[0050] From the above, it can be seen that the node device that applies the message processing method provided by the embodiment of the present invention can replace any SID after the current SID with the target address field of the message in a complete chip processing flow, which can save chip bandwidth and improve message processing efficiency to a certain extent. The following describes the process of the node device processing the message in combination with steps S100 to S400:

[0051] When the node device receives the message, step S100 will be executed to first obtain the current SID from the target address field of the message. The current SID can represent an IPv6 address, and then search the SID table to see if there is a SID that matches the current SID. If there is no SID matching the current SID in the SID table, it means that the message cannot be forwarded normally, and the message will be discarded. If there is a SID matching the current SID in the SID table, step S200 will be executed to calculate the SID offset based on the SL value of the SL field in the message and the number of node jumps.

[0052] For SRv6 messages, G-SRv6 messages, and U-SRv6 messages, the embodiments of the present invention provide different SID offset calculation methods, namely:

[0053] In the case where the message is an SRv6 message, in the above step S200, the step of calculating the SID offset according to the SL value of the SL field in the message and the number of node hops includes:

[0054] In step S211, the sum of the node hop number and 1 is subtracted from the SL value to obtain a SID offset.

[0055] Assuming that the number of node hops 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] In the case where the message is a G-SRv6 message, the SID offset includes an SI offset and an SL offset. At this time, in the above step S200, the step of calculating the SID offset according to the SL value of the SL field in the message and the number of node hops includes:

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

[0059] In step S222, when the SI initial 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, when the SI initial offset is greater than or equal to zero, the SI initial offset is used as the SI offset, and the SL offset is set to the SL value. It should be noted that at this time, the SL value is still the SL value recorded in the original message.

[0061] It can be known from step S221 that the SI initial offset D SI = SI-1-n; wherein the SI (SIDIndex) field of the G-SRv6 message is an additional pointer, which is used to combine with the SL field to point to the current G-SID. SI When <0, SL offset D11=SL-1-(n-SI) / 4, SI offset D12=3-(n-SI)%4.

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

[0063] If the message is a U-SRv6 message, see Figure 6 , Figure 6This is a schematic diagram of locating 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 prefix field information of the same group of U-SIDs is the same, and the prefix field information of different groups of U-SIDs is different. For example, for the U-SID group 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 number of the corresponding prefix information, and j represents the jth uSID in a group of U-SIDs. The label refers to the i value in Pefix[i]. For example, the label of Pefix[1] is 1. In this way, among multiple uSID[i][j], the prefix information of uSID[i][j] with the same i value is also the same, and they belong to the same group of U-SIDs.

[0064] The difference between the above two messages is that the U-SRv6 message includes not only the IPv6 Header field, SRH field and SIDList field, but also the IP address field. The current SID of the U-SRv6 message is formed by the current prefix information and the current uSID, such as Figure 6 In the target address field shown, the current SID is Pefix[3]+uSID[3][4].

[0065] In addition, the IP address field is configured between the target address field and the SRH field, and 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. 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 the above step S200, the step of calculating the SID offset according to the SL value of the SL field in the message and the number of node hops includes:

[0067] In step S231, when 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 sum of twice the sum of the number of node hops and 1 and 6 is used as the SID offset;

[0068] In step S232, when the number of node hops is greater than 3 or the U-SID corresponding to the number of node hops is zero, the SID offset is calculated according to the SL value, the number of node hops and the starting position of the last non-zero U-SID in the IP address field.

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

[0070] The first case: When 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 sum of the sum of the number of node hops and 1 and 6 is used as the SID offset, that is, D1 = 2 × (n + 1) + 6, where D1 is the SID offset in Byte, and n is the number of node hops. It can be seen that the SL value is not needed to calculate the SID offset D1. Among them, the non-zero U-SID corresponding to the number of node hops indicates that the U-SID is valid and can ensure the normal forwarding of the message.

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

[0072] by Figure 7 As shown in the example, Figure 7 is a schematic diagram of a target address field and an IP address field in a U-SRv6 message provided by an embodiment of the present invention, wherein the IP address field is Figure 7 In the IP address field, bits 63 to 48 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 bytes from bit 31 to bit 16 in the IP address field, which is Figure 7 The uSID[3][2] in the IP address field is shown.

[0073] The second case: when the number of node hops is greater than 3 or the U-SID corresponding to the number of node hops is zero, the process of calculating the SID offset according to the SL value, the number of node hops 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 message; n is the number of node hops; X represents the bit value corresponding to the starting position of the last non-zero U-SID in the IP address field. Figure 7 For example, assuming that uSID[3][3], uSID[3][2], and uSID[3][1] are all non-zero, and 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 SL value and the number of node hops need to be used to calculate the SID offset D2.

[0076] After the SID offset is calculated, step S300 can be executed to obtain the target SID from the message according to the SID offset. In this regard, since the offset calculation methods of SRv6 messages, G-SRv6 messages and U-SRv6 messages are different, and the message information is also different, the embodiments of the present invention also provide corresponding target SID acquisition solutions for these three messages, namely:

[0077] In the case where the message is an SRv6 message, the SID List field of the SRv6 message includes multiple SID fields, and the field lengths of the SID fields are the same. Accordingly, in the above step S300, the step of obtaining the target SID from the message according to the SID offset includes:

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

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

[0080] In step S313, the target SID is obtained according to the starting position of the target SID and its field length.

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

[0082] See also Figure 4 , Figure 4This is a schematic diagram of the location of the target SID in an SRv6 message provided by an embodiment of the present invention. The SID List field shown in the figure contains 4 SIDs, namely SID[3], SID[2], SID[1] and SID[0], SL value = 3, and the current SID in the target address field (Dest Address) is SID[3]. For the SRv6 message of this structure, the table start position EditBase can be obtained by the calculation method of the table start position of the SID List field of the SRv6 message in the related art. For example, the length L1 from the beginning of the message to the beginning of the IPv6 basic header in the message can be obtained by the related art, 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) is calculated to obtain the table start position EditBase. Among them, the table start position EditBase is calculated in bytes.

[0083] After obtaining the table start position EditBase, step S312 can be executed to calculate the start position EditOffset of the target SID based on the table start position EditBase and the SID offset. Assuming that the number of node jumps n = 1, at this time, 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 16Bytes. In this way, the start position EditOffset of the target SID can be obtained. In the above example, EditOffset points to the start position of SID[1]. The start position EditOffset of the target SID is calculated in bytes.

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

[0085] From the above, we can see that, in essence, the target SID is the SID whose number is the sum of the number of node hops and 1 minus the number of the current SID. In general, the number of the current SID is the same as the SL value. Figure 4From the surface level, we can know that the number of the target SID to be obtained is SL-n-1. The numbers 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, and the field lengths of the G-SID fields are the same. Accordingly, in the above step S300, obtaining the target SID from the message according to the SID offset includes:

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

[0088] In step S322, the starting position of the target SID is determined according to the table starting position, the SL offset and the SI offset;

[0089] In step S323, the target SID is obtained according to the starting position of the target SID and its field length.

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

[0091] See also Figure 5 , Figure 5 This is a schematic diagram of positioning a target SID in a G-SRv6 message provided by an embodiment of the present invention. The G-SID List field shown in the figure 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], SL value = 3, SI value = 3, and the current SID in the target address field (Dest Address) is G-SID[3][3]; for the convenience of the following description, a in G-SID[a][b] is called the SL number, and b is called the SI number. For a G-SRv6 message of this structure, the table starting position can be obtained by the calculation method of the table starting position of the G-SID List field of the G-SRv6 message in the related art. The table start position of the G-SID List field is calculated in bytes.

[0092] After obtaining the table start position of the G-SID List field, the technical principle of obtaining the target SID through steps S322 to S323 is similar to the principle in steps S312 to S313 above, except that the G-SID has an additional pointer SI, so it is necessary to combine the SL offset and the SI offset to locate the target SID. The technical principle involved in the positioning can be based on the relevant technology Figure 5 The relevant records of steps S312 to S313 are known and will not be repeated here.

[0093] The positioning of the target SID is similar to that of the target SID. 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 number of node jumps and the SI value and 4. The resulting value is the SL offset D11 in the above step S222, 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 the above step S222, that is, the SI number of the target SID = D12 = 3-(n-SI)%4.

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

[0095] It can be seen that, whether it is an SRv6 message or a G-SRv6 message, the finally calculated offset can be used as the number of the target SID, so that the specific target SID can be quickly understood.

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

[0097] In step S331, when 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 used as the table starting position; or, when 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 used as the table starting position;

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

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

[0100] The following example illustrates the relevant principles of 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 groups of U-SIDs, namely Prefix[1], Prefix[2] and Prefix[3]. The Prefix[1] group of U-SIDs includes prefix field information Prefix[1] and 5 U-SIDs. The 5 U-SIDs are uSID[1][4], uSID[1][3], uSID[1][2], uSID[1][1], and uSID[1][0]. The other two groups of U-SIDs Prefix[2] and Prefix[3] also include prefix field information and 5 U-SIDs. The principle is the same as Prefix[1] and will not be repeated 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 U-SID group as the current SID and are located after the current SID, continuing to take 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 Prefix[3] has a total of 5 U-SIDs, so Figure 6 The IP address field shown includes four U-SIDs, namely 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 U-SID group of Prefix[3]. In other words, the value of SL is the same as the value of i in Prefix[i] in the target address field, and SL has a pointer function.

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

[0105] When the number of node hops 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 in the target SID can be found in the IP address field. Therefore, the starting position of the target address field in the message is used as the table starting position EditBase, such as Figure 6 When the number of node hops is greater than 3 or uSID (63-n×16, 48-n×16) is zero, it means that the target U-SID cannot be found in the IP address field and needs to be found in the SID List field. Therefore, the starting position of the SID List field in the message is used as the table starting position EditBase', that is, the starting position of SID [0] is used as the table starting position, as shown in Figure 6 As shown in the figure, the table start positions EditBase and EditBase' are both calculated in Byte.

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

[0107] The first case: for the table starting position EditBase, that is, when n≤3 and uSID(63-n×16, 48-n×16)!=0, EditOffset=EditBase+D1=EditBase+2×(n+1)+6, thus the starting position EditOffset of the target U-SID in this case can be obtained. 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 case: for the table starting position EditBase', that is, when n>3 or uSID(63-n×16, 48-n×16)=0, Thus, the starting position EditOffset' of the target U-SID in this case can be obtained. The meaning of each letter in the formula can be found in the above related records, and will not be repeated here.

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

[0110] After obtaining the starting position of the target U-SID, step S333 may be performed to obtain the target SID according to the starting position of the target U-SID and its field length. The target SID may be obtained in two situations:

[0111] The first case: When the starting position of the target U-SID is EditOffset, it means that the target U-SID of the target SID exists in the IP address field. The target U-SID can be obtained from the IP address field by left shifting: first, the position of the target U-SID in the IP address field is shifted left to the position (79, 64), that is, moved to the position of the current U-SID in the target address field, such as Figure 7 As shown, it moves to the position of uSID[3][4]. At the same time, other U-SIDs in the IP address field also move left with the left shift of the target U-SID. For example, continue with Figure 7 As shown in the figure, for example, assuming that the starting position of the target U-SID is the starting position of uSID[3][2] in the IP address field, it can be considered that uSID[3][2] is the target U-SID and needs to be updated to the target address field to replace uSID[3][4]. Therefore, all uSIDs in the IP address field can be left-shifted 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 the target U-SID is moved to the U-SID field of the target address field through the above left shift operation, it can be seen that the starting position of the target U-SID is now changed to the starting position of the U-SID field in the target address field. Since the length of a U-SID is 2Byte, starting from the starting position of the target U-SID field in the target address field, the information with a field length Editlength of 2Byte is obtained as the target U-SID. Correspondingly, the target SID is the target prefix information + target U-SID, where the target prefix information is the current prefix information in the original message.

[0113] The second scenario: When the starting position of the target U-SID is EditOffset', it means that the target U-SID does not exist in the IP address field, so the target U-SID needs to be obtained from the SID List field: first, obtain the information with a length of 16Bytes from EditOffset'. It can be seen that the information obtained at this time includes the target U-SID. Then copy this information to the target address field and the IP address field to update the information in the target address field and the IP address field. For example, Figure 6 Taking the U-SRv6 message shown in the figure 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 that the number of node jumps 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 uSID[1][3] after uSID[3][4] 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, first replace all the information originally recorded in the target address field and the IP address field with the Prefix[1] group of U-SIDs, that is, Figure 6 The DestAddress(Prefix[3]) shown is updated to DestAddress(Prefix[1]), the uSID[3][4] in the destination address field is updated to uSID[1][4], the uSID[3][3] in the IP address field is updated to uSID[1][3], the uSID[3][2] is updated to uSID[1][2], the uSID[3][1] is updated to uSID[1][1], and the uSID[3][0] is updated to uSID[1][0]. This achieves the update of information in the destination address field and the IP address field.

[0114] Continuing with the above example, uSID[1][3] is the target U-SID, and the U-SIDs recorded in the updated IP address field are uSID[1][3], uSID[1][2], uSID[1][1], and uSID[1][0], respectively. Based on this, each uSID in the updated IP address field is shifted left 16 bits at a time to move the target U-SID, uSID[1][3], to the target address field. Subsequently, starting from the start position of the target U-SID field in the target address field, information with a field length of 2Bytes is obtained as the target U-SID. Correspondingly, the target SID is the target prefix information + target U-SID, where the target prefix information is the prefix information stored in the target address field after the information is updated. Continuing with the above example, the target prefix information at this time is the information represented by Prefix[1].

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

[0116] In the above, updating the current SID stored in the target address field in the message to the target SID includes: for SRv6 messages and G-SRv6 messages, replacing the current SID with the target SID. For U-SRv6 messages, replacing the current SID with the target SID, and updating the information in the IP address field. The updating principle can be seen in the relevant records above, which will not be repeated here.

[0117] Wherein, updating the SL value according to the number of node hops includes: for SRv6 messages, using the value of the SID offset as the updated SL value; for G-SRv6 messages, it is necessary to update the SI value as appropriate, or update the SI value and the SL value, wherein if the SL offset and the SL value are different, the SL value needs to be updated, and if the SL offset and the SL value are the same, the SL value does not need to be updated. In addition, the updated SI value is the SI offset, and the updated SL value is the SL offset; for U-SRv6 messages, when n≤3 and uSID(63-n×16, 48-n×16)! =0, since the target SID exists in the IP address field, the prefix information of the U-SID in the target SID is consistent with 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. In the case of 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 the U-SID in the target SID is inconsistent with the current U-SID. It is necessary to update the SL value according to the number of node hops so that the SL value is the same as the i value in the target prefix information Prefix[i]. At this time, the SL value is updated to

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

[0119] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a message processing device is provided below. Optionally, the message processing device may adopt the above Figure 2 For further information, please refer to Figure 8 , Figure 8 A functional module diagram of a message processing device provided in an embodiment of the present invention. It should be noted that the basic principle and technical effect of the message processing device provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. The message processing device is applied to a node device, and 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 number of node jumps. The message processing device 600 includes:

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

[0121] The calculation module 620 is configured to: when there is a SID matching the current SID in the SID table, calculate the SID offset according to the SL value of the SL field in the message and the number of node hops;

[0122] The acquisition module 630 is configured to: acquire a target SID from the message according to 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 number of node hops to obtain a target message for forwarding to the target SID.

[0124] In some embodiments, the message is an SRv6 message; the process in which the calculation module 620 calculates the SID offset according to the SL value of the SL field in the message and the number of node hops is configured as follows:

[0125] The SID offset is obtained by subtracting the sum of the node hop number and 1 from the SL value.

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

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

[0128] Determine the starting position of the target SID according to the table starting position and the SID offset;

[0129] The target SID is obtained according to the starting position of the target SID and its 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 according to the SL value of the SL field in the message and the number of node hops, and is configured as follows:

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

[0132] In the case where the SI initial 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] When the SI initial offset is greater than or equal to zero, the SI initial 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; accordingly, the process of the acquisition module 630 acquiring the target SID from the message according to the SID offset is configured as follows:

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

[0136] Determine the starting position of the target SID according to the table starting position, the SL offset and the SI offset;

[0137] The target SID is obtained according to the starting position of the target SID and its field length.

[0138] In some embodiments, the message is a U-SRv6 message, 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 the same group of U-SIDs is the same, and the prefix field information of different groups of U-SIDs is different; the U-SRv6 message also includes an IP address field configured 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. Accordingly, the process of calculating the SID offset by the calculation module 620 according to the SL value of the SL field in the message and the number of node hops is configured as follows:

[0139] When 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 sum of twice the sum of the number of node hops and 1 and 6 is used as the SID offset;

[0140] When the node hop number is greater than 3 or the U-SID corresponding to the node hop number is zero, the SID offset is calculated 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.

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

[0142] When 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 used as the starting position of the table; or, when 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 used as the starting position of the table;

[0143] Determine the starting position of the target U-SID according to the table starting position and the SID offset;

[0144] The target SID is obtained according to the starting position of the target U-SID and its field length.

[0145] Optionally, the above modules can be stored in the memory shown in the figure in the form of software or firmware or solidified in the operating system (OS) of the electronic device, and can be Figure 2 Meanwhile, the data and program codes required for executing the above modules can be stored in the memory.

[0146] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

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

[0148] If the functions are implemented in the form of software function 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 the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling 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 methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A message processing method, characterized in that: Applied to a node device, the node device stores a SID table, the SID table stores the SID of the domain where the node device is located and the number of node jumps; the method includes: When receiving a message, determining whether there is a SID in the SID table that matches the current SID stored in the target address field in the message; wherein the message is an SRv6 message or a G-SRv6 message or a U-SRv6 message; When there is a SID matching the current SID in the SID table, the SID offset is calculated 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; The current SID is updated to the target SID, and the SL value is updated according to the number of node hops to obtain a target message for forwarding to the target SID.

2. The method according to claim 1, characterized in that The message is an SRv6 message; the step of calculating the SID offset according to the SL value of the SL field in the message and the number of node hops includes: The SID offset is obtained by subtracting the sum of the node hop number and 1 from the SL value.

3. The method according to claim 2, characterized in that The SID List field includes a plurality of SID fields; the step of acquiring a target SID from the message according to the SID offset includes: Obtaining the table starting position of the SID List field in the message; Determine the starting position of the target SID according to the table starting position and the SID offset; The target SID is obtained according to the starting position of the target SID and its field length.

4. The method according to claim 1, characterized in that: The message is a G-SRv6 message, and the SID offset includes an SI offset and an SL offset; and the step of calculating the SID offset according to the SL value of the SL field in the message and the number of node hops includes: Subtract the sum of the node hop number and 1 from the SI value of the SI field in the message to obtain an SI initial offset; In the case where the SI initial 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; When the SI initial offset is greater than or equal to zero, the SI initial offset is used as the SI offset, and the SL offset is set to the SL value.

5. The method according to claim 4, characterized in that The step of acquiring the target SID from the message according to the SID offset includes: Obtaining the table starting position of the SID List field in the message; Determining the starting position of the target SID according to the table starting position, the SL offset and the SI offset metric; The target SID is obtained according to the starting position of the target SID and its field length.

6. The method according to claim 1, characterized in that 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 the same group of U-SIDs is the same, and the prefix field information of different groups of U-SIDs is different; the U-SRv6 message also includes an IP address field configured 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 number of node hops includes: When 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 sum of twice the sum of the number of node hops and 1 and 6 is used as the SID offset; When the node hop number is greater than 3 or the U-SID corresponding to the node hop number is zero, the SID offset is calculated 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 according to claim 6, characterized in that The step of acquiring the target SID from the message according to the SID offset includes: When 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 used as the starting position of the table; or, when 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 used as the starting position of the table; Determine the starting position of the target U-SID according to the table starting position and the SID offset; The target SID is obtained according to the starting position of the target U-SID and its field length.

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

9. An electronic device, characterized in that: The invention comprises 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 method according to any one of claims 1 to 7.

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

Citation Information

Patent Citations

  • Message processing method and related device

    CN114697254A

  • Data transmission method, related equipment and computer storage medium

    CN115701054A

  • Data message coding processing method and device

    CN118233377A

  • Node protection method and device, electronic equipment and medium

    CN118251871A

  • Data processing method and device, equipment and storage medium

    CN118827496A