Message sending method, receiving method, equipment and storage medium

By classifying SRv6 messages and replacing some of the message header compression fields, the problem of high transmission overhead of SRv6 messages is solved, and higher transmission efficiency is achieved.

CN118827829BActive Publication Date: 2026-08-04CHINA MOBILE COMM LTD RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE COMM LTD RES INST
Filing Date
2023-11-07
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

The SRH portion of SRv6 messages has high transmission overhead, resulting in low transmission efficiency.

Method used

By classifying SRv6 messages, the headers of messages in the same category are replaced with some compressed header fields, establishing a correspondence between the headers and compressed fields, thus reducing message length.

Benefits of technology

The length of SRv6 messages has been reduced, improving transmission efficiency and saving transmission resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827829B_ABST
    Figure CN118827829B_ABST
Patent Text Reader

Abstract

This application provides a message sending method, receiving method, device, and storage medium. The method includes: determining a first category to which a first SRv6 message to be sent belongs, wherein different SRv6 messages under the same category have the same partial message header, the partial message header including one or more segment identifier (SID) fields; replacing the first partial message header corresponding to the first category in the message header of the first SRv6 message with a first partial message header compression field corresponding to the first category to obtain a second SRv6 message, wherein the first partial message header compression field includes indication information of the first category, and the length of the partial message header compression field of a category is less than the length of the partial message header compression field of that category; and sending the second SRv6 message. This application reduces the message length of SRv6 messages and saves transmission resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data communication technology, specifically to a message sending method, receiving method, device, and storage medium. Background Technology

[0002] Segment routing (SR) is an architecture for forwarding data packets on a network, based on the concept of source routing. SR divides network paths into segments and assigns segment identifiers (SIDs) to these segments and the forwarding nodes in the network. By arranging the segments and network nodes in an ordered manner, a forwarding path, i.e., a segment list, can be obtained.

[0003] IPv6 segment routing (SR-IPv6, SRv6, also known as IPv6 SR) refers to applying segment routing to the IPv6 forwarding plane. This involves encapsulating the segment routing instruction list (SID list) in the IPv6 packet header to guide packet forwarding according to the source route. The current mainstream SRv6 data plane uses a Segment Routing Header (SRH) for encapsulation. The SRH encapsulates segment list information, with each segment being a 128-bit IPv6 address. An SRv6 tunnel is the management entity for the corresponding SID list and, like other tunnels, presents itself to services. An SRv6 tunnel can carry all known payload types, including Layer 2, Layer 3, Multi-Protocol Label Switching (MPLS), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP).

[0004] Figure 1 This provides a diagram illustrating SRv6 packet encapsulation. The IPv6 SR packet encapsulation format involves adding a new IPv6 basic header and an SRH header before the original Layer 3 datagram. SRH is a route extension header with a route type value of 4. For example... Figure 1 As shown, the Next Header value in the IPv6 basic header is 53, indicating that the next header is a routing extension header. The Routing Type field in the routing extension header has a value of 4, indicating that the routing extension header is an SRH (Short Route Header). The SRH mainly consists of the following parts:

[0005] Next Header: 8 bits, used to identify the type of the next message header;

[0006] Hdr Ext Len: 8 bits, indicating the length of the SRH header in 8-byte units, excluding the first 8 bytes;

[0007] Routing Type: 8 bits, the routing type field, with a value of 4 indicating that it carries an SRH (Short Route Hash);

[0008] Segments Left: 8 bits, indicating the number of the next SID to be viewed, initially set to n-1 (n represents the number of SIDs in the route extension header), and decremented by 1 for each node traversed;

[0009] Last Entry: 8 bits, the number of the last SID in the packet forwarding path in the SRH header, with a value of 0;

[0010] Flags: 8 bits, flag information;

[0011] Tag: 16 bits, used to mark a group of messages with the same characteristics;

[0012] Segment List: A list of segments, including at least one ordered arrangement of SIDs. The segments are arranged in order of distance from the nearest node on the packet forwarding path. That is, Segment List[0] represents the last SID of the path, Segment List[1] represents the second-to-last SID of the path, and so on.

[0013] It can be seen that the SRH part of the SRv6 message has a large transmission overhead. Therefore, there is an urgent need for a method that can improve the transmission efficiency of SRv6 messages and save transmission bandwidth. Summary of the Invention

[0014] At least one embodiment of this application provides a message sending method, receiving method, device, and storage medium to solve the problem of high transmission overhead in the SRH part of SRv6 messages in the prior art.

[0015] To solve the above-mentioned technical problems, this application is implemented as follows:

[0016] In a first aspect, embodiments of this application provide a message transmission method, applied to a first device, comprising:

[0017] Determine the first category to which the first SRv6 message to be sent belongs, wherein different SRv6 messages in the same category have the same partial message header, the partial message header including one or more segment identifier (SID) fields;

