## 3 Periodic Signal Packing  
Having considered the possibilities of future uses like transmitting large number of signals, more efficient use of bandwidth is necessary. Hence, signal packaging becomes the key point in FlexRay network design. In general packing processes, the message signals were not distinguished from the different transmission period and were packed equally. In the previous study, large periodic signals are repeatedly transmitted because of indistinguishable periodic information from packed signals. Assuming the previous algorithm without considering a period, packing the signals of 1 and 2 in Table 1 will have the transmission period of 5 ms and 20 ms, the corresponding repetition rates of 1 and 4, respectively. When two signals are packed and transmitted together, the smaller repetition of the two signals is selected as the repetition of the new message. So, signal 2 occupies three times more bandwidth with a data size of 8 bits in one super-period. In this study, the method packaging the periodic signal independently will be mentioned to avoid wasting the bandwidth and optimize the bus utilization. Assuming that any signal on \(i\) node is assumed to be a quaternion vector \(s_{i}=\{e_{s_{i}},p_{s_{i}},r_{s_{i}},b_{s_{i}}\}\). Where, \(e_{s_{i}}\) is the send node of the signal \(s_{i}\). \(p_{s_{i}}\) is the period (ms) of signal \(s_{i}\), \(r_{s_{i}}\) is the repetition of signal \(s_{i}\), \(b_{s_{i}}\) is the payload length(bit) of signal \(s_{i}\). We packing the signal set \(S=\{s_{1},s_{2},s_{3},\ldots,s_{i}\}\) into a message set \(M=\big{\{}m_{i,1},m_{i,2},m_{i,3},\ldots,m_{i,j}\big{\}}\). Assume that any message on i-node to be a quaternion vector \(m_{i,j}=\big{\{}e_{m_{i,j}},r_{m_{i,j}},r_{m_{i,j}},b_{m_{i,j}}\big{\}}\). Where, \(e_{m_{i,j}}\) is the send node message \(m_{i,j}\), \(p_{m_{i,j}}\) is period (ms) of message \(m_{i,j}\), \(r_{m_{i,j}}\) is the repetition of message \(m_{i,j}\), \(b_{m_{i,j}}\) is the payload length(bit) of message \(m_{i,j}\). In order to realize better signals packaging, assumptions of a signal packing model are listed as below. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Signal** & **Period (ms)** & **Repetition** & **Size (bit)** \\ \hline
1 & 5 & 1 & 8 \\
2 & 20 & 4 & 8 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Signal message of frame. All information of signals are known including the transmission node, transmission period, signal deadline, repetition rate, and the size of signal. The value of transmission period equals to the deadline. All of the transmission periods of signals on FlexRay bus are integral multiples of the communication cycle. There is no error frame on FlexRay bus. Each node can transmit and receive signals. Signals are only packed together when they have same ECU (Electronic Control Unit) and same repetition rates. In the case of above assumptions, the signal packing is started as follows. Two-dimensional variables \(x_{i,j}\) is pulled in and \(x_{i,j}\in\{1,0\}\). \(x_{i,j}=1\) indicates that the signal \(s_{i}\) is packaged into the message \(m_{i,j}\) when the ECU of signal \(s_{i}\) and message \(m_{i,j}\) is same to the transmission cycle, otherwise \(x_{i,j}=0\). \[x_{i,j}=\left\{ \begin{array}{ll}1,&e_{s_{i}}=e_{m_{i,j}}\ \text{and}\ p_{s_{i}}=p_{m_{i,j}}\\ 0,&\ \text{otherwise}\end{array} \right. \tag{4}\]  
In order to ensure that each signal is packaged once only, it needs a following formulation:  
\[\sum_{j=1}^{K}x_{i,j}=1,\quad i=1,2,\cdots,n \tag{5}\]  
The problem of signal packing can be transformed into an open packing problem. The capacity of the box can be converted to the effective payload length of the frame, and the signal is regarded as an item to be packed. Because the length of the frame's payload is indefinite, the upper and lower bound constraints are set on them. In FlexRay network, the length of the frame's effective payload segment is the signal length which is packaged into the frame.