A method and device for editing routing information

By matching and editing routing information, the routing segment set of the target routing path is determined and edited into the initial message, which solves the problem of high editing space occupancy in the existing technology and realizes more efficient routing information editing.

CN116366518BActive Publication Date: 2024-12-24SUZHOU CENTEC COMM CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111621059.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2024-12-24
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

In the prior art, the editing space occupies a high rate when editing routing information, and puts forward higher requirements on the chip resource waste and editing capabilities, and no effective solution has yet.

Method used

By obtaining the initial message to be forwarded, matching the target routing path and reference routing path indicated by the target routing node, determining the routing segment set of multiple target reference routing paths, and editing it into the initial message to form the target routing information carrying the target routing information The target packets can avoid coupled editing of routing segments and reduce editing space.

Benefits of technology

It realizes more routing information editing with less editing space, reduces the requirements for the routing segment editing space and editing capabilities of the message editing device, and solves the problem of high editing space occupancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366518B_ABST
    Figure CN116366518B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for editing routing information, wherein the method includes: obtaining an initial message to be forwarded, wherein the initial message is used to request that the initial message be forwarded to a target routing node; matching a target routing path indicated by the target routing node with a reference routing path to obtain multiple target reference routing paths; determining multiple routing segment sets corresponding to the multiple target reference routing paths as routing segment sets corresponding to the target routing node; and editing the multiple routing segment sets into the initial message to obtain a target message carrying target routing information. Through the present invention, the problem of high editing space occupancy when editing routing information existing in the related art is solved, thereby achieving the effect of reducing the editing space occupancy when editing routing information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of message processing, and in particular to a method and device for editing routing information. Background Art

[0002] Segment Routing is a source routing technology. SRv6 (Segment Routing Internet Protocol Version 6) is an SR (Segment Routing) solution based on IPv6 (Internet Protocol Version 6). SRv6 further enhances the network programmability by relying on the IPv6 data plane, which is conducive to supporting network and service programmability and opening up end-to-end network channels. Figure 1 This is a schematic diagram of the current SRv6 message encapsulation format, where SRH (Segment Routing Header) and SID List (Segment Identifier List) are encapsulated after the IPv6 Header. SRH contains 7 fields: Next Header (indicating the type of header following the SID List), Header Ext Length (the length of the SID List), Routing Type, Segment Left (the number of remaining segments), Last Entry (the last SID in the SID List), Flags (an 8-bit identifier), and Tag (indicating the grouping or type of the message).

[0003] In order to apply the SRv6 protocol in the VPN network, the HeadEnd and End nodes in the SRv6 protocol can be used as PE (Provider Edge) and P (Provider, backbone router in the service provider network) nodes in the VPN (Virtual Private Network) network, respectively, for protocol message encapsulation and message forwarding. At the same time, SID0 is called VPN SID, and SID1-SIDn are called PATH SID. Figure 2This is a schematic diagram of the current VPN network forwarding path. CE1 sends packets to CE2 and CE3 respectively. The forwarding paths of the two packets in the service provider network are the same, but they are forwarded to different CEs according to different VPN SIDs. In other words, the PATH SIDs of the two packets are the same, and only the VPN SIDs are different. Then the situation of VPN SID:PATH SID=N:1 will appear. Such a scenario is often used in the actual deployment of VPN networks. When PE1 receives a packet sent from CE1 to CE2 or CE3, PE1 will search the corresponding VPN instance forwarding table according to the VPN bound to the inbound interface of the packet, thereby obtaining the SID information of the remote VPN instance, and determine that the outbound interface of the VPN route is the SRv6 Policy tunnel according to the information in the forwarding table. PE1 encapsulates a layer of SRH+SIDList and IPv6 Header on the original packet and then forwards it. The SID List contains VPN SID and PATH SID.

[0004] In applications, the same PATH SID may correspond to multiple VPN SIDs. In related technologies, VPN SID and PATH SID are coupled together. That is, each routing path is edited separately. If different VPNSIDs need to be edited but the messages with the same PATH SIDs need to be edited, multiple entries of the SID List will be occupied, resulting in a waste of chip resources. This also places higher demands on the chip's editing capabilities.

