## 4 Proposed Solution  
We define time-triggered flows with different periods as heterogeneous flows and assume that all links are homogeneous which all have the same characteristics. To facilitate the understanding of our proposed routing and scheduling strategy, we first explain some of the concepts used in it. **Definition 1**. : _(Scheduling Cycle) The length of schedule denoted by \(t_{cycle}^{\text{F}}(p_{i,j})\) is defined as the least common multiple of the periods of all time-triggered flows to be scheduled via the port \(p_{i,j}\), which is attached to only one directional link \((v_{i},v_{j})\)._  
\[t_{cycle}^{\text{F}}(p_{i,j})\triangleq\text{LCM}(f_{1}.prd,f_{2}.prd,\ldots,f_ {n}.prd) \tag{1}\]  
Figure 1: Example TSN topology model \(G(16,21)\) including ten end systems which schedule six types of flows via six switches with multiple no-conflict paths. A controller collects application information and network topology information and reports to scheduler module. The schedule results can be deployed on the TSN devices. **Definition 2**. : _(Time Slot) The size of one slot denoted by \(t_{slot}^{F}\) is defined as the greatest common divisor of the periods of all time-triggered flows to be scheduled._  
\[t_{slot}^{F}\triangleq GCD(f_{1}.prd,f_{2}.prd,\ldots,f_{n}.prd) \tag{2}\]  
**Definition 3**. : _(Flow Correlation) The correlation of flow cycles denoted as \(F_{corr}\) is defined as the ability of heterogeneous flows to share bandwidth without conflict. We use the number of situations that other flows can be scheduled without conflict as a measure of correlation when one flow already exists in the network. We denote \(num(f_{m},f_{k})\) as the number of situations that accommodated flows \(f_{k}\) can coexist with \(f_{m}\), assuming that flow \(f_{m}\) has been assigned to be transmitted through one link at zero time slot._  
\[num(f_{m},f_{k})=\lfloor\frac{f_{k}.prd}{GCD(f_{m}.prd,f_{k}.prd)}\rfloor \tag{3}\]  
Proof of Definition 3.: The periods of flow \(f_{m}\) and \(f_{k}\) are defined as \(f_{m}.prd\) and \(f_{k}.prd\), respectively. We assume that the flow \(f_{m}\) has already been scheduled in the network in the earliest iteration. In the overall iterative scheduling algorithm, flow with smaller period is prioritized to reduce the number of iterations, i.e., \(f_{m}.prd\leq f_{k}.prd\). We take the sending instant of flow m as the reference zero point to analyze, for flow \(f_{k}\), how many combinations of time slots can be available to be scheduled on the same link \((v_{i},v_{j})\) with the guarantee that the two flows do not conflict. The offsets of the flow \(f_{m}\) and \(f_{k}\) in the first cycle are \(\varphi_{m}\) and \(\varphi_{k}\), respectively, and the transmission cycle constraints \(0\leq\varphi_{m}<f_{m}.prd\) as well as \(0\leq\varphi_{k}<f_{k}.prd\) are satisfied as shown in (15). Then, the locations of time slots to sending or forwarding flow \(f_{m}\) and \(f_{k}\) are \(ts_{m}=\omega_{m}\times f_{m}.prd\) and \(ts_{k}=\omega_{k}\times f_{k}.prd+\varphi_{k}\), where \(\mathbf{W_{m}}=\{\omega_{m}\in N:0\leq\omega_{m}\leq\frac{t_{slot}^{\{f_{m},f_ {k}\}}}{f_{m}.prd}-1\}\) and \(\mathbf{W_{k}}=\{\omega_{k}\in N:0\leq\omega_{k}\leq\frac{t_{slot}^{\{f_{m},f_ {k}\}}}{f_{k}.prd}-1\}\). The conditions under which collisions occur between two flows transmitting on the same link are  
\[\omega_{m}\times f_{m}.prd=\omega_{k}\times f_{k}.prd+\varphi_{k}, \tag{4}\]  
that is, the contention constraints are not satisfied as shown in (13). The time slot \(t_{slot}^{\{f_{m},f_{k}\}}\) is defined as  
\[t_{slot}^{\{f_{m},f_{k}\}}=GCD(f_{m}.prd,f_{k}.prd). \tag{5}\]  
We can obtain that \(\exists\)\(\mathbf{m}_{0},\mathbf{\hat{r}}_{0}\in\mathbb{N}\), \(f_{m}.prd=\mathbf{m}_{0}\times t_{slot}^{\{f_{m},f_{k}\}}\) and \(f_{k}.prd=\mathbf{\hat{r}}_{0}\times t_{slot}^{\{f_{m},f_{k}\}}\) are satisfied.