Message processing method and device, electronic equipment and storage medium

By receiving messages to be edited and pre-edited, combined with routing table editing, decoupling between message editing and routing table editing is achieved, solving the problem of limited routing editing capabilities caused by editing behavior coupling in the prior art, and improving the editing capabilities and flexibility of routing.

CN119561882AActive Publication Date: 2025-03-04SUZHOU CENTEC COMM CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the coupling of message editing and editing behavior based on routing tables leads to the need to limit the corresponding editing behavior of route search, which limits the editing ability of routes, especially when editing SRv6 messages, resulting in limited business planning.

Method used

By receiving the message to be edited, the first local side identifier is determined, and based on the comparison of the identifier with the local side preset identifier, the target operation type is determined, the message is pre-edited, and the first message is obtained, and the first message is edited based on the routing table, the second message is obtained, and the second message is finally forwarded.

Benefits of technology

Decoupling of message editing and routing table editing is realized, avoiding restrictions on the corresponding editing behavior of routing table search, and improving the editing ability and flexibility of routing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561882A_ABST
    Figure CN119561882A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message processing method and device, electronic equipment and a storage medium, and relates to the field of message processing, and the method comprises the steps: receiving a to-be-edited message, determining a first local end identifier of the to-be-edited message, and comparing the first local end identifier with a local end preset identifier, and when the local end identifier is consistent with the local end preset identifier, determining a target operation type corresponding to the local end 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 the routing table to obtain a second message, and forwarding the second message. Therefore, the traditional editing behaviors corresponding to editing and routing table lookup are completely independent and are not limited to each other.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the prior art, 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 the routing lookup.

[0003] For example, when editing an SRV6 message, Figure 1 As shown, it is a schematic diagram of the process of editing SRV6 message and editing SRV6 message based on routing table in the prior art.

[0004] When editing SRv6 messages based on the EndPoint node, there is a resource conflict between the first edit index output by the EndPoint node and the first edit index output by searching the routing table. In order to ensure the integrity of the SRv6 message editing function, it is necessary to restrict the editing behavior corresponding to the routing search. As a result, when SRv6 services are included in the service planning, the routing can only support limited simple editing behaviors because the corresponding editing table items cannot be used. Summary of the invention

[0005] The object of the present invention is to provide a message processing method, device, electronic device and storage medium, which can realize the decoupling of message editing and editing based on routing table pairs, thereby avoiding restrictions on the editing behavior corresponding to routing table lookup.

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

[0007] In a first aspect, an embodiment of the present application provides a method for processing a message, which is applied to a switching chip, and the method includes:

[0008] Receive a message to be edited;

[0009] Determining a first local end identifier of the message to be edited;

[0010] Based on the comparison between the first local identifier and a local preset identifier;

[0011] When the local-end identifier is consistent with the local-end preset identifier, determining the target operation type corresponding to the local-end preset identifier;

[0012] Pre-editing the message to be edited based on the target operation type to obtain a first message;

[0013] Edit the first message based on the routing table to obtain a second message;

[0014] The second message is forwarded.

[0015] In an optional implementation manner, 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 a swap type, obtaining the SL field of the message to be edited;

[0017] The SL-1 field is obtained from the SL field as a new destination address of the IPv6 message of the message to be edited, and the value of the SL field is reduced by 1 to obtain a first message.

[0018] In an optional implementation manner, 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 a psp type, obtaining the SL field of the message to be edited;

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

[0021] Obtaining the NEXT Header field in the SRH field in the message to be edited;

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

[0023] Deleting the SRH field;

[0024] Update the effective load length in the IPv6 basic message header to obtain a first message.

[0025] In an optional implementation manner, 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 a usp type, obtaining the SRH field of the message to be edited;

[0027] Obtaining the NEXT Header field in the SRH field in the message to be edited;

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

[0029] Deleting the SRH field;

[0030] Update the effective load length in the IPv6 basic message header to obtain a first message.

[0031] In an optional implementation manner, 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 message is edited at the inbound node based on the routing table to obtain a second message.

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

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

[0037] In a second aspect, an embodiment of the present application provides a message processing device, the device comprising:

[0038] A receiving module, used for receiving a message to be edited;

[0039] A determination module, used for determining a first local end identifier of the message to be edited;

[0040] A comparison module, configured to compare the first local end identifier with a local end preset identifier;

[0041] The determination module is further configured to determine, when the local end identifier is consistent with the local end preset identifier, a target operation type corresponding to the local end 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] A forwarding module is used to forward the second message.

[0043] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the message processing method when executing the computer program.

