# Heuristic Routing Algorithms for Time-Sensitive Networks in Smart Factories
## 4 Improved Genetic Algorithm to Solve TT Flow Routing Problem  
When the controller conducts time-triggered communication with servo motors within TT subnetworks, the communication method is the master-slave method, in which the controller acts as the master station to send control-type frames to each slave station and slave stations return the processed frames to the master station. In the IT-OT converged industrial control network considered in this paper, the technical idea of aggregated forwarding frames was adopted, in which the whole subsystem has only one frame that runs in a loop. For the master, all devices with I/O information are considered as \"logical\" devices and the address of the field device corresponds to the physical location in the control frame, according to the protocol. When a message passes through a slave device, the slave only needs to read the command data from the corresponding mapped address and simultaneously resend the feedback data to the same place, so the effective utilization of the message can reach up to more than 90%. The frame format for the control data and communication mechanism design are shown in Figure 2.  
In industrial control networks, the number of slaves that need to be traversed in single time cycle increases as the network size continues to grow and the time cycle that is required to traverse the nodes increases linearly. In this case, we considered a TT control network based on the idea of distributed control, as depicted in Figure 3. In smart factories, due to the high degree of integration of IT and OT networks, the central control server can combine the requirements from upper-level industrial applications and the cloud platform to simultaneously control CNC machine tools, industrial robots, and other key \begin{table}
\begin{tabular}{p{42.7 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Category** & **Sample Data** & **Description** & **Priority** \\ \hline \multirow{3}{*}{TT} & Control Data Frames & Communicate with industrial control slave devices, such as servo motors, on a strictly time cycle basis to control their actions and collect encoder feedback & \multirow{3}{*}{7} \\ \cline{2-2} \cline{4-4}  & Time-Synchronized Frames & Traverse each network node following the rules of the optimal master clock algorithm to complete precise time synchronization & \\ \hline \multirow{3}{*}{AVB} & Audio Bridging Data & Sensing signals, such as vibration, sound, etc., typically requiring latency to be less than 5 ms & \\ \cline{2-2}  & Video Bridging Data & Continuous image signals captured by industrial surveillance cameras with large bandwidth consumption: allowable time delay range is 0\(\sim\)100 ms & \multirow{3}{*}{5\(\sim\)6} \\ \cline{2-2}  & Key Sensor Data & Event-triggered multi-source heterogeneous sensor signal data, which is an important data source for realizing intelligent manufacturing management & \\ \hline \multirow{2}{*}{BE} & ERP, MES, etc. System Data & Generic Ethernet data with no particular real-time QoS requirements & \\ \cline{2-2}  & Background Stream Data & Deliver as much as possible & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: TSN data classification. manufacturing equipment on multiple smart production lines in real time. Each CNC system, six-axis robot arm, etc., forms a set of subnetworks with its own hard real-time requirements within the system. The central control server accesses the submasters of each subnetwork sequentially via SWs, controls them with TT frames, and collects feedback. By optimizing the traversal route, we can reduce the traversal period as much as possible, so that the access time interval from the central control server to each subnetwork can be significantly reduced. The more frequent the access to the manufacturing equipment in the same time slice, the faster the speed of command response and the higher the manufacturing accuracy and flexibility of the smart production line.