[0018] The first part of the header corresponding to the first category is used to replace the first part of the header of the first SRv6 message in the header of the first SRv6 message to obtain the second SRv6 message. The first part of the header compression field includes the indication information of the first category. The length of the partial header compression field of a category is less than the length of the partial header compression field of that category.

[0019] Send the second SRv6 message.

[0020] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0021] Optionally, determine the first category to which the first SRv6 message belongs, including:

[0022] The header of the first SRv6 message is matched with the partial headers corresponding to each category, and the first category is obtained based on the category corresponding to the matched partial headers.

[0023] Optionally, the above methods also include:

[0024] Multiple SRv6 messages sent by the first device are classified, and SRv6 messages with the same partial message header are classified as the same.

[0025] Establish the correspondence between the SRv6 message category, partial message header, and compressed message header compression field, wherein the length of the partial message header compression field of a category is less than the length of the partial message header compression field of that category;

[0026] After establishing the correspondence for any category, if the first SRv6 message of any category is sent to the second device, the first SRv6 message will carry the correspondence between the any category, a portion of the message header of the any category, and a portion of the compressed message header field.

[0027] Optionally, the above methods also include:

[0028] When establishing the correspondence for each category, a timer is started for each category;

[0029] Once the target category to which any SRv6 message belongs is determined, the timer corresponding to the target category is reset and the countdown restarts;

[0030] When the timer for any category reaches the preset timeout threshold, the corresponding relationship for that category is deleted.

[0031] Optionally, the above methods also include:

[0032] After deleting the correspondence of any of the categories, a notification message is sent to the second device, the notification message being used to instruct the deletion of the correspondence of any of the categories.

[0033] Secondly, embodiments of this application provide a message receiving method, applied to a second device, comprising:

[0034] Receive a second SRv6 message sent by the first device, the second SRv6 message including indication information of the first category to which the SRv6 message belongs;

[0035] Based on the correspondence between the SRv6 message classification, partial message header, and partial message header compression field, the first partial message header and the first partial message header compression field corresponding to the first classification are determined. Among them, different SRv6 messages under the same classification have the same partial message header, and the partial message header includes one or more SID fields.

[0036] The first part of the header compression field in the second SRv6 message is replaced with the first part of the header to obtain the first SRv6 message.

[0037] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0038] Optionally, the above methods also include:

[0039] Receive the first SRv6 message of any category sent by the first device, wherein the first SRv6 message carries the correspondence between the any category, a portion of the message header of the any category, and a portion of the compressed field of the message header;

[0040] Establish the correspondence between any of the categories, partial headers, and partial header compression fields.

[0041] Optionally, the above methods also include:

[0042] Receive a notification message sent by the first device, the notification message being used to instruct the deletion of the correspondence of any category;

[0043] According to the notification message, delete the corresponding relationship of any of the categories.

[0044] Thirdly, embodiments of this application provide a first device, including a transceiver and a processor, wherein...

[0045] The processor is configured to determine the first category to which the first SRv6 message to be sent belongs, wherein different SRv6 messages under the same category have the same partial message header, the partial message header including one or more segment identifier (SID) fields; and replace the first partial message header corresponding to the first category in the message header of the first SRv6 message with the first partial message header compression field corresponding to the first category to obtain a second SRv6 message, wherein the first partial message header compression field includes indication information of the first category, and the length of the partial message header compression field of a category is less than the length of the partial message header compression field of that category;

[0046] The transceiver is used to send the second SRv6 message.

[0047] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0048] Optionally, the processor is further configured to: match the header of the first SRv6 message with the partial headers corresponding to each category, and obtain the first category based on the category corresponding to the matched partial headers.

[0049] Optionally, the processor is further configured to: classify multiple SRv6 messages sent by the first device, wherein SRv6 messages with the same partial message header are classified as the same category; establish a correspondence between the SRv6 message category, partial message header, and compressed message header compression field, wherein the length of the partial message header compression field of a category is less than the length of the partial message header compression field of that category.

[0050] The transceiver is further configured to: after establishing the correspondence for any category, if the first SRv6 message of any category is sent to the second device, the first SRv6 message carries the correspondence between the any category, a portion of the message header of the any category, and a portion of the compressed message header field.

[0051] Optionally, the processor is further configured to: start a timer for each category when establishing the correspondence between each category; reset the timer corresponding to the target category and start timing again when the target category to which any SRv6 message belongs is determined; and delete the correspondence between any category when the timer of any category reaches a preset timeout threshold.

[0052] Optionally, the transceiver is further configured to: after deleting the correspondence of any of the categories, send a notification message to the second device, the notification message being used to instruct the deletion of the correspondence of any of the categories.

[0053] Fourthly, embodiments of this application provide a first device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method described in the first aspect.

[0054] Fifthly, embodiments of this application provide a second device, including a transceiver and a processor, wherein...

