## 2 VDES Data Link Credibility Monitoring Approach
### Radio Interference Detection Based on Message Characteristics
#### 2.1.1 VDES Message Integrity Verification Method Based on the MD5 Algorithm
(3) Module for Analyzing the Matching of Ship-to-Shore Distance and Propagation Distance Upon confirming the absence of radio interference in the VDES data link, the VDES data link integrity monitoring system proceeds to monitor for the presence of spoofing sources within the link. This module initially invokes the GetDistance(double, double, double) function to calculate the ship-to-shore distance using the Haversine formula, based on the vessel position reported by the VDES shipborne terminal and the base station's location. It incorporates current hydro-meteorological information, such as sea surface wind speed and sea surface temperature. Subsequently, the CalculateRange(double, double, double, double, double) function computes the propagation distance of the VDES signal in the current maritime environment. The analysis then determines whether the ship-to-shore distance falls within the tolerance range of the propagation distance. If the distance is within this tolerance range, it signifies the absence of spoofing sources in the VDES data link at that moment. Conversely, if the distance exceeds this tolerance range, it indicates the presence of a spoofing source within the VDES data link. An algorithm for spoofing source messages is employed to ascertain the location or range of the spoofing source. The Ship-to-Shore Distance vs. Propagation Distance Matching Analysis module can effectively monitor anomalous data resulting from spoofing source interference in the VDES data link. To facilitate this process and serve as a preliminary step for module programming, the pseudocode designed for this purpose is provided as shown in Algorithm 4:

Figure 20.5 Verification results of the VDES communication consistency checking module. ```
Step 1: Calculate the distance between the base station and the ship functionGETDISTANCE(lng1, lat1, lng2, lat2)  radLat1 \(\leftarrow\) Rad(lat1)  radLng1 \(\leftarrow\) Rad(lng1)  radLat2 \(\leftarrow\) Rad(lat2)  radLng2 \(\leftarrow\) Rad(lng2)  a \(\leftarrow\) radLat1 \(\leftarrow\) radLat2  b \(\leftarrow\) radLng1 \(\leftarrow\) radLng2  result \(\gets 2\times\sin^{-1}\biggl{(}\sqrt{\sin^{2}(\frac{a}{2})}+\cos(radLat1) \times\cos(radLat2)\times\sin^{2}\biggl{(}\frac{b}{2}\biggr{)}\biggr{)}\times 6378\)\(\lhd\) Haversine formula return result end function Step 2: Calculate the service radius of the base station function SERVICERADIUS(d, u, h, Ta, Ts, Rh)  L \(\leftarrow\) 0.4873 \(\times\)\(Lbu(d,u)+0.3671\)\(\times\)\(Lbh(d,h)+0.1417\)\(\times\)\(Lbhe(d,Ta,Ts,u,RH)\)\(\lhd\) Transmission loss  S \(\leftarrow\) A \(-\) L ifS = 0 then return d endif endfunction  When the system margin is greater than 0, the maximum transmission distance d corresponds to the propagation distance R of the VDES base station. Step 3: Matching monitoring ifR \(\geq\) D then  shuchu3 \(\leftarrow\) \"located within the propagation distance of the VDES base station\" else  shuchu3 \(\leftarrow\) \"beyond the propagation distance of the VDES base station\" endif
```

**Algorithm 4** Matching monitoring between ship-to-shore distance and propagation distance

To verify the functionality of the Ship-to-Shore Distance vs. Propagation Distance Matching Analysis module, consider a scenario in which the VDES base station is positioned at (38\({}^{\circ}\)58.14\({}^{\prime}\) N, 121\({}^{\circ}\)2.46\({}^{\prime}\) E). The sea surface wind speed is 10.88 m/s, the sea surface temperature is 16 \({}^{\circ}\)C, the tidal water level is 0.2 m, and the relative humidity is 75%. The VDES ship station is located at (38\({}^{\circ}\)43.176\({}^{\prime}\) N, 121\({}^{\circ}\)10.02\({}^{\prime}\) E). Given a VDES signal reception power of \(-\)67 dBm, the results of spoofing source detection in the VDES data link are illustrated in Figure 20.6

As shown in Figure 33, based on the sea surface meteorological conditions, the calculated coverage range of the VDES signal is 27.1623 nautical miles.