1. Introduction
It has been globally recognized that the construction of an intelligent industrial Internet will significantly enhance society as a whole. One key enabling technology is ensuring smooth production pipeline operations as machines are interconnected akin to the Internet. Deterministic design is a fundamental requirement where data must be sent, received, and operated on in a timely manner without ambiguity, including for both hard and soft real-time applications such as motion control, equipment manufacturing, and self-driving.
Traditional industrial networks separately consider communication and computing, with a focus on real-time execution of task scheduling on the CPU (central processing unit) and treat the network as a transparent substrate. The upper layer logic entrusts all communication support to the best effort (BE) network after establishing coarse time precision. Logic is highly reliant on communication for the correctness of the logic, with a few mistakes. For example, consistency or Byzantine problems are the primary focus of applications that relax network time precision to a second or minute level to ensure such correctness.
Additionally, the lack of semantic abstraction in the substrate layer can hinder fine-grained time control (microseconds to milliseconds) due to queuing strategies. For example, regardless of how many new versions of TCP (transmission control protocol), such as New Nano, Cubic, and BBR New Nano, Cubic, and BBR are commonly used in TCP, the classic three-way handshake is always employed. All entities engage in non-cooperative competition, with the whole network fluctuating around a Nash equilibrium [
1]. Therefore, integrated consideration of communication and computing has become an important candidate for achieving microsecond to millisecond precision control.
With regard to communication, TSN [
2,
3,
4] strives to establish a deep interconnection between the industrial network and the current Internet. The latter’s ecosystem, high bandwidth, and generality bring endless opportunities for the former’s development. One benefit of TSN is the flexibility it offers in terms of business support, as it can accommodate both real-time and BE messages. Another benefit is the high bandwidth capacity that allows for a wider variety of traffic. For example, autonomous vehicles require action after the computer vision process involving video sampled by the camera, which generates traffic several orders of magnitude higher than traditional industrial messages, i.e., CAN [
5], Flexray [
6], Lin [
7], EtherCat, and TTE (time-triggered ethernet) [
8] (each message is approximately 30∼500 bytes). Currently, the main challenge in applying TSN is the complex scheduling mechanisms [
9], including the fundamental standard 802.1 Qbv, which attempts to design the gate-control list of each switch to meet strict delay and jitter requirements.
Turning to computing, real-time task scheduling is a historically mature topic [
10,
11,
12]. RMS (rate monotonic scheduling), EDF (earliest deadline first), LLF (least slack first), and other classic algorithms have been integrated into real-time operating systems (RTOS), which can provide excellent real-time computing capabilities. However, there is still a gap between task scheduling and TSN when combining them for end-to-end scheduling. Although Craciunas et al. [
13] began to combine tasks with TTE based on the assumption that one time-triggered frame is assigned to one task and shares the same period, and it can achieve excellent end-to-end delay and jitter control, it has two disadvantages. Firstly, it inherits the low bandwidth utilization of TTE; secondly, its frame-based programming model based on SMT (satisfy module theory) hardly supports large traffic tasks, where the NP-hard computation cost of SMT makes it hardly acceptable when the number of frames is larger than 10,000. Therefore, based on a similar idea, this paper proposes replacing TTE with TSN and proposes joint scheduling of both time-sensitive tasks and the network. Moreover, Refs. [
14,
15,
16,
17] have carried out corresponding work in joint task and network scheduling. One class of methods is based on flow control strategies, adjusting the network traffic to meet task requirements. Another type of method focuses on task scheduling, selecting the optimal execution order based on task characteristics and network status. There are also methods that combine flow control and task scheduling strategies to achieve more comprehensive optimization. However, these kinds of ‘jointing’ take more attention with respect to the task and, we must consider how to adjust the network to satisfy the requirement. In our work, we can elevate the scheduling granularity of TSN data transmission from the frame level to the flow level, which can establish a one-to-one correspondence between the time control granularity of the task level and the granularity of network transmission, and has potential cross-layer transmission capabilities
Our main contributions are as follows.
We propose a novel periodic flow split theory and method that enables the mixed transmission of both periodic large and small flows while achieving near-100% bandwidth utilization with appropriate jitter control.
We introduce a flow-based SMT programming model and enumerate the corresponding first-order logical constraints. The scheduling unit is flow-level, while the identification unit is frame-level, enabling the support of larger-scale SMT solutions.
We map the transmission data of tasks into flow-level or split-flow-level gates. This approach allows tasks to label their data and track them in each device, potentially providing a new paradigm for application design.
The remainder of this paper is organized as follows:
Section 2 provides the background information and definitions of key terminology.
Section 3 presents the flow-level scheduling model.
Section 4 formulates the corresponding constraints.
Section 6 demonstrates the experiment results and discussion of the proposed model.
Section 7 summarizes the related works. Finally,
Section 8 concludes this work and outlines future work.
2. System Model and Terminology
2.1. Joint Programming Model
Figure 1 depicts the logical model, where the upper layer contains real-time computing nodes and the lower layer contains TSN switch nodes. The topological structure is abstracted as a directed graph
, where the vertex set
,
N represents the set of computing nodes,
S is the set of switch nodes and
E is the set of directed links connecting nodes in
V. Each link is denoted by pair of nodes
, indicating the direction from
to
.
denote the flow path composed of the ordered sequence of links between
and
. For instance,
For simplicity, it can also be represented as an ordered sequence of nodes,
Let denote the set of all the paths that have data transmission.
2.2. Time Sensitive Task and Flow Formulation
Assume all the tasks are generated by the computing nodes, we define as the set of live tasks at time t; when changes, the scheduling strategy must also be adjusted. Each task has a life cycle characterized by the start time and end time . In the majority of this paper, we focus on a relatively stable environment where remains constant in a long term, and can be simply denoted as .
Real-time systems typically involve periodic and aperiodic tasks. Aperiodic tasks can be classified into deadline-constrained and best effort (BE) tasks. The key to optimal scheduling lies in periodic and deadline-constrained aperiodic task scheduling. Therefore, our focus is on how to optimally schedule these types of tasks. We use and to denote the set of periodic task and deadline-constraint aperiodic tasks, respectively. For , the tuple denotes the offset in each period, WCET (worst-case execution time), deadline and period. This 4-ary tuple can also represent the characteristics of tasks in and BE tasks. For , we set .
represents the task set executed on node , which includes local tasks , input tasks and output tasks . Each task in generates a data flow sent to other nodes, and denotes the flow from node to node . Let denote the flow set on . There is a bijective relationship between the task and flow, represented by , such that the flow set on node is and flow generated by task is . We inherit the 4-ary tuple to denote the offset in each period, the transmission time, deadline, and period, where . Generally, because the flow deadline has little impact on the task deadline and every flow can finish transmission within its period to avoid piling up. Let and denote the flow set and the flow on link , respectively. Note that in our figures and theoretical descriptions, we use and instead of and for simplicity; if there is any confusion, please treat the two as equivalent. Additionally, we stipulate that all periods within the same set are distinct because all flows with the same period can be bundled into one flow for scheduling.
Let denotes the set of destination nodes that node will send data flow to and denotes the set of source nodes that node will receive data flow from. Our objective is that every task T can be executed in real-time smoothly and can be transmitted through the network deterministically and timely. The core question is how to schedule all the tasks and flows properly. Owing to the different requirements, we should first judge the schedulability and then give a related schedule strategy. We have the following definitions.
Definition 1 (task schedulable).
If task can be executed in node within the constraints, we say T is task schedulable in .
Definition 2 (flow schedulable).
If flow can obtain within the constraints, we say is flow schedulable.
Definition 3 (end-to-end schedulable).
For node pair (, ), we say task T can be end-to-end schedulable if T and is task schedulable in and , respectively, and is flow schedulable.
Definition 4 (computing node schedulable).
If are task schedule, we say the node is computing node schedulable.
Definition 5 (holistic schedulable).
The system is holistically schedulable if are computing node schedulable and are end-to-end schedulable.
According to the definition, our target is to design a holistic schedulable system. However, unlike the loosely coupled traditional Internet, many scenarios in the industrial Internet are tightly coupled. Owing to the task growth and resource limit, maximizing utilization is a big challenge. We first pay more attention to the real-time transmission and later make a joint optimization by combining both of them by building a connection between the time of task scheduling and the network.
3. Flow-Based Deterministic Scheduling
In the traditional industrial scenario, the instruction set of the servo/PLC (programming logic controller) has complete semantics, and one instruction can be encapsulated into one frame whose size is from 32 to 500 Bytes. The frame is non-preemptive and TTE/CAN/Lin is enough. While in the self-driving scenario, for instance, there are about several megabytes (MB) of video for every 33 ms from the camera, there are 100 bytes of detection signal for every 31 μs from Ladar [
6]. To the best of our knowledge, they are always handled by hard slice isolation based on TDM (time-division multiplexing) or isolated physical channels, which is costly. How to make these two kinds of flow co-exist through TSN is a big challenge.
As depicted in
Figure 2a,
represents a large flow and
a small flow. When they are sent to the same link,
will occupy multiple periods of
. Similar to task scheduling, it is easy to think of assigning different priorities to different flows, and then a higher priority flow can preempt lower ones.
Figure 2b indicates the scheduling effect after
is preempted by
based on the traditional scheduling algorithm, RMS, EDF, or LLF.
is divided into three segments, but the cutoff positions, the number, and the size of the segments are unpredictable. Apart from this, these algorithms have the following features. An RMS algorithm flow with a smaller period has higher priority and can provide a stable scheduling strategy while the utilization is limited to about 70%. An EDF (LLF) algorithm flow with the earliest deadline (least slack) has higher priority and has a utilization close to 100%, although the priority is unstable.
Generally, we hope the initial offset in the first period of each flow will repeat in the following periods like TTE; however, because preemption is inevitable and unpredictable, the delay and jitter of the preempted parts will be out of control. Therefore, we propose flow-based deterministic scheduling (FDS). Just as TTE knows the location and length of all the frames in every period, FDS considers the offset of each flow and the time when preemption happens in every period. Then, we can schedule the flow but not the frame to support large traffic and meanwhile calculate the detailed information on the frame level. It is stable and has about 100% utilization.
Table 1 shows the comparison.
Assume the flow set and are given. These flows will repeat in a hyperperiod, , which is the least common multiple (lcm) of all the periods in the flow set. If is not cut off by other flows, we need to know all the offsets, , …, , in its hyperperiod, . If is preempted, we can set , where and is the j-th segment, which has the offsets, , …, , and transmission time, , …, in . According to the above analysis, determines the number of variables and the size of the problem. When , FDS is basked to one flow per period scenario, it is very similar to one frame per period of TTE. So the key problem is to find proper .
Firstly, we consider two flow scenarios illustrated in
Figure 3; the two flows are zero-released,
,
,
and
,
,
, respectively. Assume
is atomic and its periodic flow can move back and forth within its period; the maximal available transmission time is
and the minimal is 0 as shown in
Figure 3a.
is split into
segments, which is the lower bound of
. If
has no jitter and is set as anchoring flow, the periodic flow of
comes out in fixed time in every period.
Figure 3b shows that
is split into
segments, which is the upper bound of
. However, these two extreme cases indicate
is changing and hard to be predicted. If we slightly adjust the offset of
as shown in
Figure 3c, bringing in jitter, the segments of
can keep the same number and size as a previous period in
. Therefore, it can be the first rule of
. To further simplify the number of parameters, we specify previous
segments that have the same size,
, and the size of the last segment is
. In this way, a segment set of flow
can be represented as
and we have
After considering the two flow scenarios, Equation (
1) is also suitable for multiple flows. Namely,
, we have
waiting for scheduling. Before obtaining
, we need to compute the available transmission time for multiple periodic flows. We have the following theory.
3.1. Available Transmission Time Theory
Definition 6 (available transmission time).
The accumulated time that can be used for transmitting certain flows when all the flows are considered in the same timeline.
Theorem 1. Given a set of periodic flows, , the available transmission time for is We use an inductive approach to give a strict proof.
Proof. It is very clear that if , then , which means the whole interval in period is available for .
If , then , which means the available for is minus the occupied interval for times.
Assume that for an arbitrary , is true, i.e., . Let us derive from this assumption. For , the available interval in will repeat times and will consume the available interval times. Then the left time for is .
Bringing
in the expression, we have
It can be directly obtained that if is divisible by and is divisible by , , …, . Otherwise, we need to consider the essence of the expression. We can see is an estimate of the number of occurrences of in period and is an estimate of the number of repetitions of in period . The product of the two values is computed from the number of final repetitions of in ; therefore, we can replace with . It can minimize the loss of data rounding. In the same way, should be . Then, we can see that (1) holds when . Above all, the claim follows. □
According to the theorem, we have the following corollary about the utilization of FDS.
Corollary 1. The FDS scheduling utilization can close to 1.
Proof. According to Theorem 1, if all the available transmission time is exhausted, namely , then the whole transmission time is used by flows, , and we have . After dividing on side, we can obtain . Using the same way as the proof of theorem 1, we can eliminate and obtain the approximate sum of the occupied ratio of , which is the utilization that is close to 1. Then, the corollary claims. □
We can easily have the following corollary about schedulability without proof.
Corollary 2. The flow can be schedulable if only if The corollary means the total occupied time in period
should be less than the available interval. It can be used to judge whether a new flow can be added. If the available interval is enough, it is important to arrange related flow in such an interval. As depicted in
Figure 4, if
,
must be preempted. Next, we need to estimate the number of segments
.
3.2. Segment Estimation
If all the periods are zero-released and we align smaller
, where
in the interval
. Algorithm 1 presents a simple way to compute the number of blocks that a smaller period cut a larger period. For example, in
Figure 4,
,
,
,
can split
into three blocks,
and
can together split
into seven blocks. In our model, these estimated values are treated as a reference. Then, we have to obtain the estimated average available space
in each block for flow
by
where
is the number of split blocks in one period
. The core idea is to repeat all periods in the hyperperiod and sort them in ascending order. The first index of value
is
. The estimated
can be
If there is
, flow
has to preempt
at least
times, which can be used as reasonable evidence of our estimation algorithm.
Algorithm 1 Estimated number of segment |
- Require :
Period set , transmission time set - Ensure :
Segment set - 1:
n ← size() - 2:
Hyp ← LCM() - 3:
for i in [] do - 4:
j ← 1 - 5:
while do - 6:
.append() - 7:
j ← j+1 - 8:
end while - 9:
end for - 10:
← DeduplicationAndSort() - 11:
, , - 12:
for i in [] do - 13:
← List[].Index() - 14:
- 15:
- 16:
, - 17:
, - 18:
, - 19:
end for - 20:
return
|
5. Independently Programmable Flow Subset
As our model is end-to-end scheduling and some flows are split into subsegments, the set of flows on one link will change when transmitted from one hop to the next hop. Some sets of flows are separated because they are switched into different ports, and some are converged from different ports into the same port. It is not practical to plan all the flows in the entire network for all the cases; we propose independent programmable flow subsets to minimize the number of variables in each independent scheduling.
Definition 7 (Independent programmable flow (IPF) subset).
The minimal flow set that can independently make flow segmentation.
Consider the abstract graph of
Figure 1.
Table 2 presents all the flows in the same direction sharing the same output port and link. The transmission paths and their related flows are presented in
Table 3. Take
as an example; link
has
,
,
,
has
, and
has
,
. Assume the output port of the source nodes are the start-point where flows might be split into segments. All the flows should be considered in advance so that there is enough space to be allocated for all the flows. Hence,
needs to consider the cover set of the flows on all its links, namely flow set
. Meanwhile,
needs to consider flow set
. Then, we find
and
are connected because of
. Flows
and
are both needed to be considered by
. In this way, all the paths are connected by the intersecting flows, and then all the flows should be considered together. In this example, the IPF subset includes all the flows in the topology. The example shows that there are still relationships, even if some flows have completely different paths.
Generally, the connections built up by the intersecting flows are universal in such a multiple-node system, even if the flows are not split. One extreme case is that when all the flows have different prime periods the whole connected flows must be considered entirely to allocate the resource. Fortunately, the practical network usually adopts harmonic periods and constructs disjoint and redundancy paths, such as IEC 61508. The harmonic period means a small hyper-period and the flow set on one disjoint path can be treated as the IPF subset. Furthermore, the same period flows might cut off the connections when they have a similar size. For example, if flows and have the same period and similar size, namely the estimated number of segment for each flow, , and have no change and , then flow set or can be considered independently. Therefore, we propose the following algorithm to find the IPF set.
The goal of Algorithm 2 is to find the maximum number of period flows that can be independently programmed. From line 1 to 10, it records all the flows that will be transmitted on each link after initializing the flow–link matrix with false. Then, we unite all the flows on each link on a certain path from line 11 to 15. In this step, there would be real flow on the corresponding link. After scanning all the paths from line 16 to 23, we can obtain all the possible IPF subsets. Finally, we can compare all the possible IPF and categorize them into different IPF subsets
from line 24 to 26.
Algorithm 2 Independent programmable flow subset |
- Require :
Path set , flow set - Ensure :
IPF subsets - 1:
Flow-Link matrix M← - 2:
Dict ←∅, srcDict ←∅ - 3:
for f in do - 4:
for in do - 5:
if link is the starting link of flow f then - 6:
- 7:
end if - 8:
, - 9:
end for - 10:
end for - 11:
for in do - 12:
for in path do - 13:
- 14:
end for - 15:
end for - 16:
for in do - 17:
for in and do - 18:
if PFdict[] ⋂ PFdict[]) is no empty then - 19:
- 20:
- 21:
end if - 22:
end for - 23:
end for - 24:
for in do - 25:
catalog the in the n IPF subsets, and each denoted by , - 26:
end for
|
After identifying IPS, we use a segment estimation algorithm to compute the parameters of the flow or split-flow and then construct the constraint models based on formulations in
Section 4. We can obtain the offsets of all the flows and tasks. If there is no split, each task has a list of offsets within its own hyper-period on the sender side, and the corresponding flow has delayed offsets in each TSN node. Because different flows may converge on a node and one of the flow’s offset plus its duration equals to other’s offset, we need to merge the offsets to find the start-time and end-time of the last GCL. If the flow is split, each task still keep one sending offset per period hyper-period, while the corresponding flow will be cut into several sub-flows and each sub-flow has its own offset. The sub-flows will be treated as normal flow to participate in the final merger into GCL.
7. Related Work
Steiner [
19] defined SMT-base evaluation for TTE in multihop networks. It focused on building one-frame-per-period constraints and precisely formulating the scheduling problem. Many of the constraints provide a good reference for us to build our work. As mentioned in the previous section, it can be our special case when we only consider the network part. After that, Oliver et al. [
2,
24] and considered building a similar constraint by obeying the standard itself of IEEE 802.1 Qbv. It extends a single frame in TTE to multiple frames and the scale of the problem grows extremely, making it hard to resolve. Meanwhile, they also combined the task and network based on TTE [
13] to make a schedule, and they pointed out that the number of frames is the biggest bottleneck to expanding the scale. Furthermore, when considering the coordination between routing and scheduling [
25], the problem becomes complex and difficult to solve due to the sharp increase in the number of variables. Our flow-level scheduling might be an option to break the bottleneck for it can reduce the number of variables for these models. Ref. [
18] adopted the first-order theory of arrays to express constraints and exposed synthesis of schedules via an SMT solver. It assumes the message size of one Ethernet frame and constructs time windows for GCLs based on IEEE 802.1 Qbv. In this model, the scale of the whole synthesis is still limited to 1000 frames of magnitude; the experiment shows that it takes 40 h to synthesize 264 frames with 32 windows. It is unacceptable in our megabytes per period scenarios. TSNsched [
26] is a tool for generating TSN schedulers. They consider the flow fragment in their constraint and claim TSNshed can support both individual packets and time windows; however, how to generate such fragment is still unknown. In their experiment, the flow size is limited to five frames and there is no evaluation of utilization. Concerning these works, we discuss the method of generating segments, called fragments in [
26] and the time window in [
18]. Even though time windows have been introduced into industrial applications [
27], the mapping problem from the frame to the window still exists. We think our work can make up the gap between frame and flow.