[0055] The transceiver is used to receive a second SRv6 message sent by the first device, the second SRv6 message including indication information of the first category to which the SRv6 message belongs;

[0056] The processor is configured to determine the first partial header and the first partial header compression field corresponding to the first category based on the correspondence between the SRv6 message category, partial header, and partial header compression field, wherein different SRv6 messages under the same category have the same partial header, and the partial header includes one or more SID fields; and replace the first partial header compression field in the second SRv6 message with the first partial header to obtain the first SRv6 message.

[0057] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0058] Optionally, the transceiver is further configured to receive the first SRv6 message of any category sent by the first device, wherein the first SRv6 message carries the correspondence between the any category, a portion of the message header of the any category, and a portion of the compressed field of the message header;

[0059] The processor is also used to establish the correspondence between any of the categories, a portion of the message header, and a portion of the message header compression field.

[0060] Optionally, the transceiver is further configured to receive a notification message sent by the first device, the notification message being used to indicate the deletion of the correspondence of any category;

[0061] The processor is further configured to delete the corresponding relationship of any of the categories based on the notification message.

[0062] In a sixth aspect, embodiments of this application provide a second device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method described in the second aspect.

[0063] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a program that, when executed by a processor, implements the steps of the method described above.

[0064] Compared with the prior art, the message sending method, receiving method, device and storage medium provided in this application embodiment reduce message length, save transmission resources and improve transmission efficiency by replacing the same part of the message header in SRv6 messages under the same category with part of the message header compression field. Attached Figure Description

[0065] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0066] Figure 1 A schematic diagram of message encapsulation for SRv6;

[0067] Figure 2 A schematic diagram of a local area network for transmitting SRv6 messages;

[0068] Figure 3 This is a schematic diagram of an SRv6 message header with the same block as a related technology.

[0069] Figure 4 An example diagram of multiple SIDs contained in a SID List that have no common parts;

[0070] Figure 5 A flowchart illustrating the message transmission method of this application applied to a first device;

[0071] Figure 6 A flowchart illustrating the application of the message receiving method of this application to a second device;

[0072] Figure 7 This is a schematic diagram of the structure of a first device according to an embodiment of this application;

[0073] Figure 8 This is a schematic diagram of the structure of the first device according to another embodiment of this application;

[0074] Figure 9 This is a schematic diagram of the structure of a second device according to an embodiment of this application;

[0075] Figure 10 This is a schematic diagram of the structure of a second device according to another embodiment of this application;

[0076] Figure 11 This is a schematic diagram of the structure of the first device according to yet another embodiment of this application;

[0077] Figure 12 This is a schematic diagram of the structure of a second device according to yet another embodiment of this application. Detailed Implementation

[0078] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.

[0079] The terms “first,” “second,” etc., used in the specification and claims of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. The terms “and / or” in the specification and claims indicate at least one of the connected objects.

[0080] To improve the transmission efficiency of SRv6 messages, a related SRv6 compression method is proposed. Figure 2 The SRv6 segment addresses of the SRv6 packets transmitted within the same domain network shown are compressed. The compressed SRv6 segment addresses are usually SRv6 segment addresses with the same prefix that have been planned in advance. Figure 2 In this context, P represents the network service provider router, and PE represents the edge router. In the above method, programmable SIDs within the SRv6 domain are generally assigned the same block, resulting in redundant information in the domain's SID List. For example... Figure 3 As shown, if multiple SIDs in the SID List of the message header have the same Block segment, they can be compressed to carry only one Block segment, thereby reducing the message header length and improving transmission efficiency.

[0081] The above method compresses the same Block field within the same SRv6 message to reduce the message header length. For example... Figure 4As shown, in cross-domain SRv6 scenarios involving multiple Locator segments, or in scenarios where SRv6 Locator segments are not planned in advance, there are no common parts among the multiple Locator segments. For example, in an SRv6 packet that needs to be forwarded by multiple network devices, the SID List in its SRH header contains multiple SIDs that have no common parts. Therefore, the multiple SIDs in the SID List in the SRH header cannot be compressed, and the above method will not be applicable.

[0082] To address at least one of the above problems, embodiments of this application provide a message sending method and a message receiving method. This method compresses the message header by detecting fixed fields in different SRv6 message headers, achieving message header compression independent of the SRv6Locator address segment. This reduces the transmission overhead of the SRH portion in the SRv6 message, improves the transmission efficiency of the SRv6 message, and saves transmission bandwidth.

[0083] Please refer to Figure 5 The present application provides a message sending method, which, when applied to a first device, includes:

[0084] Step 51: Determine the first category to which the first SRv6 message to be sent belongs, wherein different SRv6 messages in the same category have the same partial message header, the partial message header including one or more segment identifier (SID) fields.

[0085] Here, in this embodiment of the application, SRv6 messages are pre-classified, and SRv6 messages with the same partial message header are classified into the same category. SRv6 message identification can be referred to... Figure 1 The packet header structure, in which the NextHeader field of the IPv6 basic header has a value of 53 and the Routing Type field of the Routing Extension Header has a value of 4, indicates that the IPv6 packet is an SRv6 packet.

[0086] The partial header includes at least one SID field. That is, there is at least one identical SID field among the headers of different SRv6 packets under the same category. Optionally, in this embodiment, the partial header may also include at least one of the following fields: source address field and destination address field.

[0087] In step 51, the first device matches the header of the first SRv6 message with the partial headers corresponding to each category, and obtains the first category based on the category corresponding to the matched partial headers.

[0088] Compared to the header compression method described above, which compresses the same block field in the same SRv6 message, this embodiment of the application classifies different SRv6 messages, thereby enabling the compression of the headers of different SRv6 messages within the same category.

[0089] Step 52: Replace the first part of the header corresponding to the first category in the header of the first SRv6 message with the first part of the header compression field corresponding to the first category to obtain the second SRv6 message. The first part of the header compression field includes the indication information of the first category.

[0090] Here, in this embodiment of the application, a correspondence is pre-established between the classification, partial header, and partial header compression field of each SRv6 message. In step 52, the partial header (referred to as the first partial header for ease of description) and the partial header compression field (referred to as the first partial header compression field for ease of description) corresponding to the first classification can be determined according to the correspondence. Then, the first partial header in the first SRv6 message is replaced with the first partial header compression field, thereby converting the first SRv6 message into the second SRv6 message.

[0091] It should be noted that, in the embodiments of this application, the length of the compressed field of the partial header corresponding to each category is less than the length of the partial header corresponding to that category, so as to reduce the header length and improve transmission efficiency.

[0092] Step 53: Send the second SRv6 message.

[0093] In step 53, the first device sends the second SRv6 message, thereby reducing the length of the SRv6 message, improving transmission efficiency, and saving transmission bandwidth resources.

[0094] Prior to step 51 above, the first device can classify its multiple SRv6 messages, grouping SRv6 messages with the same partial header into the same category. Then, for each category of SRv6 messages, a correspondence is established between the partial header and its compressed fields. The length of the compressed fields in a partial header within a category is shorter than the length of the partial headers within that category, and the compressed fields are different for different categories. This correspondence includes the partial header, specifically the various fields of the partial header and the position of each field in the SRH (Signal Message Header).

[0095] After establishing the correspondence for any category, if the first device sends the first SRv6 message of that category to the second device, the first device can negotiate with the second device to notify the second device of the aforementioned correspondence for that category. For example, the first device may include the correspondence between the category, a portion of the header of that category, and the compressed field of the header in the first SRv6 message. After receiving the first message of that category carrying the aforementioned information, the second device can establish and maintain the correspondence between the category, a portion of the header, and the compressed field of the header locally based on the aforementioned information. In this way, when sending subsequent SRv6 messages of that category, a method can be used... Figure 4 The method shown replaces a portion of the header of any category in subsequent SRv6 messages with a portion of the compressed header field of any category, thereby reducing header overhead and improving transmission efficiency.

[0096] Through the above steps, after establishing the correspondence of a certain category, this application embodiment only needs to carry the original message header and the correspondence of the category in the initial SRv6 message process (negotiation process) for that category. In subsequent SRv6 messages sent to the category, some of the message headers can be replaced with some compressed message header fields, thereby reducing the message length and saving transmission resources.

[0097] Optionally, in this embodiment, the compressed header field of any category may include indication information for that category. Specifically, the indication information for any category may be an index, number, etc., of that category.

[0098] To facilitate the receiving end's identification of SRv6 messages containing partial header compression fields, in this embodiment of the application, preferably, the partial header compression fields of any category may include a first field and a second field located at a preset fixed position in the SRH. The first field has a preset value used to indicate that the SRv6 message is an SRv6 message containing partial header compression fields. The second field carries at least the indication information of any category. The positions of the first field and the second field in the SRH may be adjacent or non-adjacent; this embodiment of the application does not specifically limit this.

[0099] Considering that SRv6 messages of a certain category may no longer be sent, or that the frequency of sending SRv6 messages of a certain category is very low, in order to save the maintenance cost of the correspondence, the embodiments of this application can perform aging processing on the correspondence.

[0100] Specifically, in this embodiment, when establishing each correspondence, a timer is started for each correspondence. For example, after establishing the first correspondence for the first category, a timer is started for the first correspondence. During the process of the first device sending SRv6 messages, when the target category to which any SRv6 message belongs is determined, the timer corresponding to the target category is reset and restarted. For example, when the first category is determined in step 51, the timer for the first correspondence is reset and restarted. When the timer for any category reaches a preset timeout threshold, the correspondence for that category is deleted to reduce the number of correspondences that need to be maintained and reduce the consumption of processing resources on the first device.

[0101] Optionally, embodiments of this application may also count the transmission frequency of SRv6 messages under each category. For example, the number of times SRv6 messages under each category are sent per unit time may be counted. If the number of times SRv6 messages are sent under any category is lower than a predetermined threshold, the correspondence of any category may be deleted to reduce the maintenance workload of the correspondence.

[0102] Furthermore, after deleting the correspondence for any category, the first device can also send a notification message to a target device. This notification message instructs the target device to delete the correspondence for that category, where the first device has already sent the correspondence for that category to it. For example, assuming the first device has already sent the correspondence for that category to a second device, after deleting the correspondence for that category, the first device can also send the aforementioned notification message to the second device. Based on the notification message, the second device then deletes the correspondence for that category that it maintains locally.

[0103] Please refer to Figure 6 The message receiving method provided in this application embodiment, when applied to a second device, includes:

[0104] Step 61: Receive a second SRv6 message sent by the first device. The second SRv6 message includes indication information of the first category corresponding to the second SRv6 message.

[0105] Here, the second SRv6 message is obtained by the first device replacing the first part of the header corresponding to the first category in the header of the first SRv6 message with the first part of the compressed header field corresponding to the first category. The first category is the category to which the first SRv6 message belongs. That is, the second SRv6 message includes the first part of the compressed header field corresponding to the first category, wherein the first part of the compressed header field includes the indication information of the first category.

[0106] As an optional implementation, in this embodiment, an SRv6 message containing a partial header compression field has a first field and a second field located at a preset fixed position in the SRH. The first field has a preset value indicating that the SRv6 message contains a partial header compression field. The second field carries at least indication information of the classification corresponding to the SRv6 message. The positions of the first field and the second field in the SRH can be adjacent or non-adjacent. Thus, after receiving a second SRv6 message, the second device can determine whether the second SRv6 message contains a partial header compression field by detecting whether the first field is the preset value. If it is determined that the second SRv6 message contains a partial header compression field, the second device can further detect the second field to determine the first classification corresponding to the second SRv6 message.

[0107] Step 62: Based on the correspondence between each category of SRv6 messages, partial headers, and partial header compression fields, determine the first partial header and the first partial header compression field corresponding to the first category. Different SRv6 messages under the same category have the same partial header, and the partial header includes one or more SID fields.

[0108] Step 63: Replace the first part of the compressed header field in the second SRv6 message with the first part of the header to obtain the first SRv6 message.

[0109] In steps 62-63 above, the second device can find the correspondence of the first category in the locally maintained correspondence of each category based on the first category, thereby obtaining the first part of the packet header and the first part of the packet header compression field corresponding to the first category. Based on the obtained first part of the packet header, the second device can determine the various fields of the first part of the packet header and the position of each field in the SRH, and accordingly replace the first part of the packet header compression field in the second SRv6 packet with the first part of the packet header, thereby recovering the first SRv6 packet.

[0110] Through the above steps, this embodiment of the application can reduce the header length of SRv6 messages of the same category when transmitting SRv6 messages, thus saving transmission resources.

[0111] In this embodiment of the application, optionally, the partial message header may further include at least one of the following fields: source address field and destination address field.

[0112] After recovering the first SRv6 message, the second device can forward it according to the SRv6 message forwarding method, which will not be elaborated here.

[0113] In addition, the second device can maintain a correspondence between the partial header and the partial compressed header field of the SRv6 message between the first device and the second device based on the information sent by the first device, so as to restore the received SRv6 message containing the partial compressed header field from the first device to an uncompressed SRv6 message.

[0114] Specifically, the second device receives the first SRv6 message of any category sent by the first device. This first SRv6 message carries a correspondence between the category, a portion of the header of that category, and a compressed field within that header. Thus, after receiving the first SRv6 message, the second device can locally establish the correspondence between the category, the portion of the header, and the compressed field. Subsequently, upon receiving another SRv6 message of the same category, the second device can replace the compressed field in that header to reconstruct the original SRv6 message.

[0115] Optionally, the second device may also receive a notification message sent by the first device, the notification message being used to instruct the deletion of the correspondence of any category; and then, according to the notification message, the correspondence of any category is deleted.

[0116] The various methods of the embodiments of this application have been described above. Apparatus for implementing the above methods will now be provided.

[0117] Please refer to Figure 7 This application also provides a first device, comprising:

[0118] The first determining module 701 is used to determine the first category to which the first SRv6 message to be sent belongs, wherein different SRv6 messages under the same category have the same partial message header, and the partial message header includes one or more segment identifier (SID) fields.

[0119] The replacement module 702 is used to replace the first part of the header corresponding to the first category in the header of the first SRv6 message with the first part of the header compression field corresponding to the first category to obtain the second SRv6 message. The first part of the header compression field includes the indication information of the first category. The length of the partial header compression field of a category is less than the length of the partial header compression field of that category.

[0120] The first sending module 703 is used to send the second SRv6 message.

