## 3 System Architecture and Methodology
### Data Flow and the Realisation of Real-Time Transmission
The data response from the application layer is first divided into data blocks and encapsulated with TCP. The resultant TCP segments are equipped with a source port number 500, and the destination port number is identical to the random source port number from the data request. Then, the IP packets are formed in the internet layer. The source and destination IP addresses are the reverse of those from the data request. New WLAN frames are formed to send the reply from the server with the requested flight parameters to the wireless access point, and then routed to the client physically in the host-to-network layer. Upon the reception of the WLAN frames, the decapsulation process is undertaken to unpack WLAN frames to IP packets and TCP segments. Similarly, the TCP segments are ordered and embedded to form the original data. Due to the limitation of having to cross platforms, the arriving data are then passed to BlueSky in the client side by the data request application. They are also saved in a CSV file for easier reference. A sample of the outputted data is shown in Table 1. The units of the flight parameters are as follows: latitude and longitude, degrees (positive denotes east/north, negative denotes west/south); altitude, feet; ground speed, knots; heading, degrees. Therefore, this example implies that the aircraft position is at 22.22222, 113.749. N at the altitude of 2163.44 feet, with a ground speed of 148.713 knots and a heading of 16.1816  at the snapshotted instance of the data request. The bridge from the data request application to BlueSky terminates the data request application in a request. The remaining process is done using BlueSky in a Python 3.7 environment. The original version of BlueSky supports the use of user inputs to alter the movements of the aircraft shown on the radar map, allowing for the imitation of ATCOs providing instructions to flight crews. As simulated aircraft operations involving verbal command are not currently possible, a command console approach is adopted in BlueSky, which recognises and accepts inputs with the syntax used in NLR's TMX Traffic Manager. Therefore, users can enter commands according to the syntax used in NLR's TMX Traffic Manager to instruct the aircraft to fly according to the desired operations. A simulated aircraft can be created by entering the following command: \"CRE [callsign], [latitude], [longitude], [heading], [altitude], [speed]\", and it can be subsequently moved by \"MOVE [callsign] [latitude] [longitude] [altitude]\". Speed and heading of the simulated aircraft can also be set via \"[callsign] SPD [speed]\" and \"[callsign] HDG [heading]\", respectively. For instance, if there exists an aircraft with callsign AAE123, the ATCO could input the command \"AAE123 HDG 300\" to change the aircraft's heading to 300\". The user interface (UI) was modified to utilise this user input feature. Figure 5 shows the modified UI of BlueSky. The details of the UI modification and real-time radar map updating process are provided below. In terms of UI modification, a menu \"SimConnect\" consisting of two buttons \"Initialise\" and \"Load Flight Data\" was added to the existing UI. The first action done by \"Initialise\" is to call and activate the \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Variable** & **Latitude (\({}^{\circ}\))** & **Longitude (\({}^{\circ}\))** & **Altitude (Feet)** &
\begin{tabular}{c} **Ground Speed** \\ **(Knots)** \\ \end{tabular} & **Heading (\({}^{\circ}\))** \\ \hline Data & 22.2222 & 113.749 & 2163.44 & 148.713 & 16.1816 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: CSV data format with sample data. data request application. After that, the view of the radar map is panned to the desired airport. The Hong Kong International Airport (ICAO: VHHH, IATA: HKG) is adopted via a command \"PAN VHHH\" in our case. Then, as the aircraft synchronising with the flight simulator is not initially available on the radar map, the initialisation also creates the aircraft via the CRE command described in the previous paragraph.