Message processing methods, devices, electronic equipment, and storage media

By determining the local identifier and pre-editing it during message processing, the SRV6 message editing and routing table lookup are decoupled, solving the problem of limited SRV6 message editing and enabling more flexible service planning and editing operations.

CN119561882BActive Publication Date: 2025-10-28SUZHOU CENTEC COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411757670.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-10-28
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In existing technologies, SRV6 message editing is coupled with routing table editing, which restricts route lookup editing, cannot support complex editing operations, and limits the flexibility of business planning.

Method used

By receiving the message to be edited, determining its local identifier, comparing it with a preset identifier, determining the target operation type based on consistency, pre-editing is performed, and then editing is performed based on the routing table, thus decoupling message editing from routing table lookup.

Benefits of technology

It achieves complete independence between message editing and routing table editing, avoids resource conflicts, and improves the flexibility of business planning and the independence of editing behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561882B_ABST
    Figure CN119561882B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a message processing method, apparatus, electronic device, and storage medium, relating to the field of message processing. The method includes: receiving a message to be edited; determining a first local identifier for the message to be edited; comparing the first local identifier with a local preset identifier; if the local identifier matches the local preset identifier, determining the target operation type corresponding to the local preset identifier; pre-editing the message to be edited based on the target operation type to obtain a first message; editing the first message based on a routing table to obtain a second message; and forwarding the second message. This makes the editing and the traditional editing behavior of routing table lookup completely independent and unrestricted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the existing technology, message editing methods include message editing and routing table-based editing. Message editing and routing table-based editing behaviors are coupled. In order to ensure the integrity of the message editing function, it is necessary to restrict the editing behavior corresponding to route lookup.

[0003] For example, when editing SRV6 messages, such as Figure 1 The diagram shows a flowchart illustrating the editing process of SRV6 packets and the editing process of SRV6 packets based on routing tables in the prior art.

[0004] When editing SRv6 packets, especially when editing based on the EndPoint node, there is a resource conflict between the first editing index from the EndPoint node and the first editing index from the route table lookup. In order to ensure the integrity of the SRv6 packet editing function, it is necessary to restrict the editing behavior corresponding to the route lookup. As a result, when there are SRv6 services in the service plan, the route can only support limited simple editing behavior because the corresponding editing table entries cannot be used. Summary of the Invention

[0005] The purpose of this invention is to provide a message processing method, apparatus, electronic device, and storage medium that can decouple message editing from routing table-based editing, thereby avoiding restrictions on the editing behavior of searching for corresponding routing tables.

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

[0007] In a first aspect, embodiments of this application provide a message processing method applied to a switching chip, the method comprising:

[0008] Receive messages to be edited;

[0009] Determine the first local identifier of the message to be edited;

[0010] The comparison is based on the first local terminal identifier and the local terminal preset identifier;

[0011] When the local identifier matches the local preset identifier, the target operation type corresponding to the local preset identifier is determined.

[0012] The message to be edited is pre-edited based on the target operation type to obtain the first message;

[0013] The first packet is edited based on the routing table to obtain the second packet;

[0014] The second message is forwarded.

[0015] In an optional implementation, the first message is an SRV6 message, and the step of pre-editing the message to be edited based on the target operation type to obtain the first message includes:

[0016] When the target operation type is swap, obtain the SL field of the message to be edited;

[0017] Obtain the SL-1 field from the SL field as the new destination address of the IPv6 packet of the message to be edited, and decrement the value of the SL field by 1 to obtain the first packet.

[0018] In an optional implementation, the first message is an SRV6 message, and the step of pre-editing the message to be edited based on the target operation type to obtain the first message includes:

[0019] When the target operation type is PSP, obtain the SL field of the message to be edited;

[0020] Obtain the SL-1 field from the SL field as the new destination address of the IPv6 packet of the message to be edited;

[0021] Obtain the NEXT Header field from the SRH field of the message to be edited;

[0022] Update the NEXT Header field in the SRH field to the NEXT Header field of the base message of the IPv6 message to be edited;

[0023] Delete the SRH field;

[0024] Update the payload length in the IPv6 basic header to obtain the first message.

[0025] In an optional implementation, the first message is an SRV6 message, and the step of pre-editing the message to be edited based on the target operation type to obtain the first message includes:

[0026] When the target operation type is USP, obtain the SRH field of the message to be edited;

[0027] Obtain the NEXT Header field from the SRH field of the message to be edited;

[0028] Update the NEXT Header field in the SRH field to the NEXT Header field of the base message of the IPv6 message to be edited;