[0121] Through the above modules, this application embodiment replaces part of the message header in the SRv6 message with part of the message header compression field, thereby reducing the message length and saving transmission resources.

[0122] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0123] Optionally, the first determining module is further configured to match the header of the first SRv6 message with the partial headers corresponding to each category, and obtain the first category based on the category corresponding to the matched partial headers.

[0124] Optionally, the first device mentioned above also includes:

[0125] The classification module is used to classify multiple SRv6 messages sent by the first device, wherein SRv6 messages with the same partial message header are classified as the same category;

[0126] The module is used to establish the correspondence between the classification of SRv6 messages, partial message headers, and compressed fields of compressed message headers. The length of the compressed field of a partial message header of a category is less than the length of the compressed field of the partial message header of that category.

[0127] The second sending module is configured to, after establishing the correspondence for any category, if send the first SRv6 message of any category to the second device, carry the correspondence between any category, a portion of the message header of any category, and a portion of the compressed field of the message header in the first SRv6 message.

[0128] Optionally, the first device mentioned above also includes:

[0129] The maintenance module is used to start a timer for each category when establishing the correspondence between each category; when the target category to which any SRv6 message belongs is determined, the timer corresponding to the target category is reset and restarted; when the timer of any category reaches a preset timeout threshold, the correspondence of that category is deleted.

[0130] Optionally, the first device mentioned above also includes:

[0131] The third sending module is used to send a notification message to the second device after deleting the correspondence of any of the categories, the notification message being used to instruct the deletion of the correspondence of any of the categories.

[0132] It should be noted that the device in this embodiment corresponds to the method applied to the first device side described above. The implementation methods in each of the above embodiments are applicable to the embodiments of this device and can achieve the same technical effect. The device provided in this application embodiment can implement all the method steps implemented in the above method embodiments and can achieve the same technical effect. Therefore, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail here.

[0133] Please refer to Figure 8 This application also provides a first device 800, including: a transceiver 801 and a processor 802;

[0134] The processor 802 is configured to determine the first category to which the first SRv6 message to be sent belongs, wherein different SRv6 messages under the same category have the same partial message header, the partial message header including one or more segment identifier (SID) fields; and replace the first partial message header corresponding to the first category in the message header of the first SRv6 message with the first partial message header compression field corresponding to the first category to obtain a second SRv6 message, wherein the first partial message header compression field includes indication information of the first category, and the length of the partial message header compression field of a category is less than the length of the partial message header compression field of that category;

[0135] The transceiver 801 is used to send the second SRv6 message.

[0136] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0137] Optionally, the processor is further configured to:

[0138] The header of the first SRv6 message is matched with the partial headers corresponding to each category, and the first category is obtained based on the category corresponding to the matched partial headers.

[0139] Optionally, the processor is further configured to:

[0140] Multiple SRv6 messages sent by the first device are classified, and SRv6 messages with the same partial message header are classified as the same.

[0141] Establish the correspondence between the SRv6 message category, partial message header, and compressed message header compression field, wherein the length of the partial message header compression field of a category is less than the length of the partial message header compression field of that category;

[0142] The transceiver is further configured to, after establishing the correspondence for any category, if send the first SRv6 message of any category to the second device, carry the correspondence between the any category, a portion of the message header of the any category, and a portion of the compressed field of the message header in the first SRv6 message.

[0143] Optionally, the processor is further configured to:

[0144] When establishing the correspondence for each category, a timer is started for each category;

[0145] Once the target category to which any SRv6 message belongs is determined, the timer corresponding to the target category is reset and the countdown restarts;

[0146] When the timer for any category reaches the preset timeout threshold, the corresponding relationship for that category is deleted.

[0147] Optionally, the transceiver is further configured to send a notification message to the second device after deleting the correspondence of any of the categories, the notification message being used to instruct the deletion of the correspondence of any of the categories.

[0148] It should be noted that the device in this embodiment corresponds to the method applied to the first device side described above. The implementation methods in each of the above embodiments are applicable to the embodiments of this device and can achieve the same technical effect. The device provided in this application embodiment can implement all the method steps implemented in the above method embodiments and can achieve the same technical effect. Therefore, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail here.

[0149] Please refer to Figure 9 This application also provides a second device, comprising:

[0150] The first receiving module 901 is used to receive a second SRv6 message sent by the first device, wherein the second SRv6 message includes indication information of the first category to which the SRv6 message belongs;

[0151] The first determining module 902 is used to determine the first partial header and the first partial header compression field corresponding to the first category based on the correspondence between the classification of SRv6 messages, partial headers, and partial header compression fields. Among them, different SRv6 messages under the same category have the same partial headers, and the partial headers include one or more SID fields.

[0152] Replacement module 903 is used to replace the first part of the packet header compression field in the second SRv6 packet with the first part of the packet header to obtain the first SRv6 packet.

