# SDN-Based Secure Common Emergency Service for Railway and Road Co-Existence Scenarios
## 3 Description of the Proposed SDN-Based Service for Rail and Road Coexistence
### Considered Scenario: Level Crossing  
To demonstrate and emulate the common emergency services for railway and road coexistence scenario, a level-crossing situation has been selected, where railway tracks are perpendicular to roads, as shown in Figure 2. Nevertheless, the proposed mechanism could be applied to any type of shared or dedicated scenario/situation aiming at interconnecting rail and road services. In the considered scenario, railways and roads have shared access networks and both entities have a common backhaul core.  
A Python script is written in Mininet-WiFi to develop the selected network topology, which can mimic the level-crossing scenario [23]. In the selected topology, the ONOS [31] SDN controller is used to programmatically control the forwarding element of the network topology. The defined access points and switches are SDN-based devices that operate and control via the OpenFlow13 protocol [35]. The rail emergency server (RailEmer) and car emergency server (CarEmer) are designed to manage the exchange of emergency messages between the server and nodes. Each emergency server has primary and secondary servers, as shown in Figure 2. The secondary servers are included to ensure system redundancy and fail-safety. In addition, clusters of primary and secondary servers can be considered to enhance system security and prevent system failure. The RailServer and CarServer are defined to manage and exchange the normal messages between the nodes and server.  
To implement the common emergency service, network-side emergency service implementation is carried out using SDN and network slicing with virtual local area network (VLAN) tagging. In this empirical work, we are not creating the whole eREC mechanisms nor multipoint calls but only demonstrating how a common emergency service can be implemented and triggered from both domains. The \"start-eREC\" message can be sent by cars or trains in the specific area of the level crossing. In this implementation, it is ensured that data traffic is differentiated between roads and railways based on its source, destination, VLAN tag, and port number and provides common emergency services for both trains and cars. Detailed information about developed common services to differentiate the data traffic and emergency message delivery is presented in Sections 4.1 and 4.2.  
Figure 3 shows the developed network topology, where the nodes Train1, Train2, Car1, Car2, and New node are connected to access point Ap1. The nodes Train3 and Car3 are connected to access point Ap2. Access point Ap1 is connected to switch S11 and access point Ap2 is connected to switch S44. The RailEmer and CarEmer with their primary and secondary servers are connected to switch S22 and RailServer and CarServer are connected to switch S33. Figure 4 shows the Mininet-WiFi-generated graph with all the nodes connected to access points. For simplicity, the demonstration involves three open virtual switches, two access points, and seven nodes (representing cars and trains). However, the developed system is capable of handling more complex prototypes with an increased number of switches, access points, and nodes. The complexity of the prototype depends on the capacity of the system where the SDN-based solution is implemented.  
Figure 2: Considered scenario: rail and road coexistence at level crossing.