Data packet transmission method and network equipment

CN119948850AActive Publication Date: 2025-05-06NEW H3C TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202380010503.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-05
Publication Date
2025-05-06
Estimated Expiration
2043-09-05

AI Technical Summary

Technical Problem

In deterministic networks, the prior art is difficult to effectively solve the problem of packet serial number consistency of deterministic streams, especially when data packets are processed concurrently, resulting in discontinuity of serial numbers, affecting the correct implementation of DetNet.

Method used

By introducing a main control unit and at least two output interface units into the network device, using the information synchronization message mechanism, the main output interface unit and the target slave output interface unit respectively write the sequence number to the synchronization sequence number register, and the main control unit calculates and writes the target difference value in the distance register, and the target slave output interface unit generates the target sequence number of the data packet based on this.

Benefits of technology

Ensure that the packet serial numbers sent by the main output interface unit and the output interface unit are consistent, solving the problem of discontinuous serial numbers of multiple packets in the same deterministic stream, and ensuring the correct implementation of DetNet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119948850A_ABST
    Figure CN119948850A_ABST
Patent Text Reader

Abstract

The invention provides a data packet transmission method and network equipment. The method comprises the following steps: a master control unit sends an information synchronization message to a master output interface unit and a target slave output interface unit respectively; after receiving the information synchronization message, the main output interface unit writes the main serial number into a main synchronization serial number register; after the target slave output interface unit receives the information synchronization message, the slave serial number is written into a slave synchronization serial number register; the master control unit reads the master serial number and the slave serial number, and writes a target difference value between the master serial number and the slave serial number into a distance register corresponding to a stream identifier of a target slave output interface unit; and the target slave output interface unit adds the target serial number to the data packet corresponding to the flow identifier based on the initial serial number corresponding to the flow identifier and the target difference value in the distance register, and sends the modified data packet. Through the scheme of the invention, the serial number of the data packet of the main output interface unit is consistent with the serial number of the data packet of the slave output interface unit.
Need to check novelty before this filing date? Find Prior Art

Description