[0153] Based on the above modules, in the embodiments of this application, when transmitting SRv6 messages, some of the message headers are replaced with some of the message header compression fields, thereby reducing the message length and saving transmission resources.

[0154] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0155] Optionally, the second device mentioned above also includes:

[0156] The second receiving module is used to receive the first SRv6 message of any category sent by the first device, wherein the first SRv6 message carries the correspondence between the any category, a portion of the message header of the any category, and a portion of the compressed field of the message header;

[0157] A module is established to create a correspondence between any of the categories, a portion of the message header, and a portion of the message header compression fields.

[0158] Optionally, the second device mentioned above also includes:

[0159] The third receiving module is used to receive a notification message sent by the first device, the notification message being used to indicate the deletion of the correspondence of any category;

[0160] The deletion module is used to delete the corresponding relationship of any category based on the notification message.

[0161] It should be noted that the device in this embodiment corresponds to the method applied to the second device described above. The implementation methods in each of the above embodiments are applicable to the embodiments of this device and can achieve the same technical effect. The device provided in this application embodiment can implement all the method steps implemented in the above method embodiments and can achieve the same technical effect. Therefore, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail here.

[0162] Please refer to Figure 10 This application also provides a second device 1000, including: a transceiver 1001 and a processor 1002;

[0163] The transceiver 1001 is used to receive a second SRv6 message sent by the first device, the second SRv6 message including indication information of the first category to which the SRv6 message belongs;

[0164] The processor 1002 is configured to determine the first partial header and the first partial header compression field corresponding to the first category based on the correspondence between the classification of SRv6 messages, partial headers, and partial header compression fields, wherein different SRv6 messages under the same category have the same partial header, and the partial header includes one or more SID fields; and replace the first partial header compression field in the second SRv6 message with the first partial header to obtain the first SRv6 message.

[0165] Optionally, the partial header may also include at least one of the following fields: source address field and destination address field.

[0166] Optionally, the transceiver is further configured to receive the first SRv6 message of any category sent by the first device, wherein the first SRv6 message carries the correspondence between the any category, a portion of the message header of the any category, and a portion of the compressed field of the message header;

[0167] The processor is also used to establish the correspondence between any of the categories, a portion of the message header, and a portion of the message header compression field.

[0168] Optionally, the transceiver is further configured to receive a notification message sent by the first device, the notification message being used to indicate the deletion of the correspondence of any category;

[0169] The processor is further configured to delete the corresponding relationship of any of the categories based on the notification message.

[0170] It should be noted that the device in this embodiment corresponds to the method applied to the second device described above. The implementation methods in each of the above embodiments are applicable to the embodiments of this device and can achieve the same technical effect. The device provided in this application embodiment can implement all the method steps implemented in the above method embodiments and can achieve the same technical effect. Therefore, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail here.

[0171] Please refer to Figure 11 This application also provides a terminal 1100, including a processor 1101, a memory 1102, and a computer program stored in the memory 1102 and executable on the processor 1101. When the computer program is executed by the processor 1101, it implements the various processes of the above-described message sending method and receiving method embodiments executed by the first device and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0172] Please refer to Figure 12This application also provides a network device 1200, including a processor 1201, a memory 1202, and a computer program stored in the memory 1202 and executable on the processor 1201. When the computer program is executed by the processor 1201, it implements the various processes of the above-described message sending method and receiving method embodiments executed by the second device and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0173] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the above-described message sending or receiving method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0174] It should be noted that, in this document, 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. Unless otherwise specified, 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 that element.

[0175] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0176] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A message transmission method, applied to a first device, characterized in that, include: Determine the first category to which the first SRv6 message to be sent belongs, wherein different SRv6 messages in the same category have the same partial message header, the partial message header including one or more segment identifier (SID) fields; The first part of the header corresponding to the first category is used to replace the first part of the header of the first SRv6 message in the header of the first SRv6 message to obtain the second SRv6 message. The first part of the header compression field includes the indication information of the first category. The length of the partial header compression field of a category is less than the length of the partial header field of that category. Send the second SRv6 message; Multiple SRv6 messages sent by the first device are classified, and SRv6 messages with the same partial message header are classified as the same. Establish the correspondence between SRv6 message categories, partial message headers, and compressed fields of compressed message headers. The length of the compressed field of a partial message header for a category is shorter than the length of the partial message header field for that category; and the compressed fields of partial message headers are different for different categories. After establishing the correspondence for any category, if the first SRv6 message of any category is sent to the second device, the first SRv6 message carries the correspondence between any category, a portion of the message header of any category, and a portion of the compressed message header field. The method further includes: When establishing the correspondence for each category, a timer is started for each category; Once the target category to which any SRv6 message belongs is determined, the timer corresponding to the target category is reset and the countdown restarts; When the timer for any category reaches the preset timeout threshold, the corresponding relationship for that category is deleted.

