# A Terminal-Oriented Distributed Traffic Flow Splitting Strategy for Multi-Service of V2X Networks
## 4 TFSS Algorithm
### System Model
According to queuing theory, the state probability \(P_{\text{n}}(t)\) of \(n\) packets in the system satisfies the following equilibrium equation:  
\[\left\{\begin{array}{l}\lambda P_{0}=\mu  
**Theorem 1**.: _In the queuing theory model, if the arrival rate \(\lambda\) of the packet and the service rate \(\mu\) satisfy \(\lambda<\mu\), the output queue also obeys the Poisson distribution with the parameter\(\lambda\), and the queue maintains a stable queuing state._  
Theorem 1 can also be expressed as: corresponding to traffic flow within the communication network, if \(\lambda>\mu\), that is, if the traffic is larger than the available bandwidth, serious congestion will occur. Therefore, it is necessary to ensure \(\lambda<\mu\).  
Because there are hidden conditions, the sum of the system state probabilities is 1, i.e.,  
\[\sum_{\mathrm{i}=1}^{\infty}P_{n}=P_{0}\bigg{[}1+\frac{\lambda}{\mu}+\left( \frac{\lambda}{\mu}\right)^{2}+\cdots+\left(\frac{\lambda}{\mu}\right)^{n} \bigg{]}=P_{0}\cdot\frac{1}{1-\frac{\lambda}{\mu}}=1 \tag{3}\]  
Because  
\[P_{0}=1-\frac{\lambda}{\mu} \tag{4}\]  
then the state probability \(P_{n}\) can be expressed as  
\[P_{\mathrm{n}}=\left(\frac{\lambda}{\mu}\right)^{n}\cdot\left(1-\frac{\lambda }{\mu}\right) \tag{5}\]  
Suppose \(L_{\mathrm{s}_{i}}\) is the average number of packets in the \(i^{\mathrm{th}}\) network and satisfies as  
\[L_{\mathrm{s}_{i}}=\sum_{n=0}^{\infty}n\cdot P_{n}=\sum_{\mathrm{n}=0}^{ \infty}n\cdot\left(\frac{\lambda_{i}}{\mu_{i}}\right)^{n}\left(1-\frac{ \lambda_{i}}{\mu_{i}}\right)=\frac{\lambda_{i}}{\mu_{i}-\lambda_{i}} \tag{6}\]  
and the average service waiting time, that is, the transmission delay \(D_{\mathrm{i}}\), can be expressed as  
\[D_{i}=\frac{L_{\mathrm{s}_{i}}}{\lambda_{i}}=\frac{1}{\mu_{i}-\lambda_{i}} \tag{7}\]  
then the total transmission delay, \(D(\lambda)\), in the system is  
\[D(\lambda)=\sum_{i=1}^{n}D_{i}=\sum_{i=1}^{n}\frac{1}{\mu_{i}-\lambda_{i}} \tag{8}\]  
\(\theta_{\mathrm{i}}\) denotes the transmission cost required for the unit number of packets to be transmitted on the \(i^{\mathrm{th}}\) network. In fact, if the packet length and the cost per bit of data transmission are known, then \(\theta_{\mathrm{i}}\) can be found by their multiplication. Both the packet length and cost per bit of data are known in actual network transmission, i.e., \(\theta_{\mathrm{i}}\) is a known amount for the entire network [6]. The cost consumption on the \(i^{\mathrm{th}}\) RAT can be expressed as  
\[C_{\mathrm{i}}=L_{\mathrm{s}_{i}}\cdot\theta_{i}=\frac{\lambda_{i}\cdot\theta _{i}}{\mu_{i}-\lambda_{i}} \tag{9}\]  
Therefore, the total cost consumption \(C(\lambda)\) in a heterogeneous network is  
\[C(\lambda)=\sum_{\mathrm{i}=1}^{n}C_{i}=\sum_{i=1}^{n}\frac{\lambda_{i}\cdot \theta_{i}}{\mu_{i}-\lambda_{i}} \tag{10}\]Therefore, the joint optimization goal of the service offload problem of the in-vehicle gateway, that is, the utility function, can be expressed as  
Figure 2:0  
where \(\eta_{1}\) and \(\eta_{2}\) are weighting factors, and \(\eta_{1}+\eta_{2}=1\). If the gateway service has a high requirement for the delay, that is, the time-sensitive service, then \(\eta_{1}>\eta_{2}\). If the gateway service can tolerate a higher delay and has a higher cost requirement, that is, a cost-type service, then \(\eta_{2}>\eta_{1}\). \(D(\lambda)\) represents the total time consumption and \(C(\lambda)\) represents the total cost. Therefore, the less the delay and cost, the higher the gain. In other words, the joint optimization of the service offload of the in-vehicle gateway translates into a solution for the minimization problem.