Data packet transmission method and network device

By introducing a serial number synchronization mechanism between the main control unit and the output interface unit in the network device, the serial number synchronization problem of the deterministic flow is solved, the consistency of the serial numbers of the data packets in different output interface units is ensured, and the correct data packet transmission in the deterministic network is realized.

CN119948850BActive Publication Date: 2025-09-23NEW H3C TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In deterministic networks, existing technologies fail to effectively solve the problem of sequence number synchronization for deterministic flows, resulting in the inability to guarantee identical sequence numbers when data packets are distributed across multiple member paths, thus affecting the implementation of the PREOF function.

Method used

By introducing a master control unit and an output interface unit into the network device, an information synchronization message mechanism is adopted to synchronize the flow identifier of the deterministic flow, and the sequence number difference between the master and slave output interface units is used. Through the sequence number synchronization process of the master and slave output interface units, it is ensured that the data packets have the same target sequence number in different output interface units.

Benefits of technology

The consistency of the sequence numbers of data packets in the deterministic network is achieved, which ensures the continuous arrangement of sequence numbers when the data packets are processed concurrently and ensures the correct implementation of DetNet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119948850B_ABST
    Figure CN119948850B_ABST
Patent Text Reader

Abstract

The present application provides a data packet transmission method and network device, the method comprising: 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 master output interface unit writes a master sequence number into a master synchronization sequence number register; after receiving the information synchronization message, the target slave output interface unit writes a slave sequence number into a slave synchronization sequence number register; the master control unit reads the master sequence number and the slave sequence number, and writes a target difference between the master sequence number and the slave sequence number into a distance register corresponding to a flow identifier of the target slave output interface unit; the target slave output interface unit adds a target sequence number to a 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. Through the solution of the present application, the sequence number of the data packet of the master output interface unit is guaranteed to be consistent with the sequence number of the data packet of the slave output interface unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data packet transmission method and network equipment. Background Art

[0002] DetNet (Deterministic Network) can provide deterministic service functions for bearer services within a network domain. These deterministic service functions can include latency, packet loss rate, etc. TSN (Time Sensitive Networking) is a deterministic network implemented based on a local area network. In TSN, CQF (Cyclic Queuing and Forwarding) is used to ensure deterministic transmission at the forwarding layer, thereby providing deterministic service functions for bearer services.

[0003] For ease of description, service flows with deterministic service features (such as latency and packet loss rate) transmitted in a deterministic network are referred to as deterministic flows. Service flows other than deterministic flows can be forwarded on a best-effort basis, and are therefore referred to as best-effort flows. Summary of the Invention

[0004] The present application provides a data packet transmission method, which is applied to a network device, wherein 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, and the method includes:

[0005] The master control unit 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 a flow identifier of a deterministic flow;

[0006] 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, where 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, where the slave sequence number is the sequence number of the last data packet received by the target slave output interface unit;

[0007] 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 a target difference between the master sequence number and the slave sequence number into a distance register corresponding to the flow identifier of the target slave output interface unit;

[0008] 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, where the starting sequence number is the sequence number of the last data packet received.

[0009] The present application provides a network device, comprising 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;

[0010] The main control unit is used to send information synchronization messages to the master output interface unit and the target slave output interface unit respectively, wherein the information synchronization messages include a flow identifier of a deterministic flow;

[0011] The main output interface unit is configured to write a master sequence number into a master synchronization sequence number register corresponding to the flow identifier after receiving the information synchronization message; wherein the master sequence number is the sequence number of the last data packet received by the main output interface unit;

[0012] The target slave output interface unit is configured to write a slave sequence number into a 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;

[0013] 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 flow identifier of the target slave output interface unit;

[0014] 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, where the starting sequence number is the sequence number of the last data packet received.

[0015] It can be seen from the above technical solution that, in an example, a method for generating serial numbers for data packets of a deterministic flow in a deterministic network is proposed, which can ensure that the serial numbers of the data packets of the main output interface unit are consistent with the serial numbers of the data packets of the slave output interface unit, thereby ensuring the consistency of the serial numbers of the data packets when the data packets are processed concurrently, that is, the serial numbers of multiple data packets (that is, multiple copies) of the same deterministic flow are arranged continuously, and the continuously arranged serial numbers of the deterministic flow can ensure the correct implementation of DetNet. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1This is a schematic diagram of the working principle of CSQF in an example of this application;

[0017] Figure 2 is a comparative diagram of CSQF and CQF in an example of this application;

[0018] Figure 3 is a schematic diagram of the structure of a network device in an example of this application;

[0019] Figure 4 is a schematic diagram of the structure of a network device in an example of this application;

[0020] Figure 5 is a schematic diagram of the structure of a network device in an example of this application;

[0021] Figure 6A is a schematic diagram of a synchronization information table in an example of this application;

[0022] Figure 6B This is a schematic diagram of an implementation of a main control unit in an example of this application;

[0023] Figure 6C is a schematic diagram of a register in an example of this application;

[0024] Figure 6D This is a system block diagram of serial number synchronization of an output interface unit in an example of the present application;

[0025] Figures 7A-7D This is a schematic diagram of output interface unit serial number synchronization in an example of this application;

[0026] Figure 8 This is a flowchart of a data packet transmission method in an example of the present application. DETAILED DESCRIPTION

[0027] The terms used in the embodiments of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms "a," "the," and "the" used in this application and claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.

[0028] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" used may also be interpreted as "at the time of" or "when" or "in response to determining".

[0029] TSN is a deterministic network implemented based on a local area network. In TSN, deterministic transmission at the forwarding layer is ensured by adopting CQF, thereby providing deterministic service functions for the bearer service. 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 is no restriction on this. As a technology similar to CSQF (CycleSpecified Queuing and Forwarding), the basic working principle of CQF can include: each network device's output interface is associated with 2 queues, and the time domain is divided into 2 cycles. These 2 queues send and receive alternately within these two cycles. For example, these two queues can be recorded as queue Q1 and queue Q2, and these two cycles can be recorded as T0 cycle and T1 cycle. In the T0 cycle, queue Q1 sends and queue Q2 receives (queue Q1's reception is off, queue Q2's reception is on, queue Q1's transmission is on, queue Q2's transmission is off). In the T1 cycle, queue Q1 receives and queue Q2 sends, and so on. In this way, queue Q1 and queue Q2 can alternate according to odd and even cycles.

[0030] CQF requires that each hop transmit one cycle. A data packet is received by a network device during one cycle, sent out during the next cycle, and received by the next network device during 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 number of hops, representing the total number of network devices along the path.

[0031] Because CQF is a LAN-based technology and cannot be implemented on a WAN, CSQF was proposed based on CQF to achieve deterministic transmission on the WAN. CSQF is combined with SR (Segment Routing) or SRv6 to achieve deterministic transmission on the WAN. SR is based on MPLS (Multi-Protocol Label Switching), and SRv6 can be based on IPv6.

[0032] See also Figure 1 The figure shows the working principle of CSQF. The controller 10 is used to collect information about each network device, such as transmission capacity, interface, number of cycles, maximum jitter within a node, etc. After calculation, if the controller 10 finds sufficient transmission resources to meet the deterministic transmission requirements between the sender and the receiver, it allocates a transmission path and sends the transmission path information to the edge node. Figure 1 As shown, the transmission path from the sender to the receiver may be: network device 11 - network device 12 - network device 13 - network device 14 , and the edge node (ie, the first network device) of the transmission path is network device 11 .