A data packet transmission method and network device Technical Field This application relates to the field of communication technology, and in particular to a data packet transmission method and network device. Background Technology Deterministic Network (DetNet) provides deterministic service functions for carried services within a network domain. These deterministic service functions can include latency, packet loss rate, etc. Time-Sensitive Networking (TSN) is a deterministic network implemented based on a local area network (LAN). In TSN, deterministic transmission at the forwarding layer is ensured by employing Cyclic Queuing and Forwarding (CQF), thereby providing deterministic service functions for carried services. For ease of description, service flows with deterministic service functions (such as latency, packet loss rate, etc.) transmitted in a deterministic network are called deterministic flows. Other service flows that differ from deterministic flows can be forwarded using a best-effort forwarding method; therefore, these other service flows are called best-effort flows. Summary of the Invention This application provides a data packet transmission method applied to a network device, the network device including a master control unit and at least two output interface units, the at least two output interface units including a master output interface unit and at least one slave output interface unit, the method comprising: The main control unit sends information synchronization messages to the main output interface unit and the target slave output interface unit respectively. The information synchronization messages include the flow identifier of the deterministic flow. After receiving the information synchronization message, the main output interface unit writes the main sequence number into the main synchronization sequence number register corresponding to the flow identifier. The main sequence number is the sequence number of the last data packet received by the main output interface unit. After receiving the information synchronization message, the target slave output interface unit writes the slave sequence number into the slave synchronization sequence number register corresponding to the flow identifier. The slave sequence number is the sequence number of the last data packet received by the target slave output interface unit. The master control unit reads the master sequence number from the master synchronization sequence number register, reads the slave sequence number from the slave synchronization sequence number register, and writes the target difference between the master sequence number and the slave sequence number into the distance register corresponding to the stream identifier of the target slave output interface unit; The target output interface unit adds a target sequence number to the data packet corresponding to the flow identifier based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, and sends the modified data packet. The starting sequence number is the sequence number of the last received data packet. This application provides a network device, including a main control unit and at least two output interface units, wherein the at least two output interface units include a main output interface unit and at least one slave output interface unit; The main control unit is used to send information synchronization messages to the main output interface unit and the target slave output interface unit respectively. The information synchronization message includes the flow identifier of the deterministic flow. The main output interface unit is configured to write the main sequence number into the main synchronization sequence number register corresponding to the flow identifier after receiving the information synchronization message; wherein, the main sequence number is the sequence number of the last data packet received by the main output interface unit; The target slave output interface unit is configured to write the slave sequence number to the slave synchronization sequence number register corresponding to the stream identifier after receiving the information synchronization message; wherein, the slave sequence number is the sequence number of the last data packet received by the target slave output interface unit; The master control unit is used to read the master sequence number from the master synchronization sequence number register, read the slave sequence number from the slave synchronization sequence number register, and write the target difference between the master sequence number and the slave sequence number into the distance register corresponding to the stream identifier of the target slave output interface unit; The target is output interface unit, which is used to add a target sequence number to the data packet corresponding to the flow identifier based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, and send the modified data packet. The starting sequence number is the sequence number of the last received data packet. As can be seen from the above technical solutions, in one example, a method for generating sequence numbers of data packets in a deterministic flow in a deterministic network is proposed. This method can ensure that the sequence numbers of data packets in the main output interface unit are consistent with the sequence numbers of data packets in the slave output interface unit. This ensures that the sequence numbers of data packets are consistent during concurrent data packet processing. In other words, the sequence numbers of multiple data packets (i.e., multiple copies) of the same deterministic flow are arranged consecutively. The consecutive sequence numbers of the deterministic flow can ensure the correct implementation of DetNet. Attached Figure Description Figure 1 is a schematic diagram of the working principle of CSQF in an example of this application; Figure 2 is a comparative diagram of CSQF and CQF in an example of this application; Figure 3 is a schematic diagram of the structure of a network device in an example of this application; Figure 4 is a schematic diagram of the structure of a network device in an example of this application; Figure 5 is a schematic diagram of the structure of a network device in an example of this application; Figure 6A is a schematic diagram of a synchronization information table in an example of this application; Figure 6B is a schematic diagram of the implementation of the main control unit in an example of this application; Figure 6C is a schematic diagram of a register in an example of this application; Figure 6D is a system block diagram of the serial number synchronization of the output interface unit in an example of this application; Figures 7A-7D are schematic diagrams of output interface unit serial number synchronization in an example of this application; Figure 8 is a flowchart illustrating a data packet transmission method in an example of this application. Detailed Implementation The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and the claims are also intended to include the plural forms. Unless the context clearly indicates otherwise, the term "and / or" as used herein refers to any and all possible combinations of one or more associated listed items. It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination." TSN is a deterministic network implemented based on a local area network. In TSN, deterministic transmission at the forwarding layer is ensured by using CQF, thereby providing deterministic service functions for the carried services. Of course, CQF is just an example of providing deterministic services; other methods can also be used to ensure deterministic transmission at the forwarding layer, and there are no restrictions on this. As a technology similar to CSQF (Cycle Specified Queuing and Forwarding), the basic working principle of CQF can be as follows: each network device's outgoing interface is associated with two queues, and the time domain is divided into two cycles. These two queues alternately send and receive within these two cycles. For example, we can denote these two queues as queue Q1 and queue Q2, and these two periods as period T0 and period T1. During period T0, queue Q1 transmits and queue Q2 receives (receive is off for queue Q1, receive is on for queue Q2, transmit is on for queue Q1, and transmit is off for queue Q2). During period T1, queue Q1 receives and queue Q2 transmits, and so on. In this way, queues Q1 and Q2 can alternate according to odd and even periods. CQF requires that each hop transmission constitutes one cycle. A data packet is received by a network device within one cycle, sent out in the next cycle, and then received by the next network device in the next cycle, and so on. Thus, when the cycle T is a fixed value, the transmission delay of the data packet along the path (end-to-end transmission delay) is also fixed. The minimum transmission delay is (H-1)*T, and the maximum transmission delay is (H+1)*T, where H is the hop count, representing the total number of network devices traversed along the path. Since CQF is a LAN-based technology, it cannot be implemented in WANs. To achieve deterministic transmission over WANs, CSQF was proposed based on CQF. CSQF, combined with SR (Segment Routing) or SRv6 applications, enables deterministic transmission over WANs. SR is based on MPLS (Multi-Protocol Label Switching), and SRv6 can be based on IPv6. Referring to Figure 1, which is a schematic diagram of the working principle of CSQF, the controller 10 is used to collect information from each network device, such as transmission capacity, interface, cycle count, and maximum jitter within the node. For deterministic transmission requirements between the sender and receiver, the controller 10 calculates and, if it finds sufficient transmission resources, allocates a transmission path and sends the transmission path information to the edge nodes. As shown in Figure 1, the transmission path between the sender and receiver can be: network device 11 - network device 12 - network device 13 - network device 14, and the edge node (i.e., the first network device) of this transmission path is network device 11. After receiving a data packet that needs to be forwarded, network device 11 adds information about each network device in the transmission path to the data packet, such as the node identifier of the network device in the path (e.g., the Locator in the SID (Segment Identifier) ​​of SRv6), the sending interface of the network device, and the period that the network device needs to send. In this way, when the data packet arrives at a certain network device, the network device retrieves the corresponding interface and period information and stores the data packet in the queue corresponding to that period. For each network device, data packets in each queue can be sent in a cyclical manner according to a certain period, that is... Each queue corresponds to a period, during which data packets in that queue can be sent. Since the network device cycles in a fixed pattern, the specified period for each data packet sent by the sender remains unchanged in network device 11. The period during which data packets from the sender to the receiver are forwarded by each network device is determined. Therefore, the overall delay is also determined, thus achieving deterministic transmission. In summary, CSQF and CQF are similar in implementation. The key difference lies in their implementation methods: CSQF requires at least three queues (e.g., 3, 6, 8, 9, 10, 12, 15 queues, etc., with 15 queues as an example). In each cycle, only one queue is in the transmitting state, while the others are in the receiving state. CQF requires strict synchronization of the cycle cycles of all network devices, including phase synchronization. CSQF, on the other hand, only requires frequency synchronization of the cycle cycles, not phase synchronization. Furthermore, if a hop's transmission delay cannot be completed within one cycle, the queue for transmission in the next cycle can be specified, thus adapting to the transmission delays of different network devices in the wide area network. Referring to Figure 2, which is a comparison diagram of CSQF and CQF, for CQF, in the transmission process of a certain data packet, network device 11 sends the data packet in cycle 1, network device 12 receives the data packet in cycle 1, and network device 12 sends the data packet in cycle 2; network device 13 receives the data packet in cycle 2, and network device 13 sends the data packet in cycle 3; network device 14 receives the data packet in cycle 3, and network device 14 sends the data packet in cycle 4. For CSQF, taking the requirement of 3 queues as an example, in the transmission process of a certain data packet, network device 11 sends the data packet in cycle 1, network device 12 receives the data packet in either cycle 1 or cycle 2, and network device 12 sends the data packet in cycle 3; network device 13 receives the data packet in cycle 3, and network device 13 sends the data packet in cycle 4; network device 14 receives the data packet in either cycle 4 or cycle 5, and network device 14 sends the data packet in cycle 6. In the implementation of CSQF, the overall latency of data packets can be guaranteed to be deterministic because each network device is allocated a time slice with a fixed period. Deterministic traffic flows are uniformly scheduled, ensuring forwarding within the defined time slice. Each network device on the transmission path has its transmission time limited to a specific time slice, making the latency jitter of data packets within that device deterministic. Regardless of the number of network devices added, the jitter of one device does not increase the jitter latency of another. Of course, as the total number of network devices increases, the total forwarding latency will also increase. For the last network device, data packets are only received and sent within a defined time slice; that is, the jitter range of data packets in the last network device is limited to a defined time slice. Although CSQF can achieve deterministic transmission over wide area networks, there is no reasonable solution in related technologies for how to implement the sequence number based on the deterministic flow when fulfilling the PREOF (Packet Replication Elimination and Ordering Functions) requirement. Figure 3 shows a schematic diagram of the packet forwarding process inside the NP (Network Processor). To ensure forwarding flexibility, multiple pipeline processing units are implemented inside the NP through microcode processing (also known as pipeline processing). Multiple pipeline processing units can process packets in parallel, thereby making full use of the NP's processing capabilities, and multiple pipeline processing units can achieve load balancing. After receiving a data packet through the network interface, the data packet is transmitted to the receiving DMA. The receiving DMA then transmits the data packet to the input hardware classification unit. The input hardware classification unit then transmits the data packet to the processor management unit (PMU). Multiple data packets are queued and wait in the processor management unit. After processing the current data packet, the pipeline processing unit actively sends a request to the processor management unit. The processor management unit then assigns a processing task (data packet) to the pipeline processing unit for processing. The data packet is not dequeued. After processing, the pipeline processing unit responds to the processor management unit, which then dequeues the data packet at the head of the queue. This ensures that all data packets in the queue remain in the queue until the packet at the head of the queue is processed, thus guaranteeing the order of data packets. The pipeline processing unit can then send the processed data packet to the processor management unit, which in turn sends it to the traffic management unit. The traffic management unit then sends the data packet to the transmit DMA, which in turn sends it to the network interface, which then distributes the data packet externally. For PREOF functionality in deterministic flows, a sequence number needs to be encapsulated in each packet of the same deterministic flow. The same packet distributed across multiple member paths of PREOF must have the same sequence number, which is then used to perform packet sorting and deduplication. For example, when packet A is distributed through multiple member paths, packet A needs to have the same sequence number. Although the processor management unit can ensure that data packets are dequeued in the order they are received, it does not have the function of generating sequence numbers, nor can it perform data packet copying. Therefore, when the same data packet is distributed through multiple member paths, it cannot be guaranteed that the data packets have the same sequence number. To address the aforementioned issues, this application proposes a data packet transmission method. This method can be applied to network devices (also known as network nodes, where a network device is a forwarding device in a deterministic network's forwarding path). The network device can be a centralized multi-core forwarding device or a high-performance distributed device based on NP, such as a PE device or a P device. There are no restrictions on the type of network device. Referring to Figure 4, which is a schematic diagram of a network device, the network device may include, but is not limited to, a main control unit, an input interface unit, an input pipe processing unit, a switching unit, at least two output pipe processing units, and at least two output interface units. The number of output pipe processing units and output interface units can be the same, meaning there is a one-to-one correspondence between them. Referring to Figure 5, which shows another structural diagram of the network device, the main control unit can be a main control board, also known as a controller; that is, the main control unit is implemented through the main control board. The input interface unit can be an FPGA (Field Programmable Gate Array), meaning the input interface unit is implemented using an FPGA. Of course, it can also be implemented using ASIC devices, etc., without limitation. The input pipeline processing unit can be an Ingress NP, meaning the input pipeline processing unit can be implemented using an NP. The switching unit can be a Fabric, meaning the switching unit can be implemented using a Fabric. The output pipeline processing unit can be an Engress NP, meaning the input pipeline processing unit can be implemented using an NP. The output interface unit can be an FPGA, meaning the output interface unit is implemented using an FPGA. Of course, it can also be implemented using ASIC devices, etc., without limitation. Input interface unit. The input interface unit can receive multiple data packets from the same deterministic stream. Based on the receiving order of the multiple data packets, an auxiliary identifier is added to each data packet (the auxiliary identifier is used to assist in synchronization). The auxiliary identifier of the later data packet is greater than that of the previous data packet. Based on the ascending order of the auxiliary identifiers, each data packet is sent to the input pipeline processing unit in sequence. For example, for the first received data packet, add auxiliary identifier 1 to the data packet; for the second received data packet, add auxiliary identifier 2 to the data packet, and so on. Input pipeline processing unit. The input pipeline processing unit can receive multiple data packets of the same deterministic flow, sort the multiple data packets in ascending order of auxiliary identifiers, remove the auxiliary identifiers from each data packet, and traverse each data packet sequentially (i.e., traverse each data packet in ascending order of auxiliary identifiers). For the currently traversed data packet, the flow identifier of the deterministic flow to which the data packet belongs is determined, the flow identifier is encapsulated in the data packet, and the data packet is sent to the switching unit. For example, the input pipeline processing unit receives a large number of data packets and distinguishes multiple data packets of the same deterministic flow from these data packets, such as multiple data packets of deterministic flow A, multiple data packets of deterministic flow B, and so on. The processing method for each deterministic flow is the same. The following will take the processing of a single deterministic flow as an example. For multiple data packets belonging to the same deterministic flow, the data packets are sorted in ascending order according to their auxiliary identifiers (parsed from the data packets). After sorting, each data packet can be traversed sequentially. For the currently traversed data packet, the flow identifier of the deterministic flow to which the data packet belongs is determined, the flow identifier is encapsulated in the data packet, and the data packet is sent to the switching unit. The flow identifier for a deterministic flow is assigned by the input pipeline processing unit. Different deterministic flows have different flow identifiers, and multiple data packets of the same deterministic flow may correspond to the same flow identifier. For example, the input pipeline processing unit can identify the flow based on its data characteristics and map them to a flow identifier. Because multiple data packets are sorted according to the auxiliary identifier in ascending order, the sequential transmission of multiple data packets to the switching unit can be guaranteed. For example, the first data packet of the deterministic flow is sent to the switching unit first, then the second data packet of the deterministic flow is sent to the switching unit, then the third data packet of the deterministic flow is sent to the switching unit, and so on. Switching unit. The switching unit can receive multiple data packets of the same deterministic stream (i.e., receive multiple data packets sequentially). For each received data packet, the switching unit sends the data packet to the output pipe processing unit, which then sends the data packet to the output interface unit. For example, after data packets enter the switching unit in sequence, for each data packet, the switching unit determines the corresponding output interface unit (e.g., K output interface units, where K can be a positive integer greater than 1), and then copies the data packet to obtain K identical data packets. These K data packets are then sent to the K output pipeline processing units corresponding to the K output interface units. Assuming the data packet corresponds to output interface unit 1, output interface unit 2, and output interface unit 4, the switching unit will additionally copy two data packets, resulting in three data packets. The first data packet is sent to output pipeline processing unit 1 corresponding to output interface unit 1, the second data packet is sent to output pipeline processing unit 2 corresponding to output interface unit 2, and the third data packet is sent to output pipeline processing unit 4 corresponding to output interface unit 4. In one example, the output interface units can be divided into master output interface units and slave output interface units. There is one master output interface unit and at least one slave output interface unit; that is, all output interface units other than the master output interface unit are slave output interface units. Based on this, the switching unit can send data packets to the output pipeline processing unit corresponding to the master output interface unit, which then forwards the data packets to the master output interface unit. The switching unit can also send data packets to the output pipeline processing unit corresponding to each slave output interface unit, which then forwards the data packets to the slave output interface unit (i.e., the slave output interface unit corresponding to that output pipeline processing unit). Output pipeline processing unit. An output pipeline processing unit can receive multiple data packets from the same deterministic stream (i.e., receive multiple data packets sequentially). For each received data packet, it sends the data packet to the corresponding output interface unit. For example, the output pipeline processing unit corresponding to the main output interface unit can send the data packet to the main output interface unit, and the output pipeline processing unit corresponding to the slave output interface unit can send the data packet to the slave output interface unit. After receiving the data packet, the output pipeline processing unit can also perform QoS scheduling and internal transmission channel selection, and send the data packet to the output interface unit through different transmission channels without restriction. Output interface unit. The output interface unit can receive multiple data packets from the same deterministic flow (i.e., receive multiple data packets sequentially). For each received data packet, a target sequence number is added to the data packet based on the starting sequence number corresponding to the flow identifier of the deterministic flow. The starting sequence number is the sequence number of the previous data packet. The flow identifier in the data packet is removed, and the modified data packet is sent. For example, after receiving the first data packet of the deterministic flow, the main output interface unit adds a target sequence number to the data packet. This target sequence number is a fixed value, such as 1, 1000, 5000, etc., taking 1 as an example. After receiving the second data packet of the deterministic flow, the main output interface unit adds a target sequence number to the data packet. The target sequence number is the sum of the starting sequence number (i.e., the target sequence number of the first data packet) and 1, that is, the target sequence number is 2. After receiving the third data packet of the deterministic flow, the main output interface unit adds a target sequence number to the data packet. The target sequence number is the sum of the starting sequence number (i.e., the target sequence number of the second data packet) and 1, that is, the target sequence number is 3, and so on. For each slave output interface unit (taking one slave output interface unit as an example), after receiving the first data packet of the deterministic flow, the slave output interface unit adds a target sequence number to the data packet, which is 1. After receiving the second data packet of the deterministic flow, the slave output interface unit adds a target sequence number to the data packet, which is the sum of the starting sequence number and 1, i.e., the target sequence number is 2. After receiving the third data packet of the deterministic flow, the slave output interface unit adds a target sequence number to the data packet, which is the sum of the starting sequence number and 1, i.e., the target sequence number is 3, and so on. After receiving a data packet, the output interface unit can perform deterministic scheduling and combine it with the best-effort flow for scheduling. At the same time, it generates hardware information and sends it out. There are no restrictions on this process. In one example, because different output interface units have different activation times and start counting times, it cannot be guaranteed that the same data packet will have the same target sequence number in different output interface units. For instance, if output interface unit 1 is activated first and output interface unit 2 is activated later, and output interface unit 1 has already received 100 data packets of the deterministic flow when output interface unit 2 is activated, then for the 101st data packet of the deterministic flow, output interface unit 1 adds the target sequence number 101 to the data packet when it receives it, while output interface unit 2 adds the target sequence number 1 to the data packet when it receives it. That is, this data packet is the first data packet of output interface unit 2. Obviously, for the 101st data packet of the deterministic flow, this data packet has a different target sequence number. To address the aforementioned findings, this application adds a sequence number synchronization process. Based on this process, it can be ensured that the same data packet has the same target sequence number across different output interface units. To implement the sequence number synchronization process, all output interface units corresponding to the deterministic flow can be categorized into master output interface units and slave output interface units. The master output interface unit can be any one of all output interface units, such as those with the enable time... The earliest output interface unit is designated as the master output interface unit. The remaining output interface units, excluding the master unit, can be designated as slave output interface units. The serial number synchronization process can be implemented through the main control unit. The control unit can maintain a synchronization information table, as shown in Figure 6A, which is an example of a synchronization information table. The synchronization information table may include at least one of the following: FlowID: The flow identifier of a deterministic flow. The flow identifier of a deterministic flow is an attribute of this device and only works on this device. It is a consecutive integer in this device and can be represented by its position in the synchronization information table. For example, the flow identifier of the first deterministic flow is 0, the flow identifier of the second deterministic flow is 1, the flow identifier of the third deterministic flow is 2, and so on. The flow identifier of a deterministic flow is an optional content of the synchronization information table. Valid: Indicates whether the entry is valid. 0 indicates invalid and 1 indicates valid. That is, when the value is 1, the flow identifier of the deterministic flow is valid, and when the value is 0, the flow identifier of the deterministic flow is invalid. Iif: The interface identifier of the input interface unit, indicating that all data packets of this deterministic flow enter from the input interface unit corresponding to this interface identifier, that is, all data packets have the same input interface unit. OutIfH: The set of outgoing interface information for the output interface unit. This set of outgoing interface information includes set elements of multiple output interface units, indicating that all data packets of the deterministic flow leave from these multiple output interface units. For example, if the set of outgoing interface information includes set elements of output interface unit 1 and set elements of output interface unit 2, then all data packets of the deterministic flow leave from output interface unit 1 and output interface unit 2. For each element in the set of outgoing interface information, the set element may include: Oif: An integer representing the interface identifier of the output interface unit, used to distinguish output interface units. Role: Indicates the role of the output interface unit. For example, 1 indicates that the deterministic flow is the master output interface unit of the deterministic flow, and 0 indicates that the deterministic flow is the slave output interface unit of the deterministic flow. Sync: Synchronization status, such as 1 indicating that synchronization information is included, and 0 indicating that synchronization is not involved. Dist: Represents the difference (distance) between the serial number of the output interface unit and the serial number of the main output interface unit. For details on how to obtain this difference, please refer to the following process. Type: Indicates the sequence number width, i.e., the total number of bits in the sequence number. For example, Type can be 1 bit, Type 0 indicates a 16-bit sequence number width, and Type 1 indicates a 28-bit sequence number width. The sequence number width can be configured in the input pipeline processing unit, which encapsulates it into the metadata of the data packet. For example, the Type field in the metadata carries the sequence number position, and the sequence number width is passed to the output interface unit through the data packet. Alternatively, the sequence number width can also be configured in the register space of the output interface unit, which can directly read the sequence number width from the register space. Offset: Represents the sequence number position, i.e., the offset position of the sequence number within the data packet. The sequence number position can be configured in the input pipeline processing unit, which encapsulates it into the metadata of the data packet. For example, the Offset field of the metadata carries the sequence number position, which is then passed to the output interface unit via the data packet. Alternatively, the sequence number position can also be configured in the register space of the output interface unit, allowing the output interface unit to directly read the sequence number position from the register space. Prefix: Indicates the sequence number prefix, meaning the given sequence number prefix is ​​used as the highest few bits of the sequence number. For example, sequence... The sequence number prefix can be 4 bits, serving as the highest 4 bits of the sequence number. The output interface unit generates a sequence number suffix (e.g., a 12-bit suffix) and concatenates it with the sequence number prefix to form a 16-bit sequence number. This 16-bit sequence number is the final sequence number, overwriting the position indicated by the offset. The sequence number prefix can be configured in the input pipeline processing unit, which encapsulates it into the metadata of the data packet. For example, the Prefix field of the metadata carries the sequence number prefix, which is then passed to the output interface unit via the data packet. Alternatively, the sequence number prefix can also be configured in the register space of the output interface unit, allowing the output interface unit to directly read the sequence number prefix from the register space. Referring to Figure 6B, in addition to a synchronization information table, the master control unit may also include synchronization control logic. The sequence number synchronization process is implemented based on this synchronization control logic. This logic is responsible for maintaining the synchronization information table, responding to events related to the stream sequence number, initiating synchronization operations based on the events, and cooperating with the output interface unit to achieve sequence number synchronization. For example, the master control unit sends an information synchronization message, reads the master sequence number and slave sequence number, writes the target difference between the master and slave sequence numbers into the distance register, so that the slave output interface unit updates the starting sequence number, etc. This process can be seen in subsequent steps. To implement the sequence number synchronization process, each output interface unit can maintain a related register, as shown in Figure 6C, which is an example of a register. This register may include at least one of the following: FlowID: A flow identifier used to represent deterministic flows and to distinguish different deterministic flows. SeqRegs: This is used to represent sequence number registers. Each deterministic flow corresponds to one sequence number register. For example, 1000 deterministic flows correspond to 1000 sequence number registers. The sequence number register is indexed by the flow identifier of the deterministic flow. This sequence number register is used to record the sequence number of the last data packet of the deterministic flow. That is, after each data packet of the deterministic flow is received, the value of the sequence number register is incremented by 1. SyncSeqRegs: Represents the synchronization sequence number register, corresponding one-to-one with the sequence number register. Each deterministic flow has one synchronization sequence number register, indexed by the flow identifier of the deterministic flow. When a synchronization message is received, the sequence number in the sequence number register (i.e., the sequence number of the last data packet of the deterministic flow) is recorded into the synchronization sequence number register. The synchronization sequence number register can store the sequence number to be synchronized. For example, when the output interface unit obtains the sequence number that needs to be synchronized for a deterministic flow, it temporarily stores it in the synchronization sequence number register corresponding to that deterministic flow within SyncSeqRegs. If the flow identifier is 100, the sequence number is temporarily stored in SyncSeqRegs.

