CN112787927B - Segmented routing message forwarding method and device and preset logic circuit unit - Google Patents

Segmented routing message forwarding method and device and preset logic circuit unit Download PDF

Info

Publication number
CN112787927B
CN112787927B CN202110328292.1A CN202110328292A CN112787927B CN 112787927 B CN112787927 B CN 112787927B CN 202110328292 A CN202110328292 A CN 202110328292A CN 112787927 B CN112787927 B CN 112787927B
Authority
CN
China
Prior art keywords
message
sid
target
srh
segmented
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110328292.1A
Other languages
Chinese (zh)
Other versions
CN112787927A (en
Inventor
吕磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202110328292.1A priority Critical patent/CN112787927B/en
Publication of CN112787927A publication Critical patent/CN112787927A/en
Application granted granted Critical
Publication of CN112787927B publication Critical patent/CN112787927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/34Source routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Abstract

The embodiment of the invention provides a segmented routing message forwarding method, a segmented routing message forwarding device and a preset logic circuit unit. Wherein the method comprises the following steps: acquiring a segmented routing message to be processed; analyzing the segmented routing message to be processed to obtain a target Segmented Identification (SID) required by the NP when executing segmented routing forwarding operation; sending all the target SIDs to the NP so that the NP determines message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SIDs; receiving a message modification instruction sent by the NP, wherein the message modification instruction is used for expressing the message modification operation; modifying the segmented routing message to be processed according to the message modification operation represented by the message modification instruction to obtain a modified segmented routing message; and forwarding the modified segmented routing message according to the destination address of the modified segmented routing message. The forwarding efficiency of the segmented routing message can be improved.

Description

Segmented routing message forwarding method and device and preset logic circuit unit
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a segment routing packet, and a preset logic circuit unit.
Background
Segment Routing (Segment Routing) technology is widely applied to various application scenarios, such as IPV6 networks. In the SR technology, before a source Segment routing node sends a Segment routing packet, a Segment Identifier (SID) of each Segment routing node that the Segment routing packet needs to pass through may be encapsulated in a packet header of the Segment routing packet in advance, and when the Segment routing packet passes through the Segment routing node, a Network Processor (NP) in the Segment routing node forwards the Segment routing packet according to the SID in the Segment routing packet.
Since the SID is encapsulated in the header of the segment routing packet, the NP needs to parse the header of the segment routing packet to obtain the SID. Besides the SID required to be acquired by the NP, the packet header of the segment routing packet also includes other information, such as SID, two-layer header information, IPV6 header information and other information that the NP does not need to acquire, so the length of the packet header of the segment routing packet may be longer, and the processing performance of the NP is limited, so the NP needs to consume more time to be able to analyze the packet header to obtain the required SID, which results in lower forwarding efficiency of the segment routing packet.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for forwarding a segmented routing message and a preset logic circuit unit, so as to improve the efficiency of forwarding the segmented routing message. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a method for forwarding a segment routing packet is provided, where the method is applied to a preset logic circuit unit of a segment routing node, where the segment routing node further includes a network processor NP, and the method includes:
acquiring a segmented routing message to be processed;
analyzing the segmented routing message to be processed to obtain a target Segmented Identification (SID) required by the NP when executing segmented routing forwarding operation;
sending the target SID to the NP so that the NP determines message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID;
receiving a message modification instruction sent by the NP, wherein the message modification instruction is used for expressing the message modification operation;
modifying the segmented routing message to be processed according to the message modification operation represented by the message modification instruction to obtain a modified segmented routing message;
and forwarding the modified segmented routing message according to the destination address of the modified segmented routing message.
In a possible embodiment, the segment routing packet to be processed includes a plurality of segment routing packet headers SRH;
the analyzing the segmented routing message to be processed to obtain the target segmented identification SID required by the NP executing the segmented routing forwarding operation includes:
analyzing each SRH of the segmented routing message to be processed to obtain a target SID required by the NP in the SRH when the NP executes segmented routing forwarding operation;
the sending the target SID to the NP so that the NP determines message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID, includes:
and sending the target SID analyzed from each SRH and the attribute information corresponding to each target SID to the NP, so that the NP determines the SRH to which the corresponding target SID belongs according to each attribute information, and determines the message modification operation required to be executed when the segmented routing forwarding operation is executed according to each received target SID and the SRH to which the target SID belongs.
In a possible embodiment, the sending the target SID parsed from each SRH and the attribute information corresponding to each target SID to the NP includes:
constructing an analysis message, wherein the analysis message carries target SIDs analyzed from each SRH and attribute information corresponding to the target SIDs, the target SIDs are arranged according to a preset sequence, and each attribute information is used for representing the SRH to which the target SID positioned in the corresponding cis-position belongs;
and sending an analysis message to the NP.
In a possible embodiment, the attribute information is used to indicate the number of target SIDs parsed from each SRH;
the constructing and analyzing message comprises the following steps:
and sequentially aiming at each SRH in the segmented routing message to be processed, writing the target SID analyzed from the SRH into a current offset position in the analyzed message, and offsetting the current offset position by n offset lengths, wherein the current offset position is a preset initial position at the beginning, n is the number of the target SIDs analyzed from the SRH, and the offset length is the length of a single target SID.
In a possible embodiment, the analyzing, for each SRH of the segmented routing packet to be processed, the SRH to obtain a target SID required by the NP in the SRH to perform the segmented routing forwarding operation includes:
determining whether the residual hop count SL in each SRH of the segmented routing message to be processed is 1 or not;
if the SL is 1, analyzing a first SID and a second SID in a SID list of the SRH as a target SID;
and if the SL is not 1, analyzing the SL +1 th SID in the SID list of the SRH as the target SID. In a second aspect provided in an embodiment of the present invention, a method for forwarding a segment routing packet is provided, where the method is applied to a network processor NP of a segment routing node, where the segment routing node further includes a preset logic circuit unit, and the method includes:
receiving a target segment identification SID sent by the preset logic circuit unit, wherein the target SID is the SID required by the NP when the NP executes a segment routing forwarding operation by analyzing the received segment routing message by the preset logic circuit unit;
determining message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID;
and sending a message modification instruction to the preset logic circuit unit, wherein the message modification instruction is used for expressing the message modification operation, so that the preset logic circuit unit modifies the segmented routing message to be processed according to the message modification operation expressed by the message modification instruction to obtain the modified segmented routing message, and forwards the modified segmented routing message according to the destination address of the modified segmented routing message.
In a third aspect of the embodiments of the present invention, there is provided a segmented routing packet forwarding apparatus, which is applied to a preset logic circuit unit of a segmented routing node, where the segmented routing node further includes a network processor NP, and the apparatus includes:
the message acquisition module is used for acquiring a segmented routing message to be processed;
the SID analyzing module is used for analyzing the segmented routing message to be processed to obtain a target segmented identification SID required by the NP when the NP executes the segmented routing forwarding operation;
a first sending module, configured to send all the target SIDs to the NP, so that the NP determines, according to the target SIDs, a packet modification operation that needs to be performed when performing a segment routing forwarding operation;
a first receiving module, configured to receive a message modification instruction sent by the NP, where the message modification instruction is used to indicate the message modification operation;
the message modification module is used for modifying the segmented routing message to be processed according to the message modification operation represented by the message modification instruction to obtain the modified segmented routing message;
and the message forwarding module is used for forwarding the modified segmented routing message according to the destination address of the modified segmented routing message.
In a possible embodiment, the segment routing packet to be processed includes a plurality of segment routing packet headers SRH;
the SID analyzing module analyzes the segmented routing message to be processed to obtain a target segmented identification SID required by the NP executing the segmented routing forwarding operation, and the SID analyzing module comprises:
analyzing each SRH of the segmented routing message to be processed to obtain a target SID required by the NP in the SRH when the NP executes segmented routing forwarding operation;
the first sending module sends the target SID to the NP, so that the NP determines, according to the target SID, a packet modification operation that needs to be executed when a segment routing forwarding operation is executed, where the message modification operation includes:
and sending the target SID analyzed from each SRH and the attribute information corresponding to each target SID to the NP, so that the NP determines the SRH to which the corresponding target SID belongs according to the attribute information, and determines the message modification operation required to be executed when the segmented routing forwarding operation is executed according to each received target SID and the SRH to which the target SID belongs.
In a possible embodiment, the sending module sends the target SID parsed from each SRH and the attribute information corresponding to each target SID to the NP, including:
constructing an analysis message, wherein the analysis message carries target SIDs analyzed from each SRH and attribute information corresponding to the target SIDs, the target SIDs are arranged according to a preset sequence, and each attribute information is used for representing the SRH to which the target SID corresponding to the sequence belongs;
and sending an analysis message to the NP.
In a possible embodiment, the attribute information is used to indicate the number of target SIDs parsed from each SRH;
the first sending module constructs an analysis message, including:
sequentially aiming at each SRH in the segmented routing message to be processed, writing a target SID analyzed from the SRH into a current offset position in the analyzed message, and offsetting the current offset position by n offset lengths, wherein the current offset position is a preset initial position at the beginning, n is the number of the target SIDs analyzed from the SRH, and the offset length is the length of a single target SID;
in a possible embodiment, the SID parsing module parses, for each SRH of the to-be-processed segmented routing packet, the SRH to obtain a target SID required by the NP in the SRH to perform a segmented routing forwarding operation, where the target SID includes:
determining whether the residual hop count SL in each SRH of the segmented routing message to be processed is 1 or not;
if the SL is 1, analyzing a first SID and a second SID in a SID list of the SRH as a target SID;
and if the SL is not 1, analyzing the SL +1 th SID in the SID list of the SRH as the target SID.
In a fourth aspect of the embodiments of the present invention, there is provided a segment routing packet forwarding apparatus, which is applied to a network processor NP of a segment routing node, where the segment routing node further includes a preset logic circuit unit, and the apparatus includes:
a second receiving module, configured to receive a target segment id SID sent by the preset logic circuit unit, where the target id is a SID required by the NP when the preset logic circuit unit analyzes a received segment routing packet to perform a segment routing forwarding operation;
an operation determining module, configured to determine, according to the target SID, a message modification operation that needs to be executed when a segment routing forwarding operation is executed;
and a second sending module, configured to send a message modification instruction to the preset logic circuit unit, where the message modification instruction is used to indicate the message modification operation, so that the preset logic circuit unit modifies the to-be-processed segmented routing message according to the message modification operation indicated by the message modification instruction, obtains a modified segmented routing message, and forwards the modified segmented routing message according to a destination address of the modified segmented routing message.
In a fifth aspect of the embodiments of the present invention, there is provided a preset logic circuit unit, which is disposed in a segment routing node, where the segment routing node further includes a network processor NP, and the preset logic circuit unit includes:
a first memory for storing a computer program;
a first processor adapted to perform the method steps of any of the above first aspects when executing a program stored in a memory.
In a sixth aspect of the embodiments of the present invention, there is provided a network processor, disposed in a segment routing node, where the segment routing node further includes a preset logic circuit unit, and the network processor includes:
a second memory for storing a computer program;
a second processor, configured to implement the method steps of the second aspect when executing the program stored in the memory.
The embodiment of the invention has the following beneficial effects:
the segmented routing message forwarding method provided by the embodiment of the invention can be realized by arranging the preset logic circuit unit in the segmented routing node, analyzing the target SID from the segmented routing message by replacing NP with the preset logic circuit unit, and sending the target SID to NP, so that the NP only needs to analyze less information containing the target SID in the segmented routing message forwarding process, thereby enabling the NP to quickly determine the message modification operation required to be executed when the segmented routing message is forwarded, completing the modification and forwarding of the segmented routing message to be processed by the preset logic circuit unit according to the message modification operation determined by NP, and the NP does not need to consume a long time to analyze the target SID from a longer message header in the process, thereby effectively improving the forwarding efficiency of the segmented routing message.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of SRv6 network according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a segment routing node according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a segment routing packet forwarding method applied to a preset logic circuit unit according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of a method for constructing an analysis packet according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of parsing a packet according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a message processing flow of a preset logic circuit unit according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of a segmented routing packet forwarding method applied to an NP according to an embodiment of the present invention;
fig. 8a is a schematic diagram of a packet format of a POP packet according to an embodiment of the present invention;
fig. 8b is a schematic diagram of a message format of a SWAP message according to an embodiment of the present invention;
fig. 8c is a schematic diagram of a message format of a PUSH message according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a segment routing packet forwarding apparatus applied to a preset logic circuit unit according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a segment routing packet forwarding apparatus applied to an NP according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of a preset logic circuit unit according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a network processor according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In order to more clearly describe the segmented routing packet forwarding method provided in the embodiment of the present invention, an application scenario of the segmented routing packet forwarding method provided in the embodiment of the present invention will be exemplarily described below. It should be understood that the following example is only one possible application scenario of the segmented routing packet forwarding method provided in the embodiment of the present invention, and in other possible embodiments, the segmented routing packet forwarding method provided in the embodiment of the present invention may also be applied in the scenario, and the following example does not limit this.
With the great development of services brought by 5G, different requirements are put on a bearer network by the needs of convergence bearer of various different types of services, so that the SR technology becomes a key technology for achieving the purpose of planning different paths for different services. In addition to the objective reality of exhaustion of IPv4 addresses, services and network devices have a certain development trend of IPv6, so that the SR technology is used in an IPv6 network, and IPv6 addresses are used as SID to forward packets to become a basic bearer technology of future services, and for convenience of description, an IPv6 network using the SR technology is referred to as a SRv6 network, and a segment routing packet in an SRv6 network is referred to as a SRv6 packet.
In the message encapsulation format of SRv6, the front of the original three-layer data message further includes an IPv6 basic Header and an SRH (signal Identifier Header). The SRH includes the following parameters:
next Header: the length is 8bits and is used for identifying the type of the next message header.
Hdr Ext Len: the length is 8bits, indicating the length of the SRH header in units of 8 bytes.
Routing Type: the length is 8bits, which is used to indicate the type of the route, and when the value is 4, the type of the route is the segment route.
Segments Left (number of remaining hops, hereinafter abbreviated as SL): the length is 8bits, the number of the next SID needing to be checked is identified, the initial value is m-1, m represents the number of SIDs in the routing extension head, and the number of SIDs is reduced by 1 by itself when the SIDs pass through a segmented routing node SL.
Last Entry: the length is 8bits, and the serial number of the first SID of the actual forwarding path of the message in the SRH header.
Flag: length is 8bits, flag bit information.
Tag: the length is 16bits and is used for marking a group of messages with the same characteristics.
Segment List: list of SIDs. The nodes on the message forwarding path are arranged from far to near, that is, Segment List [0] represents the last SID of the path, Segment List [1] represents the penultimate SID of the path, and so on.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an SRv6 network according to an embodiment of the present invention, which includes a network device a, a network device B, a network device C, and a network device D, and for convenience of description, it is assumed that a SID of the network device a is a, a SID of the network device B is B, a SID of the network device C is C, and a SID of the network device D is D, and since the SID of the network device in SRv6 network is an IPv6 address of the network device, a is an IPv6 address of the network device a, B is an IPv6 address of the network device B, C is an IPv6 address of the network device C, and D is an IPv6 address of the network device D. The following describes a forwarding flow of SRv6 messages, taking an example in which network device a sends a segment routing message to network device D:
for the network device a serving as the source segment routing node, after receiving the original IPv6 packet, it is determined by looking up the routing table that the original IPv6 packet needs to be forwarded through the tunnel in the SRv6 packet manner, so the network device a may encapsulate the SRH and IPv6 headers for the original IPv6 packet, and obtain the first SRv6 packet.
Since the number of hops from network device a as the source segment routing node to network device D as the destination segment routing node is 3, SL is 2 in the SRH of the first SRv6 message. The packaged SID List information is Segment List [0] ═ D, Segment List [1] ═ C, and Segment List [2] ═ B, where D is SID of network device D, C is SID of network device C, and B is SID of network device B.
The source address in the IPv6 header of the first SRv6 message is the address of network device a, the destination address is the address indicated by SL, and at this time, SL is 2, and the address corresponding to Segment List [2] is the address of network device B, so the destination address is the address of network device B.
After the IPv6 message is encapsulated to obtain the first SRv6 message, the network device a searches a routing table according to a destination address in the IPv6 header of the first SRv6 message, and forwards the first SRv6 message to the network device B according to the route obtained by the search.
After receiving the first SRv6 message, the network device B determines whether the destination address in the IPv6 header of the first SRv6 message is the address of itself, and if so, needs to perform SRv6 operation, and for the network device that needs to perform SRv6 operation, checks the SL value in the SRH of SRv6 message, and subtracts 1 from the SL value, and meanwhile, searches for the address corresponding to the Segment List [ SL ]. For the network device B, since SL is 1 at this time, the found address is the address of the network device C, and therefore the network device B replaces the destination address in the IPv6 header of the first SRv6 message with the address of the network device C, so as to obtain the second SRv6 message. The network device B searches the routing table according to the destination address in the IPv6 header of the second SRv6 packet, and forwards the second SRv6 packet to the network device C according to the searched route.
After receiving the second SRv6 packet, the network device C determines whether the destination address in the IPv6 header of the second SRv6 packet is the address of itself, and if so, needs to perform SRv6 operation. For the network device C, since SL is 0 at this time, the found address is the address of the network device D, and therefore the network device C replaces the destination address in the IPv6 header of the second SRv6 message with the address of the network device D, so as to obtain the third SRv6 message. The network device C searches the routing table according to the destination address in the IPv6 header of the third SRv6 packet, and forwards the third SRv6 packet to the network device D according to the searched route.
After the network device D receives the third SRv6 packet sent by the network device C, the SL value in the SRH header is checked, at this time, SL is 0, so that the network device D decapsulates the third SRv6 packet, deletes the packet header of the third SRv6 packet to obtain the original IPv6 packet, and forwards the original IPv6 packet according to the destination address of the original IPv6 packet.
It can be seen that, in the forwarding process of the SRv6 message, the network device needs to analyze the corresponding SID from the message header, and modify the message according to the SID obtained by the analysis, and the length of the message header of the SRv6 message is often longer, for example, it is assumed that the SID list includes 10 SIDs, and the length of each SID is 16bits, and it is assumed that the length of the two-layer header information in the message header is 14bits, the length of the other information in the SRH header is 8bits, and the length of the IPv6 header is 40 bits. The length of the header of the SRv6 message is 222 bits.
Because the forwarding of SRv6 messages in the network device is completed by the NP and is limited by the performance of the NP, it takes a long time to complete the parsing of the 222bits header, resulting in a low forwarding efficiency of the segmented routing message.
Based on this, the segment routing forwarding method provided in the embodiment of the present invention is applied to a preset logic circuit unit of a segment routing node, and the structure of the segment routing node may be as shown in fig. 2, and includes a preset logic circuit unit 201 and a network processor 202.
As shown in fig. 3, the method for forwarding a segment routing packet provided in an embodiment of the present invention includes:
s301, acquiring a segmented routing message to be processed;
s302, analyzing the segmented routing message to be processed to obtain a target segmented identification SID required by the NP executing the segmented routing forwarding operation;
s303, sending all target SIDs to NP, so that the NP determines message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SIDs;
s304, receiving a message modification instruction sent by the NP, wherein the message modification instruction is used for expressing message modification operation;
s305, modifying the segmented routing message to be processed according to the message modification operation represented by the message modification instruction to obtain a modified segmented routing message;
s306, forwarding the modified segmented routing message according to the destination address of the modified segmented routing message.
In the embodiment, the preset logic circuit unit is arranged in the segment routing node, the preset logic circuit unit replaces NP to analyze the target SID from the segment routing message, and the target SID is sent to the NP, so that the NP only needs to analyze less information including the target SID in the segment routing message forwarding process, the NP can quickly determine message modification operation required to be executed when the segment routing message is forwarded, the preset logic circuit unit completes modification and forwarding of the segment routing message to be processed according to the message modification operation determined by the NP, and the NP does not need to consume long time to analyze the target SID from a longer message header in the process, so that the forwarding efficiency of the segment routing message can be effectively improved.
In S301, the packet received by the segment routing node may be first sent to a preset logic circuit unit, and the preset logic circuit unit determines whether the packet is a segment routing packet, and if the packet is a segment routing packet, the packet is used as a segment routing packet to be processed, and the packet is forwarded according to the segment routing packet forwarding method provided in the embodiment of the present invention.
If the message is not a segment routing message, the message can be directly sent to the NP and processed by the NP.
In S302, referring to the foregoing description about SRv6 network and SRv6 packet, it can be understood that the NP does not utilize all the SIDs in the SRH when performing the segment routing forwarding operation, for example, for the network device B in the foregoing example, it needs to determine whether the SID indicated by the SL represents itself when performing the segment routing forwarding operation, so for the network device B, the target SID is B, and C, D is not the target SID.
It is understood that the segment routing packet to be processed may include one SRH or may include a plurality of SRHs. For a scenario including only one SRH, the target SID may be parsed from the one SRH, and for a scenario including multiple SRHs, the SRH may be parsed to obtain, for each SRH, the target SID required by the NP in the SRH to perform the segment routing forwarding operation.
At S303, referring to the foregoing description about SRv6 network and SRv6 message, it can be understood that the NP may need to modify the segment routing message when performing the segment routing forwarding operation, for example, for network device B in the foregoing example, it needs to modify the destination address in the IPv6 header to the address of network device C.
Because the NP does not acquire the to-be-processed segment routing packet, the NP cannot directly modify the to-be-processed segment routing packet, and the preset logic circuit unit does not have a routing table entry pre-stored therein, so that the preset logic circuit unit cannot determine which modifications are required to be performed on the to-be-processed segment routing packet.
Therefore, in the embodiment of the present invention, the NP determines the modification operation to be executed, and the preset logic circuit unit that receives the to-be-processed segmented routing packet modifies the to-be-processed segmented routing packet, thereby implementing accurate modification of the to-be-processed segmented routing packet.
The modification operation may be different according to different application scenarios, for example, in one possible embodiment, the modification operation may include a SWAP operation, a PUSH operation, and a POP operation, and in other possible embodiments, other types of modification operations may also be included, which is not limited in this embodiment. The SWAP operation is used for modifying the destination address in the IPv6 header, the PUSH operation is used for adding a new SRH to the segment routing packet to be processed, and the POP operation is used for deleting the SRH of the segment routing packet to be processed.
How the NP determines what modification operation needs to be performed on the segmented routing packet to be processed is not a main improvement point of the present application, and therefore, details are not described herein.
In S305, the preset logic circuit unit may determine modification operations indicated by the message modification instruction by parsing the message modification instruction, and perform the modification operations on the segmented routing message to be processed. It can be understood that, in some application scenarios, modification of the to-be-processed segment routing packet may not be required, and in these application scenarios, the packet modification instruction may not represent any modification operation, and after receiving the packet modification instruction that does not represent any modification operation, the preset logic circuit unit may directly forward the to-be-processed segment routing packet without modifying the to-be-processed segment routing packet.
The format of the message modification instruction may be different according to different application scenarios, and the message modification instruction will be exemplarily described below, and therefore, the detailed description thereof is omitted here.
It can be understood that, for the foregoing scenario in which the to-be-processed segment routing packet includes multiple SRHs, since different SRHs represent different segment routes, when processing a SID belonging to different SRHs, an NP needs to query different routing table entries. In these application scenarios, the target SID belongs to different SRHs, and therefore the preset logic circuit unit needs to identify the SRH to which each target SID belongs.
Based on this, in a possible embodiment, the target SID and the attribute information corresponding to the target SID may be sent to the NP, so that the NP may determine, according to the attribute information, the SRH to which the received target SID belongs, and determine, according to the received target SID and the SRH to which the target SID belongs, a packet modification operation that needs to be executed when the segment routing forwarding operation is executed. The attribute information is used to indicate the SRH to which the corresponding target SID belongs.
For example, it is assumed that the segment routing packet to be processed includes two SRHs, which are respectively denoted as SRH1 and SRH 2. And assuming that the target SID includes a first SID, a second SID and a third SID, the attribute information corresponding to the first SID may be used to indicate that the first SID belongs to SRH1, the attribute information corresponding to the second SID may be used to indicate that the second SID belongs to SRH1, and the attribute information corresponding to the third SID may be used to indicate that the third SID belongs to SRH 2.
The representation form of the attribute information may be different according to different application scenarios, and for example, in one possible embodiment, the attribute information may be represented in the form of a SID identifier-SRH identifier pair, where the SID identifier-SRH identifier pair includes a SID identifier for identifying a SID and an SRH identifier for identifying an SRH, and the SID identified by the SID identifier belongs to the SRH identified by the SRH identifier. For example, assuming that the SID of the first SID is identified as 0b01 and the SRH of SRH1 is identified as 0c01, the attribute information corresponding to the first SID may be represented in the form of an identifier pair 0b01-0c01, which represents that the first SID belongs to SRH 1.
However, in this scheme, two identifiers are required to be used to represent the SRH to which one SID belongs, which may cause the length of information that needs to be processed by the NP to be too long, thereby causing the packet forwarding efficiency to decrease, and as an example, assuming that the length of each identifier is 8bits, 48bits are required to represent the SRHs to which the first SID, the second SID, and the third SID belong.
Based on this, in another possible embodiment, the manner of sending the target SID and the attribute information corresponding to the target SID to the NP packet may be to construct an analysis packet, where the analysis packet carries the target SID analyzed from each SRH and the attribute information corresponding to the target SID, and each target SID is arranged according to a preset order, and each attribute information is used to represent an SRH to which the target SID located in a corresponding cis position belongs. And sends the parsing message to the NP.
In this embodiment, since the target SIDs are arranged in the preset order, the target SIDs can be identified by the order, and therefore, the attribute information does not need to carry an identifier for identifying the SIDs, the length of the attribute information can be effectively reduced, and the message forwarding efficiency is improved.
For example, the attribute information corresponding to each SID may be represented in the form of an SRH identifier, where the SRH identifier is used to represent an SRH to which a target SID with the same rank as the attribute sub-information belongs. For example, suppose that the parsing message includes 3 target SIDs and includes 3 attribute information, where the attribute information located in the first order is represented in the form of SRH id 0C01, where 0C01 is the SRH id of SRH1, and then the attribute information indicates that the target SID located in the first order among the 3 target SIDs belongs to SRH 1.
According to the mode, the attribute information only needs to comprise 3 SRH marks, and if the length of each mark is 8bits, the length of the attribute information is 24bits, which is obviously shortened compared with the aforementioned 48 bits.
And in one possible embodiment, to further shorten the attribute information, the attribute information may be used to indicate the number of target SIDs parsed from each SRH, and for example, the attribute information may be used to indicate that 2 target SIDs are parsed from SRH1 and 1 target SID is parsed from SRH 2.
In this embodiment, when constructing the analysis packet, the processing may be performed in the manner shown in fig. 4 for each SRH in the segmented routing packet to be processed in sequence, and the processing method may include:
s401, writes the target SID analyzed from the SRH into the current offset position in the analysis message.
S402, shifting the current shift position by n shift lengths.
The current offset position is a preset initial position when the current offset position is initial, the preset initial position can be any position in the analysis message, and writing the target SID into the current offset position refers to writing the target SID into a continuous space starting from the current offset position in the analysis message.
n is the number of target SIDs analyzed from the SRH, and the number of target SIDs analyzed from one SRH is 1 or 2, so the value of n is 1 or 2. The skewness length is the length of a single target SID, and taking an application scenario of an SRv6 network as an example, each target SID is an IPv6 address, so that the length of the single target SID is 16bits, that is, the skew length is 16 bits.
It is assumed that the segmented routing packet to be processed includes 2 SRHs, which are respectively recorded as SRH1 and SRH2, and it is assumed that two target SIDs obtained by parsing from SRH1 are respectively recorded as a first SID and a second SID, and one target SID obtained by parsing from SRH is recorded as a third SID.
The steps shown in fig. 4 may be performed first for SRH1, i.e., writing the first SID and the second SID into the current offset position, where the current offset position is the preset initial position. And shifts the current offset position by 2 offset lengths. Since the offset length is equal to the length of a single SID, after offsetting the current offset position, the new current offset position is one bit after the second SID in the parsing message.
Then, the step shown in fig. 4 is executed for SRH2, that is, the third SID is written into the current offset position, and since the current offset position is located at the next position of the second SID in the parsing message, the third SID is written into the second SID.
In this embodiment, the target SIDs are arranged in the order of the SRHs to which the target SIDs belong, and in this embodiment, the attribute information is used to indicate the number of target SIDs parsed from each SRH, so the SRH to which each target SID belongs can be determined according to the number indicated by the attribute information.
Illustratively, still taking the foregoing example as an example, for an NP, the target SID located in each order may be obtained from the parsing message according to the offset length, and for an NP, an NP message reads offset length bits from a preset initial position in the parsing message, so that the target SID located in the first order, that is, the first SID, may be obtained, and the NP may determine, according to the attribute information, that 2 target SIDs are obtained by parsing from SRH1, and 1 target SID is obtained by parsing from SRH2, so that the target SID located in the first two bits belongs to SRH1, and thus the NP may determine that the first SID belongs to SRH1, and similarly, the NP may read the second SID and the third SID from the parsing message, and determine that the second SID belongs to SRH1, and the third SID belongs to SRH 2.
It is understood that the number of target SIDs parsed from an SRH need only be indicated by one identifier, and for example, one target SID parsed from an SRH may be indicated by 0x01, and two target SIDs parsed from an SRH may be indicated by 0x 10. Therefore, by adopting this embodiment, the number of identifiers included in the attribute information only needs to be the same as the number of SRHs in the segment routing packet to be processed, and still taking the scenario of the foregoing example as an example, the attribute information only needs to include identifiers used for representing the number of target SIDs obtained by parsing in SRH1 and identifiers used for representing the number of target SIDs obtained by parsing in SRH2, 2 identifiers are counted, and it is still assumed that the length of each identifier is 8bits, the length of the attribute information is 16bits, and compared with the first 24bits, it is seen that by adopting this embodiment, the length of the attribute information can be further shortened, thereby improving the forwarding efficiency of the segment routing packet.
An exemplary description will be given below of a format of an analysis packet, an analysis packet in the embodiment of the present invention may also be in a format other than this example, and refer to fig. 5, where fig. 5 is a schematic structural diagram of an analysis packet provided in the embodiment of the present invention, and the schematic structural diagram may include:
a message length field, an offset length field, an attribute information field, a target SID field, and a tail offset field.
Wherein, the message length field is as follows: the length is 2 bytes and is used for representing the length of the analysis message;
offset length field: length is 1 byte, used for expressing the offset length;
attribute information: the length of the target SID is 1 byte, the target SID is obtained by analyzing each SRH, and four subfields are divided according to a unit of 2bits, namely SRH 1-4 CMD, and are defined as follows: 00 indicates none, 01 indicates layer 1, 10 indicates layer 2, and 11 is a reserved field;
target SID field: the storage sequence of each target SID in the target SID field may refer to the aforementioned related description, which is not described herein again, and the starting position of the target SID field is the aforementioned preset initial position;
tail offset field: the length is 2 bytes, and in this embodiment, the preset logic circuit unit may move the SRH in the segment routing packet to be processed to the end offset field.
In other possible embodiments, the parsing message may further include other information, for example, in one possible embodiment, in order to distinguish the parsing message from other messages, the parsing message may include an internal control header, where the internal control header is used to indicate that the message is a parsing message.
Taking the analysis packet shown in fig. 5 as an example, the following description will be made in combination with the analysis of the packet with route to be processed and the construction of the analysis packet, and referring to fig. 6, fig. 6 is a schematic diagram of a packet processing flow of a preset logic circuit unit provided in an embodiment of the present invention, and the schematic diagram may include:
s601, determining whether the received message contains SRH, if so, executing S602, and if not, executing S610.
If the received message contains SRH, the message is a to-be-processed segmented routing message, and therefore needs to be forwarded according to the segmented routing message forwarding method provided by the embodiment of the present invention, and if the received message does not contain SRH, the message is not a to-be-processed segmented routing message, and therefore the message can be directly sent to NP and processed by NP.
S602 initializes the current offset position and the count nSRH.
In this embodiment, the current offset position after initialization is located at the preset initial position, where nSRH is 0 after initialization, and is used to identify SRH in a message, and when nSRH is 0, is used to identify the first SRH in the message, and when nSRH is 1, is used to identify the second SRH in the message, and so on.
S603, reading SL in SRH identified by nSRH.
S604, judging whether SL is 1, if SL is 1, executing S605, if SL is not 1, executing S606.
S605, analyzing the first SID and the second SID in the SRH identified by the nSRH, writing the first SID and the second SID as the target SID into the current offset position in the analysis message, offsetting the current offset position by 2 offset lengths, and recording the number of the target SID analyzed from the SRH identified by the nSRH in the attribute field of the analysis message as 2.
S606, resolving SL +1 SID in SRH identified by nSRH, writing the SID as target SID into current offset position in resolving message, offsetting the current offset position by 1 offset length, and recording the number of target SID resolved from SRH identified by nSRH as 1 in attribute field of resolving message.
S607, judging whether there is SRH after SRH identified by nSRH, if there is SRH, returning nSRH to S603, if there is no SRH, then executing S608.
S608, all SRHs in the message are moved to the tail offset field of the analysis message.
And S609, sending the analysis message to the NP.
S610, sending the received message to NP.
Referring to fig. 7, fig. 7 is a schematic flow chart of a segmented routing packet forwarding method applied to an NP according to an embodiment of the present invention, where the schematic flow chart may include:
s701, receiving a target segmentation identifier SID sent by a preset logic circuit unit, wherein the target SID is the SID required by the NP to execute a segmentation routing forwarding operation by analyzing the received segmentation routing message by the preset logic circuit unit;
s702, determining message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID;
and S703, sending a message modification instruction to the preset logic circuit unit, so that the preset logic circuit unit modifies the segmented routing message to be processed according to the message modification operation indicated by the message modification instruction to obtain a modified segmented routing message, and forwarding the modified segmented routing message according to the destination address of the modified segmented routing message.
In the embodiment, the preset logic circuit unit is arranged in the segment routing node, the preset logic circuit unit replaces NP to analyze the target SID from the segment routing message, and the target SID is sent to the NP, so that the NP only needs to analyze less information including the target SID in the segment routing message forwarding process, the NP can quickly determine message modification operation required to be executed when the segment routing message is forwarded, the preset logic circuit unit completes modification and forwarding of the segment routing message to be processed according to the message modification operation determined by the NP, and the NP does not need to consume long time to analyze the target SID from a longer message header in the process, so that the forwarding efficiency of the segment routing message can be effectively improved.
For more clearly explaining the segment routing packet forwarding method provided by the embodiment of the present invention, an exemplary description will be given below to a packet modification instruction sent by an NP, and reference may be made to fig. 8a, 8b, and 8c, where fig. 8a is a packet format schematic diagram of a POP packet provided by the embodiment of the present invention, fig. 8b is a packet format schematic diagram of a SWAP packet provided by the embodiment of the present invention, and fig. 8c is a packet format schematic diagram of a PUSH packet provided by the embodiment of the present invention.
The POP message is used for indicating the POP operation and comprises a length field, a PopCMD-1 field, a PopCMD-2 field, a NextCMD field and a tail offset field.
Wherein, the length field: the length is 2 bytes and is used for marking the length of the POP message;
PopCMD-1 field: the length is 4bits, which is used for indicating whether the POP operation is executed or not aiming at the first layer SRH, 0x01 indicates that the POP operation is required to be executed, and 0x00 indicates that the POP operation is not required to be executed;
PopCMD-2 field: the length is 4bits, which is used for indicating whether to execute POP operation aiming at the second layer SRH, 0x01 indicates that the POP operation is needed to be executed, and 0x00 indicates that the POP operation is not needed to be executed;
NextCMD field: the length is 1 byte, and the modification operation is used for representing the next execution, the values can be POP, SWAP and PUSH, the modification operation which is carried out next is represented as POP operation when the value is POP, the modification operation which is carried out next is represented as SWAP operation when the value is SWAP, and the modification operation which is carried out next is represented as PUSH operation when the value is PUSH;
EndSRHOffset field: the length is byte, and the logic moves the offset from the SRH head to the tail of the message, which comes from the value of the analysis message.
The SWAP message is used to indicate a SWAP operation and includes a length field, a SWAP cmd field, and an end srhoffset field.
Wherein, the length field: the length is 2 bytes and is used for representing the length of the SWAP message;
SWAPCMD field: the length is 4bits and is used for indicating whether to execute the SWAP action, 0x01 indicates that the execution is needed, and 0x00 indicates that the execution is not needed;
EndSRHOffset field: the length is 2 bytes, and the logic moves the offset from the head of the SRH to the tail of the message, and the offset comes from the value of the analysis message.
The PUSH message is used for indicating a PUSH operation and includes a length field, a Tunnel-index field, and an EndSRHOffset field.
Wherein, the length field: the length is 2 bytes and is used for expressing the length of the PUSH message;
Tunnel-Index field: the length is 4 bytes, and the length is used for identifying the SRH which is indicated by the PUSH message and is aimed at the PUSH operation;
EndSRHOffset field: the length is 2 bytes, the offset after the SRH head is logically moved to the tail part of the message comes from the value of the analysis message, or aiming at the source segmentation routing node of SRv6 message, because the SRH head needs to be logically encapsulated for the first time, the SRH head is set to be 0, and no SRH head at the tail part of the message is marked
Referring to fig. 9, fig. 9 is a schematic structural diagram of a segment routing packet forwarding apparatus according to an embodiment of the present invention, where the schematic structural diagram may include:
a message obtaining module 901, configured to obtain a segmented routing message to be processed;
a SID parsing module 902, configured to parse the to-be-processed segment routing packet to obtain a target segment identifier SID required by the NP when performing a segment routing forwarding operation;
a first sending module 903, configured to send all the target SIDs to the NP, so that the NP determines, according to the target SIDs, a message modification operation that needs to be performed when performing a segment routing forwarding operation;
a first receiving module 904, configured to receive a message modification instruction sent by the NP, where the message modification instruction is used to indicate the message modification operation;
a message modification module 905, configured to modify the to-be-processed segmented routing message according to a message modification operation indicated by the message modification instruction, to obtain a modified segmented routing message;
a message forwarding module 906, configured to forward the modified segment routing message according to the destination address of the modified segment routing message.
In a possible embodiment, the segment routing packet to be processed includes a plurality of segment routing packet headers SRH;
the SID parsing module 902 parses the to-be-processed segment routing packet to obtain a target segment identifier SID required by the NP when performing a segment routing forwarding operation, including:
analyzing each SRH of the segmented routing message to be processed to obtain a target SID required by the NP in the SRH when the NP executes segmented routing forwarding operation;
the first sending module 903 sends the target SID to the NP, so that the NP determines, according to the target SID, a packet modification operation that needs to be executed when a segment routing forwarding operation is executed, where the message modification operation includes:
and sending the target SID analyzed from each SRH and the attribute information corresponding to each target SID to the NP, so that the NP determines the SRH to which the corresponding target SID belongs according to each attribute information, and determines the message modification operation required to be executed when the segmented routing forwarding operation is executed according to each received target SID and the SRH to which the target SID belongs.
In a possible embodiment, the first sending module 903 sends the target SID parsed from each SRH and the attribute information corresponding to each target SID to the NP, including:
constructing an analysis message, wherein the analysis message carries target SIDs analyzed from each SRH and attribute information corresponding to the target SIDs, the target SIDs are arranged according to a preset sequence, and each attribute information is used for representing the SRH to which the target SID positioned in the corresponding cis-position belongs;
and sending an analysis message to the NP.
In a possible embodiment, the attribute information is used to indicate the number of target SIDs parsed from each SRH;
the first sending module 903 constructs an analysis message, which includes:
and sequentially aiming at each SRH in the segmented routing message to be processed, writing the target SID analyzed from the SRH into a current offset position in the analyzed message, and offsetting the current offset position by n offset lengths, wherein the current offset position is a preset initial position at the beginning, n is the number of the target SIDs analyzed from the SRH, and the offset length is the length of a single target SID.
In a possible embodiment, the SID parsing module 902 parses, for each SRH of the to-be-processed segmented routing packet, the SRH to obtain a target SID required by the NP in the SRH when performing a segmented routing forwarding operation, including:
determining whether the residual hop count SL in each SRH of the segmented routing message to be processed is 1 or not;
if the SL is 1, analyzing a first SID and a second SID in a SID list of the SRH as a target SID;
and if the SL is not 1, analyzing the SL +1 th SID in the SID list of the SRH as the target SID.
Referring to fig. 10, fig. 10 is a schematic diagram illustrating another structure of a segment routing packet forwarding apparatus according to an embodiment of the present invention, where the schematic diagram may include:
a second receiving module 1001, configured to receive a target segment id SID sent by the preset logic circuit unit, where the target id is a SID required by the NP when the preset logic circuit unit analyzes a received segment routing packet to perform a segment routing forwarding operation;
an operation determining module 1002, configured to determine, according to the target SID, a packet modification operation that needs to be executed when a segment routing forwarding operation is executed;
a second sending module 1003, configured to send a message modification instruction to the preset logic circuit unit, where the message modification instruction is used to indicate the message modification operation, so that the preset logic circuit unit modifies the to-be-processed segmented routing packet according to the message modification operation indicated by the message modification instruction, obtains a modified segmented routing packet, and forwards the modified segmented routing packet according to a destination address of the modified segmented routing packet.
An embodiment of the present invention further provides a preset logic circuit unit, which is disposed in a segment routing node, where the segment routing node further includes an NP, as shown in fig. 11, and includes:
a first memory 1101 for storing a computer program;
the first processor 1102, when executing the program stored in the memory 1101, implements the following steps:
acquiring a segmented routing message to be processed;
analyzing the segmented routing message to be processed to obtain a target Segmented Identification (SID) required by the NP when executing segmented routing forwarding operation;
sending all the target SIDs to the NP so that the NP determines message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SIDs;
receiving a message modification instruction sent by the NP, wherein the message modification instruction is used for expressing the message modification operation;
modifying the segmented routing message to be processed according to the message modification operation represented by the message modification instruction to obtain a modified segmented routing message;
and forwarding the modified segmented routing message according to the destination address of the modified segmented routing message.
An embodiment of the present invention further provides a network processor, which is disposed in a segment routing node, where the segment routing node further includes a preset logic circuit unit, as shown in fig. 12, and includes:
a second memory 1201 for storing a computer program;
the second processor 1202 is configured to implement the following steps when executing the program stored in the memory 1201:
receiving a target segment identification SID sent by the preset logic circuit unit, wherein the target SID is the SID required by the NP when the NP executes a segment routing forwarding operation by analyzing the received segment routing message by the preset logic circuit unit;
determining message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID;
and sending a message modification instruction to the preset logic circuit unit, wherein the message modification instruction is used for expressing the message modification operation, so that the preset logic circuit unit modifies the routing message to be processed according to the message modification operation expressed by the message modification instruction to obtain a modified segmented routing message, and forwards the modified segmented routing message according to the destination address of the modified segmented routing message.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the preset logic circuit unit and the network processor, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A segmented routing message forwarding method is applied to a preset logic circuit unit of a segmented routing node, wherein the segmented routing node further comprises a Network Processor (NP), and the method comprises the following steps:
acquiring a segmented routing message to be processed;
analyzing the segmented routing message to be processed to obtain a target Segmented Identification (SID) required by the NP when executing segmented routing forwarding operation;
sending the target SID to the NP so that the NP determines message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID;
receiving a message modification instruction sent by the NP, wherein the message modification instruction is used for expressing the message modification operation;
modifying the segmented routing message to be processed according to the message modification operation represented by the message modification instruction to obtain a modified segmented routing message;
and forwarding the modified segmented routing message according to the destination address of the modified segmented routing message.
2. The method according to claim 1, wherein the segment routing packet to be processed comprises a plurality of segment routing packet headers SRH;
the analyzing the segmented routing message to be processed to obtain the target segmented identification SID required by the NP executing the segmented routing forwarding operation includes:
analyzing each SRH of the segmented routing message to be processed to obtain a target SID required by the NP in the SRH when the NP executes segmented routing forwarding operation;
the sending the target SID to the NP so that the NP determines message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID, includes:
and sending the target SID analyzed from each SRH and the attribute information corresponding to each target SID to the NP, so that the NP determines the SRH to which the corresponding target SID belongs according to each attribute information, and determines the message modification operation required to be executed when the segmented routing forwarding operation is executed according to each received target SID and the SRH to which the target SID belongs.
3. The method of claim 2, wherein the sending the target SID parsed from each SRH and the attribute information corresponding to each target SID to the NP comprises:
constructing an analysis message, wherein the analysis message carries target SIDs analyzed from each SRH and attribute information corresponding to the target SIDs, the target SIDs are arranged according to a preset sequence, and each attribute information is used for representing the SRH to which the target SID positioned in the corresponding cis-position belongs;
and sending an analysis message to the NP.
4. The method of claim 3, wherein the attribute information is used to indicate the number of target SIDs parsed from each SRH;
the constructing and analyzing message comprises the following steps:
and sequentially aiming at each SRH in the segmented routing message to be processed, writing the target SID analyzed from the SRH into a current offset position in the analyzed message, and offsetting the current offset position by n offset lengths, wherein the current offset position is a preset initial position at the beginning, n is the number of the target SIDs analyzed from the SRH, and the offset length is the length of a single target SID.
5. The method of claim 2, wherein the analyzing, for each SRH of the to-be-processed segment routing packet, the SRH to obtain a target SID required by the NP in the SRH to perform a segment routing forwarding operation comprises:
determining whether the residual hop count SL in each SRH of the segmented routing message to be processed is 1 or not;
if the SL is 1, analyzing a first SID and a second SID in a SID list of the SRH as a target SID;
and if the SL is not 1, analyzing the SL +1 th SID in the SID list of the SRH as the target SID.
6. A method for forwarding a segment routing packet is applied to a network processor NP of a segment routing node, wherein the segment routing node further comprises a preset logic circuit unit, and the method comprises the following steps:
receiving a target segment identification SID sent by the preset logic circuit unit, wherein the target SID is the SID required by the NP when the NP executes a segment routing forwarding operation by analyzing the received segment routing message by the preset logic circuit unit;
determining message modification operation required to be executed when the segmented routing forwarding operation is executed according to the target SID;
and sending a message modification instruction to the preset logic circuit unit, wherein the message modification instruction is used for expressing the message modification operation, so that the preset logic circuit unit modifies the segmented routing message to be processed according to the message modification operation expressed by the message modification instruction to obtain the modified segmented routing message, and forwards the modified segmented routing message according to the destination address of the modified segmented routing message.
7. A segmented routing packet forwarding apparatus, which is applied to a preset logic circuit unit of a segmented routing node, where the segmented routing node further includes a network processor NP, and the apparatus includes:
the message acquisition module is used for acquiring a segmented routing message to be processed;
the SID analyzing module is used for analyzing the segmented routing message to be processed to obtain a target segmented identification SID required by the NP when the NP executes the segmented routing forwarding operation;
a first sending module, configured to send all the target SIDs to the NP, so that the NP determines, according to the target SIDs, a packet modification operation that needs to be performed when performing a segment routing forwarding operation;
a first receiving module, configured to receive a message modification instruction sent by the NP, where the message modification instruction is used to indicate the message modification operation;
the message modification module is used for modifying the segmented routing message to be processed according to the message modification operation represented by the message modification instruction to obtain the modified segmented routing message;
and the message forwarding module is used for forwarding the modified segmented routing message according to the destination address of the modified segmented routing message.
8. A segmented routing packet forwarding apparatus, which is applied to a network processor NP of a segmented routing node, where the segmented routing node further includes a preset logic circuit unit, and the apparatus includes:
a second receiving module, configured to receive a target segment id SID sent by the preset logic circuit unit, where the target id is a SID required by the NP when the preset logic circuit unit analyzes a received segment routing packet to perform a segment routing forwarding operation;
an operation determining module, configured to determine, according to the target SID, a message modification operation that needs to be executed when a segment routing forwarding operation is executed;
and a second sending module, configured to send a message modification instruction to the preset logic circuit unit, where the message modification instruction is used to indicate the message modification operation, so that the preset logic circuit unit modifies the to-be-processed segmented routing message according to the message modification operation indicated by the message modification instruction, obtains a modified segmented routing message, and forwards the modified segmented routing message according to a destination address of the modified segmented routing message.
9. A pre-defined logic circuit element, arranged in a segment routing node, said segment routing node further comprising a network processor NP, said pre-defined logic circuit element comprising:
a first memory for storing a computer program;
a first processor arranged to implement the method steps of any of claims 1 to 5 when executing a program stored in the memory.
10. A network processor disposed in a segment routing node, the segment routing node further comprising a predetermined logic circuit unit, the network processor comprising:
a second memory for storing a computer program;
a second processor adapted to perform the method steps of claim 6 when executing the program stored in the memory.
CN202110328292.1A 2021-03-26 2021-03-26 Segmented routing message forwarding method and device and preset logic circuit unit Active CN112787927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110328292.1A CN112787927B (en) 2021-03-26 2021-03-26 Segmented routing message forwarding method and device and preset logic circuit unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110328292.1A CN112787927B (en) 2021-03-26 2021-03-26 Segmented routing message forwarding method and device and preset logic circuit unit

Publications (2)

Publication Number Publication Date
CN112787927A CN112787927A (en) 2021-05-11
CN112787927B true CN112787927B (en) 2022-03-22

Family

ID=75762815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110328292.1A Active CN112787927B (en) 2021-03-26 2021-03-26 Segmented routing message forwarding method and device and preset logic circuit unit

Country Status (1)

Country Link
CN (1) CN112787927B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113472666B (en) * 2021-06-29 2023-08-18 新华三信息安全技术有限公司 Message forwarding method and device
CN116137632A (en) * 2021-11-17 2023-05-19 华为技术有限公司 Message processing method, device and equipment
CN114050996B (en) * 2021-11-29 2023-03-24 中国人民解放军国防科技大学 Segment routing extension message forwarding method
CN114900455A (en) * 2022-05-13 2022-08-12 北京字节跳动网络技术有限公司 Message transmission method, system, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105379295A (en) * 2013-07-03 2016-03-02 皇家Kpn公司 Streaming of segmented content
EP3273650A1 (en) * 2016-07-21 2018-01-24 Cisco Technology, Inc. System and method of providing segment routing as a service
CN108156077A (en) * 2016-12-02 2018-06-12 中兴通讯股份有限公司 A kind of Segment routing retransmission method and device based on IPv6 data planes
CN111095881A (en) * 2017-10-04 2020-05-01 思科技术公司 Segmented routing network signaling and packet processing
CN111628995A (en) * 2020-05-26 2020-09-04 新华三信息安全技术有限公司 SID compression method, SID compression device, SID compression equipment and storage medium based on SRv6
CN112243010A (en) * 2020-11-13 2021-01-19 中盈优创资讯科技有限公司 SRv 6-based traffic collection method and device
CN112511428A (en) * 2020-03-10 2021-03-16 中兴通讯股份有限公司 Message encapsulation method, message forwarding method, notification method, electronic device, and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10652144B2 (en) * 2018-01-09 2020-05-12 Cisco Technology, Inc. Segment routing network processing of packets including packets having a segment identifier structure providing processing and/or memory efficiencies

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105379295A (en) * 2013-07-03 2016-03-02 皇家Kpn公司 Streaming of segmented content
EP3273650A1 (en) * 2016-07-21 2018-01-24 Cisco Technology, Inc. System and method of providing segment routing as a service
CN108156077A (en) * 2016-12-02 2018-06-12 中兴通讯股份有限公司 A kind of Segment routing retransmission method and device based on IPv6 data planes
CN111095881A (en) * 2017-10-04 2020-05-01 思科技术公司 Segmented routing network signaling and packet processing
CN112511428A (en) * 2020-03-10 2021-03-16 中兴通讯股份有限公司 Message encapsulation method, message forwarding method, notification method, electronic device, and storage medium
CN111628995A (en) * 2020-05-26 2020-09-04 新华三信息安全技术有限公司 SID compression method, SID compression device, SID compression equipment and storage medium based on SRv6
CN112243010A (en) * 2020-11-13 2021-01-19 中盈优创资讯科技有限公司 SRv 6-based traffic collection method and device

Also Published As

Publication number Publication date
CN112787927A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
CN112787927B (en) Segmented routing message forwarding method and device and preset logic circuit unit
WO2021056945A1 (en) Method for forwarding message in sr network, device, and system
CN111510386B (en) Method and device for processing message
WO2021057683A1 (en) Message processing method and apparatus
WO2019185051A1 (en) Integrated flow table-based packet forwarding method and device
CN112787922A (en) Message processing method, network node and system
US9270586B2 (en) Method for abstracting datapath hardware elements
CN113411259A (en) Message forwarding method, device and equipment
CN112769738B (en) DetNet data packet processing method and device
CN112511424A (en) Method for forwarding and forwarding message, head node, forwarding node and storage medium
CN112787930B (en) Method, device and storage medium for monitoring running state of peer
CN1312890C (en) Method for generating a trie having a reduced number of trie blocks
CN114697160B (en) Tunnel message processing method and device
EP4254834A1 (en) Message transmission method and apparatus, and device, storage medium and system
CN114285907B (en) Data transmission method, device, electronic equipment and storage medium
CN101577680B (en) Updating method, device and system of tunnel routing information
CN113973074B (en) Message processing method and device, electronic equipment and medium
CN112565044A (en) Message processing method and device
US9444731B2 (en) Methods and systems for data packet routing
WO2022206397A1 (en) Buffering method and integrated circuit
CN114697408B (en) Tunnel message processing method and device
CN113452614B (en) Message processing method and device
EP4322482A1 (en) Routing information processing method and apparatus
JP4342462B2 (en) Network device and traffic counting method
WO2023088226A1 (en) Packet forwarding method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant