Mininet emulator provides a flexible environment to implement and test SDN networks. In addition, it supports the results realism and test replication (Heller, 2013). The results realism means the emulation results are close to the results which can be obtained from real network equipment (hardware or software). The test replication indicates that the test could be implemented as much as needed with the same components of the test environment. Therefore, this thesis intends to use the Mininet in some experiments to validate the results accuracy of the COVN simulator. However, it does not support the implementation of controller placement because it cannot emulate
Page | 121 the effect of changing the controller position. For that reason, this mechanism is added to Mininet to enable controller placement emulation. This section explains the problem and its proposed solution; the tools used to implement the solution and which mechanism is used to add the effect of changing controller position.
5.4.1. The Mininet Limitation and the Developed Solution in Mininet
Mininet can connect the controller to OpenFlow switches whether it was internal (on the same machine) or external (on different machines). Also, it can connect the switches to several controllers simultaneously, each group of switches is specified to one controller. The port and IP address of a controller is used to identify the controller for the switches, whereas, only the port number of the switch is used to identify the switches to the controller. The problem is, the ports connecting the switch and controller are not network ports, they are passive ports (Listening port), which are used to communicate between applications. That decimates the ability to establish a link between the switch and the controller and inhabit the possibility to make any specification or configuration for this connection. Therefore, it was not possible to reflect the effect of the controller position in the network. Conversely, all other ports used to communicate between switches or between switches and hosts are network ports. Consequently, the network links can be established and configured with any network parameters like bandwidth, latency and packet losses ratio.
That was the only limitation in Mininet according to the implementation of the controller placement algorithm. It was the motivation to find the solution to this problem. The solution is summarised by tracking the communication between the passive ports (listening ports) until the socket between the controller and switch is established, after which the active port is created. The active port is used to identify the connection and apply the traffic control mechanisms on that connection. The tools which are used for tracking the connection and apply traffic control are explained in Section 5.4.2.
5.4.2. The Tracking Communication and Traffic Control Tools A) Tracking Communication Tools
Mininet provides a wide range of tools for monitoring and debugging the communication of SDN network. It does this by integrating many well-known tools of the real network to support network monitoring realism. Also, it allows the network
Page | 122 developers to perform the monitoring in exactly the same way of the real network. For example, Mininet uses the OVS to emulate the behaviour of OpenFlow switches. Therefore, it can use all the tools which have been developed to debug the OVS switches like ovs-dpctl (OpenvSwitch, 2016b), ovs-appctl (OpenvSwitch,2016a), ovs-ofctl (OpenvSwitch,2016c) and ovs-vsctl (OpenvSwitch, 2016d). Also, it uses famous monitoring tools such as Netstat (Durgin et al., 2005), tcpdump (Van et al., 2016), Wireshark (Wireshark, 2016b) and tshark (Wireshark, 2016a). All the mentioned tools were tested to capture the needed information, but the most suitable one was the
tshark. That is because it can capture the traffic continuously in contrast to the other
OVS debugging tools and Netstat monitoring tools which could only discretely capture the status of switches. Also, it was easier than tcpdump in filtering the captured data. Finally, the tshark is used to extract the port number of the switch which is created and activated when the socket between the switch and controller is established.
B) Traffic Control Tools
There are two tools of traffic control used to solve the problem of the limitation of controller placement in Mininet they are: the Linux Traffic Control (tc) and Network
Emulation (netem). Combining these tools allows for applying all traffic impairments on
emulated nodes and links (Tim De Backer, 2014). These tools can get a proficient level of traffic realism in complex or distributed emulation of the network.
On the one hand, these tools were already applied to the emulated links between the switches or between the switches and their hosts in the Mininet (Mininet Team, 2016). On the other hand, these tools were not applied on the links between switches and controllers. Since, these links are not considered as network links. Therefore, it was imperative to recall these links (capturing their port number) and apply these tools to them in order to allow their configuration. The tc is an authoritative tool for shaping, classifying, scheduling and prioritising the network traffic. That is because, it is basically a based queuing discipline (qdisc) algorithms, which has had a long development to optimise the network traffic scheduling. The tc tool can apply any scheduling algorithm and set the transmission rate (bandwidth). However, it is not able to add all traffic deviations such as latency and jitter. Therefore, the Netem tool is used to extend the abilities of tc tool as it allows it to define and set more traffic impairments (Tim De Backer, 2014).
Page | 123
5.4.3. The Applied Traffics Control Mechanism
Changing the controller position in SDN network affects the communication between the controller and its switches. Therefore, a different path between them should be used when the controller position is changed. In a real network, this occurs automatically due to the change of the control path, Mininet emulator does not change it automatically because Mininet emulation mechanism separates the control path from the data path. This means each switch is connected directly to the controller by a separated link (control link), which ignores the controller position in the network (see Figure 5.15).
Therefore, the effect of the controller position should be added to Mininet by the following steps:
1. The path between the controller position and each switch should be identified using a routing algorithm, which computes the optimal route between the two points.
2. Communication properties of each path should be converted to traffic control rules. 3. The traffic control rules of each path should be applied to the coordinate control
path.
Figure 5.15: SD-WAN in Mininet that demonstrates the difference between the virtual control path and data path.
Page | 124 The communication properties are represented by communication latency, jitter, and losses packet ratio. The latency variation is caused by many parameters such as the links bandwidth, the number of passed hops (switches) and switches' transmission ratio. All these parameters are considered for computing the path properties in the introduced solution.
Figure 5.15 shows an example of SD-WAN which is created by Miniedit, a primitive GUI of Mininet emulator. The example demonstrates the difference between the data path and control path in Mininet. Note that the switches and hosts are connected using blue lines (Data links/Network links), while all switches are connected directly to the controller using red lines (Virtual Control Links). Therefore, the controller position does not affect the control path. The example assumes that the controller is located in the position of switch four (S4). For instance, if the controller wants to communicate with the switch one (s1) using shortest path. It should pass the path of two links through switch two (s2) (line with grey triangles), while it communicates now directly through the red link. That is not the real behaviour of SDN network and does not reflect the effect of controller position. Therefore, the properties of the blue path are calculated, converted to traffic rules and applied on the red path to achieve more realism and emulate the effect of controller position.
5.4.4. The Programmes of Implementing the Mininet Developments
This section shows the main programmes that are used to implement the above- mentioned procedure.
1. Executing Matlab programme (Latency.m) to calculate the latency of the shortest path between every node and its controller. This programme will create switch- controller latency matrix to be used to configure the control link in Mininet using tc tool.
2. Running python programme (portcap.py) on the Mininet-Virtual Machine before starting the Mininet topology to capture the switches names and ports.
The output is (outfile.txt), which contains the ports number that connects the switch to its controller for all the switches of topology.
Page | 125 3. Starting the Mininet topology.
4. Running python programme (applyTC.py) to run the tc on Mininet-Virtual Machine.
5. Implementing the required tests as will be explained in the results in the chapter five.