[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the message processing method when executed by a processor.

[0045] This application has the following beneficial effects:

[0046] The present application receives a message to be edited, determines the first local end identifier of the message to be edited, compares the first local end identifier with the local end preset identifier, and when the local end identifier is consistent with the local end preset identifier, determines the target operation type corresponding to the local end preset identifier, pre-edits the message to be edited based on the target operation type to obtain a first message, edits the first message based on a routing table to obtain a second message, and forwards the second message. This makes the traditional editing behaviors corresponding to the editing and routing table search completely independent and mutually unrestricted. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0048] Figure 1 It is a flow chart of SRV6 message editing in the prior art;

[0049] Figure 2 Schematic diagram of the forwarding process of SRV6 message in the prior art;

[0050] Figure 3 This is a schematic diagram of the editing action of a message on an ingress chip in the prior art;

[0051] Figure 4 This is a schematic diagram of the editing action of a message on an egress chip in the prior art;

[0052] Figure 5 A schematic diagram of editing an SRV6 message in a routing table in the prior art;

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

[0054] Figure 7 One of the flow charts of a method for processing a message provided in an embodiment of the present invention;

[0055] Figure 8 A second flow chart of a method for processing a message provided by an embodiment of the present invention;

[0056] Fig. 9 A third flow chart of a method for processing a message provided by an embodiment of the present invention;

[0057] Fig.10 A fourth flowchart of a method for processing a message provided by an embodiment of the present invention;

[0058] Fig.11 It is a schematic diagram of the switching chip;

[0059] Fig.12 A structural block diagram of a message processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

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

[0062] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0063] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0064] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0065] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0066] In the prior art, 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 the routing lookup.

[0067] The following takes the editing of SRV6 message as an example.

[0068] SRv6 (Segment Routing IPv6, segment routing based on IPv6 forwarding plane) is a protocol designed based on the source routing concept to forward IPv6 data packets on the network. SRv6 inserts a routing extension header SRH (Segment Routing Header) into the IPv6 message, pushes an explicit IPv6 address stack into the SRH, and the intermediate nodes continuously update the destination address and offset address stack to complete hop-by-hop forwarding.

[0069] An SRv6-enabled node maintains a local SID table that contains all SRv6 SID information generated on the node. The local SID table has the following uses:

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

[0071] Specifies the directives to bind to these SIDs.

[0072] Stores forwarding information related to these instructions, such as outgoing interface and 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 destination node in the network.

[0075] End.X SID indicates the endpoint SID of a Layer 3 cross connection and is 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 actions of the End series of instructions to meet more diverse business needs.

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

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

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

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

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

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

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

[0085] If the SL value is 0, 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 stacking system. Common architectures include Figure 3 and Figure 4 As shown:

[0087] The message is received from the ingress chip, and the forwarding table is searched to forward it from the remote chip. The message will first be forwarded to the intermediate transit chip for transfer, and finally forwarded after reaching the egress chip.

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

[0089] The advantage of ingress edit is that the next-hop table entry is managed and allocated separately for each chip, and no global planning is required. However, the disadvantage is that each chip needs to perceive the edit information on the remote chip, and the edited message may become longer, resulting in more bandwidth being occupied when transmitted between different chips.

[0090] The advantage of egress edit is that it does not need to perceive the edit information on each chip, and since the message is not edited on the ingress chip, it does not occupy more bandwidth. However, the disadvantage is that the next-hop table entry needs to be globally planned on all chips, and the next-hop table entry index needs to be carried to the remote chip through the stacking header.

[0091] The behavior of editing SRV6 messages based on the routing table is as follows Figure 5 As shown, by looking up the forwarding table to obtain the next hop index, and then reading the next hop table entry, one or more editing indexes can be generated as needed according to the complexity of the business. Through these editing indexes, the corresponding editing table entries are read, and the corresponding editing actions are completed according to the contents of these editing table entries combined with the message Packet itself.

[0092] When editing an SRV6 message, Figure 1 As shown in the figure, the SRv6 message not only executes the EndPoint node behavior, but also executes the editing behavior corresponding to the route search result.

[0093] When editing an SRV6 message, 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 routing table search. In order to ensure the integrity of the SRv6 message editing function, it is necessary to restrict the editing behavior corresponding to the routing search. As a result, when there is SRv6 service in the service planning, the route can only support limited simple editing behavior because the corresponding editing table entry cannot be used.

[0094] Therefore, the editing of SRv6 and the editing behavior corresponding to route lookup are completely independent from the application perspective, but now the two are related. Under the premise of the existence of SRv6 editing requirements, route editing is restricted and weakened.

[0095] In addition, in business planning, the next hop editing behavior based on the routing table may be based on the editing behavior of the ingress node or the egress node. However, due to the limited information carried by the switching chip Header, it is impossible to carry the first editing index to the remote node, so the editing of the SRv6 message can only support the editing behavior of the ingress node. Since the editing of the message can only be completed on one node, the editing behavior of the routing next hop is limited to the editing behavior of the ingress node, resulting in limitations in the upper-layer software when planning and sending configuration table items.