[0033] After receiving a packet to be forwarded, network device 11 adds information about each network device in the transmission path to the packet, including the node identifier of the network device in the path (such as the locator in the SRv6 SID (Segment Identifier), the network device's sending interface, and the cycle in which the network device needs to send the packet. In this way, when a packet arrives at a network device, the network device retrieves the corresponding interface and cycle information and stores the packet in the queue corresponding to the cycle.

[0034] For each network device, the data packets in each queue can be sent in a certain periodic cycle, that is, each queue corresponds to a cycle, and the data packets in the queue can be sent within the cycle. Since the periodic cycle of the network device is carried out in a fixed mode, in the network device 11, the specified cycle for each data packet of the sender remains unchanged, and the cycle of forwarding the data packet from the sender to the receiver in each network device is determined. Therefore, the entire delay is also determined, thereby achieving deterministic transmission.

[0035] From the above, we can see that the implementation process of CSQF and CQF is similar. The difference between CSQF and CQF lies in the following: CSQF requires at least three queues (such as 3, 6, 8, 9, 10, 12, and 15 queues, etc., and 15 queues will be used as an example later). In each cycle, only one queue is in the sending state, while the other queues are in the receiving state. For CQF, the cycle periods of each network device must be strictly synchronized, including phase synchronization. For CSQF, only the frequency synchronization of the cycle period is required, and phase synchronization is not required. At the same time, if the transmission delay of a certain hop cannot be completed within a cycle, the queue for transmission in the next cycle can be specified. In this way, the transmission delay of different network devices in the wide area network can be adapted.

[0036] See also Figure 2FIG. 1 is a schematic diagram comparing CSQF and CQF. For CQF, during the transmission of a certain data packet, network device 11 sends a data packet in cycle 1, network device 12 receives a data packet in cycle 1, and network device 12 sends a data packet in cycle 2. Network device 13 receives a data packet in cycle 2, and network device 13 sends a data packet in cycle 3. Network device 14 receives a data packet in cycle 3, and network device 14 sends a data packet in cycle 4. For CSQF, taking the example of CSQF requiring three queues, during the transmission of a certain data packet, network device 11 sends a data packet in cycle 1, network device 12 receives a data packet in cycle 1 or cycle 2, and network device 12 sends a data packet in cycle 3. Network device 13 receives a data packet in cycle 3, and network device 13 sends a data packet in cycle 4. Network device 14 receives a data packet in cycle 4 or cycle 5, and network device 14 sends a data packet in cycle 6.

[0037] The implementation of CSQF ensures that the overall latency of data packets is deterministic. This is because each network device divides the data into time slices with a fixed period and uniformly schedules traffic for deterministic service flows, ensuring that they are forwarded within a certain time slice. Each network device on the transmission path has its transmission time limited to a specific time slice, ensuring that the latency jitter of data packets on that network device is deterministic. Regardless of the number of network devices added, the jitter of one device does not increase the jitter latency of the next device. However, as the total number of network devices increases, the total forwarding latency also increases.

[0038] For the last network device, the data packet is received and sent only within a certain time slice, that is, the jitter range of the data packet at the last network device is limited to a certain time slice.

[0039] Although CSQF can achieve deterministic transmission in wide area networks, there is no reasonable solution in the relevant technology for how to implement sequence numbers based on deterministic flows when meeting the requirements of PREOF (Packet Replication Elimination and Ordering Functions).

[0040] See also Figure 3 Figure 2 shows a schematic diagram of the packet forwarding process within the NP (Network Processor). To ensure forwarding flexibility, multiple pipeline processing units are implemented within the NP through microcode processing (also known as pipeline processing). Multiple pipeline processing units can process packets in parallel, thereby fully utilizing the processing power of the NP. Multiple pipeline processing units can also achieve load balancing.

[0041] After receiving the data packet through the network interface, the data packet is transferred to the receiving DMA, the receiving DMA transfers the data packet to the input hardware classification unit, and the input hardware classification unit transfers the data packet to the processor management unit (PMU for short). Multiple data packets are queued in the processor management unit.

[0042] After the pipeline processing unit completes processing of the current data packet, it actively sends a request to the processor management unit. The processor management unit distributes a processing task (data packet) to the pipeline processing unit for processing. The data packet does not dequeue. After the pipeline processing unit completes processing, it responds to the processor management unit. The processor management unit dequeues the data packet at the head of the queue. In this way, as long as the data packet at the head of the queue has not been processed, the data packets of the entire queue remain in the queue, so that the order of the data packets is guaranteed by the processor management unit. The pipeline processing unit can send the processed data packet to the processor management unit, the processor management unit sends the data packet to the traffic management unit, the traffic management unit sends the data packet to the sending DMA, the sending DMA sends the data packet to the network interface, and the network interface sends the data packet to the outside.

[0043] The PREOF function for deterministic flows requires encapsulating a sequence number (Sequence Number) for each data packet in the same deterministic flow. The same data packet distributed across multiple PREOF member paths must have the same sequence number. This sequence number is then used to implement packet sorting and deduplication. For example, when data packet A is distributed across multiple member paths, it must have the same sequence number.

[0044] Although the processor management unit can ensure that data packets are dequeued in the order in which they are received, the processor management unit does not have the function of generating sequence numbers, let alone completing the data packet replication function. 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.

[0045] In response to the above problems, this application proposes a data packet transmission method, which can be applied to network devices (also known as network nodes, which are forwarding devices in the forwarding path of a deterministic network). 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, etc. There is no restriction on the type of this network device.

[0046] See also Figure 4Figure 2 shows a schematic diagram of the structure of a network device. The network device may include, but is not limited to, a main control unit, an input interface unit, an input pipeline processing unit, a switching unit, at least two output pipeline processing units, and at least two output interface units. The number of output pipeline processing units and output interface units can be the same, i.e., there is a one-to-one correspondence between output pipeline processing units and output interface units.

[0047] See also Figure 5 As shown, another structural diagram of a network device is shown. The main control unit can be a main control board, or a controller, that is, the main control unit is implemented by the main control board. The input interface unit can be an FPGA (Field Programmable Gate Array), that is, the input interface unit is implemented by an FPGA. Of course, the input interface unit can also be implemented by an ASIC device, etc., and there is no limitation on this. The input pipeline processing unit can be an Ingress NP (entry NP), that is, the input pipeline processing unit can be implemented by an NP. The switching unit can be a Fabric (switching fabric board), that is, the switching unit can be implemented by a Fabric. The output pipeline processing unit can be an Engress NP (egress NP), that is, the input pipeline processing unit can be implemented by an NP. The output interface unit can be an FPGA, that is, the output interface unit is implemented by an FPGA. Of course, the output interface unit can also be implemented by an ASIC device, etc., and there is no limitation on this.

[0048] Input interface unit. The input interface unit can receive multiple data packets from the same deterministic stream and add an auxiliary identifier to each data packet based on the order in which the multiple data packets are received (the auxiliary identifier is used to assist in synchronization). The auxiliary identifier of the subsequent data packet is larger than the auxiliary identifier of the previous data packet. Each data packet is sent to the input pipeline processing unit in ascending order of the auxiliary identifiers.

[0049] For example, for the first data packet received, auxiliary identifier 1 is added to the data packet, for the second data packet received, auxiliary identifier 2 is added to the data packet, and so on.

[0050] 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, traverse each data packet in sequence (i.e., traverse each data packet in ascending order of auxiliary identifiers), 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.

[0051] 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. Each deterministic flow is processed in the same way. The processing of a deterministic flow is taken as an example below.

[0052] For multiple data packets of the same deterministic flow, the data packets are sorted in ascending order according to the auxiliary identifiers (the auxiliary identifiers are parsed from the data packets). After sorting the multiple data packets, each data packet can be traversed in sequence. 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.

[0053] The flow ID of a deterministic flow is assigned by the input pipeline processing unit. Different deterministic flows have different flow IDs, and multiple data packets in the same deterministic flow may have the same flow ID. For example, the input pipeline processing unit can identify the flow based on the data characteristics of the deterministic flow and map it to a flow ID.

[0054] Because multiple data packets are sorted in ascending order of their auxiliary identifiers, the order in which the data packets are sent to the switching unit is guaranteed. For example, the first data packet of a deterministic flow is sent to the switching unit first, followed by the second data packet of the deterministic flow, followed by the third data packet of the deterministic flow, and so on.

[0055] Switching unit. The switching unit can receive multiple data packets of the same deterministic flow (i.e., receive multiple data packets sequentially). For each received data packet, the switching unit sends the data packet to the output pipeline processing unit, which then sends the data packet to the output interface unit.

[0056] For example, after data packets enter the switching unit in sequence, the switching unit determines the output interface unit (e.g., K output interface units, where K can be a positive integer greater than 1) corresponding to each data packet, and replicates the data packet to obtain K identical data packets. The switching unit then sends the K data packets to the K output pipeline processing units corresponding to the K output interface units. Assuming that the data packet corresponds to output interface unit 1, output interface unit 2, and output interface unit 4, the switching unit replicates two additional data packets to obtain 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.

[0057] In one example, the output interface units can be divided into master output interface units and slave output interface units, with 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 a data packet to the output pipeline processing unit corresponding to the master output interface unit, which in turn sends the data packet to the master output interface unit. The switching unit can also send a data packet to the output pipeline processing unit corresponding to each slave output interface unit, which in turn sends the data packet to the slave output interface unit (i.e., the slave output interface unit corresponding to the output pipeline processing unit).

[0058] Output pipeline processing unit. The output pipeline processing unit can receive multiple data packets of the same deterministic stream (i.e., receive multiple data packets sequentially), and for each received data packet, send the data packet to the output interface unit corresponding to the output pipeline processing unit. For example, the output pipeline processing unit corresponding to the master output interface unit can send the data packet to the master 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.

[0059] 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 any restrictions.

[0060] 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, it adds a target sequence number to the data packet based on the starting sequence number corresponding to the flow identifier of the deterministic flow, where the starting sequence number is the sequence number of the previous data packet, removes the flow identifier from the data packet, and sends the modified data packet.

[0061] For example, after receiving the first data packet of a deterministic stream, the main output interface unit adds a target sequence number to the data packet. The target sequence number is a fixed value, such as 1, 1000, 5000, etc., with 1 being used as an example. After receiving the second data packet of a deterministic stream, 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, i.e., the target sequence number is 2. After receiving the third data packet of a deterministic stream, 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, i.e., the target sequence number is 3, and so on.

[0062] For each slave output interface unit (taking one slave output interface unit as an example), after receiving the first data packet of the deterministic stream, the slave output interface unit adds a target sequence number to the data packet, and the target sequence number is 1. After receiving the second data packet of the deterministic stream, the slave output interface unit adds a target sequence number to the data packet, and the target sequence number is the sum of the starting sequence number and 1, that is, the target sequence number is 2. After receiving the third data packet of the deterministic stream, the slave output interface unit adds a target sequence number to the data packet, and the target sequence number is the sum of the starting sequence number and 1, that is, the target sequence number is 3, and so on.

[0063] After receiving the data packet, the output interface unit can perform deterministic scheduling and synthesize scheduling with the best-effort flow, and generate hardware information and send it out. There is no restriction on this process.

[0064] In one example, because different output interface units are enabled at different times and have different start count times, there's no guarantee that the same data packet will have the same target sequence number across different output interface units. For example, if output interface unit 1 is enabled first and output interface unit 2 is enabled later, and by the time output interface unit 2 is enabled, output interface unit 1 has already received a total of 100 data packets from the deterministic flow, then for the 101st data packet in the deterministic flow, upon receiving it, output interface unit 1 will add a target sequence number of 101 to the packet, while output interface unit 2 will add a target sequence number of 1 to the packet, meaning that the packet is treated as the first data packet of output interface unit 2. Clearly, the 101st data packet in the deterministic flow will have a different target sequence number.

[0065] In response to the above findings, this application adds an additional sequence number synchronization process. Based on the sequence number synchronization process, it can ensure that the same data packet has the same target sequence number in different output interface units. In order to implement the sequence number synchronization process, all output interface units corresponding to the deterministic flow can be divided into master output interface units (Master) and slave output interface units (Slave). The master output interface unit can be any one of all the output interface units, such as the output interface unit with the earliest activation time as the master output interface unit. The remaining output interface units other than the master output interface unit can be used as slave output interface units.

[0066] The serial number synchronization process can be achieved through the main control unit, and the control unit can maintain the synchronization information table. Figure 6A The following is an example of a synchronization information table. The synchronization information table may include at least one of the following:

[0067] FlowID: The flow ID of a deterministic flow. The flow ID of a deterministic flow is a property of this device and is effective only 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 ID of the first deterministic flow is 0, the flow ID of the second deterministic flow is 1, the flow ID of the third deterministic flow is 2, and so on. The flow ID of a deterministic flow is optional content in the synchronization information table.

[0068] Valid: Indicates whether the entry is valid. For example, 0 indicates invalid and 1 indicates valid. That is, when the value is 1, it indicates that the flow identifier of the deterministic flow is valid. When the value is 0, it indicates that the flow identifier of the deterministic flow is invalid.

[0069] Iif: The interface identifier of the input interface unit, indicating that all data packets of the deterministic flow enter from the input interface unit corresponding to the interface identifier, that is, the input interface unit of all data packets is the same.

[0070] OutIfH: The output interface information set of the output interface unit. The output interface information set includes the 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 output interface information set includes the set elements of output interface unit 1 and the 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.

[0071] For each set element in the outbound interface information set, the set element may include:

[0072] Oif: integer, indicating the interface identifier of the output interface unit, used to distinguish output interface units.

[0073] Role: Indicates the role of the output interface unit. For example, 1 indicates that the deterministic flow plays the master role in the output interface unit, that is, the output interface unit is the master output interface unit of the deterministic flow; 0 indicates that the deterministic flow plays the slave role in the output interface unit, that is, the output interface unit is the slave output interface unit of the deterministic flow.

[0074] Sync: Synchronization status, 1 means it contains synchronization information, and 0 means it has nothing to do with synchronization.

[0075] Dist: indicates the difference (distance) between the serial number of the slave output interface unit and the serial number of the master output interface unit. For how to obtain the difference, please refer to the subsequent process.

[0076] Type: Indicates the serial number bit width, that is, how many bits there are in the serial number. For example, Type can be 1 bit, Type 0 indicates that the serial number bit width is 16 bits, and Type 1 indicates that the serial number bit width is 28 bits. The serial number bit width can be configured to the input pipeline processing unit, and the input pipeline processing unit encapsulates the serial number bit width into the metadata of the data packet, such as the Type field of the metadata carries the serial number position, and passes the serial number bit width to the output interface unit through the data packet. Alternatively, the serial number bit width can also be configured to the register space of the output interface unit, and the output interface unit directly reads the serial number bit width from the register space.

[0077] Offset: Indicates the sequence number position, that is, the offset position of the sequence number in the data packet. The sequence number position can be configured in the input pipeline processing unit, which then encapsulates the sequence number position in the data packet metadata. For example, the metadata's Offset field carries the sequence number position, and the data packet transmits the sequence number position to the output interface unit. Alternatively, the sequence number position can be configured in the register space of the output interface unit, which then reads the sequence number position directly from the register space.

[0078] Prefix: Indicates the serial number prefix, that is, the given serial number prefix is ​​used as the highest digits in the serial number. For example, the serial number prefix can be 4 bits, which are the highest 4 bits in the serial number. The output interface unit generates a serial number suffix (such as a 12-bit serial number suffix) and then combines it with the serial number prefix to form 16 bits. This 16-bit serial number is the final serial number, covering the position indicated by the Offset. Among them, the serial number prefix can be configured to the input pipeline processing unit, and the input pipeline processing unit encapsulates the serial number prefix into the metadata of the data packet, such as the Prefix field of the metadata carries the serial number prefix, and passes the serial number prefix to the output interface unit through the data packet. Alternatively, the serial number prefix can also be configured to the register space of the output interface unit, and the output interface unit directly reads the serial number prefix from the register space.

[0079] See also Figure 6B As shown, in addition to the synchronization information table, the master control unit may also include synchronization control logic. This synchronization control logic is used to implement the sequence number synchronization process. The synchronization control logic is responsible for maintaining the synchronization information table, responding to stream sequence number-related events, initiating synchronization operations based on these 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 the slave sequence number, writes the target difference between the master and slave sequence numbers to the distance register, and causes the slave output interface unit to update the starting sequence number. This process is described in the subsequent process.

[0080] In order to realize the serial number synchronization process, each output interface unit can maintain relevant registers, see Figure 6C The figure shows an example of a register, which may include at least one of the following:

[0081] FlowID: A flow identifier used to represent a deterministic flow and to distinguish different deterministic flows.

[0082] SeqRegs: Used to represent the sequence number register. Each deterministic stream corresponds to a sequence number register. For example, 1000 deterministic streams correspond to 1000 sequence number registers. The sequence number register is indexed by the stream identifier of the deterministic stream. The sequence number register is used to record the sequence number of the last data packet of the deterministic stream. That is, after each data packet of the deterministic stream is received, the value of the sequence number register is increased by 1.

[0083] SyncSeqRegs: used to represent the synchronization sequence number register, which corresponds to the sequence number register one by one. Each deterministic stream corresponds to a synchronization sequence number register. The synchronization sequence number register is indexed by the stream identifier of the deterministic stream. When the information synchronization message is received, the sequence number in the sequence number register (that is, the sequence number of the last data packet of the deterministic stream) is recorded in 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 the deterministic stream, it is temporarily stored in the synchronization sequence number register corresponding to the deterministic stream in SyncSeqRegs. If the stream identifier is 100, the sequence number is temporarily stored in SyncSeqRegs

[100] .

[0084] DistRegs: used to represent the distance register. Each deterministic stream corresponds to a distance register. The distance register is indexed by the stream identifier of the deterministic stream. The distance register is used to record the difference (distance) between the serial number of the slave output interface unit and the serial number of the master output interface unit. Assuming that the stream identifier of the sequence number to be generated is 100, the sequence number SeqNum actually written to the data packet generated by the slave output interface unit is: SeqNum = SeqRegs

[100] + DistRegs

[100] ; SeqRegs

[100] represents the serial number value in the serial number register of the slave output interface unit, and DistRegs

[100] represents the serial number difference in the distance register.

[0085] SyncStatRegs: used to represent the control status register. Each deterministic stream corresponds to a control status register. The control status register is indexed by the stream identifier of the deterministic stream. The control status register is used to record the status of the synchronization information preparation completion. For example, 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, when the control status register is 1, it indicates that the output interface unit is ready to complete the serial number to be synchronized, and the main control unit can obtain the synchronized serial number from the synchronization serial number register. When the control status register is 0, it indicates that the output interface unit has not completed the serial number to be synchronized, and the main control unit does not obtain the synchronized serial number from the synchronization serial number register. Among them, the control status registers of the master output interface unit and the slave output interface unit can be the same, and the default value is 0.

[0086] FwdEableRegs: used to represent the forwarding control register. Each deterministic flow corresponds to a forwarding control register. The forwarding control register is indexed by the flow identifier of the deterministic flow. The forwarding control register is used to indicate whether outward forwarding of data packets is allowed. For example, the third value indicates a blocking state, indicating that outward forwarding of data packets is not allowed. The fourth value indicates a forwarding state, indicating that outward forwarding of data packets is allowed.

[0087] For example, for each slave output interface unit, if the forwarding control register is 1, it indicates that it is in the forwarding state, indicating that packets can be forwarded outward. If the forwarding control register is 0, it indicates that it is in the blocking state, not allowing packets to be forwarded outward. In other words, the packets 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. In other words, regardless of whether the forwarding control register is 0 or 1, the data packet is directly forwarded outward.

[0088] In an example, the SyncCtrlstatRegs register may be configured, and the SyncCtrlstatRegs register includes the control status register SyncStatRegs and the forwarding control register FwdEableRegs, that is, the control status register SyncStatRegs serves as a status bit, and the forwarding control register FwdEableRegs serves as a status bit.

[0089] Obviously, for the output interface unit, each time a data packet is received, the sequence number in the sequence number register will be updated according to the received data packet, that is, the corresponding sequence number will be updated each time a data packet is received, but when the forwarding control register is 0, the data packet is not sent out, but is discarded.

[0090] The synchronization sequence number register SyncSeqRegs can be deployed in the output interface unit, the distance register DistRegs can be deployed in the output interface unit, the control status register SyncStatRegs can be deployed in the output interface unit, and the forwarding control register FwdEableRegs can be deployed in the output interface unit.

[0091] In one example, the sequence number synchronization process may include the following steps:

[0092] Step S11: The main control unit sends the information synchronization message to the input interface unit.

[0093] In one example, when a sequence number synchronization is required for a certain deterministic flow, the synchronization information table is queried based on the flow identifier of the deterministic flow ( Figure 6A ), obtain the input interface unit corresponding to the deterministic flow, and send the information synchronization message to the input interface unit, where the information synchronization message includes the flow identifier of the deterministic flow.

[0094] For example, when a new deterministic stream is created, the master control unit triggers sequence number synchronization for the deterministic stream. At this point, it can obtain the master output interface unit and slave output interface unit corresponding to the newly created deterministic stream, 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 the information synchronization message to the input interface unit. The target slave output interface unit can be some or all slave output interface units.

[0095] For another 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 select a new master output interface unit from all slave output interface units, and use the remaining slave output interface units except the new master output interface unit as target slave output interface units to trigger serial 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. On this basis, the master control unit can send information synchronization messages to the input interface unit corresponding to the deterministic flow.

[0096] For another example, for a deterministic stream (i.e., any deterministic stream), if a slave output interface unit corresponding to the deterministic stream is added, the newly added slave output interface unit will be used as the target slave output interface unit, and the remaining slave output interface units may be used as the target slave output interface units, or the remaining slave output interface units may not be used as the target slave output interface units. The master control unit triggers serial number synchronization for the deterministic stream. 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 the information synchronization message to the input interface unit corresponding to the deterministic stream.

[0097] For another example, for a deterministic stream (i.e., any deterministic stream), if the slave output interface unit corresponding to the deterministic stream recovers from a fault, the slave output interface unit after the fault recovery will be used as the target slave output interface unit, and the remaining slave output interface units may be used as the target slave output interface units, or the remaining slave output interface units may not be used as the target slave output interface units. The master control unit then triggers serial number synchronization for the deterministic stream. At this time, information synchronization messages may be sent to the master output interface unit and the target slave output interface unit respectively, that is, the information synchronization message may be sent to the input interface unit corresponding to the deterministic stream.

[0098] For another example, for a deterministic stream (i.e., any deterministic stream), the main control unit can obtain the synchronization period of the deterministic stream and trigger serial number synchronization for the deterministic stream in each synchronization period. At this time, information synchronization messages can be sent to the main output interface unit and the target slave output interface unit (such as each slave output interface unit) based on the synchronization period (i.e., each synchronization period). On this basis, for each synchronization period, the main control unit sends the information synchronization message to the input interface unit corresponding to the deterministic stream.

[0099] Of course, the above are just a few examples of trigger conditions, and there is no limitation to the trigger conditions.

[0100] Step S12: The input interface unit sends the information synchronization message to the input pipeline processing unit.

[0101] Step S13: The input pipeline processing unit sends the information synchronization message to the switching unit.

[0102] In one example, after receiving an 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.

[0103] For example, the metadata may include a synchronization status (Sync). Since the information synchronization message is used to achieve sequence number synchronization, the synchronization status encapsulated by the input pipeline processing unit in the information synchronization message is 1, thereby indicating that the current data packet is an information synchronization message through the synchronization status.

[0104] The metadata may also include the serial number bit width, the serial number prefix and the serial number position, and the input pipeline processing unit may store the correspondence between the flow identifier and the serial number bit width, the serial number prefix and the serial number position. The correspondence is sent by the main control unit to the input pipeline processing unit. Therefore, the input pipeline processing unit may query the correspondence based on the flow identifier of the deterministic flow, obtain the serial number bit width, the serial number prefix and the serial number position, and encapsulate the serial number bit width, the serial number prefix and the serial number position in the information synchronization message.

[0105] Step S14: The switching unit may send the information synchronization message to the output pipeline processing unit corresponding to the master output interface unit, and the output pipeline processing unit may send the information synchronization message to the master output interface unit; the switching unit may send the information synchronization message to the output pipeline processing unit corresponding to the target slave output interface unit, and the output pipeline processing unit may send the information synchronization message to the target slave output interface unit.

[0106] At this point, the information synchronization message is successfully sent to the master output interface unit and the target slave output interface unit, that is, the main control unit sends the information synchronization message to the master output interface unit and the target slave output interface unit respectively.

[0107] 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.

[0108] For example, the main output interface unit parses the synchronization state (Sync) from the information synchronization message. If the synchronization state is 1, it means that the current data packet is an information synchronization message, and the sequence number synchronization can be achieved based on the information synchronization message. In order to achieve sequence number synchronization, the flow identifier of the deterministic flow can be parsed from the information synchronization message, and the flow identifier can be used to query Figure 6C , get the sequence number in the sequence number register SeqRegs, and record this sequence number in the main synchronization sequence number register SyncSeqRegs as the main sequence number.

[0109] Then, the main control status register (SyncStatRegs) corresponding to the flow identifier is modified from the first value to the second value, indicating that the synchronization information preparation of the main output interface unit is completed.

[0110] Step S16: After the target receives the information synchronization message from the output interface unit, the slave sequence number is written into the slave synchronization sequence number register corresponding to the flow identifier, where the slave sequence number is the sequence number of the last data packet received from the output interface unit, and the slave control state register corresponding to the flow identifier is modified from the first value to the second value. For example, the target output interface unit parses the synchronization state (Sync) from the information synchronization message. If the synchronization state is 1, the sequence number synchronization is achieved based on the information synchronization message. In order to achieve sequence number synchronization, the flow identifier of the deterministic flow can be parsed from the information synchronization message, and the flow identifier can be used to query the Figure 6C , obtain the sequence number in the sequence number register SeqRegs, record this sequence number in the slave synchronization sequence number register as the slave sequence number. Then, modify the slave control status register corresponding to the flow identifier from the first value to the second value, indicating that the synchronization information preparation of the slave output interface unit is complete.

[0111] In one example, after receiving the information synchronization message, the master output interface unit does not update the sequence number based on the information synchronization message, nor does it send the information synchronization message externally, but instead discards the information synchronization message. After receiving the information synchronization message, the target slave output interface unit does not update the sequence number based on the information synchronization message, nor does it send the information synchronization message externally, but instead discards the information synchronization message.

[0112] Step S17: The master output interface unit sends a master interrupt event message to the master control unit. The master interrupt event message includes the flow identifier and the interface identifier of the master output interface unit. The master interrupt event message is used to indicate that the master output interface unit has completed synchronization information preparation. The target slave output interface unit sends a slave interrupt event message to the master control unit. The slave interrupt event message includes the flow identifier and the interface identifier of the target slave output interface unit. The slave interrupt event message is used to indicate that the target slave output interface unit has completed synchronization information preparation.

[0113] Step S18: After receiving the master interrupt event message, the master control unit queries whether the master control status register (i.e., the control status register corresponding to the interface identifier of the master output interface unit) corresponding to the flow identifier (obtained from the master interrupt event message) is the second value; after receiving the slave interrupt event message, the master 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 flow identifier (obtained from the interrupt event message) is the second value.

[0114] 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 reads 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 is not the second value, the master sequence number and the slave sequence number are reread after waiting for a preset period of time. After reading the preset number of times, the master control unit may return to step S11 and repeat the above sequence number synchronization process.

[0115] Step S20: After obtaining the master sequence number and the slave sequence number, the master control unit 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.

[0116] Although sequence numbers may change at any time, the difference (i.e., the target difference between the master and slave sequence numbers) remains constant. Based on the difference between the master and slave sequence numbers and the sequence number of the target slave output interface unit, a sequence number identical to that of the master output interface unit can be generated. Specifically, the difference is added to the sequence number of the target slave output interface unit to obtain the sequence number identical to that of the master output interface unit. Based on this principle, the master control unit can calculate the target difference between the master and slave sequence numbers and write the target difference to the distance register corresponding to the stream identifier of the target slave output interface unit.

[0117] In step S21, after the master control unit writes the target difference value into the distance register, it modifies the master control status register corresponding to the flow identifier from the second value to the first value, and modifies the slave control status register corresponding to the flow 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 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 is waiting for the next sequence number synchronization process.

[0118] Step S22: 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.

[0119] For example, when a target difference value exists in the distance register DistRegs corresponding to the flow identifier, the target slave output interface unit can calculate the sum of the target difference value and the sequence number of the target slave output interface unit, and this sum value serves as the starting sequence number corresponding to the flow identifier. The sequence number of the target slave output interface unit can be the value in the sequence number register SeqRegs, which represents the sequence number of the last data packet of the deterministic flow. After obtaining the starting sequence number corresponding to the flow identifier, this starting sequence number can be updated to the sequence number register SeqRegs. In subsequent processes, this starting sequence number serves as the sequence number of the last data packet of the deterministic flow, thereby controlling the sequence numbers of subsequent data packets. Obviously, by performing the above operations, the sequence number in the sequence number register SeqRegs of the slave output interface unit is the same as the sequence number in the sequence number register SeqRegs of the master output interface unit.

[0120] Among them, step S22 is an optional step, and the starting sequence number corresponding to the flow identifier may not be updated based on the target difference, that is, the sequence number in the sequence number register SeqRegs is kept unchanged, that is, the sequence number in the sequence number register SeqRegs is used as the starting sequence number, and the starting sequence number is not updated.

[0121] In step S23, after the target slave output interface unit reads the target difference value from the distance register, the forwarding control register corresponding to the flow identifier (i.e., the forwarding control register of the target slave output interface unit) may be modified from the third value to the fourth value, where 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 value to the distance register, the forwarding control register corresponding to the flow identifier may be modified from the third value to the fourth value.

[0122] In an example, if the target slave output interface unit needs to update the starting 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, or, if the target slave output interface unit does not update the starting sequence number corresponding to the flow identifier based on the target difference, the main control unit can modify the forwarding control register corresponding to the flow identifier from the third value to the fourth value, and there is no restriction on this.

[0123] In one example, the initial value of the forwarding control register of the target slave output interface unit is a third 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, it only updates the slave sequence number corresponding to the flow identifier (i.e., updates the sequence number in the sequence number register SeqRegs, such as by adding 1). However, the target slave output interface unit is prohibited from sending data packets, i.e., the target slave output interface unit discards the data packets. In this way, by setting the forwarding control register to a blocking state, data packets are prevented from being sent out, thereby avoiding interfering with the behavior of the other end. At this time, only the master output interface unit sends data packets outward, while the target slave output interface unit does not send data packets outward.

[0124] In an example, after the forwarding control register is changed from the third value to the fourth value, the blocking state of the target slave output interface unit is released, and the target slave output interface unit is in the forwarding state. Each time the target slave output interface unit receives a data packet corresponding to the flow identifier, in addition to updating the sequence number corresponding to the flow identifier (that is, updating the sequence number in the sequence number register SeqRegs), it can also send a data packet.

[0125] Step S24: When the forwarding control register is in the fourth value, i.e., the target slave output interface unit is in the forwarding state, 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 transmits the modified data packet. For example, the target slave output interface unit adds the 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 transmits the modified data packet, where the starting sequence number is the sequence number of the last data packet received. Furthermore, each time the master 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 transmits the modified data packet.

[0126] In an 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 of the starting sequence number (that is, 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 master output interface unit and the target slave output interface unit are processed in the same manner. For the master output interface unit and the target slave output interface unit (hereinafter referred to as the master output interface unit and the target slave output interface unit), the target sequence number can be added to the data packet in the following manner:

[0127] First, the output interface unit obtains the serial number bit width, the serial number prefix and the serial number position.

[0128] In one example, the serial number bit width, serial number prefix, and serial number position can be sent by the main control unit to the output interface unit. For example, the main control unit configures the serial number bit width, serial number prefix, and serial number position to 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.

[0129] In another example, the serial number bit width, serial number prefix and serial number position are metadata encapsulated by the input pipeline processing unit in the data packet, so that the output interface unit can parse the serial number bit width, serial number prefix and serial number position corresponding to the flow identifier from the metadata of the data packet.

[0130] 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 example, the metadata may include a synchronization state (Sync). Since the data packet is not used to achieve sequence number synchronization, the synchronization state encapsulated by the input pipeline processing unit in the data packet may be 0, thereby indicating that the current data packet is a normally transmitted data packet through the synchronization state. The input pipeline processing unit can store the correspondence between the flow identifier and the sequence number bit width, sequence number prefix and sequence number position. The correspondence is sent by the main control unit to the input pipeline processing unit. Therefore, the input pipeline processing unit can query the correspondence based on the flow identifier of the deterministic flow, obtain the sequence number bit width, sequence number prefix and sequence number position, and encapsulate the sequence number bit width, sequence number prefix and sequence number position in the data packet.

[0131] For example, the metadata (Sync Meta Data) encapsulated in the data packet by the input pipeline processing unit may include the following: Prefix: Indicates the sequence number prefix, which is the given sequence number prefix as the highest digits in the sequence number. For example, the sequence number prefix can be 4 bits. As the highest 4 bits in the sequence number, the output interface unit generates a sequence number suffix (such as a 12-bit sequence number suffix) and combines it with the sequence number prefix to form a 16-bit sequence number. This 16-bit sequence number is the final sequence number, covering 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 synchronization is not related. Type: Indicates the sequence number bit width, that is, the total number of bits in the sequence number. For example, if Type is 1 bit, Type 0 indicates a sequence number bit width of 16 bits, and Type 1 indicates a sequence number bit width of 28 bits. Resv0: The bit width is 10 bits and is reserved. FlowID: The flow identifier of a deterministic flow, which can be 16 bits wide. Offset: Indicates the sequence number position.

[0132] Then, the output interface unit generates a target 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.

[0133] For example, the output interface unit can read the sequence number in the sequence number register SeqRegs and use it as the starting sequence number. Based on the starting sequence number, the target sequence number can be generated. For example, the target sequence number can be the starting sequence number plus 1. When generating the target sequence number, the bit width of the target sequence number is the bit width of the sequence number, and the prefix of the target sequence number is the prefix of the sequence number. After the target sequence number is generated, the target sequence number can also be updated in the sequence number register SeqRegs to serve as the starting sequence number for the next data packet.

[0134] To sum up, each time the target receives a data packet from the output interface unit, it can generate a target sequence number for 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 flow identifier.

[0135] The output interface unit then adds the target sequence number to the data packet based on the sequence number position, i.e., the target sequence number is located at the offset position indicated by the sequence number position in the data packet. For example, the sequence number position indicates 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, i.e., the target sequence number is located at the offset position indicated by the sequence number position.

[0136] The output interface unit can then send a data packet with the target sequence number as the sequence number. Based on the sequence number synchronization process, the sequence numbers 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 in the data packet (i.e., the flow identifier of the deterministic flow will not be sent to the external device) and send the modified data packet.

[0137] In one example, if the target slave 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 of the starting sequence number and the target difference into the sequence number register SeqRegs, the target slave output interface unit can add the target sequence number to the data packet in the following manner:

[0138] First, the target output interface unit obtains the serial number bit width, the serial number prefix and the serial number position.

[0139] Then, the target output interface unit generates a target 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.

[0140] For example, the target output interface unit can read the sequence number in the sequence number register SeqRegs and use it as the starting sequence number. Based on the starting sequence number, a candidate sequence number can be generated. For example, the candidate sequence number can be the starting sequence number plus 1. When generating the candidate sequence number, the bit width of the candidate sequence number is the bit width of the sequence number, and the prefix of the candidate sequence number is the prefix of the sequence number. After the candidate sequence number is generated, it can be updated in the sequence number register SeqRegs and used as the starting sequence number for the next data packet.

[0141] 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 example, the sum of the candidate sequence number and the target difference can be used as the target sequence number of the data packet.

[0142] In summary, each time the target slave output interface unit receives a data packet, it generates a candidate sequence number for the packet based on the starting sequence number in the sequence number register SeqRegs and updates the candidate sequence number to the starting sequence number in SeqRegs. The sum of the candidate sequence number and the target difference in the distance register is then used as the target sequence number, and the target sequence number is added to the packet.

[0143] 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.

[0144] Then, the target output interface unit can send the 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 in the data packet (that is, the flow identifier of the deterministic flow will not be sent to the external device) and send the modified data packet.

[0145] See also Figure 6D Figure 2 shows a system block diagram for sequence number synchronization in an 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 output interface unit's PCIE interface (PCIE-INTF) via the PCIe bus. The main control board and the output interface unit exchange control flow data via the PCIE interface, such as information synchronization messages and interrupt event messages exchanged during sequence number synchronization. The main control board can also access the output interface unit's sequence number synchronization register module (Registers for Sequence Number Synchronization) through the PCIE interface. The sequence number synchronization register module manages various registers in the output interface unit, such as the synchronization sequence number register SyncSeqRegs, the distance register DistRegs, the control status register SyncStatRegs, and the forwarding control register FwdEableRegs.

[0146] The output pipeline processing unit (i.e., the Egress NP) is connected to the output interface unit via the ILKN (Interlaken) bus, specifically the IF-ADAPTER connected to the output interface unit via the ILKN bus. After a data packet passes through the input pipeline processing unit (i.e., the Ingress NP) and the output pipeline processing unit, some metadata is generated. This metadata is transmitted along with the data packet to the output interface unit via the ILKN bus. This metadata may include the following: Prefix: indicates the sequence number prefix; Sync: indicates the synchronization status; Type: indicates the sequence number bit width; Resv0: a reserved field; FlowID: a flow identifier for deterministic flows; Offset: indicates the sequence number position. Of course, the above metadata is only an example and is not intended to be limiting.

[0147] 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) and transmitted to the sequence number generator module. The sequence number generator module, in conjunction with the main control unit and the sequence number synchronization register module, synchronizes the sequence numbers. The sequence number generator module also generates sequence numbers for synchronized deterministic stream data packets and sends them to other processing modules for further processing. These other processing modules can be scheduled in some manner and perform PTP-related processing.

[0148] In one example, before the serial number synchronization process, the following initialization process may also be involved: under the control of the main 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, the internal registers of the output interface unit, etc., and can clear the internal registers of the output interface unit, initialize the internal registers of the output interface unit when creating a deterministic stream, and configure the registers according to the master and slave roles of the deterministic stream in the output interface unit.

[0149] In one example, after receiving a data packet, the output interface unit parses metadata from the data packet. Assume that the stream 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. When Sync is 1, it indicates an information synchronization message, and when Sync is 0, it indicates a normal data packet. If Sync is 0, the output interface unit's deterministic flow forwarding process is executed. If Sync is 1, the sequence number synchronization process is executed. The sequence number synchronization process may include:

[0150] The output interface unit stores the value in the SeqRegs

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

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

[100] to 1, indicating that the output interface unit has completed the synchronization information preparation; the output interface unit sends an interrupt event message to the main control unit (this step is optional), and 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.

[0151] The master control unit queries the register of the output interface unit according to the interrupt event message (or adopts active polling), reads the SyncStatRegs status bit of SyncCtrlstatRegs

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

[100] , and clears the flag by writing 0 to the SyncStatRegs.

[0152] The master control unit calculates the target distance Dist between the serial number of the slave output interface unit and the serial number of the master output interface unit based on the acquired serial number, the interface identifier of the output interface unit, and the flow identifier, in combination with the synchronization information table. This target distance is stored in the synchronization information table corresponding to the master control unit. For the slave output interface unit, the target distance is configured in DistRegs

[100] and FwdEnbleRegs in SyncCtrlstatRegs

[100] is written to 1 to enable the output interface unit to forward data packets for this deterministic flow.

[0153] For the slave output interface unit, the slave output interface unit can also update the serial number in the SeqRegs

[100] register according to the target distance in DistRegs

[100] , that is, add the serial number in the SeqRegs

[100] register to the target distance in DistRegs

[100] , and write the updated serial number into the SeqRegs

[100] register.

[0154] The main control unit updates the Sync flag in the synchronization information table. The Sync flag indicates that the corresponding output interface unit has completed the serial number synchronization and the serial number synchronization processing flow can be ended.

[0155] If Sync is 0, the output interface unit performs the forwarding process, which includes:

[0156] Assuming that the stream identifier in the metadata is 100 and Sync is 0, the output interface unit reads the serial number in the SeqRegs

[100] register, which is the current serial number (i.e., the starting serial number), and sets the serial number in the SeqRegs

[100] register to Value; updates Value: Value = Value + 1; writes the value of Value back to the SeqRegs

[100] register; obtains the serial number prefix Prefix from the metadata; generates the serial number SeqNum = Value | (Prefix << 28); writes SeqNum to the position with the offset of Offset in the data packet according to the Offset obtained in the metadata; if FwdEnableRegs of SyncCtrlstatRegs

[100] is 1, sends the data packet to the next module; otherwise, discards the data packet.

[0157] See also Figure 7A 、 Figure 7B 、 Figure 7C and Figure 7D As shown in the figure, it is a schematic diagram of output interface unit serial number synchronization. Assume that the flow identifier (FlowID) of a deterministic flow after mapping is 1. The deterministic flow is received from network device interface 0 (Iif0) and sent from interface 1 (Oif1) and interface 2 (Oif2) of the network device.

[0158] See also Figure 7A As shown in the figure, the values ​​of the serial number-related registers in the output interface unit after synchronization is completed are displayed. To simplify the description, Oif1.SeqRegs[1] is used to represent the SeqRegs with a flow identifier of 1 on the Oif1 interface. Oif2 plays the master role. Since the master and slave roles are not synchronized at the time of activation, the sequence numbers on Oif1 and Oif2 are different. Assume that when synchronization is completed, the value of Oif1.SeqRegs[1] is 100, so the value of Oif1.SynSeqRegs[1] is 100. Similarly, the value of Oif2.SeqRegs[1] is 90100, so the value of Oif2.SynSeqRegs[1] is 90100. After processing by the master 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.

[0159] See also Figure 7BAs shown, assuming that 16 data packets are received from Iif0, for ease of description, the received data packets are identified by input numbers (Input No) from 1 to 16. The received data packets belong to 3 deterministic flows, and there are 6 data packets with FlowID (flow identifier) ​​of 1, whose input numbers are 1, 4, 7, 10, 13, and 16. Obviously, if the input interface unit does not perform flow identification and generates sequence numbers for the data packets, the sequence numbers of the same deterministic flow will be discontinuous (i.e., 1, 4, 7, 10, 13, 16, etc.). Since the paths taken by the data packets with FlowIDs 2 and 3 cannot be determined to be the same as the path taken by the data packet with FlowID 1, only the data packet with FlowID 1 is used as an example for description.

[0160] See also Figure 7C As shown, it is an example of each register of the output interface unit after synchronization is completed and before the above 6 data packets (ie 1, 4, 7, 10, 13, 16) arrive at Oif12 and Oif2.

[0161] See also Figure 7D Figure 2 shows an example of how data packets are identified using generated sequence numbers. After being processed by the output interface unit, six data packets are sent from Oif12 and Oif2. Clearly, the master and slave output interface units generate the same sequence number for the same data packet. Since sequence numbers are generated in the output interface unit based on the order in which the data packets arrive, the sequence numbers are not sent out of order and are continuous. The peer end can use these continuous sequence numbers to implement relevant QoS guarantees.

[0162] As can be seen from the above technical solutions, in this application, a method for generating serial numbers for data packets of deterministic flows in a deterministic network is proposed, which can ensure that the serial numbers of the data packets of the main output interface unit are consistent with the serial numbers of the data packets of the slave output interface unit, thereby ensuring the consistency of the serial numbers of the data packets when the data packets are processed concurrently, that is, the serial numbers of multiple data packets (i.e., multiple copies) of the same deterministic flow are arranged continuously, and the serial numbers of the continuously arranged deterministic flows can ensure the correct implementation of DetNet. By fully considering the feasibility and performance factors of software and hardware, it has very high scalability and is suitable for large-scale deterministic network applications. It is also suitable for implementation in high-end, mid-range and low-end routers. It can solve the problem that in the implementation of the PREOF function, the sequence number generation depends on flow identification, the flow identification requires high-performance concurrent processing, the concurrent processing causes the order to be not maintained, and the continuous serial numbers that identify the order of the deterministic flow cannot be generated for multiple copies of the same flow.

[0163] The present application proposes a data packet transmission method applied to a network device, wherein 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. Figure 8 , which is a flow chart of the method, the method includes:

[0164] Step 801: The master control unit sends an information synchronization message to the master output interface unit and the target slave output interface unit respectively. The information synchronization message may include a flow identifier of a deterministic flow.

[0165] In step 802, after receiving the information synchronization message, the master output interface unit writes the master sequence number (MSN) into the master synchronization sequence number register corresponding to the flow identifier. The MSN may 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 (SSN) into the slave synchronization sequence number register corresponding to the flow identifier. The SSN may be the sequence number of the last data packet received by the target slave output interface unit.

[0166] 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.

[0167] Step 804: 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. The starting sequence number is the sequence number of the last data packet received by the target slave output interface unit.

[0168] In one example, after the master output interface unit writes the master sequence number into the master synchronization sequence number register, it can also modify the master control status register corresponding to the flow identifier from the first value to the second value, the first value indicating that the synchronization information preparation is not complete, and the second value indicating that the synchronization information preparation is complete. After the target slave output interface unit writes the slave sequence number into the slave synchronization sequence number register, it can also modify the slave control status register corresponding to the flow 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, which may include: if the master control status register and the slave control status register are both the second value, then read the master sequence number from the master synchronization sequence number register and read the slave sequence number from the slave synchronization sequence number register. After the master control unit writes the target difference value into the distance register, it also modifies the master control status register corresponding to the flow identifier from the second value to the first value, and modifies the slave control status register corresponding to the flow identifier from the second value to the first value.

[0169] In an example, after the master output interface unit modifies the master control status register corresponding to the flow identifier to the second value, it sends a master interrupt event message carrying the flow identifier to the master control unit; after the target slave output interface unit modifies the slave control status register corresponding to the flow identifier to the second value, it 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 the second value; if the master control status register is the second value, the master sequence number is read from the master synchronization sequence number register; after receiving the slave interrupt event message, the master control unit queries whether the slave control status register corresponding to the flow identifier is the second value; if the slave control status register is the second value, the slave sequence number is read from the slave synchronization sequence number register.

[0170] 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, where the third value indicates a blocking state, and the fourth value indicates a forwarding state. Alternatively, after the main control unit writes the target difference to 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 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 sending the data packet. The target slave output interface unit sending the modified data packet may include: when the forwarding control register is the fourth value, the target slave output interface unit sends the modified data packet.

[0171] In one example, the main control unit sends information synchronization messages to the main output interface unit and the target slave output interface unit respectively, which may include: when a new deterministic flow is created, the main control unit obtains the main output interface unit and the target slave output interface unit corresponding to the newly created deterministic flow, and sends information synchronization messages to the main output interface unit and the target slave output interface unit respectively, where the information synchronization message includes the flow identifier of the newly created deterministic flow; or, for a deterministic flow, if the main output interface unit corresponding to the deterministic flow fails, the main control unit selects a new main output interface unit from all the slave output interface units, and uses the remaining slave output interface units except the new main output interface unit as the target slave output interface units, and sends information synchronization messages to the newly elected main output interface unit and the target slave output interface unit respectively. The interface unit sends an information synchronization message; or, for a deterministic flow, if a slave output interface unit corresponding to the deterministic flow is newly added, the newly added slave output interface unit is used as the target slave output interface unit, and the main control unit sends information synchronization messages to the main 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 is recovered is used as the target slave output interface unit, and the main control unit sends information synchronization messages to the main output interface unit and the target slave output interface unit respectively; or, for a deterministic flow, the main control unit obtains the synchronization period of the deterministic flow, and sends information synchronization messages to the main output interface unit and the target slave output interface unit respectively based on the synchronization period.

[0172] In an example, a 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, which may include: 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 main control unit sends the information synchronization message 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.

[0173] In one example, a 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 receives multiple data packets, adds 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 latter data packet is greater than the auxiliary identifier of the previous data packet; sends each data packet in sequence to the input pipeline processing unit based on the order of the auxiliary identifiers from small to large; the input pipeline processing unit receives multiple data packets, sorts the multiple data packets in order from small to large according to the auxiliary identifiers, and removes the auxiliary identifier in each data packet; traverses each data packet in sequence, determines the flow identifier of the deterministic flow to which the data packet belongs for the currently traversed data packet, encapsulates the flow identifier in the data packet, and sends the data packet to the switching unit. 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 slave 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 and the target difference in the distance register, removes the flow identifier in the data packet, and sends the modified data packet.

[0174] In one example, 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. This may include: the target slave output interface unit reads the target difference from the distance register, determines the sum of 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, 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 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 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.

[0175] In one example, the target slave output interface unit may also obtain 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 may be 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 may be sent to the target slave output interface unit by the master control unit. When the target slave output interface unit generates a target sequence number for 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 may be 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 may be greater than the starting sequence number. The target slave output interface unit adding a target sequence number to the data packet may include: the target slave output interface unit adding the target sequence number to 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.

[0176] It can be seen from the above technical solution that, in an example, a method for generating serial numbers for data packets of a deterministic flow in a deterministic network is proposed, which can ensure that the serial numbers of the data packets of the main output interface unit are consistent with the serial numbers of the data packets of the slave output interface unit, thereby ensuring the consistency of the serial numbers of the data packets when the data packets are processed concurrently, that is, the serial numbers of multiple data packets (that is, multiple copies) of the same deterministic flow are arranged continuously, and the continuously arranged serial numbers of the deterministic flow can ensure the correct implementation of DetNet.

[0177] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A data packet transmission method, characterized in that: Applied to a network device, the network device includes a main control unit and at least two output interface units, the at least two output interface units include a master output interface unit and at least one slave output interface unit, the method includes: The master control unit 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 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, where 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, where 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 a target difference between the master sequence number and the slave sequence number into a distance register corresponding to the flow 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, where 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 includes: after the master output interface unit writes the master sequence number into the master synchronization sequence number register, modifying the master control status register corresponding to the flow identifier from a first value to a second value, the first value indicating that synchronization information preparation is not completed, and the second value indicating that 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 status register corresponding to the flow 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 status register and the slave control status register are the second values, 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 master output interface unit modifies the master control status register corresponding to the flow identifier to a second value, the master output interface unit sends a master interrupt event message carrying the flow identifier to the master 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, reading 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 status register corresponding to the flow identifier is the second value; if the slave control status register is the second value, the master control unit reads the slave sequence number from the slave synchronization sequence number register.

4. The method according to claim 1, wherein The method further includes: 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 takes the third value, each time the target slave output interface unit receives a data packet corresponding to the flow identifier, the target slave sequence number corresponding to the flow identifier is updated and the sending of the data packet is prohibited; 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 master control unit sends information synchronization messages to the master output interface unit and the target slave output interface unit respectively, including: When a new deterministic flow is created, the master control unit obtains the master output interface unit and the target slave output interface unit corresponding to the new deterministic flow, 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 flow identifier of the new deterministic flow; 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 flow, if a slave output interface unit corresponding to the deterministic flow is newly added, the newly added slave output interface unit is used as the 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 recovered slave output interface unit is used as the 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, the master control unit obtains a synchronization period of the deterministic flow, and sends information synchronization messages to the master output interface unit and the 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 pipe processing unit corresponding to the main output interface unit, and the output pipe 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 ascending order of the auxiliary identifiers. 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 from 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 master output interface unit, and the output pipeline processing unit sends the data packet to the master 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 a 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, 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, and 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 includes: the target slave output interface unit obtaining 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 master control unit to the target slave output interface unit; When the target slave output interface unit generates a target sequence number for 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 slave output interface unit adds the target sequence number to the data packet, including: the target slave output interface unit adds the target sequence number to 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 master output interface unit and at least one slave output interface unit; The main control unit is used to send information synchronization messages to the master 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 configured to write a master sequence number into a master synchronization sequence number register corresponding to the flow identifier after receiving the information synchronization message; wherein the master 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 a slave sequence number into a 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 flow 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, where the starting sequence number is the sequence number of the last data packet received.

11. The network device according to claim 10, wherein: The master output interface unit is further configured to, after writing the master sequence number into the master synchronization sequence number register, modify the master control status register corresponding to the flow identifier from a first value to a second value, the first value indicating that synchronization information preparation is not completed, and the second value indicating that synchronization information preparation is completed; the target slave output interface unit is further configured to, after writing the slave sequence number into the slave synchronization sequence number register, modify the slave control status register corresponding to the flow 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 when reading the slave sequence number from the slave synchronization sequence number register, is specifically configured to: if both the master control status register and the slave control status register have the second value, read the master sequence number from the master synchronization sequence number register, and read the slave sequence number from the slave synchronization sequence number register; The main control unit is further used to modify the master 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, wherein: 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 status 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 configured to, after receiving the main interrupt event message, query whether the main control status register corresponding to the flow identifier is a second value; 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, after receiving the slave interrupt event message, query whether the slave control status register corresponding to the flow identifier is a second value; if the slave control status register is the second value, read the slave sequence number from the slave synchronization sequence number register.

13. The network device according to claim 10, wherein: The target slave output interface unit is further configured to, after reading the target difference value from the distance register, modify 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 the main control unit is further configured to, after writing the target difference value to the distance register, 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; 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 the 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 configured to receive a plurality of data packets, add 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 sequentially send each data packet to the input pipeline processing unit based on the order of the auxiliary identifiers from smallest to largest. The input pipeline processing unit is configured to receive a plurality of data packets, sort the plurality of data packets in ascending order of the auxiliary identifiers, and remove the auxiliary identifier from each data packet; sequentially traverse each data packet, 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 configured to receive the data packet, send the data packet to the output pipeline processing unit corresponding to the master output interface unit, and the output pipeline processing unit sends the data packet to the master 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 configured 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 from 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, wherein: The target slave output interface unit is specifically configured 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: Reading the target difference from the distance register, determining a sum between the starting sequence number corresponding to the flow identifier and the target difference, and updating 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 for 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 for 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 a target sequence number for 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