# A Realistic, Flexible and Extendible Network Emulation Platform for Space Networks
## 4 Designs
### Link
#### 4.2.2 Implementation of a Time-Varying Connection Relationship  
(1) Computation Principle  
The link types in SN can be classified into three categories, namely the space-based link, ground-based link, and space-terrestrial link. Due to the mobility of space platforms, the time-varying connection relationship is mainly reflected in the space-based link and space-terrestrial link. The mutual visibility between two space platforms or between a space platform and a ground-based node determines whether there exists a corresponding link. Relying on the location parameters of emulation nodes, the main controller calculates the actual position of nodes, and then achieves the mutual visibility between nodes at each time slot. The calculation principle is described as follows. a. Space-based Link  
In a space-based link, the mutual visibility is defined as the direct line of sight between two space platforms at a certain time. Considering the geometry defined in Figure 4(a), in which Sat. 1 and Sat. 2 are visible to each other. Figure 4: Different types of emulation container. \(\vec{r_{1}}\) and \(\vec{r_{2}}\) are the position vectors of Sat. 1 and Sat. 2, respectively. \(\vec{S}\) emanates from the Earth's dynamical center perpendicular to \(\vec{C}=(\vec{x}_{1}+\vec{x_{2}})\) at \(h\) and intersect the Earth's surface at \(q\), where \(\vec{x_{1}}\) and \(\vec{x_{2}}\) are unknown vectors, \(\vec{x_{1}}\) is the distance vector from Sat. 1 to \(h\) to Sat. 2. The magnitude of \(\vec{S}\) is divided into \(|\vec{o}\vec{q}|=R_{E}\) which is the Earth's radius and \(\left|\vec{q}\vec{h}\right|=R_{V}\) which is the thickness of the atmosphere from the Earth's surface to the vector \(\vec{C}\). From Figure 5, two fundamental vector closure equations are:  
\[\vec{r_{1}}=\vec{S}-\vec{x_{1}} \tag{1}\]  
\[\vec{r_{2}}=\vec{S}+\vec{x_{2}} \tag{2}\]  
According to variables, mentioned above, the magnitude of \(\vec{C}\) can be described by the following equations:  
\[C=\sqrt{{r_{1}}^{2}+{r_{2}}^{2}-2(\vec{r_{1}},\vec{r_{2}})} \tag{3}\]  
\[C=x_{1}+x_{2}=\sqrt{{r_{1}}^{2}-S^{2}}+\sqrt{{r_{2}}^{2}-S^{2}} \tag{4}\]  
Equating Equations (3) and (4) and then squaring twice, we obtain an analytical expression for the visibility function as:  
\[R_{V}=\left(\sqrt{\frac{{r_{1}}^{2}{r_{2}}^{2}-(\vec{r_{1}},\vec{r_{2}})^{2}} {{r_{1}}^{2}+{r_{2}}^{2}-2(\vec{r_{1}},\vec{r_{2}})}}\right)-R_{E} \tag{5}\]  
The visibility function defined by Equation (5) can be used to predict explicitly whether satellites are visible to one another or not. The sign of \(R_{V}\) associated with visibility can be obtained by constructing a case in which direct line-of-sight visibility is impossible, as shown in Figure 4(b). For this case we have:  
\[(\vec{r_{1}},\vec{r_{2}})=r_{1}r_{2}cos(180)=-r_{1}r_{2} \tag{6}\]  
Then Equation (3) can be written as:  
\[R_{V}=-R_{E} \tag{7}\]  
Hence, we can put this rule:  
\[R_{V}= \begin{cases}\text{Positive value},&\text{Derect line-of-sight}\\ \text{Zero or negative value},&\text{Nonvisibility case}\end{cases}  \tag{8}\]  
b. Space-terrestrial Link  
In the space-terrestrial link, the mutual visibility is defined as the direct line of sight between a space platform and a ground-based node at a certain time. Considering the  
Figure 5: Geometry of two satellites in the case of direct line-of-sight. geometry defined in Figure 6, in which a satellite and ground station are visible to each other. The two points represent the satellite (Sat) and ground station (GS), and then the third is the Earth's center. The subsatellite point is indicated by T, which is the point where the joining line of the satellite and Earth's center intersect the Earth's surface. Distance \(d\) represents slant range between a satellite and ground station. This range changes over time since the satellite flies too fast above the ground station. In Figure 5(a), the radius \(r\) is:  
\[r=R_{E}+H \tag{9}\]  
\(R_{E}\) is Earth's radius and \(H\) is satellite's altitude.