## 6 Network Topology Creation Using Mininet-WiFi
### Network Topology S2(5/6)1--Different Access Network and Shared Core, Railway Track Parallel to Road
Using a similar mechanism, four access points, ap1, ap2, ap3, and ap4, are defined for the selected scenario. The access points are assigned with different operating frequency ranges. The parameters _mode_ and _channel_ define the operating frequency range to broadcast and receive signals. The available modes for WiFi are b/g/n on a 2.4 GHz network and a/ac/n on a 5 GHz network [27]. The _net.setPropagationModel()_ function is used with path loss exponent 5. ```
ap1=net.addAccessPoint('ap1',ssid='ssid-ap1',mode='a', channel='36',position='100,300,0',' protocols':'OpenFlow13','xpower':'49 dBm',range':110') net.setPropagationModel(model='logDistance\",exp=5) info('...Configuring_wifi_nodes\
'') net.configureWifiNodes() After creating the network switches, hosts, and service server, the connectivity links are created using _net.addLink()_ as shown in Listing 4. The parameter _bw_ is used to define the bandwidth in Mbps of the connecting link. The line of codes present in Listing 4 create links between the hosts, switches, access points, and nodes. Access points ap1 and ap3 are connected to switch S11, and ap2 and ap4 are connected to switch S33. ```
info('\"\"\"Creating_linksn') s11s22={'bw'':1000} net.addLink(s11,s22,cls=TCLink,\"\"s11s22) s22s33={'bw'':1000} net.addLink(s22,s33,cls=TCLink,\"\"s22s33) CarServers22={'bw'':500} net.addLink(CarServer,s22,cls=TCLink,\"\"CarServers22) RailServers22={'bw'':500} net.addLink(RailServer,s22,cls=TCLink,\"\"RailServers22) s11 ap1={'bw'':500} net.addLink(s11,ap1,cls=TCLink,\"\"s11 ap1) s11 ap3={'bw'':500} net.addLink(s11,ap3,cls=TCLink,\"\"s11 ap3) s33 ap2={'bw'':500} net.addLink(s33,ap2,cls=TCLink,\"\"s33 ap2) s33 ap4={'bw'':500} net.addLink(s33,ap4,cls=TCLink,\"\"s33 ap4) Mininet-Wifi has a method _net.plotGraph0_ to show the position of defined hosts and access points on a graph. Using this method, the user can define the range of x- and y-coordinates for the plot limits, as shown in Listing 5. Figure 4 shows the graphical representation of the selected topology: we can clearly see access points ap1, ap2, ap3, and ap4 and defined nodes. The developed network topology with assigned switches, access points, connected hosts, and nodes/stations can be seen on the ONOS graphical representation platform as shown in Figure 5. The network topology is built using _net.build()_, and access points are started using _start()_. Mininet-Wifi also provides a command line interface (CLI) using the function _CLI(net)_, which enables interaction with any element of the developed topology. To stop the network, the _net.stop()_ function is used. In the code below, \"c1\" is the name assigned to the ONOS SDN controller. ``` if'-p'notinargs:{ net.plotGraph(max_x=450,min_x=-50,min_y=-50,max_y=450)} info('\"\"\"Starting_the_networkn') net.build() info('\"\"\"Starting_the_controllersn') forcontrollerinnet.controllers: controller.start() ap1.start([c1]) ap2.start([c1]) ap3.start([c1]) ap4.start([c1]) net.get('s11').start([c1]) net.get('s22').start([c1]) net.get('s33').start([c1]) info('\"\"\"Starting_CLN') CLI(net)
Using the above-mentioned methods, functions, and procedures, users can emulate any salable and complex topology. Figure 5 represents the topology created using the Python script for the S2(5/6)1 scenario represented by the ONOS SDN controller's graphical user interface (GUI), where hosts Car1 and Train1 are defined with moving capability. ### S4(5/6)4: Shared Access Network and Shared Core, Track Perpendicular to Road

To design the S4(5/6)4 scenario, a similar Python script is written using the methods and functions mentioned in Section 6.1, and a network topology is developed in such a way that access points and the core network are shared by both railway and road domains. Figure 4: Hosts and access points: Mininet-WFi graph. Figure 5: S2(5/6)1: Different Access Network and Shared Core, Track Parallel to Road Topology: ONOS screenshot. In this selected scenario, railway tracks are perpendicular to roads.