[0029] Delete the SRH field;

[0030] Update the payload length in the IPv6 basic header to obtain the first message.

[0031] In an optional implementation, the first message is an SRV6 message, and the step of pre-editing the message to be edited based on the target operation type to obtain the first message includes:

[0032] When the target operation type is none, the message to be edited is used as the first message.

[0033] In an optional implementation, the switching chip includes an inbound node;

[0034] The first packet is edited at the inbound node based on the routing table to obtain the second packet.

[0035] In an optional implementation, the switching chip includes an outgoing node;

[0036] The first packet is edited at the outgoing node based on the routing table to obtain the second packet.

[0037] Secondly, embodiments of this application provide a message processing apparatus, the apparatus comprising:

[0038] The receiving module is used to receive messages to be edited.

[0039] The determination module is used to determine the first local terminal identifier of the message to be edited;

[0040] The comparison module is used to compare the first local identifier with a local preset identifier;

[0041] The determining module is further configured to: determine the target operation type corresponding to the local terminal preset identifier when the local terminal identifier is consistent with the local terminal preset identifier; pre-edit the message to be edited based on the target operation type to obtain a first message; and edit the first message based on the routing table to obtain a second message.

[0042] The forwarding module is used to forward the second message.

[0043] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the message processing method.

[0044] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the message processing method.

[0045] This application has the following beneficial effects:

[0046] This application receives a message to be edited, determines its first local identifier, compares it with a preset local identifier, and if they match, determines the target operation type corresponding to the preset local identifier. Based on this target operation type, it pre-edits the message to be edited to obtain a first message. Then, it edits the first message based on the routing table to obtain a second message, which is then forwarded. This makes the editing process completely independent of the traditional editing behavior of looking up the routing table, without any mutual restrictions. Attached Figure Description

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

[0048] Figure 1 This is a flowchart illustrating the SRV6 message editing process in the prior art.

[0049] Figure 2 This is a schematic diagram of the forwarding process of SRV6 messages in the prior art;

[0050] Figure 3 This diagram illustrates the editing process of a message on an ingress chip in existing technologies.

[0051] Figure 4 This diagram illustrates the editing process of a message on an egress chip in existing technologies.

[0052] Figure 5 This diagram illustrates how routing tables are edited for SRV6 packets in existing technologies.

[0053] Figure 6 A block diagram of an electronic device provided in an embodiment of the present invention;

[0054] Figure 7 This is one of the flowcharts illustrating a message processing method provided in an embodiment of the present invention;

[0055] Figure 8 This is a second flowchart illustrating a message processing method provided in an embodiment of the present invention.

[0056] Figure 9 This is a third flowchart illustrating a message processing method provided in an embodiment of the present invention.

[0057] Figure 10 The fourth flowchart illustrates a message processing method provided in an embodiment of the present invention.

[0058] Figure 11 This is a schematic diagram of the switching chip;

[0059] Figure 12 This is a structural block diagram of a message processing apparatus provided in an embodiment of the present invention. Detailed Implementation

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

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

[0062] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0063] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0064] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0065] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0066] In the existing technology, message editing methods include message editing and routing table-based editing. Message editing and routing table-based editing behaviors are coupled. In order to ensure the integrity of the message editing function, it is necessary to restrict the editing behavior corresponding to route lookup.

[0067] The following example demonstrates editing an SRV6 message.

[0068] SRv6 (Segment Routing IPv6) is a protocol designed based on source routing principles for forwarding IPv6 packets over a network. SRv6 achieves hop-by-hop forwarding by inserting a SRH (Segment Routing Header) into IPv6 packets, pushing an explicit IPv6 address stack onto the SRH, and having intermediate nodes continuously update the destination address and offset address stacks.

[0069] Nodes with SRv6 enabled maintain a local SID table, which contains information on all SRv6 SIDs generated on that node. The local SID table serves the following purposes:

[0070] Define a locally generated SID, such as End / End.X SID.

[0071] Specify the instructions to bind to these SIDs.

[0072] Store forwarding information associated with these instructions, such as the outgoing interface and the next hop.

[0073] There are many types of SRv6 SIDs, and different types of SRv6 SIDs represent different functions:

[0074] End SID stands for Endpoint SID, which is used to identify a specific destination node in the network.

[0075] End.X SID represents the Endpoint SID of a Layer 3 cross-connection, used to identify a link in the network.

[0076] In addition to the EndPoint node behavior, there are several additional behaviors defined to enhance the End series of instructions. These additional behaviors are optional and will change the execution action of the End series of instructions to meet richer business needs.