[0005] With regard to the problem of high editing space occupancy when editing routing information in the related art, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present invention provide a method and device for editing routing information, so as to at least solve the problem of high editing space occupancy rate when editing routing information in the related art.

[0007] According to one embodiment of the present invention, a method for editing routing information is provided, comprising: obtaining an initial message to be forwarded, wherein the initial message is used to request that the initial message be forwarded to a target routing node; matching a target routing path indicated by the target routing node with a reference routing path to obtain multiple target reference routing paths; determining multiple routing segment sets corresponding to the multiple target reference routing paths as routing segment sets corresponding to the target routing node, wherein the target reference routing path is a reference routing path in the reference routing paths that matches the target routing path; editing the multiple routing segment sets into the initial message to obtain a target message carrying target routing information, wherein the target routing information is used to indicate that the target message is forwarded to the target routing node according to the target routing path.

[0008] Optionally, determining the multiple routing segment sets corresponding to the multiple target reference routing paths as the routing segment sets corresponding to the target routing node includes: determining multiple editors corresponding to the multiple target reference routing paths, wherein each of the multiple editors is used to edit corresponding initial routing information in a format matched by the each editor, and the initial routing information is used to indicate routing according to the target reference routing path corresponding to the each editor; determining the multiple routing segment sets corresponding to the multiple target reference routing paths according to the initial routing information edited by each of the multiple editors; and determining the multiple routing segment sets as the routing segment sets corresponding to the target routing node.

[0009] Optionally, determining the multiple routing segment sets corresponding to the multiple target reference routing paths based on the initial routing information edited by each of the multiple editors includes: obtaining first routing information edited by a first editor, and obtaining second routing information edited by a second editor, wherein the multiple editors include the first editor and the second editor, the first routing information is used to indicate routing information of a tunnel-level routing path in the target routing path, the second routing information is used to indicate routing information of a user-level routing path in the target routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set; determining the first routing segment set and the second routing segment set as the multiple routing segment sets corresponding to the multiple target reference routing paths.

[0010] Optionally, determining the multiple editors corresponding to the multiple target reference routing paths includes: determining index information corresponding to each target routing path in the multiple target reference routing paths; and searching for the multiple editors according to the index information.

[0011] Optionally, the editing of the multiple routing segment sets into the initial message to obtain a target message carrying target routing information includes: editing the multiple routing segment sets into the initial message to obtain an intermediate message carrying intermediate routing information, wherein the intermediate routing information has a corresponding relationship with the multiple routing segment sets; adjusting the intermediate routing information to target routing information to obtain a target message carrying the target routing information.

[0012] Optionally, the editing of the multiple routing segment sets into the initial message to obtain the intermediate message carrying the intermediate routing information includes: saving the first routing information edited by the first editor in a temporary variable set, and saving the second routing information edited by the second editor in the temporary variable set, wherein the first routing information is used to indicate the routing information of the tunnel-level routing path in the target routing path, and the second routing information is used to indicate the routing information of the user-level routing path in the target routing path, the multiple target reference routing paths include the tunnel-level routing path and the user-level routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set; when it is determined that the first routing information and the second routing information are all saved in the temporary variable set, editing the initial protocol message header, the initial routing message header, the first routing segment set, and the second routing segment set to the target position of the initial message according to the target editing format to obtain the intermediate message.

[0013] Optionally, adjusting the intermediate routing information to target routing information to obtain a target message carrying the target routing information includes: changing a field in an initial routing message header of the intermediate routing information according to the routing segments included in the multiple routing segment sets to obtain a message to be processed carrying a target routing message header; and changing a field in an initial protocol message header of the message to be processed according to the routing segments included in the multiple routing segment sets to obtain the target message carrying the target routing information.

[0014] According to another embodiment of the present invention, there is also provided a device for editing routing information, comprising: an acquisition module, used to acquire an initial message to be forwarded, wherein the initial message is used to request that the initial message be forwarded to a target routing node; a matching module, used to match a target routing path indicated by the target routing node with a reference routing path to obtain multiple target reference routing paths; a determination module, used to determine multiple routing segment sets corresponding to the multiple target reference routing paths as routing segment sets corresponding to the target routing node, wherein the target reference routing path is a reference routing path in the reference routing path that matches the target routing path; an editing module, used to edit the multiple routing segment sets into the initial message to obtain a target message carrying target routing information, wherein the target routing information is used to indicate that the target message is forwarded to the target routing node according to the target routing path.