2. The method according to claim 1, characterized in that, The partial header also includes at least one of the following fields: source address field and destination address field.

3. The method according to claim 1, characterized in that, Determine the first category to which the first SRv6 message belongs, including: The header of the first SRv6 message is matched with the partial headers corresponding to each category, and the first category is obtained based on the category corresponding to the matched partial headers.

4. The method according to claim 1, characterized in that, Also includes: After deleting the correspondence of any of the categories, a notification message is sent to the second device, the notification message being used to instruct the deletion of the correspondence of any of the categories.

5. A message receiving method, applied to a second device, characterized in that, include: Receive a second SRv6 message sent by the first device, the second SRv6 message including indication information of the first category to which the SRv6 message belongs; Based on the correspondence between the SRv6 message classification, partial message header, and partial message header compression field, the first partial message header and the first partial message header compression field corresponding to the first classification are determined. Among them, different SRv6 messages under the same classification have the same partial message header, and the partial message header includes one or more SID fields. Replace the first part of the compressed header field in the second SRv6 message with the first part of the header to obtain the first SRv6 message; The first SRv6 message of any category sent by the first device is received. The first SRv6 message carries the correspondence between the category, a portion of the header of the category, and the compressed field of the portion of the header; and the compressed field of the portion of the header is different for different categories. Establish the correspondence between any of the aforementioned categories, a portion of the message header, and a portion of the compressed message header fields; The method further includes: Receive a notification message sent by the first device, the notification message being used to instruct the deletion of the correspondence of any category; According to the notification message, delete the corresponding relationship of any of the categories.

6. The method according to claim 5, characterized in that, The partial header also includes at least one of the following fields: source address field and destination address field.

7. A first device, characterized in that, Includes transceivers and processors, among which, The processor is configured to determine the first category to which the first SRv6 message to be sent belongs, wherein different SRv6 messages under the same category have the same partial message header, the partial message header including one or more segment identifier (SID) fields; and replace the first partial message header corresponding to the first category in the message header of the first SRv6 message with the first partial message header compression field corresponding to the first category to obtain a second SRv6 message, wherein the first partial message header compression field includes indication information of the first category, and the length of the partial message header compression field of a category is less than the length of the partial message header field of that category; The transceiver is used to send the second SRv6 message; The processor is further configured to: classify multiple SRv6 messages sent by the first device, wherein SRv6 messages with the same partial message header are classified as the same category; establish a correspondence between the SRv6 message category, partial message header, and compressed message header compression field, wherein the length of the compressed message header field of a category is less than the length of the partial message header field of that category; and the compressed message header fields of different categories are different; The transceiver is further configured to: after establishing the correspondence of any category, if the first SRv6 message of any category is sent to the second device, the first SRv6 message carries the correspondence between any category, a portion of the message header of any category, and a portion of the message header compression field. The processor is further configured to: start a timer for each category when establishing the correspondence between each category; reset the timer corresponding to the target category and start timing again when the target category to which any SRv6 message belongs is determined; and delete the correspondence between any category when the timer of any category reaches a preset timeout threshold.

8. The first device according to claim 7, characterized in that, The partial header also includes at least one of the following fields: source address field and destination address field.

9. The first device according to claim 7, characterized in that, The processor is further configured to: match the header of the first SRv6 message with the partial headers corresponding to each category, and obtain the first category based on the category corresponding to the matched partial headers.

10. The first device according to claim 7, characterized in that, The transceiver is further configured to: after deleting the correspondence of any of the categories, send a notification message to the second device, the notification message being used to instruct the deletion of the correspondence of any of the categories.

11. A first device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the first device as described in any one of claims 1 to 4.

12. A second device, characterized in that, Includes transceivers and processors, among which, The transceiver is used to receive a second SRv6 message sent by the first device, the second SRv6 message including indication information of the first category to which the SRv6 message belongs; The processor is configured to determine the first partial header and the first partial header compression field corresponding to the first category based on the correspondence between the SRv6 message category, partial header, and partial header compression field, wherein different SRv6 messages under the same category have the same partial header, and the partial header includes one or more SID fields; and replace the first partial header compression field in the second SRv6 message with the first partial header to obtain the first SRv6 message. The transceiver is further configured to receive the first SRv6 message of any category sent by the first device, wherein the first SRv6 message carries the correspondence between the category, a portion of the message header of the category, and a portion of the message header compression field; and the portion of the message header compression field is different for different categories. The processor is also used to establish the correspondence between any category, a portion of the message header, and a portion of the message header compression field; The transceiver is also used to receive a notification message sent by the first device, the notification message being used to instruct the deletion of the correspondence of any category; The processor is further configured to delete the corresponding relationship of any of the categories based on the notification message.

13. The second device according to claim 12, characterized in that, The partial header also includes at least one of the following fields: source address field and destination address field.

14. A second device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, performs the steps of the second device as described in any one of claims 5 to 6.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 6.