[0100] middle. DistRegs: Used to represent distance registers. Each deterministic flow corresponds to one distance register. The distance register is indexed by the flow identifier of the deterministic flow. The distance register is used to record the difference (distance) between the sequence number of the output interface unit and the sequence number of the main output interface unit. Assuming that the flow identifier of the sequence number to be generated is 100, the sequence number SeqNum that is actually written to the data packet generated from the output interface unit is: SeqNum = SeqRegs

[0100] + DistRegs

[0100] ; SeqRegs

[0100] represents the sequence number value in the sequence number register of the output interface unit, and DistRegs

[0100] represents the sequence number difference in the distance register. SyncStatRegs: This represents the control status register. Each deterministic flow corresponds to one control status register, indexed by the flow identifier of the deterministic flow. This control status register records the synchronization information preparation status. For example, the first value indicates that synchronization information preparation is not complete, and the second value indicates that synchronization information preparation is complete. For instance, when the control status register is 1, it means that the output interface unit has prepared the sequence number to be synchronized, and the master control unit can obtain the synchronization sequence number from the synchronization sequence number register. When the control status register is 0, it means that the output interface unit has not prepared the sequence number to be synchronized, and the master control unit does not obtain the synchronization sequence number from the synchronization sequence number register. The control status registers of the master output interface unit and the slave output interface unit can be the same, with a default value of 0. FwdEableRegs: This is used to represent the forwarding control register. Each deterministic flow corresponds to one forwarding control register, which is indexed by the flow identifier of the deterministic flow. This forwarding control register is used to indicate whether data packets are allowed to be forwarded outward. For example, the third value indicates a blocking state, which means that data packets are not allowed to be forwarded outward, and the fourth value indicates a forwarding state, which means that data packets are allowed to be forwarded outward. For example, for each slave output interface unit, if the forwarding control register is 1, it indicates that it is in a forwarding state, meaning that data packets are allowed to be forwarded. If the forwarding control register is 0, it indicates that it is in a blocked state, meaning that data packets are not allowed to be forwarded and are directly discarded, but the sequence number in the sequence number register still needs to be updated. For the master output interface unit, the value of the forwarding control register is not considered; that is, regardless of whether the forwarding control register is 0 or 1, data packets are forwarded directly. In one example, the SyncCtrlstatRegs register can be configured. The SyncCtrlstatRegs register includes the control status register SyncStatRegs and the forwarding control register FwdEableRegs. That is, the control status register SyncStatRegs and the forwarding control register FwdEableRegs are used as status bits. Obviously, for the output interface unit, the sequence number in the sequence number register will be updated according to the received data packet each time a data packet is received. That is, the corresponding sequence number will be updated for each data packet received. However, when the forwarding control register is 0, the data packet is not sent out, but is discarded. The synchronization sequence number register SyncSeqRegs, the distance register DistRegs, the control status register SyncStatRegs, and the forwarding control register FwdEableRegs can all be deployed in the output interface unit. In one example, the serial number synchronization process may include the following steps: Step S11: The main control unit sends the information synchronization message to the input interface unit. In one example, when sequence number synchronization is required for a certain deterministic flow, the synchronization information table (Figure 6A) is queried based on the flow identifier of the deterministic flow to obtain the input interface unit corresponding to the deterministic flow, and the information synchronization message is sent to the input interface unit. The information synchronization message includes the flow identifier of the deterministic flow. For example, when creating a new deterministic flow, the master control unit triggers sequence number synchronization for that flow. At this time, it can obtain the master output interface unit and slave output interface unit corresponding to the newly created deterministic flow, and send information synchronization messages to the master output interface unit and the target slave output interface unit respectively. Based on this, the master control unit can send information synchronization messages to the input interface unit. The target slave output interface unit can be some slave output interface units or all slave output interface units. For example, for a deterministic flow (i.e., any deterministic flow), if the master output interface unit corresponding to the deterministic flow fails, the master control unit can elect a new master output interface unit from all slave output interface units, and take the remaining slave output interface units other than the new master output interface unit as the target slave output interface units, triggering sequence number synchronization for the deterministic flow. At this time, information synchronization messages can be sent to the newly elected master output interface unit and the target slave output interface unit respectively. Based on this, the master control unit can send information synchronization messages to the input interface unit corresponding to the deterministic flow. For example, for a deterministic flow (i.e., any deterministic flow), if a new slave output interface corresponding to that deterministic flow is added... If a unit is selected, the newly added slave output interface unit will be used as the target slave output interface unit. Alternatively, the remaining slave output interface units can be used as the target slave output interface units, or the remaining slave output interface units can be excluded. The master control unit will trigger sequence number synchronization for this deterministic flow. At this time, information synchronization messages can be sent to the master output interface unit and the target slave output interface unit respectively. That is, the master control unit can send information synchronization messages to the input interface unit corresponding to this deterministic flow. For example, for a deterministic flow (i.e., any deterministic flow), if the slave output interface unit corresponding to the deterministic flow recovers from the fault, the slave output interface unit after the fault recovery is used as the target slave output interface unit. The remaining slave output interface units can be used as the target slave output interface units, or the remaining slave output interface units can not be used as the target slave output interface units. Then the master control unit triggers sequence number synchronization for the deterministic flow. At this time, information synchronization messages can be sent to the master output interface unit and the target slave output interface unit respectively. That is, the information synchronization messages can be sent to the input interface unit corresponding to the deterministic flow. For example, for a deterministic flow (i.e., any deterministic flow), the master control unit can obtain the synchronization period of the deterministic flow and trigger sequence number synchronization for the deterministic flow in each synchronization period. At this time, information synchronization messages can be sent to the master output interface unit and the target slave output interface unit (such as each slave output interface unit) respectively based on the synchronization period (i.e., each synchronization period). On this basis, for each synchronization period, the master control unit sends the information synchronization message to the input interface unit corresponding to the deterministic flow. Of course, the above are just a few examples of triggering conditions, and there are no restrictions on these triggering conditions. Step S12: The input interface unit sends the information synchronization message to the input pipe processing unit. Step S13: The input pipeline processing unit sends the information synchronization message to the switching unit. In one example, after receiving the information synchronization message, the input pipeline processing unit can parse the flow identifier of the deterministic flow from the information synchronization message, query the metadata corresponding to the flow identifier, encapsulate the metadata in the information synchronization message, and send the modified information synchronization message to the switching unit. For example, the metadata may include a synchronization status (Sync). Since the information synchronization message is used to realize sequence number synchronization, the synchronization status encapsulated in the information synchronization message by the input pipeline processing unit is 1, so as to indicate that the current data packet is an information synchronization message through the synchronization status. The metadata may also include sequence number width, sequence number prefix, and sequence number position. The input pipeline processing unit can store the correspondence between the flow identifier and the sequence number width, sequence number prefix, and sequence number position. This correspondence is sent to the input pipeline processing unit by the master control unit. Therefore, the input pipeline processing unit can query this correspondence based on the flow identifier of the deterministic flow to obtain the sequence number width, sequence number prefix, and sequence number position, and encapsulate the sequence number width, sequence number prefix, and sequence number position in the information synchronization message. Step S14: The switching unit can send the information synchronization message to the output pipe processing unit corresponding to the main output interface unit, and the output pipe processing unit will send the information synchronization message to the main output interface unit; the switching unit can send the information synchronization message to the output pipe processing unit corresponding to the target slave output interface unit, and the output pipe processing unit will send the information synchronization message to the target slave output interface unit. At this point, the information synchronization message has been successfully sent to the main output interface unit and the target slave output interface unit, that is, the master control unit sends the information synchronization message to the main output interface unit and the target slave output interface unit respectively. Step S15: After receiving the information synchronization message, the main output interface unit writes the main sequence number into the main synchronization sequence number register corresponding to the flow identifier. The main sequence number is the sequence number of the last data packet received by the main output interface unit. The main control status register corresponding to the flow identifier is modified from the first value to the second value. The first value indicates that the synchronization information preparation is not complete, and the second value indicates that the synchronization information preparation is complete. For example, the main output interface unit parses the synchronization status (Sync) from the information synchronization message. If the synchronization status is 1, it indicates that the current data packet is an information synchronization message, and sequence number synchronization can be achieved based on the information synchronization message. To achieve sequence number synchronization, the flow identifier of the deterministic flow can be parsed from the information synchronization message. By querying Figure 6C through this flow identifier, the sequence number in the sequence number register SeqRegs is obtained, and this sequence number is recorded in the main synchronization sequence number register SyncSeqRegs as the main sequence number. Then, the main control status register (SyncStatRegs) corresponding to the stream identifier is changed from the first value to the second value, indicating that the synchronization information of the main output interface unit is ready. Step S16: After receiving the information synchronization message from the output interface unit, the target writes the sequence number to the slave synchronization sequence number register corresponding to the flow identifier. The sequence number is the sequence number of the last data packet received from the output interface unit. The slave control status register corresponding to the flow identifier is modified from the first value to the second value. For example, the target parses the synchronization status (Sync) from the information synchronization message from the output interface unit. If the synchronization status is 1, sequence number synchronization is achieved based on the information synchronization message. To achieve sequence number synchronization, the flow identifier of the deterministic flow can be parsed from the information synchronization message. The flow identifier is used to query Figure 6C to obtain the sequence number in the sequence number register SeqRegs, and this sequence number is recorded in the slave synchronization sequence number register as the slave sequence number. Then, the slave control status register corresponding to the flow identifier is modified from the first value to the second value, indicating that the synchronization information preparation of the output interface unit is complete. In one example, after receiving the synchronization message, the primary output interface unit neither updates its sequence number based on the message nor sends it out; instead, it discards the synchronization message. Similarly, after receiving the synchronization message, the target output interface unit neither updates its sequence number based on the message nor sends it out; instead, it discards the synchronization message. Step S17: The main output interface unit sends a main interrupt event message to the main control unit. This main interrupt event message includes the stream identifier and the interface identifier of the main output interface unit. This main interrupt event message indicates that the synchronization information preparation of the main output interface unit is complete. The target slave output interface unit sends a slave interrupt event message to the main control unit. This slave interrupt event message includes the stream identifier and the interface identifier of the target slave output interface unit. This slave interrupt event message indicates that the synchronization information preparation of the target slave output interface unit is complete. Step S18: After receiving the main interrupt event message, the main control unit queries whether the main control status register (i.e., the control status register corresponding to the interface identifier of the main output interface unit) corresponding to the stream identifier (obtained from the main interrupt event message) is the second value; after receiving the slave interrupt event message, the main control unit queries whether the slave control status register (i.e., the control status register corresponding to the interface identifier of the target slave output interface unit) corresponding to the stream identifier (obtained from the slave interrupt event message) is the second value. Step S19: If both the master control status register and the slave control status register have the second value, the master control unit reads the master sequence number from the master synchronization sequence number register and the slave sequence number from the slave synchronization sequence number register. Alternatively, if at least one of the master control status register and the slave control status register does not have the second value, the master sequence number and the slave sequence number are read again after a preset time. After a preset number of reads, the master control unit can return to step S11 and repeat the above sequence number synchronization process. Step S20: After obtaining the master serial number and slave serial number, the master control unit writes the target difference between the master serial number and the slave serial number into the distance register corresponding to the stream identifier of the target slave output interface unit. Although the serial number may change at any time, the characteristic that the difference (i.e., the target difference between the master serial number and the slave serial number) remains constant can be utilized. Based on the difference between the master and slave serial numbers and the serial number of the target slave output interface unit, a serial number identical to that of the master output interface unit can be generated. That is, the difference is accumulated on the serial number of the target slave output interface unit to obtain a serial number identical to that of the master output interface unit. Based on the above principle, the master control unit can calculate the target difference between the master and slave serial numbers and write the target difference to the distance register corresponding to the stream identifier of the target slave output interface unit. Step S21: After the master control unit writes the target difference to the distance register, it modifies the master control status register corresponding to the stream identifier from the second value to the first value, and modifies the slave control status register corresponding to the stream identifier from the second value to the first value. For example, by modifying the master control status register from the second value to the first value, the synchronization status of the master output interface unit is cleared, indicating that the synchronization information of the master output interface unit is not ready and it is waiting for the next sequence number synchronization process. By modifying the slave control status register from the second value to the first value, the synchronization status of the target slave output interface unit is cleared, indicating that the synchronization information of the target slave output interface unit is not ready and it is waiting for the next sequence number synchronization process. Step S22: The target reads the target difference from the distance register corresponding to the stream identifier from the output interface unit, and updates the starting sequence number corresponding to the stream identifier based on the target difference. For example, once a target difference exists in the DistRegs register corresponding to the flow identifier, the target output interface unit can calculate the sum of this target difference and the sequence number of the target output interface unit. This sum serves as the starting sequence number corresponding to the flow identifier. The sequence number of the target output interface unit can be a value in the SeqRegs register, representing the sequence number of the last data packet in the deterministic flow. After obtaining the starting sequence number corresponding to the flow identifier, this starting sequence number can be updated in the SeqRegs register. In subsequent processes, this starting sequence number serves as the sequence number of the last data packet in the deterministic flow, thereby controlling the sequence numbers of subsequent data packets. Clearly, through the above operations, the sequence number in the SeqRegs register of the output interface unit is the same as the sequence number in the SeqRegs register of the master output interface unit. Step S22 is an optional step. Alternatively, the starting sequence number corresponding to the stream identifier may not be updated based on the target difference. That is, the sequence number in the SeqRegs register remains unchanged, and the sequence number in the SeqRegs register is used as the starting sequence number without updating the starting sequence number. Step S23: After the target output interface unit reads the target difference value from the distance register, it can modify the forwarding control register corresponding to the flow identifier (i.e., the forwarding control register of the target output interface unit) from the third value to the fourth value. The third value is used to indicate the blocking state, and the fourth value is used to indicate the forwarding state. Alternatively, after the master control unit writes the target difference value into the distance register, it can modify the forwarding control register corresponding to the flow identifier from the third value to the fourth value. In one example, if the target slave output interface unit needs to update the start sequence number corresponding to the flow identifier based on the target difference, the target slave output interface unit can modify the forwarding control register corresponding to the flow identifier from the third value to the fourth value. Alternatively, if the target slave output interface unit does not update the start sequence number corresponding to the flow identifier based on the target difference, the master control unit can modify the forwarding control register corresponding to the flow identifier from the third value to... The fourth value is not restricted. In one example, the initial value of the forwarding control register of the target output interface unit is the third value. When the forwarding control register is in the third value, each time the target output interface unit receives a data packet corresponding to that flow identifier, it only updates the corresponding sequence number of that flow identifier (i.e., updates the sequence number in the SeqRegs register, such as incrementing it by 1). However, the target output interface unit prohibits the transmission of data packets; that is, the target output interface unit discards data packets. In this way, by setting the forwarding control register to a blocked state, data packets are prevented from being transmitted outward, thus avoiding interference with the behavior of the peer. At this time, only the master output interface unit transmits data packets outward, while the target output interface unit does not transmit data packets outward. In one example, after the forwarding control register is changed from the third value to the fourth value, the blocking state of the target output interface unit is released, and the target output interface unit is put into the forwarding state. Each time the target output interface unit receives a data packet corresponding to the flow identifier, in addition to updating the sequence number corresponding to the flow identifier (i.e., updating the sequence number in the SeqRegs register), it can also send data packets. Step S24: When the forwarding control register is in its fourth value, i.e., the target slave output interface unit is in forwarding mode, each time the target slave output interface unit receives a data packet corresponding to the flow identifier, it determines the target sequence number of the data packet, adds the target sequence number to the data packet, and sends the modified data packet. For example, the target slave output interface unit adds a target sequence number to the data packet corresponding to the flow identifier based on the difference between the starting sequence number corresponding to the flow identifier and the target sequence number in the distance register, and sends the modified data packet. The starting sequence number is the sequence number of the last received data packet. Furthermore, each time the main output interface unit receives a data packet corresponding to the flow identifier, it determines the target sequence number of the data packet based on the starting sequence number, adds the target sequence number to the data packet, and sends the modified data packet. In one example, if the target slave output interface unit reads the target difference from the distance register corresponding to the flow identifier, and updates the starting sequence number corresponding to the flow identifier based on the target difference, that is, determines the sum between the starting sequence number (i.e., the value in the sequence number register SeqRegs) and the target difference, and updates the sum to the starting sequence number corresponding to the flow identifier, that is, updates the sum to the sequence number register SeqRegs, then the processing method of the main output interface unit and the target slave output interface unit is the same. For the main output interface unit and the target slave output interface unit (hereinafter referred to as the output interface unit), the target sequence number can be added to the data packet in the following way: First, the output interface unit obtains the serial number width, serial number prefix, and serial number position. In one example, the serial number bit width, serial number prefix, and serial number position can be sent by the master control unit to the output interface unit. For instance, the master control unit configures the serial number bit width, serial number prefix, and serial number position into the register space of the output interface unit, and the output interface unit directly reads the serial number bit width, serial number prefix, and serial number position corresponding to the stream identifier from the register space. In another example, the sequence number width, sequence number prefix, and sequence number position are metadata encapsulated in the data packet by the input pipeline processing unit. In this way, the output interface unit can parse the sequence number width, sequence number prefix, and sequence number position corresponding to the stream identifier from the metadata of the data packet. For example, when the input pipeline processing unit receives a data packet, it can parse the flow identifier of the deterministic flow from the data packet, query the metadata corresponding to the flow identifier, and encapsulate the metadata in the data packet. For instance, this metadata may include synchronization status (Sync). Since this data packet is not used for sequence number synchronization, the input pipeline processing unit... The synchronization state encapsulated in the data packet by the ingress pipeline processing unit can be 0, thus indicating that the current data packet is a normally transmitted data packet. The ingress pipeline processing unit can store the correspondence between the flow identifier and the sequence number width, sequence number prefix, and sequence number position. This correspondence is sent to the ingress pipeline processing unit by the master control unit. Therefore, the ingress pipeline processing unit can query this correspondence based on the flow identifier of the deterministic flow to obtain the sequence number width, sequence number prefix, and sequence number position, and encapsulate the sequence number width, sequence number prefix, and sequence number position in the data packet. For example, the metadata (Sync Meta Data) encapsulated in the data packet by the input pipeline processing unit may include the following: Prefix: Represents the sequence number prefix, i.e., the highest few bits of the sequence number given the sequence number prefix. For example, the sequence number prefix can be 4 bits, which are used as the highest 4 bits of the sequence number. The output interface unit generates a sequence number suffix (such as a 12-bit sequence number suffix) and concatenates it with the sequence number prefix to form a 16-bit sequence number. This 16-bit sequence number is the final sequence number and overwrites the position indicated by Offset. Sync: Synchronization status, with a bit width of 1 bit. For example, 1 indicates that synchronization information is included, and 0 indicates that it is not related to synchronization. Type: Represents the sequence number bit width, i.e., how many bits are in the sequence number. For example, Type is 1 bit, Type 0 indicates that the sequence number bit width is 16 bits, and Type 1 indicates that the sequence number bit width is 28 bits. Resv0: Bit width is 10 bits, reserved. FlowID: Flow identifier for deterministic flow, with a bit width of 16 bits. Offset: Represents the sequence number position. Then, the output interface unit generates a target sequence number. The target sequence number has the same bit width as the sequence number and the same prefix as the sequence number. The target sequence number is also greater than the starting sequence number. For example, the output interface unit can read the sequence number from the SeqRegs register, use that sequence number as the starting sequence number, and generate the target sequence number based on it. For instance, the target sequence number can be the starting sequence number plus 1. When generating the target sequence number, its bit width is the same as the original sequence number, and its prefix is ​​also the same. After generating the target sequence number, it can be updated in the SeqRegs register as the starting sequence number for the next data packet. In summary, each time the target receives a data packet from the output interface unit, it can generate the target sequence number of the data packet based on the starting sequence number in the Sequence Number Register SeqRegs, add the target sequence number to the data packet, and update the target sequence number to the starting sequence number corresponding to the stream identifier. Then, the output interface unit adds the target sequence number to the data packet based on the sequence number position; that is, the offset position of the target sequence number in the data packet is the sequence number position. For example, the sequence number position is used to indicate the offset position of the target sequence number in the data packet. Therefore, the target sequence number can be added to the data packet based on the sequence number position, meaning the target sequence number is located at the offset position indicated by the sequence number position. Then, the output interface unit can send data packets outwards, and the sequence number of the data packet is the target sequence number. Based on the above sequence number synchronization process, the sequence number of the data packets sent by each output interface unit can be the same. Before sending the data packet, the output interface unit can also remove the flow identifier from the data packet (i.e., the flow identifier of deterministic flow will not be sent to the external device) and send the modified data packet. In one example, if the target output interface unit does not update the starting sequence number corresponding to the stream identifier based on the target difference, that is, does not update the sum between the starting sequence number and the target difference in the sequence number register SeqRegs, the target output interface unit can add the target sequence number to the data packet in the following way: First, the target output interface unit obtains the sequence number width, sequence number prefix, and sequence number position. Then, the target output interface unit generates a target sequence number, the bit width of which is the same as the sequence number's bit width. The target sequence number is prefixed with the sequence number prefix, and the target sequence number is greater than the starting sequence number. For example, the target output interface unit can read the sequence number from the sequence number register SeqRegs, use that sequence number as the starting sequence number, and generate candidate sequence numbers based on the starting sequence number, such as incrementing the starting sequence number by 1. When generating candidate sequence numbers, the bit width of the candidate sequence number is the same as the original sequence number, and the prefix of the candidate sequence number is the same as the original sequence number's prefix. After generating the candidate sequence numbers, they can be updated in the sequence number register SeqRegs as the starting sequence number for the next data packet. For example, after generating the candidate sequence number, the target output interface unit can also generate the target sequence number of the data packet based on the candidate sequence number and the target difference in the distance register. For instance, the sum of the candidate sequence number and the target difference can be used as the target sequence number of the data packet. In summary, each time the target receives a data packet from the output interface unit, it can generate a candidate sequence number for the data packet based on the starting sequence number in the Sequence Number Register (SeqRegs), and update the candidate sequence number to the starting sequence number in SequenceRegs. Then, the sum of the candidate sequence number and the target difference in the distance register is used as the target sequence number, and the target sequence number is added to the data packet. Then, the target output interface unit adds the target sequence number to the data packet based on the sequence number position, that is, the offset position of the target sequence number in the data packet is the sequence number position. Then, the target output interface unit can send a data packet outward, and the sequence number of the data packet is the target sequence number. Before sending the data packet, the target output interface unit can also remove the flow identifier from the data packet (i.e., the flow identifier of a deterministic flow will not be sent to the external device) and send the modified data packet. Referring to Figure 6D, which shows the system block diagram for serial number synchronization of the output interface unit, the Local CPU is an optional implementation unit. The main control board (i.e., the main control unit) is connected to the PCIE interface (PCIE-INTF) of the output interface unit via the PCIe bus. The main control board interacts with the output interface unit through the PCIE interface to exchange control flow data, such as information synchronization messages and interrupt event messages exchanged during serial number synchronization. The main control board can also access the serial number synchronization register module of the output interface unit through the PCIE interface. The serial number synchronization register module can manage various registers of the output interface unit, such as the synchronization serial number register SyncSeqRegs, the distance register DistRegs, the control status register SyncStatRegs, and the forwarding control register FwdEableRegs. The output pipeline processing unit (i.e., Egress NP) is connected to the output interface unit via the ILKN (Interlaken) bus, specifically via the ILKN bus to the adapter (IF-ADAPTER) of the output interface unit. After data packets pass through the input pipeline processing unit (i.e., Ingress NP) and the output pipeline processing unit, some metadata is generated. This metadata is transmitted to the output interface unit along with the data packets via the ILKN bus. This metadata may include the following: Prefix: indicating the sequence number prefix; Sync: indicating the synchronization status; Type: indicating the sequence number width; Resv0: a reserved field; FlowID: the flow identifier for deterministic flows; Offset: indicating the sequence number position. Of course, the above is just an example of metadata and is not a limitation. The output interface unit receives data packets from the ILKN bus. After processing by the adapter, the data packets are assembled by a data packet assembly module (such as the PKT-ASM module). The assembled data packets are then transmitted to the sequence number generator module. The sequence number generator module, in cooperation with the main control unit and the sequence number synchronization register module, achieves sequence number synchronization. The sequence number generator module can also verify the synchronization completion... The qualitative stream data packets generate sequence numbers and are sent to other processing modules for further processing. These other processing modules can schedule data in a certain way and perform PTP-related processing, etc. In one example, before the sequence number synchronization process, the following initialization process may also be involved: Under the control of the master control unit, the network device initializes the functional modules according to the supported specifications, including the input pipeline processing unit, the output pipeline processing unit, and the registers inside the output interface unit. It can clear the registers inside the output interface unit, initialize the registers inside the output interface unit when creating a deterministic flow, and configure the registers according to the master-slave role of the deterministic flow in the output interface unit. In one example, after receiving a data packet, the output interface unit parses the metadata from it, assuming the flow identifier in the metadata is 100. The output interface unit can also determine whether it is a synchronization message based on the Sync (synchronization status) in the metadata. Sync is 1 when it represents an information synchronization message, and Sync is 0 when it represents a normal data packet. If Sync is 0, the deterministic flow forwarding process of the output interface unit is executed. If Sync is 1, the sequence number synchronization process is executed, which may include: The output interface unit stores the value in the SeqRegs