[0015] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0016] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0017] According to the present invention, an initial message to be forwarded is obtained, wherein the initial message is used to request that the initial message be forwarded to a target routing node; a target routing path indicated by the target routing node is matched with a reference routing path to obtain multiple target reference routing paths; multiple routing segment sets corresponding to the multiple target reference routing paths are determined as routing segment sets corresponding to the target routing node, wherein the target reference routing path is a reference routing path in the reference routing path that matches the target routing path; multiple routing segment sets are edited into the initial message to obtain a target message carrying target routing information, wherein the target routing information is used to indicate that the target message is forwarded to the target routing node according to the target routing path, that is, multiple routing segment sets corresponding to multiple reference routing paths that have a matching relationship with the target routing path are used as routing segment sets of the target routing path, and when editing the target routing information to be forwarded according to the target routing path for the initial message, the target routing information is determined according to the target routing path. The target routing path of the initial message is determined according to the destination routing node of the initial message, and the target reference routing path matching the target routing path is determined by matching the target routing path and the reference routing path. The target message routed according to the target routing path is obtained by taking the multiple routing segment sets corresponding to the multiple target reference routing paths as the routing segment sets of the target routing segments and then editing the multiple routing segment sets into the initial message. This avoids coupling the various routing segments in the target routing path together and editing the routing path of each message separately in the related art, thereby reducing the editing space occupied by the routing segments of the message editing device and reducing the requirements for the routing segment editing capabilities of the message editing device, so that more routing information can be edited through less editing space. Therefore, the problem of high editing space occupancy when editing routing information in the related art is solved, and the effect of reducing the editing space occupancy when editing routing information is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a diagram of the current SRv6 message encapsulation format;

[0019] Figure 2 It is a schematic diagram of the current VPN network forwarding path;

[0020] Figure 3 is a hardware structure block diagram of a mobile terminal of a method for editing routing information according to an embodiment of the present invention;

[0021] Figure 4 is a flow chart of a method for editing routing information according to an embodiment of the present invention;

[0022] Figure 5 is a schematic diagram of an optional target message format according to an embodiment of the present invention;

[0023] Figure 6is a schematic diagram of an optional edit table index according to an embodiment of the present invention;

[0024] Figure 7 4 is a structural block diagram of a device for editing routing information according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 3 FIG. 1 is a block diagram of the hardware structure of a mobile terminal according to the method for editing routing information in an embodiment of the present invention. Figure 3 As shown, the mobile terminal may include one or more ( Figure 3 Only one is shown in the figure) a processor 302 (the processor 302 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 304 for storing data, wherein the mobile terminal may also include a transmission device 306 and an input / output device 308 for communication functions. It can be understood by those skilled in the art that Figure 3 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 3 Different configurations are shown.

[0028] The memory 304 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for editing routing information in the embodiment of the present invention. The processor 302 executes various functional applications and data processing by running the computer program stored in the memory 304, that is, to implement the above method. The memory 304 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 304 may further include a memory remotely arranged relative to the processor 302, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0029] The transmission device 306 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 306 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 306 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0030] In this embodiment, a method for editing routing information is provided. Figure 4 is a flow chart of a method for editing routing information according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0031] Step S402, obtaining an initial message to be forwarded, wherein the initial message is used to request that the initial message be forwarded to a target routing node;

[0032] Step S404, matching the target routing path indicated by the target routing node with the reference routing path to obtain multiple target reference routing paths;

[0033] Step S406, determining the multiple routing segment sets corresponding to the multiple target reference routing paths as the routing segment set corresponding to the target routing node, wherein the target reference routing path is a reference routing path in the reference routing paths that matches the target routing path;

[0034] Step S408: edit the plurality of routing segment sets into the initial message to obtain a target message carrying target routing information, wherein the target routing information is used to indicate that the target message is forwarded to the target routing node according to the target routing path.