[0077] For example: PSP (Penultimate Segment POP of the SRH, the penultimate segment performs the SRH removal operation of the routing extension header): The penultimate segment performs the SRH removal operation of the routing extension header. Its function is similar to the penultimate hop popping (PHP) in the MPLS forwarding mechanism, which can improve forwarding efficiency.

[0078] USP (Ultimate Segment POP of the SRH, the last segment performs the SRH removal operation).

[0079] The forwarding process of SRV6 messages is as follows: Figure 2 As shown:

[0080] In SRv6, the Segments Left (SL) field is decremented by 1 each time an SRv6 node is passed, and the IPv6DA information is transformed once. The above steps are called Sid Swap processing.

[0081] If the SL value is n, then the IPv6 DA value is the value of Segment List[n].

[0082] If the SL value is n-1, then the IPv6 DA value is the value of Segment List[n-1]. ...

[0084] If the SL value is 1, then the IPv6 DA value is the value of Segment List[1].

[0085] If the SL value is 0, then the IPv6 DA value is the value of Segment List[0].

[0086] When a single chip cannot provide sufficient port density and bandwidth, multiple chips are often combined into a stacked system. A common architecture is as follows: Figure 3 and Figure 4 As shown:

[0087] When a message is received from the ingress chip, the forwarding table needs to be looked up to forward it from the remote chip. The message will first be forwarded to the intermediate transit chip for relay, and finally forwarded after reaching the egress chip.

[0088] like Figure 3 As shown, if the message editing is performed on the ingress chip, it is called ingressedit. Figure 4 As shown, if the message is edited on the egress chip, it is called an egress edit.

[0089] The advantage of ingress editing is that each chip manages and allocates its next-hop entries independently, eliminating the need for global planning. However, the disadvantage is that each chip needs to be aware of the editing information on the remote chip, and because the edited message may become longer, it consumes more bandwidth when transmitting between different chips.

[0090] The advantage of egress editing is that it doesn't require awareness of editing information on each chip, and since the message isn't edited on the ingress chip, it doesn't consume more bandwidth. However, the disadvantage is that the next-hop entry needs to be planned globally across all chips, and the next-hop entry index needs to be carried to the remote chip via the stacking header.

[0091] Editing SRV6 packets based on the routing table, such as... Figure 5 As shown, the next-hop index is obtained by looking up the forwarding table, and then the next-hop table entry is read. Depending on the complexity of the business, one or more edit indexes can be generated as needed. Through these edit indexes, the corresponding edit table entries are read, and the corresponding editing actions are completed based on the content in these edit table entries and the packet itself.

[0092] When editing SRV6 messages, such as Figure 1 As shown, SRv6 messages will not only execute EndPoint node behavior, but also the editing behavior corresponding to the route lookup results.

[0093] When editing SRV6 packets, there is a resource conflict between the first edit index from the EndPoint node and the first edit index from the route lookup table when editing based on the EndPoint node. In order to ensure the integrity of the SRv6 packet editing function, it is necessary to restrict the editing behavior corresponding to the route lookup. As a result, when there is SRv6 service in the service plan, the route can only support limited simple editing behavior because the corresponding editing table entries cannot be used.

[0094] Therefore, SRv6 editing and route lookup editing are completely independent in application, but now they are related. Given the need for SRv6 editing, route editing is restricted and weakened.

[0095] Furthermore, in terms of business planning, next-hop editing based on the routing table could be done at either the ingress or egress node. However, due to the limited information carried by the switching chip header, it cannot carry the first edit index to the remote node. Therefore, SRv6 packet editing can only support ingress node editing. Since packet editing can only be completed on a single node, this restricts next-hop editing to ingress node editing, creating limitations for upper-layer software when planning and distributing configuration entries.

[0096] In view of the above-mentioned problems, this embodiment provides a message processing method, apparatus, electronic device, and storage medium capable of receiving a message to be edited, determining a first local identifier of the message to be edited, comparing the first local identifier with a local preset identifier, determining the target operation type corresponding to the local preset identifier when the local identifier matches the local preset identifier, pre-editing the message to be edited based on the target operation type to obtain a first message, editing the first message based on a routing table to obtain a second message, and forwarding the second message. This makes the editing and the traditional editing behavior of routing table lookup completely independent and unrestricted. The solution provided in this embodiment will be described in detail below.