[0100] register (i.e., the current sequence number of the stream identifier 100) into SyncSeqRegs

[0100] ; the output interface unit sets SyncStatRegs of SyncCtrlstatRegs

[0100] to 1, indicating that the output interface unit has completed the preparation of synchronization information; the output interface unit sends an interrupt event message to the master control unit (this step is optional), the interrupt event message includes at least the interrupt event type, the interface identifier of the output interface unit, and the stream identifier 100; the output interface unit discards the information synchronization message. The master control unit queries the register of the output interface unit according to the interrupt event message (or adopts the active polling method), reads the SyncStatRegs status bit of SyncCtrlstatRegs

[0100] from the output interface unit, if the SyncStatRegs status bit is 1, then obtains the sequence number to be synchronized (i.e. the master sequence number or slave sequence number mentioned above) from SyncSeqRegs

[0100] , and clears the flag by writing 0 to the SyncStatRegs. The master control unit calculates the target distance Dist between the sequence number of the output interface unit and the sequence number of the master output interface unit based on the acquired sequence number, the interface identifier of the output interface unit, and the flow identifier, in conjunction with the synchronization information table. This target distance is stored in the synchronization information table corresponding to the master control unit. For the output interface unit, the target distance is configured in DistRegs

[0100] , and FwdEnbleRegs of SyncCtrlstatRegs