[0035] Through the above steps, multiple routing segment sets corresponding to multiple reference routing paths that have a matching relationship with the target routing path are used as routing segment sets of the target routing path. When editing the target routing information forwarded according to the target routing path for the initial message, the target routing path of the initial message is determined according to the destination routing node of the initial message, and the target reference routing path matching the target routing path is determined by matching the target routing path and the reference routing path. By using multiple routing segment sets corresponding to multiple target reference routing paths as routing segment sets of the target routing segments, the multiple routing segment sets are edited into the initial message to obtain the target message routed according to the target routing path, thereby avoiding the coupling of the routing segments in the target routing path and editing the routing path of each message separately in the related art, thereby reducing the editing space occupied by the routing segments of the message editing device and reducing the requirements for the routing segment editing capability of the message editing device, so that more routing information can be edited through less editing space. Therefore, the problem of high editing space occupancy when editing routing information in the related art is solved, and the effect of reducing the editing space occupancy when editing routing information is achieved.

[0036] In the technical solution provided in the above step S402, the target routing node is the end point of the routing path of the initial message. The target routing node can be a user device or a service provider device. For example, the target routing device can be a user network edge device (such as a router or routing switch used by the user), a service provider network edge device, a backbone router in the service provider network, etc.

[0037] In the technical solution provided in the above step S404, the target routing path may include a tunnel-level routing path and a user-level routing path, or the target routing path may only include a tunnel-level routing path.

[0038] Optionally, in this embodiment, one or more identical routing nodes may exist between each target routing path in the multiple target routing paths, or the routing nodes included in each target routing path may be different, which is not limited in this solution.

[0039] Optionally, in this embodiment, the target reference routing path is a routing path that has been established on the device.

[0040] Optionally, in this embodiment, the path length of the target routing path is greater than the length of each target reference routing path, and multiple target reference routing paths can be combined to obtain the target routing path. For example, the target routing path includes node 1, node 2, node 3, node 4, and node 5 connected in sequence. When forwarding or routing, it is sent from node 5 to node 1 in sequence. The path from node 2 to node 5 is a tunnel-level routing path, and the path from node 1 to node 2 is a user-level routing path. At this time, the reference routing path can be the routing path from node 5 to node 3, the routing path from node 3 to node 2, and the routing path from node 2 to node 1.

[0041] Optionally, in this embodiment, the path lengths of the target reference routing paths may be the same or different, and this solution does not limit this.

[0042] In the technical solution provided in the above step S406, the routing segment set corresponding to each reference routing path may include, but is not limited to, one or more routing segments.

[0043] In the technical solution provided in the above step S408, the target routing information is routing information in a target format, such as routing information in an IPv6 format, routing information in an SRv6 format, etc. Figure 5 is a schematic diagram of an optional target message format according to an embodiment of the present invention. In this embodiment, the target message is routing information in SRv6 format as an example. Figure 5 As shown, the following contents may be included but are not limited to: the initial message is in the Inner Packet position, and the initial message is preceded by SRv6 routing information (including SRH and SID List, where SID List includes VPN SID and Path SID), IPv6 routing information (including IPv6 Header, IPSA and IPDA), and Outer Ether Header.

[0044] As an optional embodiment, determining the plurality of routing segment sets corresponding to the plurality of target reference routing paths as the routing segment set corresponding to the target routing node includes:

[0045] Determine a plurality of editors corresponding to the plurality of target reference routing paths, wherein each of the plurality of editors is used to edit corresponding initial routing information according to a format matched with the editor, and the initial routing information is used to indicate routing according to the target reference routing path corresponding to the editor;

[0046] Determine the plurality of routing segment sets corresponding to the plurality of target reference routing paths according to the initial routing information edited by the each editor of the plurality of editors;

[0047] The multiple routing segment sets are determined as routing segment sets corresponding to the target routing node.

[0048] Optionally, in this embodiment, the editor is used to edit routing information. The editor may be in the form of an edit table in which fixed fields for editing routing information are stored. Alternatively, the editor may be a packaged script containing code for editing routing information. This solution does not limit this.

[0049] As an optional embodiment, determining the multiple routing segment sets corresponding to the multiple target reference routing paths according to the initial routing information edited by each of the multiple editors includes:

