## 6 Network Topology Creation Using Mininet-WiFi
### Network Topology S2(5/6)1--Different Access Network and Shared Core, Railway Track Parallel to Road
When this data packet arrives at switch S8, it removes the VLAN ID and sends the data packet to the host rail server. 9. Validation of Developed SDN Application and Selected Tools

This section provides the procedure and logic to validate the selected tools that are used to generate the data traf c. Along with this, it also investigates the developed ONOS application and analyses its functionalities such as handover and traf c differentiation capabilities based on VLAN tagging. Figure 10: Data packet tagging. ### Handover/Mobility (Speed/Direction/Providing Coordinates)

To test the handover scenario, the rst criteria is to design a network topology where hosts should have the capability to connect to wireless networks (WiFi) and users can de ne the mobility and speed of the moving host in a certain direction. These criteria can be full lied by Mininet-WiFi since it supports the mobility model and Mininet-WiFi Python API integrates a new method net.addStation()that authorizes users to de ne nodes that can move around in the de ned virtual space, as mentioned in Section 6.1. By developing a prede ned mobility model, Mininet-WiFi can also move the nodes automatically in the de ned virtual space as soon as the emulation scenario starts running. Mininet-WiFi supports the following mobility models: RandomDirection, RandomWalk, RandomWayPoint, GaussMarkov, ReferencePoint, TruncatedLevyWalk, and TimeVariantCommunity [18, 22]. To demonstrate the handover and moving for railway and road coexistence environments, scenario S2(5/6)1 is selected, which is described in Section 6.1 of this paper. In the above-given Listing 6, two nodes, Car1 and Train1, are de ned with moving capability. The speedparameter can be any feasible number greater than zero. For demonstration purposes, we keep the speed at 3 m/s. In this scenario, to de ne the moving and handover of nodes, the lines of codes given in List 8 are used. Node Car1 is connected to ap1 and starts moving towards ap2 after 60 s. Similarly, Train1 is initially connected to ap3 and starts moving towards ap4. The mobility of nodes starts using the net.startMobility() function and stops by using the net.stopMobility()function as shown in Listing 7. The start parameter initializes the starting time of the node's mobility, and stopinitializes the stop time of the node's mobility. While moving, the ping command is executed using CLI from Car1 to CarServer and Train1 to RailServer, as shown in Figure 11.

Both of the selected nodes are pinging their assigned service server so that we can verify the network connectivity and handover between the assigned access points. Figure 11 shows that when Car1 crosses the ap1 coverage range, it automatically connects to ap2. Similarly, Train1 connects to access point ap4 automatically after crossing the coverage range of access point ap3. In Figure 11, we can see that after crossing the previously connected access points, Car1 and Train1 are disconnected, but there is no packet loss, and they are automatically connected to the nearest access point again. Figure 4 shows the position of nodes and access points de ned for scenario S2(5/6)1 before the moving scenario, and Figure 15 shows the positions of nodes and access points after moving and handover. After comparing these two graphs, we can conclude that Mininet-WiFi has the potential to emulate moving and handover scenarios for railway and road coexistence environments. There is some delay between the handover. This delay is because of the network joining process carried out by the nodes/stations and during this process; no data loss is recorded. ### Level Crossing

To manifest the level crossing scenario for railway and road coexistence environments, the S4(5/6)4 scenario is selected, which is presented in Section 6.2 of this paper. In this scenario, railway tracks are perpendicular to roads, as shown in Figure 7. We know that at a level crossing, when a Train/Tram is coming, Cars or other vehicles should have to

Figure 14: Handover scenario for S2(5/6)1 topology: ONOS screenshot.