[0100] is written to 1, enabling the output interface unit to forward data packets to the deterministic flow. For the output interface unit, the output interface unit can also update the sequence number in the SeqRegs

[0100] register according to the target distance in DistRegs

[0100] . That is, add the sequence number in the SeqRegs

[0100] register to the target distance in DistRegs

[0100] , and write the updated sequence number into the SeqRegs

[0100] register. The main control unit updates the Sync identifier in the synchronization information table. The Sync identifier indicates that the corresponding output interface unit has completed the serial number synchronization and the serial number synchronization process can be terminated. If Sync is 0, the output interface unit executes the forwarding process, which includes: Assuming the stream identifier in the metadata is 100 and Sync is 0, the output interface unit reads the sequence number from the SeqRegs

[0100] register. The sequence number in the SeqRegs

[0100] register is the current sequence number (i.e., the starting sequence number). The sequence number in the SeqRegs

[0100] register is set to Value; Value is updated: Value = Value + 1; the value of Value is written back to the SeqRegs

[0100] register; the sequence number prefix Prefix is ​​obtained from the metadata; the sequence number SeqNum is generated as Value | (Prefix << 28); based on the Offset obtained from the metadata, SeqNum is written into the data packet. Move to the position of Offset; if FwdEnableRegs of SyncCtrlstatRegs