[0050] Acquire first routing information edited by a first editor, and acquire second routing information edited by a second editor, wherein the multiple editors include the first editor and the second editor, the first routing information is used to indicate routing information of a tunnel-level routing path in the target routing path, the second routing information is used to indicate routing information of a user-level routing path in the target routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set;

[0051] The first routing segment set and the second routing segment set are determined as the multiple routing segment sets corresponding to the multiple target reference routing paths.

[0052] Optionally, in this embodiment, the number of first editors can be one or more. For example, the target routing path is composed of SID1, SID2, SID3, SID4, SID5 arranged in sequence, where SID2, SID3, SID4, SID5 are routing segments of the tunnel-level routing path, and SID1 is a routing segment of the user-level routing path. In this case, the first editor can be an editor that can edit the routing information of SID2, SID3, SID4, and SID5, or the first editor can also be two editors, one for editing the routing information of SID2 and SID3, and the other for editing the routing information of SID4 and SID5. This solution does not limit this.

[0053] Optionally, in this embodiment, the protocol message header is a message header for forwarding a message according to a certain protocol, and the protocol message header may include but is not limited to an IPv6 protocol message header, an IPv4 protocol message header, and the like.

[0054] Optionally, in this embodiment, the routing message header is a message header for performing segment routing on the routing path, for example, the routing message header may be an SRH message header.

[0055] As an optional embodiment, determining a plurality of editors corresponding to the plurality of target reference routing paths includes:

[0056] Determine index information corresponding to each target routing path in the multiple target reference routing paths;

[0057] The plurality of editors are searched for according to the index information.

[0058] Figure 6 is a schematic diagram of an optional editing table index according to an embodiment of the present invention. In this embodiment, the editor is an editing table for editing routing information, such as Figure 6As shown, the initial message (Raw Packet) carries the destination routing node information to which the routing is requested. By parsing the initial message, the corresponding target routing path can be matched in the message forwarding table according to the destination routing node information. By matching with the preset reference routing path, multiple target reference routing paths that match the target routing path are determined, so that the routing segments corresponding to the multiple target reference routing paths can be used as the routing segments of the target routing path. Therefore, it is necessary to find the editing table corresponding to the target reference routing path, so that the index information (NHPtr) of the target reference routing path can be determined to find the corresponding editing table (DsNexthop). The DsNexthop table includes important fields {InnerEditPtr, OuterEditPtr, DestInterfaceId}, InnerEditPtr is used to index the editing information of SRH and Path SID; OuterEditPtr is used to index the editing information of IPv6 Header and VPN SID; DestInterface is used to index the export Interface information. The DsL3EditAddIp6ExtHeader table contains several important information {SRH, Path SID (1-N)}, SRH is used to edit SRH information; Path SID is used to edit other SIDs in the SID List except VPN SID, among which, according to the provisions of the Srv6 protocol, SIDN is also used to edit IPDa in the outer IPv6 header. The DsL3EditAddIp6Sr table includes important fields {SidEditPtr, L2EditPtr, IPSa}, SidEditPtr is used to index the editing information of VPN SID; L2EditPtr is used to index the editing information of the outer layer 2 header; IPSa is used to edit IPSa in the outer IPv6 header. The DsDestInterface table includes important fields {RoutermacId}, RoutermacId is used to index DsEgressRoutermac to obtain information for editing the outer MacSa. The DsL3EditAddIp6SrVpnSid table is used to edit the VPN SID; the DsL2Eidt table is used to edit the outer layer 2 header, including Vlan and MacDa.

[0059] Depend on Figure 6It can be seen that VPN SID and Path SID are edited using two different table entries, namely DsL3EditAddIp6ExtHeader and DsL3EditAddIp6SrVpnSid. ​​DsNexthop uses InnerEditPtr to index DsL3EditAddIp6ExtHeader to obtain SRH and Path SID; uses OuterEditPtr to index DsL3EditAddIp6Sr table entry, and then uses SidEditPtr in DsL3EditAddIp6Sr to index DsL3EditAddIp6SrVpnSid to obtain VPNSID. In this way, VPN SID and Path SID can be flexibly matched to achieve the purpose of decoupling and save chip table entries.

