# A Realistic, Flexible and Extendible Network Emulation Platform for Space Networks
## 4 Designs
### Link
#### 4.2.3 Implementation of Dynamic Link Characteristic  
(1) Computation Principle  
On the basis of the signal modulation method and \(\frac{E_{b}}{N_{0}}\), the bit error rate (BER) can be gained. The modulation method is a parameter of the emulation node, including FSK, PSK, DPSK, and etc. For example, BER of 2 PSK can be expressed by (18).  
\[BER=\frac{1}{2}\times erfc\Bigg{(}\sqrt{\frac{E_{b}}{N_{0}}}\Bigg{)} \tag{18}\]  
\(\frac{E_{b}}{N_{0}}\) is described in Formula (19), representing the received energy per bit over noise power density.  
\[\frac{E_{b}}{N_{0}}=EIRP-L_{p}+\frac{G}{T}-k-R \tag{19}\]  
\[L_{p}=20 lg(d)+20 lg(f)+92.45 \tag{20}\]  
\[R=10 lg(R_{b}) \tag{21}\]  
Figure 8: Logical topology of the dynamic link connection.  
Figure 9: Physical topology of the dynamic link connection.  
In Formula (19), \(EIRP\) is the transmitter effective isotropic radiated power, in dBW. \(\frac{G}{T}\) is the receiver antenna gain divided by the receiver system noise temperature, in dB/K. \(L_{p}\) is the sum of all path losses, described by Formula (20), in dB. \(k\) is a constant and equal to \(-228.6\) dB. \(R\) is the transmission code rate loss which can be expressed by Formula (21), and \(R_{b}\) is bandwidth, in bps. As parameters of the satellite node, \(EIRP\), \(\frac{G}{T}\), \(f\), and \(R_{b}\) are known values. When calculating the mutual visibility between nodes, mentioned in Section 4.2.2, \(d\) can also be obtained. Thus, \(\frac{E_{b}}{N_{0}}\) is a computable value.  
(2) Implementation Method  
In our emulation architecture, the SDN switch only offers the topology management and do not support the simulation of link characteristics. So, another supplementary method is needed to fulfill this function.  
All emulation nodes installed the Linux-based operation system in advance. The link characteristic configuration is performed via the Linux traffic control (TC) mechanism [31]. NetEm is part of TC and supports the emulation of network delay, packet loss ratio, etc. This mechanism also includes a Token Bucket Filter (TBF) for bandwidth limitation. TC has been evaluated in [32] and has been found to emulate most parameters accurately.  
TC can classify different parts of the data packet according to its characteristics and provide different traffic control mechanisms for these packets. The queuing rule is one of the most important parts in TC which can be used to realize the classification function. Before packets are sent by network interfaces, they are added to different send queues according to the characteristics of packets. Then the kernel takes packets from these queues and delivers packets to network interfaces to complete the process of data transmission.  
The FIFO algorithm forms the basis for the default queuing disciplines (qdisc) on all Linux network interfaces. It transmits packets as soon as it can receive and queue them, as shown in Figure 10. A real FIFO qdisc must have a size parameter to prevent it from overflowing in case it is unable to dequeue packets as quickly as it receives them, i.e., when we have a requirement to emulate a high bandwidth with a certain delay, we need to calculate the queue size to avoid discarding packets. The size of the queue is defined by the parameter \(limit\), and the unit of \(limit\) is the packet in TC. We consider the value of \(limit\) in the worst case. The \(limit\) would be greater than the average delay \(t\) multiplied by the maximum packet rate. The maximum packet rate equals to the maximum bandwidth \(B\) divided by the maximum transmission unit (MTU). MTU is the largest length of the frame. Its default value is 1500 bytes and this value can be changed according to the needs of experiments.  
\[limit\geqslant\frac{B\times t}{8\times MTU} \tag{22}\]  
Via the formula (3), the setting value of \(limit\) in a specific network scenario can be obtained.