[0096] In view of the discovery of the above problems, this embodiment provides a message processing method, device, electronic device and storage medium, which can receive a message to be edited, determine the first local end identifier of the message to be edited, compare the first local end identifier with the local end preset identifier, and when the local end identifier is consistent with the local end preset identifier, determine the target operation type corresponding to the local end preset identifier, pre-edit the message to be edited based on the target operation type to obtain a first message, edit the first message based on the routing table to obtain a second message, and forward the second message. The traditional editing behaviors corresponding to the editing and routing table search are completely independent and do not restrict each other. The solution provided by this embodiment is described in detail below.

[0097] This embodiment provides an electronic device that can process messages. In a possible implementation, the electronic device can be a user terminal, for example, the electronic device can be, but is not limited to, a server, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), etc.

[0098] Please refer to Figure 6 , Figure 6 1 is a schematic diagram of the structure of the electronic device 100 provided in the embodiment of the present application. The electronic device 100 may also include Figure 6 More or fewer components as shown, or with Figure 1 Different configurations shown. Figure 6 Each component shown in the figure can be implemented by 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 memory 120 and the processor 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements 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 solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the 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, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.

[0102] Understandably, Figure 6 The structure shown is for illustration only. The electronic device may also have Figure 6 More or fewer components than shown, or with Figure 6 Different configurations are shown. It is worth noting that Figure 6 The components shown can be implemented by hardware, software or a combination thereof. That is, the implementation of the processing flow in the above embodiments is not limited to the processor reading and running pure computer-readable program code from the memory, but can also be implemented by hardware or logic devices.

[0103] It should be understood here that improvements to a technology can be divided into hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) and software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user programming the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and make a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, 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, RHDL (Ruby Hardware Description Language), etc. Among them, VHDL (Very High Speed ​​Integrated Circuit Hardware Description Language) and Verilog are currently the most commonly used. Those skilled in the art should also be aware that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0104] Please refer to Figure 7 , Figure 7 For application Figure 6 The flowchart of a message processing method of the electronic device 100 is shown in FIG. 1 , and the method including each step is described in detail below.

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

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

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

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

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

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

[0111] S207: Forward the second message.

[0112] Each node is pre-configured with a local-end preset identifier. When receiving a message to be edited, the first local-end identifier of the message to be edited is determined, and the first local-end identifier is compared with the local-end preset identifier of the node of the switching chip. When the first local-end identifier of the message to be edited is consistent with the local-end preset identifier, the message is edited according to subsequent operations. When the first local-end identifier of the message to be edited is inconsistent with the local-end preset identifier, there is no need to edit the message to be edited, and it is subsequently forwarded and edited according to the conventional routing table.

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

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

[0115] The local SID can also be dynamically configured through an automated tool or protocol. For example, the SDN controller can dynamically assign the local SID to a node and configure its behavior.

[0116] When it is determined that the local-end identifier is consistent with the local-end preset identifier, the target operation type corresponding to the local-end preset identifier is determined, and the message to be processed is edited based on the target operation type to implement the editing behavior of the message. After editing the message, the edited first message is further traditionally edited, that is, the first message is edited based on the routing table to obtain a second message, and the second message is sent to the next node.

[0117] It should be noted that the message processing method of the present application is not limited to the forwarding editing of SRV6 message + routing forwarding. As long as there is a coupling or conflict relationship between the editing of the original business and the ingress node editing or egress node editing behavior, the editing of the message and the editing of the routing table can be decoupled based on the message processing method of the present application.

[0118] In the following, when the first message is an SRV6 message, an example is given. There are multiple implementation methods for pre-editing the message to be edited based on the target operation type to obtain the first message. In one implementation method, for example Figure 8 As shown, the following steps are included:

[0119] S301: When the target operation type is a swap type, 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 message of the message to be edited, and subtract 1 from the value of the SL field to obtain the first message.

[0121] In SRv6, the target operation type is swap, which refers to a specific operation type, namely the swap operation. This operation is mainly used to change the current segment of the message to be edited in the network. This is usually used to change the next hop path or target address of the message.

[0122] According to the SL field of the message to be edited, the SID [SL-1] of the message to be edited is taken as the new IPV6DA, and the SL field is reduced by 1.

[0123] In the following, when the first message is an SRV6 message, an example is given. There are multiple implementation methods for pre-editing the message to be edited based on the target operation type to obtain the first message. In one implementation method, for example Fig. 9 As shown, the following steps are included:

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

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

[0126] S403: Obtain the NEXT Header field in the SRH field in the message to be edited.

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

[0128] S405: Delete the SRH field.

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

