Exercise 3.1: Timestamp management in order to calculate Round Trip Time (RTT) - grupogita/ONOSP4-tutorial GitHub Wiki

Round-Trip Time (RTT) can be defined in simple terms as the time ellapsed between initiating a request and receving back its response. That is, it represents the time required for a packet to travel from a one device to another device plus the time for a reply to that packet to go back to the originating device [1]. It is frequently used as a metric for network performance assessment [2]. The following figure shows an approximation to the measurement of RTT between two end hosts. However, it is important to remark that RTT can also be measured between any two devices in a network as long as they can send and receive packets by themselves (e.g. the RTT can be measured between a host and a router or a pair of routers).

In this exercise, you will configure a mininet topology formed by two hosts and two software switches which will be programmed with P4. The goal of this exercise is to demonstrate how to measure frame processing times bby leveraging timestamps in order to identify how much the network parameters defined from the mininet topology affect the Round-Trip time (RTT). In this case, you will create a P4 program which will make the switches capable of calculating time metrics.

You will have to modify the following files in this exercise:

  • topo.py located on the path ONOSP4-tutorial/
  • main.p4 located on the path ONOSP4-tutorial/
  • flows file located on the path ONOSP4-tutorial/

Topology and Mininet

The exercise requires the creation of links between host H1 and Switch S1, host H2 and Switch S2 and between Switches S1 and S2. The following diagram shows the resulting topology:

The first task to be performed is to edit the "topo.py" file applying the knowledge acquired so far to build the topology illustrated above. Note that you will have to repeatedly change the channel bandwidth parameters in order to demonstrate their effect on the RTT once the exercise is completed.

After performing the previous step, you can check the topology was created correctly using the following commands:

  • make app-build
  • make start
  • make mn-log

At the end of the last command, the CLI output is expected to look like the following code block:

Another way to check that the topology was successfully created is to use the command make mn-cli to access the mininet CLI. Then, you can use the net command to visualize the topology currently deployed on Mininet. You should see a CLI output similar to the following code block:

P4 program

Considering the approach followed in the P4 program developed in Exercise 1: first approach to the P4 development process, this exercise focuses on Egress Processing and it uses a custom packet header. This modified header is based on the structure of an Ethernet header with the following field description:

  • ingress_port: Port through which the frame enters to the Switch.
  • egress_port: Port through which the frame egresses to the Switch.
  • process_time_sw1: Time taken by the Switch S1 to process the frame.
  • process_time_sw2: Time taken by the Switch S2 to process the frame.
  • egress_time_sw1: Time in which the frame gets out of Switch1.
  • ingress_back_time_sw1: Represents the time taken for the frame to enter Switch S1 once it has been sent from Switch S2.
  • total: Represents the communication time (processing time in each Switch plus channel time).
  • th: Refers to the RTT concept

In order to complete this exercise, you have to modify the file "main.p4". The instructions can be found in the file with the comment code ”TO-DO”. The objective is to use logic statements to identify which Switch is processing the frame and calculate the time metrics to assign them to the total and the header fields.

NOTE: Use the above image as support for the resolution of the requested TO-DO.

References

[1] Haggag, A. (2019). Network optimization for improved performance and speed for SDN and security analysis of SDN vulnerabilities. International Journal of Computer Networks and Communications Security, 7(5), 83-90.

[2] A. Atary and A. Bremler-Barr, "Efficient Round-Trip Time monitoring in OpenFlow networks," IEEE INFOCOM 2016 - The 35th Annual IEEE International Conference on Computer Communications, 2016, pp. 1-9, doi: 10.1109/INFOCOM.2016.7524501.