CN112995064A - Time-sensitive network message forwarding method, device, terminal and storage medium - Google Patents
Time-sensitive network message forwarding method, device, terminal and storage medium Download PDFInfo
- Publication number
- CN112995064A CN112995064A CN202110429224.4A CN202110429224A CN112995064A CN 112995064 A CN112995064 A CN 112995064A CN 202110429224 A CN202110429224 A CN 202110429224A CN 112995064 A CN112995064 A CN 112995064A
- Authority
- CN
- China
- Prior art keywords
- message
- time
- forwarded
- real
- queue
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2416—Real-time traffic
Abstract
The invention discloses a method, a device, a terminal and a storage medium for forwarding time-sensitive network messages, wherein the method comprises the following steps: receiving a message to be forwarded, determining a target service flow corresponding to the message to be forwarded, and acquiring the byte number of the message sent by the target service flow and the promised service rate of the target service flow; determining the number of sending rounds of the message to be forwarded and the real-time queue to which the message to be forwarded belongs according to the number of bytes of the message to be forwarded and the number of bytes of the message to be sent, and adding the message to be forwarded to the real-time queue to which the message to be forwarded belongs; and sequentially reading the messages in each real-time queue in each round, wherein the reading time of each real-time queue does not exceed a preset time period, and when the messages to be forwarded in the affiliated real-time queue are read, if the residual reading time of the affiliated real-time queue is longer than the sending time of the messages to be forwarded and the number of sending rounds of the messages to be forwarded is not more than the current number of rounds, sending the messages to be forwarded. The invention can support dynamic addition/deletion of service flow in time sensitive network.
Description
Technical Field
The present invention relates to the field of time-sensitive network technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for forwarding a time-sensitive network packet.
Background
The information technology brings deep innovation of industrial automation, many new services need deterministic network communication guarantee, such as high-quality audio and video transmission, telemedicine, unmanned aerial vehicle group control and the like, the TSN (Time-Sensitive network) is widely applied, and the key for realizing the TSN technology is to guarantee low-delay reliable transmission of service data streams.
The TSN standard 802.1Qbv provides TAS, i.e. time-aware shaping, where a TAS time-aware scheduler divides data traffic into different types, allocates a specific time slot for time-sensitive critical data, and at a specified time node, all nodes in a network must preferentially ensure the passage of an important data frame, and the TAS implements precise time scheduling through a gated queue GCL (gate Control list). The method can be planned by utilizing a controller visible in the whole network, when more than thousands of services exist, the controller needs a complex algorithm to ensure that all services generate GCL gating information at outlets of all network nodes along the way, but the centralized calculation of GCL of each network outlet needs to grasp the requirements of all service flows in advance and then perform centralized calculation and solution, when a service flow needs to be newly added, all service flows need to be input into the algorithm for recalculation, and the effect of dynamically adding/deleting the flow in reality cannot be met.
Thus, there is a need for improvements and enhancements in the art.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a time-sensitive network message forwarding method, a device, a terminal and a storage medium, aiming at solving the problem that the requirement of dynamically adding/deleting streams cannot be met based on GCL control in the prior art.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
in a first aspect of the present invention, a method for forwarding a time-sensitive network packet is provided, where the method includes:
receiving a message to be forwarded, determining a target service flow corresponding to the message to be forwarded, and acquiring the byte number of the message sent by the target service flow and the committed service rate of the target service flow;
determining the number of transmission rounds and the belonging real-time queue of the message to be forwarded according to the number of bytes of the message to be forwarded and the number of bytes of the transmitted message, and adding the message to be forwarded into the belonging real-time queue;
and sequentially reading the messages in each real-time queue in each round, wherein the reading time of each real-time queue does not exceed a preset time period, and when the message to be forwarded in the affiliated real-time queue is read, if the residual reading time of the affiliated real-time queue is longer than the sending time of the message to be forwarded and the number of sending rounds of the message to be forwarded is not more than the current number of rounds, sending the message to be forwarded.
The method for forwarding the time-sensitive network message, wherein the determining of the number of transmission rounds and the real-time queue of the message to be forwarded according to the number of bytes of the message to be forwarded and the number of bytes of the sent message, comprises the following steps:
when the message to be forwarded is not the first message of the target service flow, determining the number of sending rounds and the real-time queue to which the message belongs according to a first preset formula and a second preset formula;
wherein the first preset formula is as follows:
the second preset formula is as follows:
wherein the content of the first and second substances,for the number of said transmission rounds,is the serial number of the belonging real-time queue,as the number of the current rounds,the byte number of the sent message for the target service flow,the number of bytes of the message to be forwarded is,for the said preset period of time, the time is,a committed service rate for the target traffic flow,for the initial turn number of the target traffic flow,in order to count the number of real-time queues,for the initial queue number of the target traffic stream, "/" indicates the integer division quotient and "%" indicates the integer division remainder.
The method for forwarding the time-sensitive network message, wherein the determining the number of transmission rounds of the message to be forwarded and the number of bytes of the sent message according to the number of bytes of the message to be forwarded and the number of bytes of the sent message before the real-time queue, comprises:
acquiring the round number when the first message of the target service flow is received as the initial round number of the target service flow;
and determining an initial queue of the target service flow according to the queue which is being read when the first message of the target service flow is received.
The method for forwarding the time-sensitive network message, wherein the adding the message to be forwarded to the real-time queue includes:
when the difference value between the sending round number of the message to be forwarded and the current round number is not greater than a preset threshold value, adding the message to be forwarded into the belonging real-time queue;
and when the difference value between the sending round number of the message to be forwarded and the current round number is larger than a preset threshold value, discarding the message to be forwarded.
The time-sensitive network message forwarding method further includes, after the message to be forwarded in the belonging real-time queue is read, the following steps:
if the number of the sending rounds of the message to be forwarded is larger than the current round number, placing the message to be forwarded at the tail of the real-time queue to which the message to be forwarded belongs;
and if the residual reading time of the real-time queue is less than the sending time of the message to be forwarded, reading the message in the next queue of the real-time queue.
The method for forwarding the time-sensitive network message, wherein the step of placing the message to be forwarded at the tail of the real-time queue includes:
when the isolation label exists in the affiliated real-time queue, directly placing the message to be forwarded at the tail of the affiliated real-time queue;
and when the isolation label does not exist in the real-time queue, inserting the isolation label into the real-time queue and then placing the message to be forwarded at the tail of the real-time queue.
The time-sensitive network message forwarding method, wherein reading the messages in each real-time queue in each round in sequence, includes:
when reading the message of the target real-time queue, if the target real-time queue is empty or the isolation tag is read, reading the message in the BE queue;
reading a message in a next queue of the target real-time queue when the current message read from the BE queue cannot BE sent within the remaining reading time of the target real-time queue;
wherein, the BE queue includes the message of BE service flow.
In a second aspect of the present invention, a time-sensitive network packet forwarding apparatus is provided, including:
the receiving module is used for receiving a message to be forwarded, determining a target service flow corresponding to the message to be forwarded, and acquiring the byte number of the message sent by the target service flow and the committed service rate of the target service flow;
the determining module is used for determining the number of sending rounds of the message to be forwarded and the belonging real-time queue according to the byte number of the message to be forwarded and the byte number of the sent message, and adding the message to be forwarded to the belonging real-time queue;
and the scheduling module is used for reading the messages in each real-time queue in sequence in each round, the reading time of each real-time queue does not exceed a preset time period, and when the message to be forwarded in the belonged real-time queue is read, if the residual reading time of the belonged real-time queue is greater than the sending time of the message to be forwarded and the number of sending rounds of the message to be forwarded is not greater than the current round number, the message to be forwarded is sent.
In a third aspect of the present invention, a terminal is provided, where the terminal includes a processor, and a computer-readable storage medium communicatively connected to the processor, where the computer-readable storage medium is adapted to store a plurality of instructions, and the processor is adapted to call the instructions in the computer-readable storage medium to perform the steps of implementing any one of the foregoing time-sensitive network packet forwarding methods.
In a fourth aspect of the present invention, a computer readable storage medium is provided, which stores one or more programs, which are executable by one or more processors to implement the steps of any of the above-mentioned time-sensitive network message forwarding methods.
Compared with the prior art, the invention provides a time-sensitive network message forwarding method, a device, a terminal and a storage medium, wherein the time-sensitive network message forwarding method is provided with a plurality of real-time queues, messages in each real-time queue are sequentially read in each round, after the message to be forwarded is received, the round number and the belonging real-time queue of the message to be forwarded are determined according to the number of bytes sent and the committed service rate of a target service flow corresponding to the message to be forwarded, when the message to be forwarded is read, if the residual reading time of the real-time queue to which the message to be forwarded belongs is greater than the sending time of the message to be forwarded and the sending round number of the message to be forwarded is not greater than the current round number, the message to be forwarded is sent, gate control information does not need to be set, and dynamic addition/deletion of the service flow in the time-sensitive.
Drawings
Fig. 1 is a flowchart of an embodiment of a time-sensitive network message forwarding method provided in the present invention;
fig. 2 is a schematic diagram illustrating reading information of a target service flow in an embodiment of a time-sensitive network packet forwarding method provided in the present invention;
fig. 3 is a schematic view of the flow of a packet in a network node in the embodiment of the method for forwarding a packet in a time-sensitive network provided by the present invention;
fig. 4 is a logic block diagram of reading a packet in a queue in an embodiment of a time-sensitive network packet forwarding method provided in the present invention;
fig. 5 is a schematic structural diagram of an embodiment of a time-sensitive network packet forwarding apparatus provided in the present invention;
fig. 6 is a schematic diagram illustrating the principle of an embodiment of the terminal provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The time-sensitive network message forwarding method provided by the invention can be executed by any network node in the time-sensitive network.
Example one
As shown in fig. 1, an embodiment of the method for forwarding a time-sensitive network packet includes the steps of:
s100, receiving a message to be forwarded, determining a target service flow corresponding to the message to be forwarded, and acquiring the byte number of the message sent by the target service flow and the promised service rate of the target service flow.
After receiving the message to be forwarded, the node determines a target service flow corresponding to the message to be forwarded, where in this embodiment, the target service flow is a real-time service flow, that is, a flow having a forwarding delay requirement. Then, the number of bytes of the message sent by the service flow of the message to be forwarded and the committed service rate of the target service flow are searched, specifically, the number of bytes of the message sent by the target service flow and the committed service rate of the target service flow are searched, which may be implemented by a flow information table, specifically, information of all real-time flows in the current network is recorded in the flow information table, as shown in fig. 2, an index table may be established by using a 2-left hash algorithm, and then the flow information table is searched from the index table. The 2-left Hash index table comprises two Hash tables with the same size and respectively called an A table and a B table, after the message to be forwarded is received, a keyword, namely f-key, of the message is extracted, the f-key is respectively Hash to two index positions, namely the A table and the B table, through two Hash functions, M Hash barrels are established at each index position, each Hash barrel stores a compression value pocket corresponding to the f-key and an index pointing to the information retention table, when one f-key is stored, the two index positions are combined, the position occupying less Hash barrels is selected, if the two index positions occupy the same position, the f-key is always stored in the A table, and theories and experiences show that the size of the Hash table A + B is larger than 1.5N, and N is the number of streams, so that a good hash effect can be obtained. Considering that it may still happen that two index positions are completely occupied, a very small list is set to apply extreme hash collisions, and this small list size may be N/20 in general. For the case that a single node is required to support 2K service flows, the space required by the flow information table structure is about 450B, and each message only needs three times of storage access, so that the method is easy to implement in a hardware chip. Of course, it can be understood that the implementation of the flow information table is merely illustrated here, and a person skilled in the art may select another implementation of the flow information table so that after receiving the packet to be forwarded, the node can query the relevant information of the target service flow corresponding to the packet to be forwarded.
If the message to BE forwarded is not a message of a real-time service flow, it is indicated that the message to BE forwarded is a message of a BE (Best Effort) service flow, and the message to BE forwarded is directly sent to a BE queue.
S200, determining the number of sending rounds and the real-time queue of the message to be forwarded according to the number of bytes of the message to be forwarded and the number of bytes of the sent message, and adding the message to be forwarded to the real-time queue.
In this embodiment, a plurality of real-time queues (e.g., Q1, Q2, and Q3 in fig. 3) are set in a node, a packet of each real-time service flow is added to one of the real-time queues, the node periodically reads the packets in each real-time queue, sequentially reads the packets in each real-time queue in each round and records the number of rounds, the number of rounds is increased by one after each round is finished, and whether the packet needs to be sent currently is determined according to the number of sending rounds of the read packet and the current number of rounds.
It should be noted that, in this embodiment, the number of transmission rounds of the message to be forwarded is not the number of rounds of the actual transmission of the message to be forwarded, but is an expected value, which may not be consistent with the number of rounds of the actual transmission of the message to be forwarded, which will be described in detail later.
Specifically, the determining the number of transmission rounds of the packet to be forwarded and the real-time queue to which the packet to be forwarded belongs according to the number of bytes of the packet to be forwarded and the number of bytes of the transmitted packet includes:
when the message to be forwarded is not the first message of the target service flow, determining the number of sending rounds and the real-time queue to which the message belongs according to a first preset formula and a second preset formula;
wherein the first preset formula is as follows:
the second preset formula is as follows:
wherein the content of the first and second substances,for the number of said transmission rounds,is the serial number of the belonging real-time queue,as the number of the current rounds,the byte number of the sent message for the target service flow,the number of bytes of the message to be forwarded is,for the said preset period of time, the time is,a committed service rate for the target traffic flow,for the initial turn number of the target traffic flow,in order to count the number of real-time queues,for the initial queue number of the target traffic stream, "/" indicates the integer division quotient and "%" indicates the integer division remainder.
And the initial queue sequence number of the target service flow and the initial round number of the target service flow are the sending round number of the first message of the target service flow and the belonging real-time queue.
Before determining the number of transmission rounds of the message to be forwarded and the real-time queue to which the message to be forwarded belongs according to the number of bytes of the message to be forwarded and the number of bytes of the sent message, the method comprises the following steps:
acquiring the round number when the first message of the target service flow is received as the initial round number of the target service flow;
and determining an initial queue of the target service flow according to the queue which is being read when the first message of the target service flow is received.
The first message of the target service flow is the first received message of the target service flow by the node, when the node receives the first message of the target service flow, the current round number is used as the initial round number of the target service flow, namely the initial round numberIn a possible implementation manner, the initial queue of the target service flow is determined based on a principle that a header message of the target service flow can be forwarded as soon as possible, that is, whether adding the header message of the target service flow to the read queue when determining that the header message of the target service flow is received can be implemented to be sent in a current reading period of the read queue, specifically, the read queue can be used as the initial queue of the target service flow according to the read queueThe read time of the column and the byte length of the first message of the target service flow are determined, if yes, the first message of the target service flow is added into the currently read queue, namely, the currently read queue is used as the initial queue of the target service flowIf not, adding the head message of the target service flow into the next queue of the reading queue, namely taking the next queue of the reading queue as the initial queue of the target service flow。
As shown in fig. 3, after the number of sending rounds of the to-be-forwarded packet and the belonging real-time queue are determined, the to-be-forwarded packet is added to the belonging real-time queue.
In practice, the rate of the low-latency real-time service flow fluctuates, there is a burst, and when the target service flow has a burst exceeding a tolerance, the burst packet should be discarded, so in this embodiment, the adding the packet to be forwarded to the belonging real-time queue includes:
when the difference value between the sending round number of the message to be forwarded and the current round number is not greater than a preset threshold value, adding the message to be forwarded into the belonging real-time queue;
and when the difference value between the sending round number of the message to be forwarded and the current round number is larger than a preset threshold value, discarding the message to be forwarded.
That is, before adding the message to be forwarded to the real-time queue, calculating a difference between the number of transmission rounds of the message to be forwarded and the current round number:and if the difference is larger than the preset threshold value, indicating that the target service flow has a burst exceeding the tolerance, and discarding the message to be forwarded. The preset threshold may be determined according to the size of the RAM space available for packet forwarding in the node, for example, the preset threshold may be determined according to the size of the RAM space available for packet forwarding in the nodeTaking values between 3 and 8.
Referring to fig. 1 again, the method for forwarding a time-sensitive network packet provided in this embodiment further includes the steps of:
s300, sequentially reading the messages in each real-time queue in each round, wherein the reading time of each real-time queue does not exceed a preset time period, and when the message to be forwarded in the affiliated real-time queue is read, if the residual reading time of the affiliated real-time queue is longer than the sending time of the message to be forwarded and the number of sending rounds of the message to be forwarded is not more than the current round number, sending the message to be forwarded.
It should be noted that, although the sequence number of the step of sequentially reading the messages in each real-time queue in each round is after receiving the step sequence number of the message to be forwarded in the present description, the step of sequentially reading the messages in each real-time queue in each round in the present invention is not limited to be performed after receiving the message to be forwarded, but is repeatedly performed all the time when the node starts to execute the time-sensitive network message provided in this embodiment.
As shown in fig. 3, assuming that three real-time queues Q1, Q2, and Q3 are set in the node, in each round, the node reads the packet in the queue Q1 first, then reads the packet in the queue Q2, and the packet in the queue Q3, and the reading time of each queue does not exceed a preset time period, and completes one round, and then starts a new round, and the number of the back rounds is increased by one each time. The preset time period is selected based on the highest rate service of the time-sensitive network service or based on the link bandwidth of the egress line, for example, if the highest rate service or the egress line bandwidth is 10Gbps, considering that at least one longest packet (1500 bytes) can be output each time the queue is read, the preset time period is 1500 × 8/10Gbps =1.2 microseconds.
When reading the real-time queue, when reading the message to be forwarded, if the remaining reading time of the real-time queue is longer than the sending time of the message to be forwarded, determining whether the number of sending rounds of the message to be forwarded is largeAnd if the current round number is not greater than the current round number, sending the message to be forwarded. The number of transmission rounds of the messages in the queue may be obtained by adding the messages to the queueAnd adding the data into the header of the message, so that the number of transmission rounds of the message can be acquired when the message is read. And starting timing when the messages in the belonging real-time queue are read, wherein the total reading time of the belonging real-time queue does not exceed a preset time period every time, namely, the residual reading time of the belonging real-time queue is the preset time period minus the reading time of the belonging real-time queue, assuming that the current time is T, the time for starting reading the belonging real-time queue in the current round is T0, and the preset time period is T, the residual reading time of the belonging real-time queue is T- (T0-T).
After the message to be forwarded is sent out, the next message in the belonging real-time queue is continuously read until the sending time of the message read from the belonging real-time queue is greater than the remaining reading time of the belonging real-time queue, or the reading time of the belonging real-time queue reaches the preset time period, or the message of the belonging real-time queue is empty or an isolation tag is read, which will be explained later.
As can be seen from the above description, the method for forwarding a time-sensitive network packet provided in this embodiment can implement independent scheduling for each service flow, and the packet forwarding time of each flow is scheduled according to the committed rate of the flow, so that a wider flow rate range can be covered, and the flow exceeding the committed rate can be shaped in time. Even if only one stream exists on the link, the message forwarding does not exceed the maximum committed rate of the stream, so that the stream message is not transmitted more quickly on the link due to more sufficient bandwidth so as to squeeze the bandwidth, and non-working monitoring (bandwidth protection in non-working period) is realized. The method for forwarding a packet in a time-sensitive network provided by this embodiment may be independently executed by each node in the time-sensitive network, so that each node determines the forwarding order of the packet according to the committed rate of the traffic flow and the number of bytes of the transmitted packet, and the packet catch does not continuously accumulate jitter along the route.
Further, after reading the packet to be forwarded, the method further includes:
if the number of the sending rounds of the message to be forwarded is larger than the current round number, placing the message to be forwarded at the tail of the real-time queue to which the message to be forwarded belongs;
and if the residual reading time of the real-time queue is less than the sending time of the message to be forwarded, reading the message in the next queue of the real-time queue.
In this embodiment, in order to increase adaptation to a service burst and prevent a large number of burst service packets from being discarded, a packet with a number of transmission rounds greater than the current number of transmission rounds in a queue is wrapped around to the tail of the queue, and since reading of the packet in the queue is continuous when the switching queue is not satisfied, after the packet is wrapped around to the tail of the queue, if corresponding setting is not performed, the packet is repeatedly read and determined, which wastes resources, and therefore, in this embodiment, an isolation tag is provided, and specifically, the step of placing the packet to be forwarded at the tail of the real-time queue includes:
when the isolation label exists in the affiliated real-time queue, directly placing the message to be forwarded at the tail of the affiliated real-time queue;
and when the isolation label does not exist in the real-time queue, inserting the isolation label into the real-time queue and then placing the message to be forwarded at the tail of the real-time queue.
At most, there is only one isolation tag in one queue, and as long as the isolation tag is read, it indicates that the message after the isolation tag is a message that has been read and is determined not to BE sent in the period, at this time, the message in the BE queue can BE read, specifically, the reading of the messages in each real-time queue in each round in sequence includes:
when reading the message of the target real-time queue, if the target real-time queue is empty or the isolation tag is read, reading the message in the BE queue;
reading a message in a next queue of the target real-time queue when the current message read from the BE queue cannot BE sent within the remaining reading time of the target real-time queue;
wherein, the BE queue includes the message of BE service flow.
For each real-time queue, if the queue is empty, that is, there is no message to BE sent in the queue at present, when the isolation tag is read, the message after the isolation tag is a message that does not need to BE sent in the period, so when the queue is empty or the isolation tag is read from the queue, the node starts to read the message in the BE queue.
As shown in fig. 4, the specific steps of reading the packet in the queue each time may be summarized as follows:
1. when a read cycle begins, the insert tag enable flag F is first set to 1. And inserting a tag permission mark F, wherein the tag permission mark is used for controlling that only 1 isolation tag can be inserted into one queue in one scheduling period. Each queue has a corresponding F tag.
2. And reading the message from the queue, and simultaneously acquiring the size (size) of the message and the r value of the message header.
3. If the queue is empty, or if an isolation tag is read, then execute 4; otherwise, 5 is executed.
4. Pop the isolation tag and read the BE queue. And 9, turning.
5. And judging whether the current message can be sent in the current time period, if so, executing 6, and otherwise, executing 9.
6. Judging whether R is larger than the R value, if R is not larger than R, sending a message, and then switching to 2 to process the next message; otherwise go to 7.
7. And if the F =1, inserting an isolation tag to the tail of the queue, juxtaposing the F =0, and then turning to 8. If F =0, go directly to 8.
8. And (4) wrapping the message to the tail of the queue, and then turning to 2 to process the next message.
9. Let Q = Q +1, if Q is the last queue, then Q =0 points to the 1 st queue. When one round of queue reading is completed, R = R + 1.
10. Waiting for the end of the cycle. After the period time, the next queue will be read, and the above-mentioned process 1-10 will be repeated.
In summary, this embodiment provides a method for forwarding a time-sensitive network packet, where a plurality of real-time queues are set, and each round reads packets in each real-time queue in sequence, and after receiving a packet to be forwarded, determines the round number and the belonging real-time queue of the packet to be forwarded according to the number of bytes sent and the committed service rate of a target service flow corresponding to the packet to be forwarded, and when reading the packet to be forwarded, if the remaining reading time of the real-time queue to which the packet to be forwarded belongs is greater than the sending time of the packet to be forwarded and the number of sending rounds of the packet to be forwarded is not greater than the current round number, sends the packet to be forwarded, without setting gating information, and can support dynamic addition/deletion of service flows in a time-sensitive network.
It should be understood that, although the steps in the flowcharts shown in the figures of the present specification are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Example two
Based on the foregoing embodiment, the present invention also provides a time-sensitive network packet forwarding apparatus, as shown in fig. 5, where the time-sensitive network packet forwarding apparatus includes:
a receiving module, configured to receive a packet to be forwarded, determine a target service flow corresponding to the packet to be forwarded, and obtain the number of bytes of the packet sent by the target service flow and a committed service rate of the target service flow, which is specifically described in embodiment one;
a determining module, configured to determine, according to the number of bytes of the packet to be forwarded and the number of bytes of the sent packet, the number of sending rounds of the packet to be forwarded and an associated real-time queue, and add the packet to be forwarded to the associated real-time queue, which is specifically described in embodiment one;
the scheduling module is configured to sequentially read the messages in each real-time queue in each round, where the reading time of each real-time queue does not exceed a preset time period, and when the message to be forwarded in the belonging real-time queue is read, if the remaining reading time of the belonging real-time queue is greater than the sending time of the message to be forwarded and the number of sending rounds of the message to be forwarded is not greater than the current round number, send the message to be forwarded, specifically as described in embodiment one.
EXAMPLE III
Based on the above embodiments, the present invention further provides a terminal, as shown in fig. 6, where the terminal includes a processor 10 and a memory 20. Fig. 6 shows only some of the components of the terminal, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 20 may in some embodiments be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the terminal. The memory 20 is used for storing application software installed in the terminal and various data. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 has stored thereon a time-sensitive network message forwarding program 30, and the time-sensitive network message forwarding program 30 is executable by the processor 10 to implement the time-sensitive network message forwarding method of the present application.
The processor 10 may be a Central Processing Unit (CPU), a microprocessor or other chip in some embodiments, and is configured to run program codes stored in the memory 20 or process data, such as executing the time-sensitive network message forwarding method.
In one embodiment, the following steps are implemented when the processor 10 executes the time-sensitive network message forwarding program 30 in the memory 20:
receiving a message to be forwarded, determining a target service flow corresponding to the message to be forwarded, and acquiring the byte number of the message sent by the target service flow and the committed service rate of the target service flow;
determining the number of transmission rounds and the belonging real-time queue of the message to be forwarded according to the number of bytes of the message to be forwarded and the number of bytes of the transmitted message, and adding the message to be forwarded into the belonging real-time queue;
and sequentially reading the messages in each real-time queue in each round, wherein the reading time of each real-time queue does not exceed a preset time period, and when the message to be forwarded in the affiliated real-time queue is read, if the residual reading time of the affiliated real-time queue is longer than the sending time of the message to be forwarded and the number of sending rounds of the message to be forwarded is not more than the current number of rounds, sending the message to be forwarded.
Wherein, the determining the number of transmission rounds of the message to be forwarded and the real-time queue thereof according to the number of bytes of the message to be forwarded and the number of bytes of the sent message comprises:
when the message to be forwarded is not the first message of the target service flow, determining the number of sending rounds and the real-time queue to which the message belongs according to a first preset formula and a second preset formula;
wherein the first preset formula is as follows:
the second preset formula is as follows:
wherein the content of the first and second substances,for the number of said transmission rounds,is the serial number of the belonging real-time queue,as the number of the current rounds,the byte number of the sent message for the target service flow,the number of bytes of the message to be forwarded is,for the said preset period of time, the time is,a committed service rate for the target traffic flow,for the initial turn number of the target traffic flow,in order to count the number of real-time queues,for the initial queue number of the target traffic stream, "/" indicates the integer division quotient and "%" indicates the integer division remainder.
Before determining the number of transmission rounds of the message to be forwarded and the number of bytes of the sent message according to the number of bytes of the message to be forwarded and the number of bytes of the sent message, the method comprises the following steps:
acquiring the round number when the first message of the target service flow is received as the initial round number of the target service flow;
and determining an initial queue of the target service flow according to the queue which is being read when the first message of the target service flow is received.
Adding the message to be forwarded to the real-time queue, including:
when the difference value between the sending round number of the message to be forwarded and the current round number is not greater than a preset threshold value, adding the message to be forwarded into the belonging real-time queue;
and when the difference value between the sending round number of the message to be forwarded and the current round number is larger than a preset threshold value, discarding the message to be forwarded.
After reading the message to be forwarded in the real-time queue, the method further includes:
if the number of the sending rounds of the message to be forwarded is larger than the current round number, placing the message to be forwarded at the tail of the real-time queue to which the message to be forwarded belongs;
and if the residual reading time of the real-time queue is less than the sending time of the message to be forwarded, reading the message in the next queue of the real-time queue.
Wherein, the placing the message to be forwarded at the tail of the real-time queue includes:
when the isolation label exists in the affiliated real-time queue, directly placing the message to be forwarded at the tail of the affiliated real-time queue;
and when the isolation label does not exist in the real-time queue, inserting the isolation label into the real-time queue and then placing the message to be forwarded at the tail of the real-time queue.
Wherein, the reading the messages in each real-time queue in each round in turn comprises:
when reading the message of the target real-time queue, if the target real-time queue is empty or the isolation tag is read, reading the message in the BE queue;
reading a message in a next queue of the target real-time queue when the current message read from the BE queue cannot BE sent within the remaining reading time of the target real-time queue;
wherein, the BE queue includes the message of BE service flow.
Example four
The present invention also provides a computer readable storage medium having stored thereon one or more programs, which are executable by one or more processors, to implement the steps of the time-sensitive network message forwarding method as described above.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for forwarding a time-sensitive network message, the method comprising:
receiving a message to be forwarded, determining a target service flow corresponding to the message to be forwarded, and acquiring the byte number of the message sent by the target service flow and the committed service rate of the target service flow;
determining the number of transmission rounds and the belonging real-time queue of the message to be forwarded according to the number of bytes of the message to be forwarded and the number of bytes of the transmitted message, and adding the message to be forwarded into the belonging real-time queue;
and sequentially reading the messages in each real-time queue in each round, wherein the reading time of each real-time queue does not exceed a preset time period, and when the message to be forwarded in the affiliated real-time queue is read, if the residual reading time of the affiliated real-time queue is longer than the sending time of the message to be forwarded and the number of sending rounds of the message to be forwarded is not more than the current number of rounds, sending the message to be forwarded.
2. The method according to claim 1, wherein the determining the number of transmission rounds and the real-time queue of the packet to be forwarded according to the number of bytes of the packet to be forwarded and the number of bytes of the transmitted packet comprises:
when the message to be forwarded is not the first message of the target service flow, determining the number of sending rounds and the real-time queue to which the message belongs according to a first preset formula and a second preset formula;
wherein the first preset formula is as follows:
the second preset formula is as follows:
wherein the content of the first and second substances,for the number of said transmission rounds,is the serial number of the belonging real-time queue,as the number of the current rounds,the byte number of the sent message for the target service flow,the number of bytes of the message to be forwarded is,for the said preset period of time, the time is,a committed service rate for the target traffic flow,for the initial turn number of the target traffic flow,in order to count the number of real-time queues,for the initial queue number of the target traffic stream, "/" indicates the integer division quotient and "%" indicates the integer division remainder.
3. The method according to claim 2, wherein the determining the number of transmission rounds of the packet to be forwarded and the number of bytes of the packet to be transmitted before the real-time queue includes:
acquiring the round number when the first message of the target service flow is received as the initial round number of the target service flow;
and determining an initial queue of the target service flow according to the queue which is being read when the first message of the target service flow is received.
4. The method according to claim 1, wherein the adding the packet to be forwarded to the real-time queue comprises:
when the difference value between the sending round number of the message to be forwarded and the current round number is not greater than a preset threshold value, adding the message to be forwarded into the belonging real-time queue;
and when the difference value between the sending round number of the message to be forwarded and the current round number is larger than a preset threshold value, discarding the message to be forwarded.
5. The method according to claim 1, wherein after reading the message to be forwarded in the real-time queue, the method further comprises:
if the number of the sending rounds of the message to be forwarded is larger than the current round number, placing the message to be forwarded at the tail of the real-time queue to which the message to be forwarded belongs;
and if the residual reading time of the real-time queue is less than the sending time of the message to be forwarded, reading the message in the next queue of the real-time queue.
6. The method according to claim 5, wherein the placing the packet to be forwarded at the tail of the real-time queue comprises:
when the isolation label exists in the affiliated real-time queue, directly placing the message to be forwarded at the tail of the affiliated real-time queue;
and when the isolation label does not exist in the real-time queue, inserting the isolation label into the real-time queue and then placing the message to be forwarded at the tail of the real-time queue.
7. The method according to claim 6, wherein the reading the packets in each real-time queue in turn in each round comprises:
when reading the message of the target real-time queue, if the target real-time queue is empty or the isolation tag is read, reading the message in the BE queue;
reading a message in a next queue of the target real-time queue when the current message read from the BE queue cannot BE sent within the remaining reading time of the target real-time queue;
wherein, the BE queue includes the message of BE service flow.
8. A time-sensitive network packet forwarding device, comprising:
the receiving module is used for receiving a message to be forwarded, determining a target service flow corresponding to the message to be forwarded, and acquiring the byte number of the message sent by the target service flow and the committed service rate of the target service flow;
the determining module is used for determining the number of sending rounds of the message to be forwarded and the belonging real-time queue according to the byte number of the message to be forwarded and the byte number of the sent message, and adding the message to be forwarded to the belonging real-time queue;
and the scheduling module is used for reading the messages in each real-time queue in sequence in each round, the reading time of each real-time queue does not exceed a preset time period, and when the message to be forwarded in the belonged real-time queue is read, if the residual reading time of the belonged real-time queue is greater than the sending time of the message to be forwarded and the number of sending rounds of the message to be forwarded is not greater than the current round number, the message to be forwarded is sent.
9. A terminal, characterized in that the terminal comprises: a processor, a computer readable storage medium communicatively coupled to the processor, the computer readable storage medium adapted to store a plurality of instructions, the processor adapted to invoke the instructions in the computer readable storage medium to perform the steps of implementing the time-sensitive network packet forwarding method of any of claims 1-7.
10. A computer-readable storage medium, having one or more programs stored thereon, the one or more programs being executable by one or more processors to perform the steps of the method for time-sensitive network packet forwarding according to any of claims 1-7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110429224.4A CN112995064B (en) | 2021-04-21 | 2021-04-21 | Time-sensitive network message forwarding method, device, terminal and storage medium |
PCT/CN2021/099189 WO2022222242A1 (en) | 2021-04-21 | 2021-06-09 | Method and apparatus for forwarding time-sensitive networking message, terminal, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110429224.4A CN112995064B (en) | 2021-04-21 | 2021-04-21 | Time-sensitive network message forwarding method, device, terminal and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112995064A true CN112995064A (en) | 2021-06-18 |
CN112995064B CN112995064B (en) | 2021-07-27 |
Family
ID=76341505
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110429224.4A Active CN112995064B (en) | 2021-04-21 | 2021-04-21 | Time-sensitive network message forwarding method, device, terminal and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112995064B (en) |
WO (1) | WO2022222242A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023273788A1 (en) * | 2021-06-30 | 2023-01-05 | 华为技术有限公司 | Data processing method and related apparatus |
WO2023123104A1 (en) * | 2021-12-29 | 2023-07-06 | 新华三技术有限公司 | Message transmission method and network device |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117579577A (en) * | 2024-01-17 | 2024-02-20 | 北京智芯微电子科技有限公司 | Data frame forwarding method and device based on time sensitive network and computer equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101964758A (en) * | 2010-11-05 | 2011-02-02 | 南京邮电大学 | Differentiated service-based queue scheduling method |
CN101964745A (en) * | 2010-06-12 | 2011-02-02 | 福建星网锐捷网络有限公司 | Network forwarding equipment and message forwarding method thereof |
CN111327540A (en) * | 2020-02-25 | 2020-06-23 | 重庆邮电大学 | Deterministic scheduling method for industrial time-sensitive network data |
US10754816B2 (en) * | 2018-12-21 | 2020-08-25 | Intel Corporation | Time sensitive networking device |
WO2020200405A1 (en) * | 2019-03-29 | 2020-10-08 | Huawei Technologies Co., Ltd. | Switch device, control device and corresponding methods for enhanced schedulability and throughput on a tsn network |
CN112202685A (en) * | 2017-11-06 | 2021-01-08 | 华为技术有限公司 | Message forwarding method, forwarding equipment and network equipment |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110166380B (en) * | 2018-02-14 | 2022-08-19 | 华为技术有限公司 | Method for scheduling message, first network device and computer readable storage medium |
CN112449366B (en) * | 2019-08-30 | 2023-03-17 | 腾讯科技(深圳)有限公司 | Message forwarding method and device, wireless AP equipment and storage medium |
CN112491493B (en) * | 2020-11-23 | 2022-12-13 | 鹏城实验室 | Time slot allocation method and message forwarding method for time-sensitive network |
-
2021
- 2021-04-21 CN CN202110429224.4A patent/CN112995064B/en active Active
- 2021-06-09 WO PCT/CN2021/099189 patent/WO2022222242A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101964745A (en) * | 2010-06-12 | 2011-02-02 | 福建星网锐捷网络有限公司 | Network forwarding equipment and message forwarding method thereof |
CN101964758A (en) * | 2010-11-05 | 2011-02-02 | 南京邮电大学 | Differentiated service-based queue scheduling method |
CN112202685A (en) * | 2017-11-06 | 2021-01-08 | 华为技术有限公司 | Message forwarding method, forwarding equipment and network equipment |
US10754816B2 (en) * | 2018-12-21 | 2020-08-25 | Intel Corporation | Time sensitive networking device |
WO2020200405A1 (en) * | 2019-03-29 | 2020-10-08 | Huawei Technologies Co., Ltd. | Switch device, control device and corresponding methods for enhanced schedulability and throughput on a tsn network |
CN111327540A (en) * | 2020-02-25 | 2020-06-23 | 重庆邮电大学 | Deterministic scheduling method for industrial time-sensitive network data |
Non-Patent Citations (1)
Title |
---|
刘浩林: "面向智能生产线的TSN安全协议栈研究与应用", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023273788A1 (en) * | 2021-06-30 | 2023-01-05 | 华为技术有限公司 | Data processing method and related apparatus |
WO2023123104A1 (en) * | 2021-12-29 | 2023-07-06 | 新华三技术有限公司 | Message transmission method and network device |
Also Published As
Publication number | Publication date |
---|---|
WO2022222242A1 (en) | 2022-10-27 |
CN112995064B (en) | 2021-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112995064B (en) | Time-sensitive network message forwarding method, device, terminal and storage medium | |
KR102317523B1 (en) | Packet control method and network device | |
TWI713329B (en) | Multiplexing method for scheduled frames in an ethernet switch, network system, network processing device, and computer program product | |
CN113645149B (en) | Method for realizing time-sensitive network gating list | |
US8930593B2 (en) | Method for setting parameters and determining latency in a chained device system | |
KR100918327B1 (en) | Method and apparatus for generating a header in a communication network | |
US8806089B2 (en) | Programmable queuing | |
CN103222242B (en) | The dynamic flow redistribution of blocking for avoiding line end | |
US8711752B2 (en) | Distributed multicast packet replication with centralized quality of service | |
US7529224B2 (en) | Scheduler, network processor, and methods for weighted best effort scheduling | |
EP2306322A1 (en) | Method for processing data packets in flow-aware network nodes | |
US9569291B1 (en) | Systems and methods for inter-process messaging | |
EP1471699B1 (en) | Frame processing | |
EP2919426B1 (en) | Concurrent hashes and sub-hashes on data streams | |
JP2020507245A (en) | Method, entity and program for transmitting communication signal frame | |
US9838500B1 (en) | Network device and method for packet processing | |
US10862809B2 (en) | Modifying carrier packets based on information in tunneled packets | |
CN111163058B (en) | DPDK data encryption processing method, device and network equipment | |
US20150304227A1 (en) | Queue Management Method and Apparatus | |
US20060245443A1 (en) | Systems and methods for rate-limited weighted best effort scheduling | |
US20060187963A1 (en) | Method for sharing single data buffer by several packets | |
CN116955247A (en) | Cache descriptor management device and method, medium and chip thereof | |
CN115086239B (en) | Shared TSN shaping scheduling device | |
US7069397B2 (en) | Stream based memory manager with function specific hardware logic for accessing data as a stream in memory | |
CN106790320A (en) | A kind of method that multi-application inter-system data is pushed |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |