# A Simulation of Contact Graph Routing for Mars-Earth Data Communication
## 3 Algorithms of the Model
Table 6 shows some data deliveries from PR and CR during 03:41-03:44, and those data are received by SPN during 03:53-03:56. Figure 5 shows the first data packets being sent and received in those time intervals. Data from both satellites are received by a DSN antenna in Spain. \begin{table}
\begin{tabular}{l c c c c c} \hline
**Dep/Arr** & **Time** & **Packet** & **Routes** & **Data** & **Info** \\  & & **Number** & & **Size** & \\ Dep & 03:41 & 5 & PR-ODY & 1280 & Figure 5a \\ Dep & & 8 & CR-TGO & 2048 & \\ Dep & 03:42 & 4 & PR-ODY & 1024 & \\ Dep & & 6 & CR-TGO & 1536 & \\ Dep & 03:43 & 2 & PR-ODY & 512 & \\ Dep & & 3 & CR-TGO & 768 & \\ Dep & 03:44 & 4 & PR-ODY & 768 & \\ Dep & & 5 & CR-TGO & 1280 & \\ Arr & 03:53 & 5 & ODY-SPN & 1280 & \\ Arr & & 8 & TGO-SPN & 2048 & Figure 5b \\ Arr & 03:54 & 4 & ODY-SPN & 1024 & \\ Arr & & 6 & TGO-SPN & 1536 & \\ Arr & 03:55 & 2 & ODY-SPN & 512 & \\ Arr & & 3 & CR-TGO & 768 & \\ Arr & 03:56 & 4 & ODY-SPN & 768 & \\ Arr & & 5 & TGO-SPN & 1280 & \\ \hline \end{tabular}
\end{table} 
Table 6: Case 2: Deliveries of data from two rovers. Figure 4: Case 1: (**a**) Sending data at 00:25, (**b**) receiving data at 00:37. **Case 3. ** During the day, the possibility of a nonexistent contact window for the satellite and DSN antenna is high. If this occurs, data that have already been sent to the satellite should be kept in the satellite's storage. Based on Table 4, there are nine time intervals of this occurance ranging from 4 to 45 min. In Table 7, the nonexisting contact window occurs frequently, so the accumulated data starting from 04:54 in MVN is kept for more than 4 h. During this time, MVN receives two series of data packets from CR and PR in different times. It also happens to MRO. As shown in Figure 2, all lines during this time have a flat horizontal segment, which indicates no change over the nonexistent contact window. Those lines drop to 0 at 08:44 when all data begin to be transmitted and are received by the DSN antenna in the USA at 08:56. There is a data deletion for deliveries to ODY during 07:29-07:35 due to its limited storage capacity. In this case, the operator of the USA antenna will know after 08:56, so a new request for the lost data is submitted in order to make CR send the data again. **Case 4:** An overlap contact window from one rover to two satellites occurs when 21:46-21:58 (PR-ODY) and 21:50-21:58 (PR-MVN). When 21:50-21:58, data from PR should \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dep/Arr** & **Time** & **Routes** & **Total** & **Info** \\  & & & **Data** \\  & 04:50–04:53 & - & - & No contact \\ Dep & 04:54–05:00 & CR-MVN & 11,712 & \\
05:01–05:15 & - & - & No contact \\ Dep & 05:16–05:30 & PR-TGO & 25,536 & \\
05:31–05:53 & - & - & No contact \\ Dep & 05:54–06:03 & PR-MVN & 16,256 & \\
06:04–06:38 & - & - & No contact \\ Dep & 06:39–06:51 & CR-MRO & 18,496 & \\
06:52–07:26 & - & - & No contact \\ Dep & 07:27–07:35 & CR-ODY & 8000 \\
07:36–08:12 & - & - & No contact \\ Dep & 08:13–08:23 & PR-MRO & 14,976 & \\
08:24–08:55 & - & - & No contact \\ Arr & 08:56 & MVN-USA & 27,968 & \\  & & TGO-USA & 25,536 & \\  & & MRO-USA & 33,472 & \\  & & ODY-USA & 8000 & Loss 12,224 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Case 3: Nonexistent contact windows. Figure 5: Case 2: (a) Sending data at 13:41, (b) receiving data at 03:53.

choose between ODY or MVN. The result in Table 8 shows that the data are sent to MVN instead of to ODY because MVN's storage (16 GB) is bigger than ODY's storage (8 MB). If it continues to send data to ODY until 21:58, 22,848 KB would be deleted because the ODY's storage cannot keep data that are larger than 8000 KB. Figure 5(a) shows data sent to ODY, and the destination satellite is switched to MVN in Figure 5(b). When there is no available contact window after 45 min, all data are sent to SPN, as seen in Figure 5(c). We calculate the percentage of the data that are successfully sent from Mars to Earth.