Message forwarding method, node equipment and SRv6 network
By integrating the forwarding chip with CPU in the SRv6 network, service routing table entry query and SRH packaging are implemented, which solves the problem of high CPU burden and high difficulty in realizing forwarding chips in the existing technology, and improves forwarding performance and flexibility.
Patent Information
- Application Number
- CN202411878502.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-19
AI Technical Summary
In the prior art, the CPU has a heavy burden and poor forwarding performance when forwarding packets based on the CPU; the implementation difficulty and cost when forwarding packets based on the forwarding chip are high, and the flexibility is poor.
By fusing the forwarding chip with the CPU, the forwarding chip performs service routing table entry query and ACL message feature matching, the CPU performs SRH encapsulation, and jointly completes SRv6 encapsulation forwarding.
It reduces the burden on the CPU and improves the working performance of the CPU; reduces the implementation difficulty and implementation cost of forwarding chips, and improves flexibility.
Smart Images

Figure CN119697111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a message forwarding method, a node device and an SRv6 network. Background Art
[0002] SR (Segment Routing) is a technology designed based on the source routing concept to forward data packets on the network. SRv6 TE (SRv6 Traffic Engineering) is a TE tunnel technology based on SRv6. The industry usually uses SRv6 TE Policy to define an SRv6 TE tunnel. SRv6 TE policy generally uses Color (tunnel color identification) and Endpoint (tunnel tail node address) as keywords. An SRv6 TE Policy contains one or more Segment Lists, and a Segment List contains multiple SIDs (Segment Identification). Segment List is also called a SID linked list or SID address stack. Each SID corresponds to a node or link in the message forwarding path. The SRv6 tunnel head node encapsulates the Segment Routing Header (SRH) based on the Segment List in the SRv6TE Policy and the service SID of the routing table entry, and forwards the message to the next-hop device based on the forwarding information corresponding to the first SID in the Segment List, thereby implementing SRv6 tunnel encapsulation and forwarding.
[0003] There are currently two implementation schemes for SRv6 tunnel encapsulation and forwarding. The first is a software forwarding scheme based on CPU implementation. Software routing table entries and SRv6 tunnel table entries are created at the software level, and data packets are processed by software programs running on the CPU. The corresponding routing table entries, flow policy table entries, SRv6 TEPolicy, Segment List, first segment next hop and other information are searched according to the destination address or five-tuple information of the packet, and the SRH is encapsulated and the packet is forwarded to the next hop. The second scheme is a hardware forwarding scheme based on forwarding chips. Hardware routing table entries and hardware tunnel table entries are installed in the forwarding chip, and SRv6 tunnel encapsulation and forwarding are implemented by hardware.
[0004] However, the first solution requires the CPU to perform multiple table lookups and message feature matching operations, which places a heavy burden on the CPU and results in poor forwarding performance. Since SRv6 is very flexible in message processing, and SRv6 encapsulates a large number of SIDs and a long encapsulated message header, the second solution is difficult and costly to implement, and has poor flexibility. Summary of the invention
[0005] The purpose of the present application is to provide a message forwarding method, a node device and an SRv6 network to address the deficiencies in the above-mentioned prior art, so as to solve the problems in the prior art of heavy CPU burden and poor forwarding performance when forwarding messages based on CPU, high implementation difficulty and cost and poor flexibility when forwarding messages based on forwarding chips.
[0006] To achieve the above objectives, the technical solutions adopted in this application are as follows:
[0007] In a first aspect, the present application provides a message forwarding method, which is applied to a head node device in an SRv6 network, wherein the head node device includes a forwarding chip and a CPU, and the method includes:
[0008] The forwarding chip determines the forwarding identification information of the data message according to the pre-installed hardware forwarding table, and sends the data message and the forwarding identification information to the CPU;
[0009] The CPU determines the service SID, tunnel tail node address and tunnel color identification of the data message according to the forwarding identification information and the software forwarding table;
[0010] The CPU determines a segment list Segment List of the data message according to the SRv6 TE Policy forwarding table, the tunnel tail node address, and the tunnel color identifier;
[0011] The CPU encapsulates the data message according to the service SID and the Segment List to obtain an encapsulated message, and sends the encapsulated message to the forwarding chip;
[0012] The forwarding chip forwards the encapsulated message.
[0013] Optionally, the hardware forwarding table includes a routing table;
[0014] The forwarding chip determines the forwarding identification information of the data message according to the pre-installed hardware forwarding table, and sends the data message and the forwarding identification information to the CPU, including:
[0015] Query the routing table according to the destination IP address of the data message, determine the tunnel identifier that matches the data message, and determine whether there is an access control list in the hardware forwarding table;
[0016] If the access control list exists and an entry matching the data message is found, obtaining a flow rule identifier matching the data message, and sending the tunnel identifier and the flow rule identifier as the forwarding identifier information together with the data message to the CPU;
[0017] If the access control list does not exist or an entry matching the data message is not found in the access control list, the tunnel identifier is sent to the CPU together with the data message as the forwarding identifier information according to the routing table.
[0020] Optionally, the software forwarding table includes an SRv6 tunnel encapsulation information table and a flow policy rule table;
[0021] The CPU determines the service SID, the tunnel tail node address and the tunnel color identifier of the data message according to the forwarding identifier information and the software forwarding table, including:
[0022] Search the SRv6 tunnel encapsulation information table for the tunnel identifier, determine a tunnel encapsulation information table entry that matches the tunnel identifier, and obtain a service SID, a tunnel tail node address, and a tunnel color identifier in the tunnel encapsulation information table entry;
[0023] If the forwarding identification information does not include the flow rule identification, the service SID, tunnel tail node address and tunnel color identification in the tunnel encapsulation information table entry are used as the service SID, tunnel tail node address and tunnel color identification of the data message;
[0024] If the forwarding identification information includes a flow rule identifier, the flow policy rule table is searched to determine the flow policy rule table entry that matches the flow rule identifier, the service SID, tunnel tail node address, and tunnel color identifier in the flow policy rule table entry are obtained, and the service SID, tunnel tail node address, and tunnel color identifier of the data packet are determined based on the tunnel encapsulation information table entry and the flow policy rule table entry.
[0025] Optionally, the step of determining the service SID, the tunnel tail node address, and the tunnel color identifier of the data message according to the tunnel encapsulation information entry and the flow policy rule entry includes:
[0026] If the service SID, tunnel tail node address and tunnel color identifier in the tunnel encapsulation information table item are different from the service SID, tunnel tail node address and tunnel color identifier in the flow policy rule table item, the service SID, tunnel tail node address and tunnel color identifier in the flow policy rule table item are used as the service SID, tunnel tail node address and tunnel color identifier of the data message; or, if the flow policy rule table item contains a tunnel color identifier, the service SID, tunnel tail node address and tunnel color identifier of the data message are determined based on the tunnel color identifier in the flow policy rule table item and the service SID and tunnel tail node address in the tunnel encapsulation information table item.
[0027] Optionally, the CPU determines a Segment List of the data message according to the SRv6 TE Policy forwarding table, the tunnel egress node address, and the tunnel color identifier, including:
[0028] The CPU searches the SRv6 TE Policy forwarding table according to the tunnel tail node address and the tunnel color identifier, determines an SRv6 TE Policy table entry that matches the tunnel tail node address and the tunnel color identifier, and uses a Segment List in the SRv6 TE Policy table entry as a Segment List of the data message.
[0029] Optionally, the forwarding chip forwards the encapsulated message, including:
[0030] The forwarding chip determines the next hop information of the encapsulated message, edits the Ethernet header of the encapsulated message based on the next hop information, and forwards the edited encapsulated message to the next node device.
[0031] In a second aspect, the present application provides a message forwarding method, which is applied to other node devices in an SRv6 network, wherein the other node devices include: an intermediate node device or a tail node device, and the other node devices include: a forwarding chip and a CPU, and the method includes:
[0032] The forwarding chip determines the SID index corresponding to the destination address of the encapsulated message according to the pre-installed hardware routing table, and sends the encapsulated message and the SID index to the CPU;
[0033] The CPU determines, according to the SID index and the SID forwarding table, a SID table entry corresponding to the destination address of the encapsulated message;
[0034] The CPU processes the encapsulated message according to the processing action in the SID table entry to obtain a data message, and sends the data message to the forwarding chip;
[0035] The forwarding chip forwards the data message.
[0036] Optionally, if the other node device is a tail node device, the CPU processes the encapsulated message according to the processing action in the SID table entry to obtain a data message, including:
[0037] The CPU performs SRv6 decapsulation on the encapsulated message according to the processing action in the SID table entry to obtain a data message, and sends the data message to the forwarding chip;
[0038] The step of the forwarding chip forwarding the data message includes:
[0039] The forwarding chip determines the next hop information of the data message according to the hardware routing table, edits the Ethernet header of the data message based on the next hop information, and forwards the edited data message to the destination device.
[0040] In a third aspect, an embodiment of the present application further provides a node device, wherein the node device is a head node device, an intermediate node device, or a tail node device in the SRv6 network;
[0041] If the node device is a head node device, the node device includes: a processor, a storage medium and a bus, the storage medium stores program instructions executable by the processor, when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the message forwarding method as described in the first aspect when executing;
[0042] If the node device is an intermediate node device or a tail node device, the node device includes: a processor, a storage medium and a bus, the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the message forwarding method described in the second aspect.
[0043] In a fourth aspect, an embodiment of the present application further provides an SRv6 network, comprising a head node device for executing the method described in the first aspect, and also comprising an intermediate node device and a tail node device for executing the method described in the second aspect.
[0044] The beneficial effects of the present application are: by querying the service routing table items through the forwarding chip and performing SRH encapsulation through the CPU, on the one hand, the forwarding chip only needs to query the service routing table items, which reduces the implementation difficulty and cost of the forwarding chip; on the other hand, the CPU does not need to query the routing table items, but only needs to perform SRH encapsulation based on the tunnel identifier, which reduces the workload of the CPU matching, thereby improving the CPU's forwarding performance for data packets. In addition, by integrating the forwarding chip and the CPU, the flexibility of the expansion of the packet forwarding function can also be enhanced.
[0045] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A schematic diagram of the architecture of an SRv6 network provided in an embodiment of the present application is shown;
[0048] Figure 2 A schematic diagram of the architecture of a node device provided in an embodiment of the present application is shown;
[0049] Figure 3 A flow chart of a message forwarding method in a head node device provided in an embodiment of the present application is shown;
[0050] Figure 4 A flow chart of determining forwarding identification information provided by an embodiment of the present application is shown;
[0051] Figure 5 A flow chart of determining a service SID, a tunnel tail node address, and a tunnel color identifier provided by an embodiment of the present application is shown;
[0052] Figure 6 A flow chart of a head node device performing message forwarding provided by an embodiment of the present application is shown;
[0053] Figure 7 A flowchart of another head node device performing message forwarding provided in an embodiment of the present application is shown;
[0054] Figure 8 A flowchart of a message forwarding method in another node device provided in an embodiment of the present application is shown;
[0055] Fig. 9 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0056] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0057] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0058] There are two implementation schemes for SRv6 tunnel encapsulation and forwarding in the prior art. The first is a software forwarding scheme based on the CPU, but this method requires processing data packets according to the software program running on the CPU. During the forwarding process, the CPU needs to perform multiple table lookups and packet feature matching operations, so the CPU is heavily burdened and the forwarding performance needs to be improved.
[0059] The second is a hardware forwarding solution based on forwarding chips. However, when this solution is applied to SRv6 message forwarding, SRv6 processes messages very flexibly, and the number of SIDs encapsulated in SRv6 is large, and the encapsulated message header is long, which exceeds the processing capacity of general forwarding chips. Therefore, the implementation cost and difficulty of the hardware forwarding solution are high, and there is also the problem of poor flexibility.
[0060] Based on this, this application proposes a message forwarding method, which realizes the forwarding of SRv6 messages by integrating the forwarding chip with the CPU. The forwarding chip performs service routing table query and ACL message feature matching, and uses the CPU for SRH encapsulation. The forwarding chip and the CPU cooperate to complete SRv6 encapsulation forwarding. Compared with the software forwarding solution, this application reduces the burden on the CPU and improves the working performance of the CPU. Compared with the hardware forwarding solution, this application reduces the implementation difficulty and cost of the forwarding chip and has higher flexibility.
[0061] Figure 1 This is a schematic diagram of the architecture of an SRv6 network given in this application. Figure 1 The network includes a head node device PE1, intermediate node devices P1, P2 and a tail node device PE2. The method of the present application can be applied to the head node device, the intermediate node device or the tail node device in the network. The following text describes the process of SRv6 message forwarding by each device based on the message forwarding method of the present application.
[0062] Figure 2 It is a schematic diagram of the structure of a node device. A node device can be Figure 1 The head node device, the intermediate node device or the tail node device in the node device includes a forwarding chip and a CPU, wherein the forwarding chip can be a switching chip, and the CPU mentioned below refers to a software program running in the CPU to forward SRv6 packets.
[0063] like Figure 3 , which is a description of the method steps performed by the head node device when the method of the present application is applied to the head node device, refer to Figure 3 , the steps of the message forwarding method in the head node device include:
[0064] S301. The forwarding chip determines forwarding identification information of a data message according to a pre-installed hardware forwarding table, and sends the data message and the forwarding identification information of the data message to the CPU.
[0065] Optionally, the forwarding chip can be a switching chip. The hardware forwarding table includes: a routing table, which includes multiple routing table items, each of which corresponds to a routing tunnel identifier. After receiving the data message, the head node device can obtain the source address and destination address in the data message, search the routing table based on the source address and destination address of the data message, and after hitting the routing table item, use the tunnel identifier corresponding to the hit routing table item as the forwarding identification information of the data message, and put the forwarding identification information into the message descriptor and send it to the CPU together with the data message.
[0066] As another optional implementation method, in the present application, not only can the forwarding identification information of the data message be determined based on the routing information of the message, but also the forwarding identification information of the data message can be determined based on the five-tuple characteristics of the message. At this time, the hardware forwarding table can include a hardware ACL (Access Control List), and the ACL includes a five-tuple of messages, a DSCP value (Differentiated Services Code Point), a flow rule identifier, and a processing action. The processing action in this step can be to hand over the data message to the CPU for SRv6 tunnel encapsulation. After receiving the data message, the head node device can search in the ACL based on the five-tuple information and DSCP value of the data message, determine the flow rule identifier and processing action corresponding to the data message, and use the flow rule identifier and the tunnel identifier determined based on the routing table as the forwarding identification information. The processing action is to put the forwarding identification information into the message descriptor and send it to the CPU together with the data message. Among them, the flow rule identifier is used to indicate the diversion strategy adopted for data message forwarding, and the head node device can determine the tunnel used for data message forwarding based on the diversion strategy.
[0067] The tunnel identifier is used to uniquely identify the tunnel in the SRv6 forwarding system. Figure 1 The SRv6 forwarding system shown includes Figure 1 Tunnel policy1 and tunnel policy2 in the.
[0068] In a possible implementation, the head node device in SRv6 can learn the routing information of each node device through the BGP protocol, build a routing table based on the learned routing information of each node device, and store the routing table in the forwarding chip.
[0069] S302: The CPU determines the service SID, tunnel tail node address and tunnel color identifier of the data message according to the forwarding identifier information and the software forwarding table.
[0070] After obtaining the forwarding identification information, the forwarding chip may send the forwarding identification information and the data message to the CPU, and the CPU may further match the data message.
[0071] The tunnel tail node address may be the address identifier of the last node device in the tunnel, and the tunnel color identifier may be a keyword used to uniquely identify the tunnel. Figure 1 , the tail node devices of tunnel policy1 and tunnel policy2 are both PE2, then the tunnel tail node address Endpoint can be expressed as 2::2.
[0072] In the first implementation, if the hardware forwarding table only includes the routing table, the software forwarding table may include the SRv6 tunnel encapsulation information table, which may be generated based on the SRv6 service route, for example, by the head node device based on the BGP routing protocol learning. The keyword of the SRv6 tunnel encapsulation information table is the tunnel identifier, and the SRv6 tunnel encapsulation information table item includes one or more of the following information: the tunnel tail node address (Endpoint), the service SID, and the tunnel color identifier (Color). After the CPU receives the forwarding identifier information, it can search in the SRv6 tunnel encapsulation information table based on the tunnel identifier, determine the target table item corresponding to the tunnel identifier in the table, and use the Endpoint and Color of the target table item as the tunnel tail node address and tunnel color identifier of the data message.
[0073] In the second implementation, if the hardware forwarding table includes a routing table and an ACL, the software forwarding table may include an SRv6 tunnel encapsulation information table and a flow policy rule table. The keyword of the flow policy rule table is the flow rule identifier, and the flow policy rule table items include one or more of Endpoint, service SID, and Color. After the CPU receives the forwarding identifier information, it can determine the target table item corresponding to the tunnel identifier in the SRv6 tunnel encapsulation information table based on the tunnel identifier, and can also determine the target table item corresponding to the flow rule identifier in the flow policy rule table based on the flow rule identifier determined by the ACL, and finally determine the tunnel tail node address and tunnel color identifier of the data packet according to the SRv6 tunnel encapsulation information table and the target table item in the flow policy rule table. Among them, the flow policy rule table can be generated based on the diversion policy configured on the node device, and the diversion policy can be, for example, PBR (Policy-based-route).
[0074] S303: The CPU determines a segment list of the data message according to the SRv6 TE Policy forwarding table, the tunnel egress address, and the tunnel color identifier.
[0075] The CPU includes an SRv6 TE Policy forwarding table. The keywords in the table are the tunnel endpoint address Endpoint and Color. The SRv6 TE Policy forwarding table contains one or more candidate paths. When searching for SRv6TEPolicy based on the tunnel endpoint address and tunnel color, the candidate path with the highest priority can be selected from multiple candidate paths as the forwarding path.
[0076] Among them, determining the segment list (Segment List) of the data message can be to determine the number of SIDs in the SID forwarding table corresponding to the head node device. The Segment List can indicate the number of SIDs that the data message needs to pass through before reaching the destination address. After the CPU determines the forwarding path, it can determine the Segment List of the data message based on the number of node devices included in the forwarding path.
[0077] For example, refer to Figure 1 , search the SRv6 TE Policy forwarding table for tunnel policy2 according to the tunnel egress address and tunnel color identifier, and use the segment list of tunnel policy2 as the segment list of the data packet.
[0078] S304: The CPU encapsulates the data message according to the service SID and the Segment List to obtain an encapsulated message, and sends the encapsulated message to the forwarding chip.
[0079] The CPU encapsulates the data message, which may be to add an SRH message header to the data message to obtain an encapsulated message. The SRH message header includes multiple fields, such as a Tag field, a Segments Left field, a Segment List[] field, etc., wherein the Tag field is used to fill in the segment list index, the Segments Left field is used to fill in the number of SIDs, the Segment List[0] of the SegmentList[] field is used to fill in the service SID, and the remaining positions in the Segment List[] are used to fill in the SID of the tunnel Segment List. The CPU may fill in the Segments Left field with the number of SIDs indicated by the Segment List, fill in the Segments List[0] of the Segment List[] field with the service SID, and fill in the remaining positions of the Segment List[] with the SID of the tunnel Segment List to obtain the SRH message header, and encapsulate the SRH message header as the message header of the data message to obtain the encapsulated message.
[0080] It should be noted that after adding the SRH header to the data message, IPv6 encapsulation is required. In the first implementation, the CPU can perform IPv6 encapsulation on the encapsulated message, add the SRH and IPv6 header, obtain the encapsulated SRv6 message, and send the encapsulated SRv6 message to the forwarding chip.
[0081] In the second implementation, the CPU can send the encapsulated message to the forwarding chip, which will perform IPv6 encapsulation and forwarding processing.
[0082] Before sending the encapsulated message to the forwarding chip, the CPU can also set the next hop information according to the first SID and determine the outbound interface.
[0083] S305: The forwarding chip forwards the encapsulated message.
[0084] In the first implementation, the CPU can encapsulate the encapsulated message in IPv6 and send the encapsulated SRv6 message to the forwarding chip. The forwarding chip can forward the encapsulated SRv6 message according to the destination address of the IPv6 message header of the encapsulated SRv6 message.
[0085] In the second implementation, the CPU may send the encapsulated message to the forwarding chip, the forwarding chip performs IPv6 encapsulation on the encapsulated message to obtain an encapsulated SRv6 message, and forwards the encapsulated SRv6 message to the next node device.
[0086] In an embodiment of the present application, the forwarding chip determines the forwarding identification information of the data packet according to the pre-installed hardware forwarding table, and sends the data packet and the forwarding identification information of the data packet to the CPU. The CPU determines the service SID, tunnel tail node address and tunnel color identification of the data packet according to the forwarding identification information and the software forwarding table. The CPU determines the Segment List of the data packet according to the SRv6TE Policy forwarding table, the tunnel tail node address and the tunnel color identification. The CPU encapsulates the data packet according to the service SID and the Segment List to obtain the encapsulated message, and sends the encapsulated message to the forwarding chip, and the forwarding chip forwards the encapsulated message.
[0087] The forwarding chip is used to query the service routing table, and the CPU is used to perform SRH encapsulation. On the one hand, the forwarding chip only needs to query the service routing table, which reduces the difficulty and cost of implementing the forwarding chip. On the other hand, the CPU does not need to query the routing table, but only needs to perform SRH encapsulation based on the tunnel identifier, which reduces the workload of the CPU matching and improves the CPU's forwarding performance for data packets. In addition, by integrating the forwarding chip and the CPU, the flexibility of expanding the packet forwarding function can also be enhanced.
[0088] Optionally, the hardware forwarding table includes: a routing table. The following is a further description of the above-mentioned determination of the forwarding identification information of the data message by the forwarding chip according to the pre-installed hardware forwarding table, such as Figure 4 As shown, the above step S301 includes:
[0089] S401. Query the routing table according to the destination IP address of the data message, determine the tunnel identifier that matches the data message, and determine whether there is an access control list in the hardware forwarding table.
[0090] The forwarding chip can search the routing table based on the destination address of the data message, and use the tunnel identifier in the matching routing table entry as the tunnel identifier of the data message.
[0091] Exemplarily, the source address of the data packet is 10.0.0.1, and the destination address of the data packet is 20.0.0.1. Based on the source address and destination address of the data packet, a search is performed in the routing table. The tunnel identifier 10 in the hit routing table entry can be used as the tunnel identifier of the data packet, and the tunnel identifier is recorded in the message description to obtain a message descriptor.
[0092] The forwarding chip can first determine whether there is a pre-configured access control list in the hardware forwarding table, that is, whether the PBR policy is pre-configured on the forwarding chip. The access control list can be the ACL mentioned above, which records the message five-tuple, DSCP value, flow rule identifier, and processing action. Based on the five-tuple information and DSCP value of the data message, the ACL can be searched to obtain the flow rule identifier and processing action corresponding to the data message.
[0093] S402: If an access control list exists and an entry matching the data message is found, a flow rule identifier matching the data message is obtained, and the tunnel identifier and the flow rule identifier are sent to the CPU together with the data message as forwarding identifier information.
[0094] If the forwarding chip includes ACL, that is, the PBR policy is pre-configured on the forwarding chip, the data packet can be diverted based on the packet characteristics. The forwarding chip can parse the data packet to obtain the five-tuple information and DSCP value of the data packet, and search in the ACL based on the five-tuple information and DSCP value of the data packet, and use the flow rule identifier of the ACL table item that hits as the flow rule identifier of the data packet, and use the flow rule identifier and the tunnel identifier as forwarding identifier information, and send the data packet and forwarding identifier information to the CPU according to the processing action of the ACL table item that hits.
[0095] The forwarding chip may record the tunnel identifier and the flow rule identifier in the message descriptor as the forwarding identifier information of the data message, and send the message descriptor to the CPU together with the data message.
[0096] S403: If the access control list does not exist or an entry matching the data message is not found in the access control list, the tunnel identifier is sent to the CPU together with the data message as forwarding identifier information according to the routing table.
[0097] If the ACL is not installed in the forwarding chip, the data message is routed and diverted. The forwarding chip only records the tunnel identifier as the forwarding identifier information of the data message in the message description, obtains the message descriptor, and sends the message descriptor to the CPU together with the data message.
[0098] In another possible implementation, an ACL is installed in the forwarding chip, but no ACL entry matching the data packet is found in the ACL. In this case, the forwarding chip may only record the tunnel identifier as the forwarding identifier information of the data packet in the message descriptor, and send the message descriptor to the CPU together with the data packet.
[0099] Optionally, the software forwarding table includes: a tunnel encapsulation information table and a flow policy rule table.
[0100] The output table item of the routing table is the tunnel identifier, the keyword in the tunnel encapsulation information table is the tunnel identifier, and the table items include: service SID, tunnel tail node address, and tunnel color identifier. The CPU can determine the table item of the data message in the tunnel encapsulation information table based on the tunnel identifier. The matching keyword of the ACL table item is the flow rule identifier, and the keyword in the flow policy rule table is the flow rule identifier. The flow policy rule table item includes one or more of the Endpoint, service SID, and Color information. The CPU can determine the Endpoint, service SID, Color, and other information of the data message based on the flow rule identifier.
[0101] In the above step S302, the CPU determines the service SID, tunnel tail node address and tunnel color identification of the data message according to the forwarding identification information and the software forwarding table, such as Figure 5 As shown, including:
[0102] S501. Search the SRv6 tunnel encapsulation information table according to the tunnel identifier, determine the tunnel encapsulation information table entry that matches the tunnel identifier, and obtain the service SID, tunnel tail node address, and tunnel color identifier in the tunnel encapsulation information table entry.
[0103] The CPU takes out the tunnel identifier in the forwarding identifier information from the message descriptor, and searches the SRv6 tunnel encapsulation information table according to the tunnel identifier. Each tunnel encapsulation information table item in the SRv6 tunnel encapsulation information table includes: tunnel identifier, service SID, tunnel tail node address, and tunnel color identifier. By matching the tunnel identifier determined by the forwarding chip based on the hardware forwarding table with the keywords of each item in the SRv6 tunnel encapsulation information table, a tunnel encapsulation information table item with the same keyword as the tunnel identifier can be obtained. Among them, the keyword of each item in the SRv6 tunnel encapsulation information table is the tunnel identifier.
[0104] S502: If the forwarding identification information does not include the flow rule identification, the service SID, tunnel end node address and tunnel color identification in the tunnel encapsulation information entry are used as the service SID, tunnel end node address and tunnel color identification of the data message.
[0105] If the hardware forwarding table of the forwarding chip does not include ACL, the software forwarding table of the CPU may also not include the flow policy rule table. At this time, the forwarding identification information taken out by the CPU from the message descriptor does not include the flow rule identification, and the tunnel encapsulation information item can be directly determined based on the tunnel identification, and the business SID in the tunnel encapsulation information item is used as the business SID of the data message, the tunnel tail node address in the tunnel encapsulation information item is used as the tunnel tail node address of the data message, and the tunnel color identification in the tunnel encapsulation information item is used as the tunnel color identification of the data message.
[0106] S503. If the forwarding identification information includes a flow rule identifier, search the flow policy rule table, determine the flow policy rule table item that matches the flow rule identifier, obtain the service SID, tunnel tail node address, and tunnel color identifier in the flow rule policy table item, and determine the service SID, tunnel tail node address, and tunnel color identifier of the data packet based on the tunnel encapsulation information table item and the flow policy rule table item.
[0107] If the forwarding identification information extracted by the CPU from the message descriptor includes a flow rule identification, indicating that the method used is the message feature diversion method, then the flow policy rule table entry corresponding to the flow rule identification can be searched in the flow policy rule table. Each entry in the flow policy rule table includes a flow rule identification, a service SID, a tunnel tail node address, and a tunnel color identification. The CPU can search for the flow policy rule table entry with the same flow rule identification.
[0108] It should be noted that the contents of the items in the flow policy rule table and the SRv6 tunnel encapsulation information table may not correspond. At this time, based on the user's choice, the service SID, tunnel tail node address and tunnel color identification in the flow policy rule table or the SRv6 tunnel encapsulation information table can be used as the service SID, tunnel tail node address and tunnel color identification of the data message. For example, assuming that the method of diverting traffic based on message features is preferred, when the contents of the items in the flow policy rule table and the SRv6 tunnel encapsulation information table are different, the contents of the items in the flow policy rule table shall prevail.
[0109] In an embodiment of the present application, by pre-configuring the ACL in the forwarding chip and pre-configuring the flow policy rule table corresponding to the ACL in the CPU, the forwarding chip can execute the ACL message feature matching step and determine the diversion strategy used when forwarding the data message, so that the CPU can determine the encapsulation information of the data message based on the diversion strategy and perform SRH encapsulation on the data message.
[0110] The following is a further description of determining the service SID, tunnel tail node address and tunnel color identification of the data message according to the tunnel encapsulation information table item and the flow policy rule table item. The above step S502 includes:
[0111] If the service SID, tunnel tail node address and tunnel color identifier in the tunnel encapsulation information table item are different from the service SID, tunnel tail node address and tunnel color identifier in the flow policy rule table item, the service SID, tunnel tail node address and tunnel color identifier in the flow policy rule table item shall be used as the service SID, tunnel tail node address and tunnel color identifier of the data message; or if the flow policy rule table item contains a tunnel color identifier, the service SID, tunnel tail node address and tunnel color identifier of the data message shall be determined based on the tunnel color identifier in the flow policy rule table item and the service SID and tunnel tail node address in the tunnel encapsulation information table item.
[0112] Optionally, if the service SID in the tunnel encapsulation information table item is different from the service SID in the flow policy rule table item, the service SID in the flow policy rule table item can be used as the service SID of the data message. If the tunnel tail node address in the tunnel encapsulation information table item is different from the tunnel tail node address in the flow policy rule table item, the tunnel tail node address in the flow policy rule table item can be used as the tunnel tail node address of the data message. If the tunnel color identifier in the tunnel encapsulation information table item is different from the tunnel color identifier in the flow policy rule table item, the tunnel color identifier in the flow policy rule table item can be used as the tunnel color identifier of the data message.
[0113] If the flow policy rule entry contains partial information of the service SID, the tunnel end node address, and the tunnel color identifier, the service SID, the tunnel end node address, and the tunnel color identifier of the data packet are determined according to the partial information in the flow policy rule entry and the tunnel encapsulation information entry.
[0114] The flow policy rule table item may only include part of the information of the service SID, tunnel tail node address, and tunnel color identification. In this case, the content contained in the flow policy rule table item can be used as the information of the data packet, and the missing information in the flow policy rule table item can be determined, and the corresponding content of the missing information in the tunnel encapsulation information table item can be used as the information of the data packet.
[0115] Exemplarily, the flow policy rule table item only includes the tunnel color identifier. The tunnel color identifier in the flow policy rule table item can be used as the tunnel color identifier of the data packet, and the service SID and the tunnel tail node address can be obtained from the tunnel encapsulation information table item. The service SID of the tunnel encapsulation information table item is used as the service SID of the data packet, and the tunnel tail node address of the tunnel encapsulation information table item is used as the tunnel tail node address of the data packet.
[0116] It should be understood that the traffic diversion strategy based on packet characteristics has higher flexibility and is generally more in line with actual business needs. Therefore, when the contents of the tunnel encapsulation information table item and the flow policy rule table item are different, the content of the flow policy rule table item shall prevail, which can further improve the flexibility of data packet forwarding and reduce the possibility of network congestion.
[0117] The following is a further description of the CPU determining the Segment List of the data message according to the SRv6 TE Policy forwarding table, the tunnel egress node address, and the tunnel color identifier. The above S303 step includes:
[0118] The CPU searches the SRv6 TE Policy forwarding table based on the tunnel egress address and tunnel color identifier, determines the SRv6 TE Policy entry that matches the tunnel egress address and tunnel color identifier, and uses the segment list in the SRv6 TE Policy entry as the segment list of the data packet.
[0119] The tunnel egress node address and the tunnel color identifier are used as keywords to match the tunnel egress node address and the tunnel color identifier of each entry in the SRv6 TE Policy forwarding table. If the currently matched tunnel egress node address and the tunnel color identifier are the same as the tunnel egress node address and the tunnel color identifier determined in step S302, the currently matched entry is used as the SRv6 TE Policy entry corresponding to the tunnel egress node address and the tunnel color identifier.
[0120] The SRv6 TE Policy forwarding table records at least one candidate path, and the candidate path with the highest priority among the candidate paths can be used as the forwarding path. The forwarding path can be a SID forwarding table, which is used to indicate the remaining node devices that the data packet needs to pass through before reaching the destination address. Based on the forwarding path and the current node device, the number of remaining node devices can be determined and used as the segment list of the data packet.
[0121] The following is a further description of the forwarding chip forwarding the encapsulated message, which includes:
[0122] The forwarding chip determines the next hop information of the encapsulated message, edits the Ethernet header of the encapsulated message based on the next hop information, and forwards the edited encapsulated message to the next node device.
[0123] The next hop information may be an index value of a next hop device. The CPU may add the index value of the next hop device to the message descriptor, and send the message descriptor and the encapsulated message to the forwarding chip. After receiving the message descriptor, the forwarding chip may obtain the index value of the next hop device from the message descriptor, and edit the Ethernet header of the encapsulated message based on the index value of the next hop device to obtain the edited encapsulated message.
[0124] Next, the steps of data message encapsulation and forwarding in the head node device are further explained with reference to two examples.
[0125] In the first example, the forwarding chip is pre-configured with a routing table, and the CPU is pre-configured with an SRv6 tunnel encapsulation information table and an SRv6 TE Policy forwarding table. Figure 6 After receiving the data message, the forwarding chip of the head node device matches the data message in the routing table based on the source address and the destination address. After hitting the routing table entry, the tunnel identifier in the hit routing table entry is sent to the CPU as the forwarding identifier information, and the CPU performs SRH encapsulation.
[0126] Reference Figure 1 When forwarding data packets, PE1 receives data packets from CE1. The forwarding chip of PE1 first receives the data packet, the source IP address of the packet is 10.0.0.1, the destination IP address is 20.0.0.1, and the routing table is searched according to the destination IP address. The tunnel identifier value is 10 according to the hit routing table entry, and the tunnel identifier is recorded as the forwarding identifier information in the packet descriptor. The next hop information in the routing table entry is to send the data packet to the CPU for SRv6 encapsulation, so the forwarding chip hands the packet to the CPU.
[0127] After receiving the forwarding identifier information, the CPU extracts the tunnel identifier from the message descriptor, searches the SRv6 tunnel encapsulation information table based on the tunnel identifier, and obtains Endpoint 2::2, service SID 200::400, and Color 100. The CPU continues to search the SRv6 TE Policy forwarding table based on the Endpoint and Color to obtain tunnel policy2, and encapsulates the SRH and outer IPv6 header based on the service SID and the Segment List of policy2. The destination address of the outer IPv6 header is the first segment SID of policy2.
[0128] If the first SID of policy2 is Figure 1 The End SID of the middle node device P2 needs to be forwarded based on the SID routing table entry. Therefore, the CPU hands the encapsulated message to the forwarding chip. Among them, the forwarding chip can select the route based on the destination address of the outer IPv6 header and edit the Ethernet header before sending the encapsulated message to the next node device. The forwarding chip looks up the routing table according to the destination address of the message, obtains the routing table entry of P2, and then forwards the encapsulated message to P2.
[0129] In the second example, a routing table and an ACL are pre-configured in the forwarding chip of the head node device, and a flow policy rule table, an SRv6 tunnel encapsulation information table, and an SRv6 TE Policy forwarding table are pre-configured in the CPU. Figure 7 This is a schematic diagram of the process of the head node device forwarding messages. Figure 1 In the network topology shown in the figure, two SRv6 TE Policies are created on PE1: policy1 and policy2. The endpoint of policy1 is 2::2 and the color is 100, and the endpoint of policy2 is 2::2 and the color is 200. PE1 installs the corresponding entries of policy1 and policy2 in the SRv6 TE Policy table.
[0130] PE1 and PE2 establish a BGP neighbor relationship. PE1 learns CE2's routing information through the BGP protocol and generates an SRv6 tunnel encapsulation information table and a hardware routing table based on the learned routing information. The routing tunnel identifier of the SRv6 tunnel encapsulation information table is 10, and the corresponding Endpoint is 2::2. The service SID comes from PE2's End.DT4 SID, which is 200::400. The destination network segment of the routing table is 20.0.0.1 / 32, and the routing tunnel identifier is 10.
[0131] Assume that the service requires traffic with source address 10.0.0.1 and destination address 20.0.0.1 to go through SRv6 tunnel policy1. Then you can configure PBR (Policy-Based Routing) on PE1. PE1 installs the flow policy rule table and hardware ACL. The flow rule identifier value of the flow policy rule table is 1, and the corresponding color value is 100. The ACL table entry matches the packet source address 10.0.0.1 and the packet destination address 20.0.0.1. The corresponding processing action is to report the data packet to the CPU, and the flow rule identifier is 1.
[0132] After the forwarding chip receives the data packet, the head node device PE1 receives the data packet from CE1. The forwarding chip of PE1 first receives the data packet, analyzes it and finds that the source IP address of the packet is 10.0.0.1, and the destination IP address is 20.0.0.1. By searching the routing table and hitting the routing table entry, the routing tunnel identifier value is 10, and the routing tunnel identifier is recorded in the packet descriptor.
[0133] Next, the forwarding chip performs ACL matching, hits the ACL table entry, obtains the flow rule identifier value of 1, and records the flow rule identifier in the message descriptor. Under the processing action instruction of the hit table entry, the message is handed over to the CPU. At this time, the message descriptor carries the tunnel identifier and flow rule identifier.
[0134] The CPU receives the message from the forwarding chip and extracts the tunnel ID and flow rule ID from the message descriptor. It searches the SRv6 tunnel encapsulation information table based on the tunnel ID and obtains Endpoint 2::2 and service SID 200::400. It searches the flow policy rule table based on the flow rule ID and obtains the color value 100. The CPU continues to search the SRv6 TE Policy forwarding table based on the Endpoint and Color to obtain tunnel policy1. It encapsulates the SRH and outer IPv6 header based on the service SID and the Segment List of policy1 to obtain the encapsulated message.
[0135] Assume that the first-segment SID of policy1 is the End.X SID of PE1. The software obtains the next-hop index based on the next-hop information associated with the first-segment SID, sets the next-hop index in the message descriptor, and hands the encapsulated message to the forwarding chip. The forwarding chip takes the next-hop index from the message descriptor, obtains the hardware next-hop information, performs the Ethernet header editing action, and then forwards the encapsulated message to the next-hop device.
[0136] After the head node device forwards the encapsulated message to other node devices, the other node devices can also forward the message by integrating the forwarding chip and the CPU. The other node devices can be intermediate node devices or tail node devices. The following is a further description of the method for performing message forwarding by the intermediate node device and the tail node device. Among them, the structure of the intermediate node device and the tail node device can be as follows: Figure 2 As shown, the forwarding chip may be a switching chip, and the CPU refers to a software program running on the CPU for forwarding SRv6 packets.
[0137] Reference Figure 8 The steps of the message forwarding method in the intermediate node device and the tail node device include:
[0138] S801. The forwarding chip determines the SID index corresponding to the destination address of the encapsulated message according to the pre-installed hardware routing table, and sends the encapsulated message and the SID index of the encapsulated message to the CPU.
[0139] The routing table can be pre-configured in the forwarding chip of other node devices. It should be noted that there are differences in the contents of the routing table items in other node devices and the head node device. The items in the routing table of other node devices respectively include the SID index corresponding to the destination address. After the forwarding chip receives the encapsulated message, it can perform a routing table search on the encapsulated message, hit the routing table item, and obtain the SID index corresponding to the destination address in the routing table item corresponding to the encapsulated message, and send the SID index and the encapsulated message to the CPU.
[0140] The routing table includes the routing address and SID index value of each node device. The forwarding chip can search the routing table according to the destination address of the encapsulated message, hit the table entry where the SID index corresponding to the destination address is located, and use the SID index value contained in the hit table entry as the SID index of the encapsulated message.
[0141] S802: The CPU determines the SID entry corresponding to the destination address of the encapsulated message according to the SID index and the SID forwarding table.
[0142] The SID table entry records the processing actions for the encapsulated message, wherein the processing action of the intermediate node device may be to forward the encapsulated message to the next node device, and the processing action of the tail node device may be to decapsulate the encapsulated message and forward the data message obtained after decapsulation.
[0143] The CPU pre-configures the SID forwarding table. The keyword in the SID forwarding table is the SID index, and the output information is the SID table entry. The CPU searches the SID index sent by the forwarding chip in the SID forwarding table, and obtains the SID table entry corresponding to the SID index in the SID forwarding table. The CPU then sends the encapsulated message and the SID table entry of the encapsulated message to the forwarding chip, which then performs the next step based on the processing action in the SID table entry.
[0144] S803: The CPU processes the encapsulated message according to the processing action in the SID table entry to obtain a data message, and sends the data message to the forwarding chip.
[0145] The SID entry may indicate a processing action. After receiving the SID entry, the CPU may process the encapsulated message according to the processing action in the SID entry to obtain a data message, wherein the data message may be a decapsulated data message.
[0146] S804: The forwarding chip forwards the data message.
[0147] The forwarding chip can determine the destination address of the data message, that is, the destination address of the decapsulated data message, and forward the data message to the device indicated by the destination address.
[0148] In the embodiment of the present application, the forwarding chip performs a routing table query to obtain the SID index of the encapsulated message, the CPU performs a SID table query to obtain the SID table item of the encapsulated message, and finally the CPU processes the encapsulated message according to the processing action in the SID table item to obtain a data message, and sends the data message to the forwarding chip, which forwards the data message. The forwarding chip only needs to perform routing table query and message forwarding, which reduces the difficulty and cost of implementation, and the CPU only needs to perform SID table query, which reduces the complexity of work and improves the performance of the CPU in forwarding messages.
[0149] If the other node device is an end node device, the step of the CPU forwarding the encapsulated message according to the SID table entry of the encapsulated message includes:
[0150] The CPU performs SRv6 decapsulation on the encapsulated message according to the processing action in the SID table entry to obtain a data message, and sends the data message to the forwarding chip.
[0151] If the current node device is a tail node device, the processing action of the SID table entry can be to perform SRv6 decapsulation on the encapsulated message. At this time, the CPU can strip off the outer message header of the encapsulated message, retain the inner IP message header of the encapsulated message, and send the message after stripping the outer message header to the forwarding chip. The forwarding chip searches the preset mapping table based on the inner IP message header to obtain the destination routing information corresponding to the inner IP message header, and forwards the data message based on the destination routing information.
[0152] The destination routing information may be VPN routing information of the destination device, the preset mapping table may be a VPN routing table, and after the forwarding chip searches the VPN routing table to obtain the VPN routing information of the data message, the data message may be forwarded to the device indicated by the VPN routing information based on the VPN routing information.
[0153] The steps of the forwarding chip forwarding the data message include:
[0154] The forwarding chip determines the next hop information of the data message according to the hardware routing table, edits the Ethernet header of the data message based on the next hop information, and forwards the edited data message to the destination device.
[0155] The hardware routing table records the routing information of each node device passed through in the data packet forwarding path and the routing information of the destination device. When forwarding the data packet, the forwarding chip of the tail node device can hit the next hop information of the data packet in the hardware routing table according to the destination address of the data packet, obtain the routing information of the destination device, edit the Ethernet header of the data packet based on the routing information of the destination device, and forward the edited data packet to the destination device.
[0156] In the embodiment of the present application, by adopting the forwarding chip and CPU fusion method to forward messages on the intermediate node device and the tail node device, not only the implementation difficulty and cost of the forwarding chip can be reduced, but also the performance of the CPU forwarding messages can be improved.
[0157] The embodiment of the present application also provides a node device, which can be a head node device, an intermediate node device, and a tail node device in an SRv6 network. Fig. 9 As shown, it is a schematic diagram of the node device structure provided by an embodiment of the present invention, including: a processor 901, a memory 902 and a bus. The memory 902 stores machine-readable instructions executable by the processor 901. When the computer device is running, the processor 901 communicates with the memory 902 through the bus, and when the machine-readable instructions are executed by the processor 901, the processing of the above-mentioned message forwarding method is performed.
[0158] The present application also provides an SRv6 network. Figure 1 The SRv6 network includes at least one node device, and the node devices include: a head node device, an intermediate node device, and a tail node device.
[0159] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A message forwarding method, characterized in that: A head node device applied to an SRv6 network, the head node device comprising a forwarding chip and a CPU, and the method comprising: The forwarding chip determines the forwarding identification information of the data message according to the pre-installed hardware forwarding table, and sends the data message and the forwarding identification information to the CPU; The CPU determines the service SID, tunnel tail node address and tunnel color identification of the data message according to the forwarding identification information and the software forwarding table; The CPU determines a segment list Segment List of the data message according to the SRv6 TE Policy forwarding table, the tunnel tail node address, and the tunnel color identifier; The CPU encapsulates the data message according to the service SID and the Segment List to obtain an encapsulated message, and sends the encapsulated message to the forwarding chip; The forwarding chip forwards the encapsulated message.
2. The method according to claim 1, characterized in that The hardware forwarding table includes a routing table; The forwarding chip determines the forwarding identification information of the data message according to the pre-installed hardware forwarding table, and sends the data message and the forwarding identification information to the CPU, including: Query the routing table according to the destination IP address of the data message, determine the tunnel identifier that matches the data message, and determine whether there is an access control list in the hardware forwarding table; If the access control list exists and an entry matching the data message is found, obtaining a flow rule identifier matching the data message, and sending the tunnel identifier and the flow rule identifier as the forwarding identifier information together with the data message to the CPU; If the access control list does not exist or an entry matching the data message is not found in the access control list, the tunnel identifier is sent to the CPU together with the data message as the forwarding identifier information according to the routing table.
3. The method according to claim 2, characterized in that The software forwarding table includes an SRv6 tunnel encapsulation information table and a flow policy rule table; The CPU determines the service SID, the tunnel tail node address and the tunnel color identifier of the data message according to the forwarding identifier information and the software forwarding table, including: Search the SRv6 tunnel encapsulation information table according to the tunnel identifier, determine a tunnel encapsulation information table entry that matches the tunnel identifier, and obtain the service SID, tunnel tail node address, and tunnel color identifier in the tunnel encapsulation information table entry; If the forwarding identification information does not include the flow rule identification, the service SID, tunnel tail node address and tunnel color identification in the tunnel encapsulation information table item are used as the service SID, tunnel tail node address and tunnel color identification of the data message; If the forwarding identification information includes a flow rule identifier, the flow policy rule table is searched to determine the flow policy rule table entry that matches the flow rule identifier, the service SID, tunnel tail node address, and tunnel color identifier in the flow policy rule table entry are obtained, and the service SID, tunnel tail node address, and tunnel color identifier of the data packet are determined based on the tunnel encapsulation information table entry and the flow policy rule table entry.
4. The method according to claim 3, characterized in that The step of determining the service SID, the tunnel tail node address and the tunnel color identifier of the data message according to the tunnel encapsulation information table entry and the flow policy rule table entry includes: If the service SID, tunnel tail node address and tunnel color identification in the tunnel encapsulation information table item are different from the service SID, tunnel tail node address and tunnel color identification in the flow policy rule table item, the service SID, tunnel tail node address and tunnel color identification in the flow policy rule table item are used as the service SID, tunnel tail node address and tunnel color identification of the data message, or, If the flow policy rule entry includes a tunnel color identifier, the service SID, tunnel tail node address and tunnel color identifier of the data message are determined according to the tunnel color identifier in the flow policy rule entry and the service SID and tunnel tail node address in the tunnel encapsulation information entry.
5. The method according to claim 1, characterized in that The CPU determines a segment list Segment List of the data message according to the SRv6 TE Policy forwarding table, the tunnel tail node address, and the tunnel color identifier, including: The CPU searches the SRv6 TE Policy forwarding table according to the tunnel tail node address and the tunnel color identifier, determines an SRv6 TE Policy table entry that matches the tunnel tail node address and the tunnel color identifier, and uses a Segment List in the SRv6 TE Policy table entry as a Segment List of the data message.
6. The method according to claim 1, characterized in that The step of the forwarding chip forwarding the encapsulated message includes: The forwarding chip determines the next hop information of the encapsulated message, edits the Ethernet header of the encapsulated message based on the next hop information, and forwards the edited encapsulated message to the next node device.
7. A message forwarding method, characterized in that: Applied to other node devices in an SRv6 network, the other node devices include: intermediate node devices or tail node devices, the other node devices include: forwarding chips and CPUs, and the method includes: The forwarding chip determines the SID index corresponding to the destination address of the encapsulated message according to the pre-installed hardware routing table, and sends the encapsulated message and the SID index to the CPU; The CPU determines, according to the SID index and the SID forwarding table, a SID table entry corresponding to the destination address of the encapsulated message; The CPU processes the encapsulated message according to the processing action in the SID table entry to obtain a data message, and sends the data message to the forwarding chip; The forwarding chip forwards the data message.
8. The method according to claim 7, characterized in that If the other node device is a tail node device, the CPU processes the encapsulated message according to the processing action in the SID table entry to obtain a data message, including: The CPU performs SRv6 decapsulation on the encapsulated message according to the processing action in the SID table entry to obtain a data message, and sends the data message to the forwarding chip; The step of the forwarding chip forwarding the data message includes: The forwarding chip determines the next hop information of the data message according to the hardware routing table, edits the Ethernet header of the data message based on the next hop information, and forwards the edited data message to the destination device.
9. A node device, characterized in that: The node device is a head node device, an intermediate node device, or a tail node device in the SRv6 network; If the node device is a head node device, the node device includes: a processor, a storage medium and a bus, the storage medium stores program instructions executable by the processor, when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the message forwarding method according to any one of claims 1 to 6; If the node device is an intermediate node device or a tail node device, the node device includes: a processor, a storage medium and a bus, the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the message forwarding method as described in claim 7 or 8.
10. An SRv6 network, characterized in that: It includes a head node device that executes the message forwarding method as described in any one of claims 1-6, and also includes an intermediate node device and a tail node device that execute the message forwarding method as described in claim 7 or 8.
Citation Information
Patent Citations
Method and system for implementing data stream hardware forwarding, and network routing device
CN101404612A
Message forwarding method and device
CN108259293A
Network processor and data packet forwarding method
CN112087387A
Hardware forwarding entry synchronization method and equipment
CN112637062A
Method and device for forwarding message
CN112769701A