[0060] exist Figure 6 In the editing table index diagram, the entire message editing process includes: the message queries the forwarding table through the IPDA of the original message in the ingress processing engine (IPE) to obtain NHPtr. Next, after the message carries NHPtr to EPE, the DsNexthop table is obtained according to the NHPtr index, and the InnerEditPtr, OuterEditPtr and DsDestInterfaceId are further used to index DsL3EditAddIp6ExtHeader, DsL3EditAddIp6Sr and DsDestInterface. The information for editing SRH and Path SID (using SID N to edit the IPDa of the outer IPv6 header) is obtained from DsL3EditAddIp6ExtHeader, the IPSa, VPN SID of the outer IPv6 header, and the Vlan and MACDa of the outer layer 2 header are obtained from DsL3EditAddIp6Sr, and the information for editing the MACSa of the outer layer 2 header is obtained from DsDestInterface.

[0061] As an optional embodiment, the editing the plurality of routing segment sets into the initial message to obtain a target message carrying target routing information includes:

[0062] Editing the multiple routing segment sets into the initial message to obtain an intermediate message carrying intermediate routing information, wherein the intermediate routing information has a corresponding relationship with the multiple routing segment sets;

[0063] The intermediate routing information is adjusted to target routing information, and a target message carrying the target routing information is obtained.

[0064] Optionally, in this embodiment, editing multiple routing segment sets into the initial message can be editing the routing information edited by each editor into the corresponding position of the initial message by setting the corresponding offset value according to the order of the indexed editors, or the routing information edited by each editor can be stored in a temporary variable set. After determining that all routing information exists in the temporary variable set, the corresponding data is extracted from the temporary variable set in turn according to the format of the target message and edited into the initial message. This solution does not limit this.

[0065] As an optional embodiment, the editing the plurality of routing segment sets into the initial message to obtain the intermediate message carrying the intermediate routing information includes:

[0066] The first routing information edited by the first editor is saved in a temporary variable set, and the second routing information edited by the second editor is saved in the temporary variable set, wherein the first routing information is used to indicate the routing information of the tunnel-level routing path in the target routing path, and the second routing information is used to indicate the routing information of the user-level routing path in the target routing path, the multiple target reference routing paths include the tunnel-level routing path and the user-level routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set;

[0067] When it is determined that the first routing information and the second routing information are all stored in the temporary variable set, the initial protocol message header, the initial routing message header, the first routing segment set and the second routing segment set are edited to the target position of the initial message according to the target editing format to obtain the intermediate message.

[0068] Optionally, in this embodiment, the first routing information edited by the first editor and the second routing information edited by the second editor may be stored in the same temporary variable set or in different temporary variable sets.

[0069] As an optional embodiment, the adjusting the intermediate routing information to the target routing information to obtain the target message carrying the target routing information includes:

[0070] Modify the fields in the initial routing message header of the intermediate routing information according to the routing segments included in the plurality of routing segment sets to obtain a to-be-processed message carrying a target routing message header;

[0071] The fields in the initial protocol message header of the message to be processed are modified according to the routing segments included in the plurality of routing segment sets to obtain the target message carrying the target routing information.

[0072] Optionally, in this embodiment, the fields in the changed routing message header may include but are not limited to NextHeader, Segment Left, etc.

[0073] Optionally, in this embodiment, the fields in the modified protocol message header may include but are not limited to NextHeader, IPDA, etc.

[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0075] In this embodiment, a device for editing routing information is also provided. Figure 7 is a structural block diagram of a device for editing routing information according to an embodiment of the present invention, such as Figure 7 As shown, the device comprises:

[0076] An acquisition module 72, configured to acquire an initial message to be forwarded, wherein the initial message is used to request that the initial message be forwarded to a target routing node;

[0077] A matching module 74, configured to match the target routing path indicated by the target routing node with the reference routing path to obtain a plurality of target reference routing paths;

[0078] A determination module 76, configured to determine the plurality of routing segment sets corresponding to the plurality of target reference routing paths as the routing segment set corresponding to the target routing node, wherein the target reference routing path is a reference routing path among the reference routing paths that matches the target routing path;

[0079] The editing module 78 is used to edit the multiple routing segment sets into the initial message to obtain a target message carrying target routing information, wherein the target routing information is used to indicate that the target message is forwarded to the target routing node according to the target routing path.

[0080] Optionally, the determination module includes: a first determination unit, used to determine a plurality of editors corresponding to the plurality of target reference routing paths, wherein each of the plurality of editors is used to edit corresponding initial routing information in a format matched with the each editor, and the initial routing information is used to indicate routing according to the target reference routing path corresponding to the each editor; a second determination unit, used to determine the plurality of routing segment sets corresponding to the plurality of target reference routing paths based on the initial routing information edited by the each of the plurality of editors; and a third determination unit, used to determine the plurality of routing segment sets as the routing segment sets corresponding to the target routing node.

[0081] Optionally, the second determination unit is used to: obtain first routing information edited by a first editor, and obtain second routing information edited by a second editor, wherein the multiple editors include the first editor and the second editor, the first routing information is used to indicate routing information of a tunnel-level routing path in the target routing path, and the second routing information is used to indicate routing information of a user-level routing path in the target routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set; the first routing segment set and the second routing segment set are determined as the multiple routing segment sets corresponding to the multiple target reference routing paths.

[0082] Optionally, the first determining unit is used to: determine index information corresponding to each target routing path in the multiple target reference routing paths; and search for the multiple editors according to the index information.

[0083] Optionally, the editing module includes: an editing unit, used to edit the multiple routing segment sets into the initial message to obtain an intermediate message carrying intermediate routing information, wherein the intermediate routing information has a corresponding relationship with the multiple routing segment sets; an adjustment unit, used to adjust the intermediate routing information to target routing information to obtain a target message carrying the target routing information.

[0084] Optionally, the editing unit is used to: save the first routing information edited by the first editor in a temporary variable set, and save the second routing information edited by the second editor in the temporary variable set, wherein the first routing information is used to indicate the routing information of the tunnel-level routing path in the target routing path, and the second routing information is used to indicate the routing information of the user-level routing path in the target routing path, the multiple target reference routing paths include the tunnel-level routing path and the user-level routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set; when it is determined that the first routing information and the second routing information are all saved in the temporary variable set, the initial protocol message header, the initial routing message header, the first routing segment set and the second routing segment set are edited to the target position of the initial message according to the target editing format to obtain the intermediate message.

[0085] Optionally, the adjustment unit is used to: change the fields in the initial routing message header of the intermediate routing information according to the routing segments included in the multiple routing segment sets to obtain a to-be-processed message carrying a target routing message header; change the fields in the initial protocol message header of the to-be-processed message according to the routing segments included in the multiple routing segment sets to obtain the target message carrying the target routing information.

[0086] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0087] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0088] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0089] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0090] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0091] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0092] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

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

Claims

1. A method for editing routing information, characterized in that: include: Acquire an initial message to be forwarded, wherein the initial message is used to request that the initial message be forwarded to a target routing node; Matching the target routing path indicated by the target routing node with the reference routing path to obtain multiple target reference routing paths; Determine a plurality of routing segment sets corresponding to the plurality of target reference routing paths as a routing segment set corresponding to the target routing node, wherein the target reference routing path is a reference routing path among the reference routing paths that matches the target routing path; Editing the plurality of routing segment sets into the initial message to obtain a target message carrying target routing information, wherein the target routing information is used to indicate that the target message is forwarded to the target routing node according to the target routing path; The step of determining the multiple routing segment sets corresponding to the multiple target reference routing paths as the routing segment sets corresponding to the target routing node comprises: determining multiple editors corresponding to the multiple target reference routing paths, wherein each of the multiple editors is used to edit corresponding initial routing information in a format matched with the each editor, and the initial routing information is used to indicate routing according to the target reference routing path corresponding to the each editor; determining the multiple routing segment sets corresponding to the multiple target reference routing paths according to the initial routing information edited by each of the multiple editors; and determining the multiple routing segment sets as the routing segment sets corresponding to the target routing node.