[0100] is 1, send the data packet to the next module; otherwise, discard the data packet. Referring to Figures 7A, 7B, 7C, and 7D, which are schematic diagrams of output interface unit sequence number synchronization, it is assumed that the flow identifier (FlowID) of a certain deterministic flow after mapping is 1. This deterministic flow is received from network device interface 0 (Iif0) and sent out from network device interface 1 (Oif1) and interface 2 (Oif2). Referring to Figure 7A, the values ​​of the sequence number-related registers in the output interface unit are shown after synchronization is completed. For simplicity, Oif1.SeqRegs[1] represents the SeqRegs with a flow identifier of 1 on the Oif1 interface. Oif2 is the master role. Since the master and slave roles are not synchronized, the sequence numbers on Oif1 and Oif2 are different. Assuming that the value of Oif1.SeqRegs[1] is 100 when synchronization is completed, then the value of Oif1.SynSeqRegs[1] is also 100. Similarly, the value of Oif2.SeqRegs[1] is 90100, therefore, the value of Oif2.SynSeqRegs[1] is also 90100. After processing by the main control unit, the target difference Dist between the master sequence number and the slave sequence number is 90000. Therefore, the value of Oif1.DistRegs[1] of the slave output interface unit is 90000, while the value of Oif2.DistRegs[1] of the master output interface unit is 0. Referring to Figure 7B, assume 16 data packets are received from Iif0. For ease of description, the received data packets are identified by input numbers 1 to 16. The received data packets belong to 3 deterministic flows. There are 6 data packets with FlowID (flow identifier) ​​1, with input numbers 1, 4, 7, 10, 13, and 16. Obviously, if sequence numbers are generated for the data packets without flow identification in the input interface unit, the sequence numbers of the same deterministic flow will be discontinuous (i.e., 1, 4, 7, 10, 13, 16, etc.). Since the paths traversed by data packets with FlowID 2 and 3 cannot be determined to be the same as those of data packets with FlowID 1, only data packets with FlowID 1 will be described as an example. Referring to Figure 7C, this is an example of the registers of the output interface unit after synchronization is completed and before the above 6 data packets (i.e., 1, 4, 7, 10, 13, 16) arrive at Oif12 and Oif2. Referring to Figure 7D, this example illustrates how data packets are identified using generated sequence numbers. After processing by the output interface unit, six data packets are sent from Oif12 and Oif2, and sequence numbers are generated. Clearly, the master and slave output interface units generate the same sequence number for the same data packet. Since the sequence numbers are generated in the output interface unit according to the order of data packet arrival, out-of-order sequence numbers are avoided, and consecutive sequence numbers are generated. The peer can use these consecutive sequence numbers to implement relevant QoS guarantees. As can be seen from the above technical solutions, this application proposes a method for generating sequence numbers of data packets for deterministic flows in a deterministic network. This method ensures that the sequence numbers of data packets in the main output interface unit are consistent with those in the slave output interface unit, thereby guaranteeing sequence number consistency during concurrent data packet processing. Specifically, the sequence numbers of multiple data packets (i.e., multiple replicas) of the same deterministic flow are arranged consecutively, and this consecutive sequence number arrangement ensures the correct implementation of DetNet. By fully considering the feasibility and performance factors of hardware and software, this method has very high scalability, is suitable for large-scale deterministic network applications, and is applicable to implementation in high-, mid-, and low-end routers. It solves the problem in PREOF function implementation where sequence number generation depends on flow identification, flow identification requires high-performance concurrent processing, and concurrent processing causes non-order preservation, making it impossible to generate consecutive sequence numbers identifying the order of deterministic flows for multiple replicas of the same flow. This application proposes a data packet transmission method applied to a network device. The network device includes a main control unit and at least two output interface units, wherein the at least two output interface units include a main output interface unit and at least one slave output interface unit. The output interface unit, as shown in Figure 8, is a flowchart of the method, which includes: Step 801: The master control unit sends information synchronization messages to the master output interface unit and the target slave output interface unit respectively. The information synchronization message may include the flow identifier of the deterministic flow. Step 802: After receiving the information synchronization message, the master output interface unit writes the master sequence number into the master synchronization sequence number register corresponding to the flow identifier. This master sequence number can be the sequence number of the last data packet received by the master output interface unit. After receiving the information synchronization message, the target slave output interface unit writes the slave sequence number into the slave synchronization sequence number register corresponding to the flow identifier. This slave sequence number can be the sequence number of the last data packet received by the target slave output interface unit. Step 803: The master control unit reads the master sequence number from the master synchronization sequence number register, reads the slave sequence number from the slave synchronization sequence number register, and writes the target difference between the master sequence number and the slave sequence number into the distance register corresponding to the stream identifier of the target slave output interface unit. Step 804: The target adds a target sequence number to the data packet corresponding to the flow identifier based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, and sends the modified data packet. The starting sequence number is the sequence number of the last data packet received by the target from the output interface unit. In one example, after the main output interface unit writes the main sequence number to the main synchronization sequence number register, it can also modify the main control status register corresponding to the flow identifier from a first value to a second value. The first value indicates that the synchronization information preparation is not complete, and the second value indicates that the synchronization information preparation is complete. After the target slave output interface unit writes the sequence number to the slave synchronization sequence number register, it can also modify the slave control status register corresponding to the flow identifier from a first value to a second value. The main control unit reads the main sequence number from the main synchronization sequence number register and the slave sequence number from the slave synchronization sequence number register. This can include: if both the main control status register and the slave control status register have the second value, then the main sequence number is read from the main synchronization sequence number register, and the slave sequence number is read from the slave synchronization sequence number register. After the main control unit writes the target difference to the distance register, it also modifies the main control status register corresponding to the flow identifier from a second value to a first value, and modifies the slave control status register corresponding to the flow identifier from a second value to a first value. In one example, after the main output interface unit modifies the main control status register corresponding to the stream identifier to the second value, it sends a main interrupt event message carrying the stream identifier to the main control unit; after the target slave output interface unit modifies the slave control status register corresponding to the stream identifier to the second value, it sends a slave interrupt event message carrying the stream identifier to the main control unit; after receiving the main interrupt event message, the main control unit queries whether the main control status register corresponding to the stream identifier is the second value; if the main control status register is the second value, it reads the main sequence number from the main synchronization sequence number register; after receiving the slave interrupt event message, the main control unit queries whether the slave control status register corresponding to the stream identifier is the second value; if the slave control status register is the second value, it reads the slave sequence number from the slave synchronization sequence number register. In one example, after the target slave output interface unit reads the target difference from the distance register, it can also modify the forwarding control register corresponding to the flow identifier from the third value to the fourth value. The third value indicates a blocking state, and the fourth value indicates a forwarding state. Alternatively, after the master control unit writes the target difference into the distance register, it can also modify the forwarding control register corresponding to the flow identifier of the target slave output interface unit from the third value to the fourth value. Wherein, when the forwarding control register is at the third value, each time the target slave output interface unit receives a data packet corresponding to the flow identifier, it can update the slave sequence number corresponding to the flow identifier and prohibit the transmission of data packets. The target slave output interface unit sending the modified data packet may include: when the forwarding control register is at the fourth value, the target slave output interface unit sends... Send the modified data packet. In one example, the master control unit sends information synchronization messages to the master output interface unit and the target slave output interface unit, respectively. This may include: when establishing a new deterministic flow, the master control unit obtains the master output interface unit and the target slave output interface unit corresponding to the newly established deterministic flow, and sends information synchronization messages to the master output interface unit and the target slave output interface unit, respectively. The information synchronization messages include the flow identifier of the newly established deterministic flow; or, for a deterministic flow, if the master output interface unit corresponding to the deterministic flow fails, the master control unit elects a new master output interface unit from all slave output interface units, and uses the remaining slave output interface units other than the new master output interface unit as the target slave output interface units, and sends information synchronization messages to the newly elected master output interface unit and the target slave output interface unit, respectively. The interface unit sends a synchronization message; or, for a deterministic flow, if a new slave output interface unit corresponding to the deterministic flow is added, the newly added slave output interface unit is used as the target slave output interface unit, and the master control unit sends synchronization messages to the master output interface unit and the target slave output interface unit respectively; or, for a deterministic flow, if the slave output interface unit corresponding to the deterministic flow recovers from a fault, the recovered slave output interface unit is used as the target slave output interface unit, and the master control unit sends synchronization messages to the master output interface unit and the target slave output interface unit respectively; or, for a deterministic flow, the master control unit obtains the synchronization period of the deterministic flow and sends synchronization messages to the master output interface unit and the target slave output interface unit based on the synchronization period. In one example, the network device includes an input interface unit, an input pipe processing unit, a switching unit, and an output pipe processing unit. The master control unit sends information synchronization messages to the master output interface unit and the target slave output interface unit, respectively. This can include: the master control unit sending the information synchronization message to the input interface unit; the input interface unit sending the information synchronization message to the input pipe processing unit; the input pipe processing unit sending the information synchronization message to the switching unit; the switching unit sending the information synchronization message to the output pipe processing unit corresponding to the master output interface unit, which then sends the information synchronization message to the master output interface unit; and sending the information synchronization message to the output pipe processing unit corresponding to the target slave output interface unit, which then sends the information synchronization message to the target slave output interface unit. In one example, the network device includes an input interface unit, an input pipeline processing unit, a switching unit, and an output pipeline processing unit. Based on this, the method may further include: the input interface unit receiving multiple data packets, adding an auxiliary identifier to each data packet based on the receiving order, with the auxiliary identifier of a later data packet being greater than that of a previous data packet; sequentially sending each data packet to the input pipeline processing unit based on the ascending order of the auxiliary identifiers; the input pipeline processing unit receiving multiple data packets, sorting the data packets according to the ascending order of the auxiliary identifiers, and removing the auxiliary identifier from each data packet; sequentially traversing each data packet, determining the flow identifier of the deterministic flow to which the currently traversed data packet belongs, encapsulating the flow identifier in the data packet, and sending the data packet to the switching unit. The switching unit receives the data packet and sends it to the output pipeline processing unit corresponding to the main output interface unit, which then sends the data packet to the main output interface unit; and sends the data packet to the output pipeline processing unit corresponding to the target slave output interface unit, which then sends the data packet to the target slave output interface unit; the main output interface unit receives the data packet, adds a target sequence number to the data packet based on the start sequence number corresponding to the flow identifier, removes the flow identifier from the data packet, and sends the modified data packet; the target slave output interface unit receives the data packet, adds a target sequence number to the data packet based on the start sequence number corresponding to the flow identifier and the target difference in the distance register, removes the flow identifier from the data packet, and sends the modified data packet. In one example, the target is stored from the output interface unit based on the starting sequence number and distance register corresponding to the stream identifier. The target difference in the device adds a target sequence number to the data packet, which may include: the target reads the target difference from the distance register from the output interface unit, determines the sum between the starting sequence number corresponding to the flow identifier and the target difference, and updates the sum to the starting sequence number corresponding to the flow identifier; after the starting sequence number is updated, each time the target receives a data packet, it generates a target sequence number for the data packet based on the starting sequence number, adds the target sequence number to the data packet, and updates the target sequence number to the starting sequence number corresponding to the flow identifier. Alternatively, the target generates a candidate sequence number for the data packet based on the starting sequence number corresponding to the flow identifier, updates the candidate sequence number to the starting sequence number corresponding to the flow identifier, generates the target sequence number for the data packet based on the candidate sequence number and the target difference in the distance register, and adds the target sequence number to the data packet. In one example, the target slave output interface unit can also obtain the sequence number bit width, sequence number prefix, and sequence number position. These can be encapsulated in the data packet by the input pipeline processing unit, or they can be sent to the target slave output interface unit by the master control unit. When the target slave output interface unit generates the target sequence number of the data packet based on the starting sequence number, the bit width of the target sequence number is the same as the sequence number bit width, and the prefix of the target sequence number is the same as the sequence number prefix. The target sequence number can be greater than the starting sequence number. When the target slave output interface unit generates the candidate sequence number corresponding to the data packet based on the starting sequence number corresponding to the flow identifier, the bit width of the candidate sequence number is the same as the sequence number bit width, and the prefix of the candidate sequence number is the same as the sequence number prefix. The candidate sequence number can be greater than the starting sequence number. Adding a target sequence number to the data packet by the target slave output interface unit can include: adding the target sequence number to the data packet based on the sequence number position, where the offset position of the target sequence number within the data packet is the sequence number position. As can be seen from the above technical solutions, in one example, a method for generating sequence numbers of data packets in a deterministic flow in a deterministic network is proposed. This method can ensure that the sequence numbers of data packets in the main output interface unit are consistent with the sequence numbers of data packets in the slave output interface unit. This ensures that the sequence numbers of data packets are consistent during concurrent data packet processing. In other words, the sequence numbers of multiple data packets (i.e., multiple copies) of the same deterministic flow are arranged consecutively. The consecutive sequence numbers of the deterministic flow can ensure the correct implementation of DetNet. The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A data packet transmission method, characterized in that: Applied to a network device, the network device comprises a main control unit and at least two output interface units, the at least two output interface units comprise a main output interface unit and at least one slave output interface unit, the method comprises: The main control unit sends an information synchronization message to the main output interface unit and the target slave output interface unit respectively, wherein the information synchronization message includes a flow identifier of a deterministic flow; After receiving the information synchronization message, the master output interface unit writes the master sequence number into the master synchronization sequence number register corresponding to the flow identifier, and the master sequence number is the sequence number of the last data packet received by the master output interface unit; after receiving the information synchronization message, the target slave output interface unit writes the slave sequence number into the slave synchronization sequence number register corresponding to the flow identifier, and the slave sequence number is the sequence number of the last data packet received by the target slave output interface unit; The master control unit reads the master sequence number from the master synchronization sequence number register, reads the slave sequence number from the slave synchronization sequence number register, and writes the target difference between the master sequence number and the slave sequence number into the distance register corresponding to the stream identifier of the target slave output interface unit; The target slave output interface unit adds a target sequence number to the data packet corresponding to the flow identifier based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, and sends the modified data packet, wherein the starting sequence number is the sequence number of the last data packet received.