[0097] This embodiment provides an electronic device capable of processing messages. In one possible implementation, the electronic device can be a user terminal, such as, but not limited to, a server, smartphone, personal computer (PC), tablet computer, personal digital assistant (PDA), mobile internet device (MID), etc.

[0098] Please refer to Figure 6 , Figure 6 This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application. The electronic device 100 may further include... Figure 6 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 6 The components shown can be implemented using hardware, software, or a combination thereof.

[0099] The electronic device 100 includes a message processing device 110, a memory 120, and a processor 130.

[0100] The components of the memory 120 and processor 130 are electrically connected 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. The message processing device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or embedded in the operating system (OS) of the electronic device 100. The processor 130 is used to execute executable modules stored in the memory 120, such as the software function modules and computer programs included in the message processing device 110.

[0101] The memory 120 may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 120 is used to store programs, and the processor 130 executes the programs after receiving execution instructions.

[0102] Understandable. Figure 6 The structure shown is for illustrative purposes only. Electronic devices may also have more advanced features. Figure 6 Showing more or fewer components, or having with Figure 6 The different configurations shown are worth noting. Figure 6 The components shown can be implemented in hardware, software, or a combination thereof. That is to say, the implementation of the processing flow in the above embodiments is not limited to the processor reading and running purely computer-readable program code from memory, but can also be implemented through hardware or logic devices.

[0103] It should be understood here that improvements to a technology can be divided into hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) and software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology can now be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement to the methodology cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, VHDL (Very High Speed ​​Integrated Circuit Hardware Description Language) and Verilog are the most commonly used. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0104] Please refer to Figure 7 , Figure 7 For application Figure 6 The flowchart below shows a message processing method of an electronic device 100, and the method includes each step in detail.

[0105] S201: Receive the message to be edited.

[0106] S202: Determine the first local identifier of the message to be edited.

[0107] S203: Compare the first local identifier with the local preset identifier.

[0108] S204: When the local identifier is consistent with the local preset identifier, the target operation type corresponding to the local preset identifier is determined.

[0109] S205: Pre-edit the message to be edited based on the target operation type to obtain the first message.

[0110] S206: Edit the first packet based on the routing table to obtain the second packet.

[0111] S207: Forward the second message.

[0112] Each node is pre-configured with a local preset identifier. When a packet to be edited is received, the first local identifier of the packet is determined. The first local identifier is compared with the local preset identifier of the node in the switching chip. If the first local identifier of the packet to be edited matches the local preset identifier, the packet is edited according to the subsequent operations. If the first local identifier of the packet to be edited does not match the local preset identifier, no packet editing is required, and the packet is forwarded and edited according to the regular routing table.

[0113] The default identifier on the local node is the Local SID. The Local SID can instruct a node to perform specific routing actions, such as forwarding packets to another interface or modifying the segment list of a packet. A Local SID can be configured to forward packets to a specific next hop or send packets to a specific service chain. Local SIDs can be used to trigger specific service functions, such as firewalls, NAT (Network Address Translation), and load balancing. Local SIDs can be configured to send packets to a firewall for security checks. Local SIDs can be used to implement management functions, such as monitoring and logging.

[0114] Administrators can manually configure local identifiers (SIDs) to specify the behavior of each SID. For example, an administrator can configure a local SID fc00::1 on a router to instruct nodes to forward packets to a specific next hop.

[0115] Local SIDs can also be dynamically configured through automated tools or protocols. For example, an SDN controller can dynamically assign local SIDs to nodes and configure their behavior.

[0116] When it is determined that the local identifier is consistent with the local preset identifier, the target operation type corresponding to the local preset identifier is determined, and the message to be processed is edited based on the target operation type to realize the message editing behavior. After the message is edited, the first message is then edited in the traditional way, that is, the first message is edited based on the routing table to obtain the second message, and the second message is sent to the next node.

[0117] It should be noted that the message processing method of this application is not limited to forwarding and editing of SRV6 messages and routing forwarding. As long as there is a coupling or conflict between the editing of the original service and the editing of the ingress node or the editing of the egress node, the message processing method of this application can be used to decouple the editing of the message and the editing of the routing table.

[0118] The following example uses an SRV6 message as the first message. There are multiple ways to pre-edit the message to be edited based on the target operation type to obtain the first message. One such method is... Figure 8 As shown, it includes the following steps:

[0119] S301: When the target operation type is swap, obtain the SL field of the message to be edited.

[0120] S302: Obtain the SL-1 field from the SL field as the new destination address of the IPv6 packet to be edited, and decrement the value of the SL field by 1 to obtain the first packet.