2. The method according to claim 1, characterized in that Determining the plurality of routing segment sets corresponding to the plurality of target reference routing paths according to the initial routing information edited by each of the plurality of editors comprises: Acquire first routing information edited by a first editor, and acquire second routing information edited by a second editor, wherein the multiple editors include the first editor and the second editor, the first routing information is used to indicate routing information of a tunnel-level routing path in the target routing path, the second routing information is used to indicate routing information of a user-level routing path in the target routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set; The first routing segment set and the second routing segment set are determined as the multiple routing segment sets corresponding to the multiple target reference routing paths.

3. The method according to claim 1, characterized in that: The determining of the plurality of editors corresponding to the plurality of target reference routing paths comprises: Determine index information corresponding to each target routing path in the multiple target reference routing paths; The plurality of editors are searched for according to the index information.

4. The method according to claim 1, characterized in that: The step of editing the plurality of routing segments into the initial message to obtain a target message carrying target routing information comprises: Editing the multiple routing segment sets into the initial message to obtain an intermediate message carrying intermediate routing information, wherein the intermediate routing information has a corresponding relationship with the multiple routing segment sets; The intermediate routing information is adjusted to target routing information, and a target message carrying the target routing information is obtained.

5. The method according to claim 4, characterized in that The step of editing the plurality of routing segments into the initial message to obtain the intermediate message carrying the intermediate routing information comprises: The first routing information edited by the first editor is saved in a temporary variable set, and the second routing information edited by the second editor is saved in the temporary variable set, wherein the first routing information is used to indicate the routing information of the tunnel-level routing path in the target routing path, and the second routing information is used to indicate the routing information of the user-level routing path in the target routing path, the multiple target reference routing paths include the tunnel-level routing path and the user-level routing path, the first routing information includes an initial routing message header and a first routing segment set, and the second routing information includes an initial protocol message header and a second routing segment set; When it is determined that the first routing information and the second routing information are all stored in the temporary variable set, the initial protocol message header, the initial routing message header, the first routing segment set and the second routing segment set are edited to the target position of the initial message according to the target editing format to obtain the intermediate message.

6. The method according to claim 4, characterized in that The adjusting the intermediate routing information to the target routing information to obtain the target message carrying the target routing information comprises: Modify the fields in the initial routing message header of the intermediate routing information according to the routing segments included in the plurality of routing segment sets to obtain a to-be-processed message carrying a target routing message header; The fields in the initial protocol message header of the message to be processed are modified according to the routing segments included in the plurality of routing segment sets to obtain the target message carrying the target routing information.

7. A device for editing routing information, characterized in that: include: An acquisition module, used for acquiring an initial message to be forwarded, wherein the initial message is used for requesting that the initial message be forwarded to a target routing node; A matching module, used for matching the target routing path indicated by the target routing node with the reference routing path to obtain multiple target reference routing paths; A determination module, configured to determine a plurality of routing segment sets corresponding to the plurality of target reference routing paths as a routing segment set corresponding to the target routing node, wherein the target reference routing path is a reference routing path among the reference routing paths that matches the target routing path; An editing module, used for editing the plurality of routing segment sets into the initial message to obtain a target message carrying target routing information, wherein the target routing information is used to indicate that the target message is forwarded to the target routing node according to the target routing path; The determination module comprises: a first determination unit, used to determine a plurality of editors corresponding to the plurality of target reference routing paths, wherein each of the plurality of editors is used to edit the corresponding initial routing information in a format matched with the each editor, and the initial routing information is used to indicate routing according to the target reference routing path corresponding to the each editor; a second determination unit, used to determine the plurality of routing segment sets corresponding to the plurality of target reference routing paths according to the initial routing information edited by the each editor of the plurality of editors; and a third determination unit, used to determine the plurality of routing segment sets as the routing segment sets corresponding to the target routing node.

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

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • A method and apparatus for saving segment identification cost in IPv6 segment routing

    CN109067652A

  • Segmented routing message forwarding method and device and preset logic circuit unit

    CN112787927A

  • Route determination method and device, and network device

    CN113395206A

  • Message forwarding method and device, and equipment

    CN113411259A

  • Routing method, routing device and computer readable storage medium

    CN113438160A