2. The method according to claim 1, characterized in that The method further comprises: after the master output interface unit writes the master sequence number into the master synchronization sequence number register, modifying the master control state register corresponding to the stream identifier from a first value to a second value, the first value indicating that the synchronization information preparation is not completed, and the second value indicating that the synchronization information preparation is completed; after the target slave output interface unit writes the slave sequence number into the slave synchronization sequence number register, modifying the slave control state register corresponding to the stream identifier from the first value to the second value; The master control unit reads the master sequence number from the master synchronization sequence number register, and reads the slave sequence number from the slave synchronization sequence number register, comprising: if the master control state register and the slave control state register are the second value, reading the master sequence number from the master synchronization sequence number register, and reading the slave sequence number from the slave synchronization sequence number register; The method also includes: after the main control unit writes the target difference into the distance register, modifying the main control status register corresponding to the flow identifier from the second value to the first value, and modifying the slave control status register corresponding to the flow identifier from the second value to the first value.

3. The method according to claim 2, characterized in that The method further comprises: After the main output interface unit modifies the main control state register corresponding to the flow identifier to a second value, the main output interface unit sends a main interrupt event message carrying the flow identifier to the main control unit; After the target slave output interface unit modifies the slave control state register corresponding to the flow identifier to a second value, the target slave output interface unit sends a slave interrupt event message carrying the flow identifier to the master control unit; After receiving the master interrupt event message, the master control unit queries whether the master control status register corresponding to the flow identifier is a second value; if the master control status register is the second value, reads the master sequence number from the master synchronization sequence number register; After receiving the slave interrupt event message, the master control unit queries whether the slave control state register corresponding to the stream identifier is a second value; if the slave control state register is the second value, the slave synchronization The serial number register reads the slave serial number.

4. The method according to claim 1, characterized in that The method further comprises: after the target slave output interface unit reads the target difference value from the distance register, modifying the forwarding control register corresponding to the flow identifier from a third value to a fourth value, wherein the third value indicates a blocking state and the fourth value indicates a forwarding state; or, after the main control unit writes the target difference value into the distance register, modifying the forwarding control register corresponding to the flow identifier of the target slave output interface unit from the third value to the fourth value; When the forwarding control register is at the third value, each time the target slave output interface unit receives a data packet corresponding to the flow identifier, the slave sequence number corresponding to the flow identifier is updated to prohibit sending the data packet; The target sends the modified data packet from the output interface unit, comprising: when the forwarding control register has a fourth value, the target sends the modified data packet from the output interface unit.

5. The method according to any one of claims 1 to 4, characterized in that: The main control unit sends information synchronization messages to the main output interface unit and the target slave output interface unit respectively, including: When a new deterministic stream is created, the main control unit obtains the master output interface unit and the target slave output interface unit corresponding to the newly created deterministic stream, and sends an information synchronization message to the master output interface unit and the target slave output interface unit respectively, wherein the information synchronization message includes the stream identifier of the newly created deterministic stream; or, For a deterministic flow, if the master output interface unit corresponding to the deterministic flow fails, the master control unit selects a new master output interface unit from all slave output interface units, and uses the remaining slave output interface units except the new master output interface unit as target slave output interface units, and sends information synchronization messages to the newly elected master output interface unit and the target slave output interface unit respectively; or, For a deterministic stream, if a slave output interface unit corresponding to the deterministic stream is newly added, the newly added slave output interface unit is used as a target slave output interface unit, and the master control unit sends information synchronization messages to the master output interface unit and the target slave output interface unit respectively; or, For a deterministic flow, if the slave output interface unit corresponding to the deterministic flow recovers from a fault, the slave output interface unit after the fault recovery is used as the target slave output interface unit, and the main control unit sends information synchronization messages to the master output interface unit and the target slave output interface unit respectively; or, For a deterministic flow, the main control unit obtains a synchronization period of the deterministic flow, and sends information synchronization messages to a master output interface unit and a target slave output interface unit based on the synchronization period.