[0121] In SRv6, a target operation type of "swap" refers to a specific operation type: a swap operation. This operation is primarily used to modify the current segment of a packet to be edited within the network. This is typically used to change the next-hop path or destination address of a packet.

[0122] Based on the SL field of the message to be edited, take the SID[SL-1] of the message to be edited as the new IPV6DA, and decrement the SL field by 1.

[0123] The following example uses an SRV6 message as the first message. There are multiple ways to pre-edit the message to be edited based on the target operation type to obtain the first message. One such method is... Figure 9 As shown, it includes the following steps:

[0124] S401: When the target operation type is PSP, retrieve the SL field of the message to be edited.

[0125] S402: Obtain the SL-1 field from the SL field as the new destination address of the IPv6 packet to be edited.

[0126] S403: Retrieve the NEXT Header field from the SRH field of the message to be edited.

[0127] S404: Update the NEXT Header field in the SRH field to the NEXT Header field of the base message of the IPv6 message to be edited.

[0128] S405: Delete the SRH field.

[0129] S406: Update the payload length in the IPv6 basic header to obtain the first message.

[0130] If the target operation type is PSP, then based on the SL field of the message to be edited, take the SID [SL-1] of the message to be edited as the new IPV6 DA, update the content of the next header field in the SRH of the message to be edited to the Next header of the IPV6 basic message header, delete the entire SRH, adjust the payload length field in the IPV6 basic message header, and subtract the length of the entire SRH.

[0131] For example, the initial state of an SRv6 message is as follows:

[0132] IPv6 Header:

[0133] Source Address:2001:db8::a

[0134] Destination Address:2001:db8::1

[0135] Next Header: 43 (indicating SRH)

[0136] Payload Length: 100

[0137] SRH:

[0138] Segments Left:1

[0139] Segment List:[SID【0】,SID【1】,SID【2】]

[0140] Next Header:17 (indicates UDP)

[0141] The current segment SID[1] is 2001:db8::2. The next segment SID[0] is 2001:db8::1. Update IPv6DA to 2001:db8::1. Update the Next Header field of the IPv6 basic header to 17 (the Next Header value in the SRH). Delete the entire SRH. Assuming the SRH length is 24 bytes, subtract 24 bytes from the Payload Length field. The new PayloadLength = 100 - 24 = 76.

[0142] Final state:

[0143] IPv6 Header:

[0144] Source Address:2001:db8::a

[0145] Destination Address:2001:db8::1

[0146] Next Header:17 (indicates UDP)

[0147] Payload Length: 76

[0148] The following example uses an SRV6 message as the first message. There are multiple ways to pre-edit the message to be edited based on the target operation type to obtain the first message. One such method is... Figure 10 As shown, it includes the following steps:

[0149] S501: When the target operation type is USP, obtain the SRH field of the message to be edited.

[0150] S502: Retrieve the NEXT Header field from the SRH field of the message to be edited.

[0151] S503: Update the NEXT Header field in the SRH field to the NEXT Header field of the base message of the IPv6 message to be edited.

[0152] S504: Delete the SRH field.

[0153] S505: Update the payload length in the IPv6 basic header to obtain the first message.

[0154] If the target operation type is USP, then update the next header field of the SRH of the message to be edited to the Next header of the IPv6 basic header, delete the entire SRH, adjust the Payload length field in the IPv6 basic header, and subtract the length of the entire SRH.

[0155] In SRv6, USP (Uniform Service Path) is a specific operation type used to ensure consistent service paths across the network. The USP operation ensures that all packets meeting certain conditions follow the same path.

[0156] Copy the Next Header field value from the SRH to the Next Header field of the IPv6 base packet header. This ensures the packet can be correctly parsed and processed upon arrival at its final destination. Remove the SRH portion from the packet. This simplifies the packet structure, retaining only the basic IPv6 header and upper-layer protocol data. Subtract the length of the SRH and update the Payload Length field in the IPv6 base packet header. This ensures the packet length information is accurate.

[0157] The following example uses an SRV6 message as the first message. When the target operation type is none, the message to be edited is taken as the first message.

[0158] If the target operation type is none, then no SRv6 editing is required, and no operation is performed.

[0159] like Figure 11 The switching chip includes an inbound node 1, which edits the first packet at the inbound node based on the routing table to obtain the second packet. The switching chip also includes an outbound node 2, which edits the first packet at the outbound node based on the routing table to obtain the second packet.

[0160] The advantage of editing the first packet at the inbound node based on the routing table is that the next-hop table entry is managed and allocated separately for each chip, eliminating the need for global planning.

[0161] The advantage of editing the first packet at the outgoing node based on the routing table is that it does not need to be aware of the editing information on each chip, and since the packet is not edited on the ingress chip, it does not consume more bandwidth.

[0162] Therefore, the message processing method provided in this application decouples message editing from routing table-based editing, allowing for flexible selection of whether to edit at the inbound or outbound node.

[0163] Please refer to Figure 12 This application embodiment also provides an application for Figure 6 The message processing device 110 of the electronic device 100 includes:

[0164] The receiving module 111 is used to receive messages to be edited;

[0165] The determining module 112 is used to determine the first local terminal identifier of the message to be edited;

[0166] Comparison module 113 is used to compare the first local identifier with a local preset identifier;

[0167] The determining module 112 is further configured to: determine the target operation type corresponding to the local terminal preset identifier when the local terminal identifier is consistent with the local terminal preset identifier; pre-edit the message to be edited based on the target operation type to obtain a first message; and edit the first message based on the routing table to obtain a second message.

[0168] Forwarding module 114 is used to forward the second message.

[0169] This application also provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer-executable instructions, which, when executed by the processor 130, implement a method for processing the message.

[0170] This application embodiment also provides a computer-readable storage medium storing a computer program, which, when executed by a processor 130, implements a method for processing the message.

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

[0172] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

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

[0174] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A message processing method, characterized in that, Applied to a switching chip, the method includes: Receive messages to be edited; Determine the first local identifier of the message to be edited; The comparison is based on the first local terminal identifier and the local terminal preset identifier; When the local identifier matches the local preset identifier, the target operation type corresponding to the local preset identifier is determined. The message to be edited is pre-edited based on the target operation type to obtain the first message; The first packet is edited based on the routing table to obtain the second packet; The second message is forwarded.

2. The method according to claim 1, characterized in that, The first message is an SRV6 message. The step of pre-editing the message to be edited based on the target operation type to obtain the first message includes: When the target operation type is swap, obtain the SL field of the message to be edited; Obtain the SL-1 field from the SL field as the new destination address of the IPv6 packet of the message to be edited, and decrement the value of the SL field by 1 to obtain the first packet.

3. The method according to claim 1, characterized in that, The first message is an SRV6 message. The step of pre-editing the message to be edited based on the target operation type to obtain the first message includes: When the target operation type is PSP, obtain the SL field of the message to be edited; Obtain the SL-1 field from the SL field as the new destination address of the IPv6 packet of the message to be edited; Obtain the NEXT Header field from the SRH field of the message to be edited; Update the NEXT Header field in the SRH field to the NEXT Header field of the base message of the IPv6 message to be edited; Delete the SRH field; Update the payload length in the IPv6 basic header to obtain the first message.

4. The method according to claim 1, characterized in that, The first message is an SRV6 message. The step of pre-editing the message to be edited based on the target operation type to obtain the first message includes: When the target operation type is USP, obtain the SRH field of the message to be edited; Obtain the NEXT Header field from the SRH field of the message to be edited; Update the NEXT Header field in the SRH field to the NEXT Header field of the base message of the IPv6 message to be edited; Delete the SRH field; Update the payload length in the IPv6 basic header to obtain the first message.

5. The method according to claim 1, characterized in that, The first message is an SRV6 message. The step of pre-editing the message to be edited based on the target operation type to obtain the first message includes: When the target operation type is none, the message to be edited is used as the first message.

6. The method according to claim 1, characterized in that, The switching chip includes an inbound node; The first packet is edited at the inbound node based on the routing table to obtain the second packet.

7. The method according to claim 1, characterized in that, The switching chip includes an outgoing node; The first packet is edited at the outgoing node based on the routing table to obtain the second packet.

8. A message processing apparatus, characterized in that, The device includes: The receiving module is used to receive messages to be edited. The determination module is used to determine the first local terminal identifier of the message to be edited; The comparison module is used to compare the first local identifier with a local preset identifier; The determining module is further configured to: determine the target operation type corresponding to the local terminal preset identifier when the local terminal identifier is consistent with the local terminal preset identifier; pre-edit the message to be edited based on the target operation type to obtain a first message; and edit the first message based on the routing table to obtain a second message. The forwarding module is used to forward the second message.

9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method according to any one of claims 1-7.

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

Citation Information

Patent Citations

  • Routing information editing method and device, storage medium and electronic device

    CN116366516A

  • Route editing method, system and equipment and readable storage medium

    CN118646703A