[0130] When the target operation type is psp type, according to the SL field of the message to be edited, take the SID [SL-1] of the message to be edited as the new IPV6DA, update the next header field content 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 (indicates 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 length of the SRH is 24 bytes, subtract 24 bytes from the Payload Length field. The new Payload Length = 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] In the following, when the first message is an SRV6 message, an example is given. There are multiple implementation methods for pre-editing the message to be edited based on the target operation type to obtain the first message. In one implementation method, for example Fig.10 As shown, the following steps are included:

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

[0150] S502: Obtain the NEXT Header field in the SRH field in the message to be edited.

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

[0152] S504: Delete the SRH field.

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

[0154] If the target operation type is usp type, the next header field content in the SRH of the message to be edited is updated to the Next header of the IPv6 basic message header, the entire SRH is deleted, and the Payload length field in the IPv6 basic message header is adjusted to subtract the length of the entire SRH.

[0155] In SRv6, USP (Uniform Service Path) is a specific type of operation used to implement a consistent service path in the network. The USP operation ensures that all packets that meet specific conditions follow the same path.

[0156] Copy the Next Header field value in the SRH to the Next Header field in the IPv6 basic header. This ensures that the message can be correctly parsed and processed when it reaches the final destination. Delete the SRH part from the message. This will make the structure of the message simpler, 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 basic header. This ensures that the length information of the message is accurate.

[0157] The following takes the case where the first message is an SRV6 message as an example. 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, no SRv6 editing is required and no operation is performed.

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

[0160] The advantage of editing the first message at the inbound node based on the routing table is that each chip of the next hop table entry is managed and allocated separately, and no global planning is required.

[0161] The advantage of editing the first message at the outgoing node based on the routing table is that there is no need to perceive the editing information on each chip, and since the message is not edited on the ingress chip, it will not occupy more bandwidth.

[0162] Therefore, the message processing method provided in the present application realizes the decoupling of message editing and routing table-based editing, so it is possible to flexibly choose to edit the nodes in the inbound direction or the outbound direction.

[0163] Please refer to Fig.12 The present application embodiment also provides a method for applying Figure 6 The message processing device 110 of the electronic device 100 includes:

[0164] A receiving module 111, used for receiving a message to be edited;

[0165] A determination module 112, configured to determine a first local end identifier of the message to be edited;

[0166] A comparison module 113, configured to compare the first local end identifier with a local end preset identifier;

[0167] The determination module 112 is further configured to determine a target operation type corresponding to the local preset identifier when the local identifier is consistent with the local 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] The forwarding module 114 is configured to forward the second message.

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

[0170] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the method for processing the message is implemented.

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

[0172] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.

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

[0174] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for processing a message, characterized in that: Applied to a switching chip, the method comprises: Receive a message to be edited; Determining a first local end identifier of the message to be edited; Based on the comparison between the first local identifier and a local preset identifier; When the local-end identifier is consistent with the local-end preset identifier, determining the target operation type corresponding to the local-end preset identifier; Pre-editing the message to be edited based on the target operation type to obtain a first message; Edit the first message based on the routing table to obtain a second message; The second message is forwarded.

2. The method according to claim 1, characterized in that 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: When the target operation type is a swap type, obtaining the SL field of the message to be edited; The SL-1 field is obtained from the SL field as a new destination address of the IPv6 message of the message to be edited, and the value of the SL field is reduced by 1 to obtain a first message.

3. The method according to claim 1, characterized in that 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: When the target operation type is a psp type, obtaining the SL field of the message to be edited; Acquire the SL-1 field from the SL field as a new destination address of the IPv6 message of the message to be edited; Obtaining the NEXT Header field in the SRH field in the message to be edited; Update the NEXT Header field in the SRH field to the NEXT Header field of the basic message of the IPv6 message of the message to be edited; Deleting the SRH field; Update the effective load length in the IPv6 basic message header to obtain a first message.

4. The method according to claim 1, characterized in that: 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: When the target operation type is a usp type, obtaining the SRH field of the message to be edited; Obtaining the NEXT Header field in the SRH field in the message to be edited; Update the NEXT Header field in the SRH field to the NEXT Header field of the basic message of the IPv6 message of the message to be edited; Deleting the SRH field; Update the effective load length in the IPv6 basic message header to obtain a first message.

5. The method according to claim 1, characterized in that 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: 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 message is edited at the inbound node based on the routing table to obtain a second message.

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

8. A message processing device, characterized in that: The device comprises: A receiving module, used for receiving a message to be edited; A determination module, used for determining a first local end identifier of the message to be edited; A comparison module, configured to compare the first local end identifier with a local end preset identifier; The determination module is further configured to determine, when the local end identifier is consistent with the local end preset identifier, a target operation type corresponding to the local end 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; A forwarding module is used to forward the second message.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.

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

Citation Information

Patent Citations

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

    CN116366516A

  • SRv6 message processing method and device, communication equipment and storage medium

    CN116846862A

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

    CN118646703A

  • Apparatus and method for flow-through editing in a quote-reply messaging system

    US20240267347A1