6. The method according to any one of claims 1 to 4, characterized in that: The network device includes an input interface unit, an input pipeline processing unit, a switching unit and an output pipeline processing unit; the main control unit sends information synchronization messages to the main output interface unit and the target slave output interface unit respectively, including: The main control unit sends the information synchronization message to the input interface unit; The input interface unit sends the information synchronization message to the input pipeline processing unit; The input pipeline processing unit sends the information synchronization message to the switching unit; The switching unit sends the information synchronization message to the output pipeline processing unit corresponding to the main output interface unit, and the output pipeline processing unit sends the information synchronization message to the main output interface unit; And the information synchronization message is sent to the output pipeline processing unit corresponding to the target slave output interface unit, and the output pipeline processing unit sends the information synchronization message to the target slave output interface unit.

7. The method according to any one of claims 1 to 4, characterized in that: The network device includes an input interface unit, an input pipeline processing unit, a switching unit and an output pipeline processing unit; The input interface unit receives a plurality of data packets, adds an auxiliary identifier to each data packet based on the order in which the plurality of data packets are received, wherein the auxiliary identifier of a subsequent data packet is greater than the auxiliary identifier of a previous data packet; and sends each data packet to the input pipeline processing unit in sequence based on the order of the auxiliary identifiers from small to large. The input pipeline processing unit receives a plurality of data packets, sorts the plurality of data packets in ascending order of the auxiliary identifiers, and removes the auxiliary identifier in each data packet; Traversing each data packet in sequence, determining the flow identifier of the deterministic flow to which the data packet belongs for the currently traversed data packet, encapsulating the flow identifier in the data packet, and sending the data packet to the switching unit; The switching unit receives the data packet, sends the data packet to the output pipeline processing unit corresponding to the main output interface unit, and the output pipeline processing unit sends the data packet to the main output interface unit; and sends the data packet to the output pipeline processing unit corresponding to the target slave output interface unit, and the output pipeline processing unit sends the data packet to the target slave output interface unit; The main output interface unit receives the data packet, adds a target sequence number to the data packet based on the starting sequence number corresponding to the flow identifier, removes the flow identifier in the data packet, and sends the modified data packet; The target receives the data packet from the output interface unit, adds a target sequence number to the data packet based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, removes the flow identifier in the data packet, and sends the modified data packet.

8. The method according to claim 7, characterized in that The target slave output interface unit adds a target sequence number to the data packet based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, including: The target slave output interface unit reads the target difference from the distance register, determines the sum between the starting sequence number corresponding to the flow identifier and the target difference, and updates the sum to the starting sequence number corresponding to the flow identifier; after the starting sequence number is updated, each time the target slave output interface unit receives a data packet, it generates a target sequence number for the data packet based on the starting sequence number, adds the target sequence number to the data packet, and updates the target sequence number to the starting sequence number corresponding to the flow identifier; Alternatively, the target slave output interface unit generates a candidate sequence number corresponding to the data packet based on the starting sequence number corresponding to the flow identifier, updates the candidate sequence number to the starting sequence number corresponding to the flow identifier, generates a target sequence number for the data packet based on the candidate sequence number and the target difference in the distance register, and adds the target sequence number to the data packet.

9. The method according to claim 8, characterized in that The method further comprises: the target slave output interface unit acquires a sequence number bit width, a sequence number prefix and a sequence number position; wherein the sequence number bit width, the sequence number prefix and the sequence number position are encapsulated in the data packet by the input pipeline processing unit, or the sequence number bit width, the sequence number prefix and the sequence number position are sent by the main control unit to the target slave output interface unit; When the target slave output interface unit generates a target sequence number of the data packet based on the starting sequence number, the bit width of the target sequence number is the sequence number bit width, the prefix of the target sequence number is the sequence number prefix, and the target sequence number is greater than the starting sequence number; When the target slave output interface unit generates a candidate sequence number corresponding to the data packet based on the starting sequence number corresponding to the flow identifier, the bit width of the candidate sequence number is the sequence number bit width, the prefix of the candidate sequence number is the sequence number prefix, and the candidate sequence number is greater than the starting sequence number; The target output interface unit adds a target sequence number to the data packet, including: The element adds the target sequence number in the data packet based on the sequence number position, and the offset position of the target sequence number in the data packet is the sequence number position.

10. A network device, characterized in that: It includes a main control unit and at least two output interface units, wherein the at least two output interface units include a main output interface unit and at least one slave output interface unit; The main control unit is used to send information synchronization messages to the main output interface unit and the target slave output interface unit respectively, wherein the information synchronization messages include a flow identifier of a deterministic flow; The main output interface unit is used to write the main sequence number into the main synchronization sequence number register corresponding to the flow identifier after receiving the information synchronization message; wherein the main sequence number is the sequence number of the last data packet received by the main output interface unit; The target slave output interface unit is used to write the slave sequence number into the slave synchronization sequence number register corresponding to the flow identifier after receiving the information synchronization message; wherein the slave sequence number is the sequence number of the last data packet received by the target slave output interface unit; The master control unit is configured to read the master sequence number from the master synchronization sequence number register, read the slave sequence number from the slave synchronization sequence number register, and write a target difference between the master sequence number and the slave sequence number into a distance register corresponding to the stream identifier of the target slave output interface unit; The target slave output interface unit is used to add a target sequence number to the data packet corresponding to the flow identifier based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, and send the modified data packet, wherein the starting sequence number is the sequence number of the last data packet received.

11. The network device according to claim 10, characterized in that: The master output interface unit is further used to modify the master control status register corresponding to the stream identifier from a first value to a second value after writing the master sequence number into the master synchronization sequence number register, the first value indicating that the synchronization information preparation is not completed, and the second value indicating that the synchronization information preparation is completed; the target slave output interface unit is further used to modify the slave control status register corresponding to the stream identifier from the first value to the second value after writing the slave sequence number into the slave synchronization sequence number register; The master control unit reads the master sequence number from the master synchronization sequence number register, and the slave sequence number is read from the slave synchronization sequence number register specifically for: if the master control status register and the slave control status register are both the second value, the master sequence number is read from the master synchronization sequence number register, and the slave sequence number is read from the slave synchronization sequence number register; The main control unit is further used to modify the main control status register corresponding to the flow identifier from the second value to the first value, and modify the slave control status register corresponding to the flow identifier from the second value to the first value after writing the target difference into the distance register.

12. The network device according to claim 11, characterized in that: The main output interface unit is further configured to send a main interrupt event message carrying the flow identifier to the main control unit after modifying the main control state register corresponding to the flow identifier to a second value; The target slave output interface unit is further configured to send a slave interrupt event message carrying the flow identifier to the master control unit after modifying the slave control state register corresponding to the flow identifier to a second value; The main control unit is further used to query whether the main control status register corresponding to the flow identifier is a second value after receiving the main interrupt event message; if the main control status register is the second value, read the main sequence number from the main synchronization sequence number register; The main control unit is further configured to query the corresponding stream identifier after receiving the slave interrupt event message. whether the slave control status register is the second value; if the slave control status register is the second value, reading the slave sequence number from the slave synchronization sequence number register.

13. The network device according to claim 10, characterized in that: The target slave output interface unit is further used to modify the forwarding control register corresponding to the flow identifier from a third value to a fourth value after reading the target difference value from the distance register, wherein the third value indicates a blocking state and the fourth value indicates a forwarding state; or the main control unit is further used to modify the forwarding control register corresponding to the flow identifier of the target slave output interface unit from a third value to a fourth value after writing the target difference value into the distance register; The target slave output interface unit is also used to update the slave sequence number corresponding to the flow identifier and prohibit sending data packets each time a data packet corresponding to the flow identifier is received when the forwarding control register has a third value; when the target slave output interface unit sends a modified data packet, it is specifically used to: send the modified data packet when the forwarding control register has a fourth value.

14. The network device according to any one of claims 10 to 13, characterized in that: The network device includes an input interface unit, an input pipeline processing unit, a switching unit and an output pipeline processing unit; The input interface unit is used to receive multiple data packets, add an auxiliary identifier to each data packet based on the order in which the multiple data packets are received, and the auxiliary identifier of the subsequent data packet is greater than the auxiliary identifier of the previous data packet; and send each data packet to the input pipeline processing unit in sequence based on the order of the auxiliary identifiers from small to large; The input pipeline processing unit is used to receive multiple data packets, sort the multiple data packets in ascending order of the auxiliary identifiers, and remove the auxiliary identifier in each data packet; traverse each data packet in order, determine the flow identifier of the deterministic flow to which the data packet belongs for the currently traversed data packet, encapsulate the flow identifier in the data packet, and send the data packet to the switching unit; The switching unit is used to receive the data packet, send the data packet to the output pipeline processing unit corresponding to the main output interface unit, and the output pipeline processing unit sends the data packet to the main output interface unit; and send the data packet to the output pipeline processing unit corresponding to the target slave output interface unit, and the output pipeline processing unit sends the data packet to the target slave output interface unit; The main output interface unit is used to receive the data packet, add a target sequence number to the data packet based on the starting sequence number corresponding to the flow identifier, remove the flow identifier in the data packet, and send the modified data packet; The target slave output interface unit is used to receive the data packet, add a target sequence number to the data packet based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register, remove the flow identifier in the data packet, and send the modified data packet.

15. The network device according to claim 14, characterized in that: The target slave output interface unit is specifically used to add a target sequence number to the data packet based on the starting sequence number corresponding to the flow identifier and the target difference in the distance register: Read the target difference from the distance register, determine a sum between the starting sequence number corresponding to the flow identifier and the target difference, and update the sum to the starting sequence number corresponding to the flow identifier; After the starting sequence number is updated, each time a data packet is received, a target sequence number of the data packet is generated based on the starting sequence number, the target sequence number is added to the data packet, and the target sequence number is updated to the starting sequence number corresponding to the flow identifier; or, a candidate sequence number corresponding to the data packet is generated based on the starting sequence number corresponding to the flow identifier, the candidate sequence number is updated to the starting sequence number corresponding to the flow identifier, and the target sequence number of the data packet is generated based on the candidate sequence number and the target difference in the distance register, and the target sequence number is added to the data packet.

Citation Information

Patent Citations

  • Message forwarding method and network device

    CN113839871A

  • Message transmission method and network equipment

    CN116686272A

  • Supporting asynchronous packet operations in a deterministic network

    US20210021510A1

  • Packet ordering function for TSN / detnet networks

    WO2022139656A1

  • Deterministic traffic transmission method and apparatus

    WO2023108479A1