P4utils: measure one way delay

Before running this lab, you need to refer to Isochronous Round-Trip Tester to install irtt.

 

[topology]

I wan to measure the delay from h1 to h3. Assume the link bandwidth for all links is 10Mbps and the link delay is 1ms.

Code are available at here.

 

[p4app.json] (See the red words for the differences from original file.)

{

  "program": "forwarding.p4",

  "switch": "simple_switch",

  "compiler": "p4c",

  "options": "--target bmv2 --arch v1model --std p4-16",

  "switch_cli": "simple_switch_CLI",

  "cli": true,

  "pcap_dump": false,

  "enable_log": false,

  "topo_module": {

    "file_path": "",

    "module_name": "p4utils.mininetlib.apptopo",

    "object_name": "AppTopo"

  },

  "controller_module": null,

  "topodb_module": {

    "file_path": "",

    "module_name": "p4utils.utils.topology",

    "object_name": "Topology"

  },

  "mininet_module": {

    "file_path": "",

    "module_name": "p4utils.mininetlib.p4net",

    "object_name": "P4Mininet"

  },

  "topology": {

    "assignment_strategy": "manual",

    "default_bw":10,

    "default_delay":"1ms",          

    "auto_gw_arp": true,

    "links": [["h1", "s1"], ["s1", "s2"], ["s1", "s3"], ["s2", "s4"], ["s3", "s4"], ["s4", "h2"], ["s4", "h3"]],

    "hosts": {

      "h1": {

        "ip": "10.0.1.2",

        "gw":"10.0.1.1"

      },

      "h2": {

        "ip" : "10.0.2.2",

        "gw":"10.0.2.1"

      },

      "h3": {

        "ip": "10.250.250.2",

        "gw":"10.250.250.1"

      }

    },

    "switches": {

      "s1": {

        "program": "forwarding.p4"

      },

      "s2": {

        "program": "forwarding.p4"

      },

      "s3": {

        "program": "forwarding.p4"

      },

      "s4": {

        "program": "forwarding.p4"

      }

    }

  }

}

 

Execution

…………………………………………… (see the bandwidth and delay settings)

………….

 

Open terminal for h1 and h3

 

Setting the routing rules at switches.

 

Running irtt server at h3.

 

Running irtt client at h1. (-i 1s: each 1 second, send out a packet; -d 10s: duration is 10 seconds) note: sd=send delay, rd =receive delay

 

Parse the result to get delay (use the following script to get the sd and rd. the first column is packet id, the second is rd, and the third is sd.)

 

Dr. Chih-Heng Ke

Department of Computer Science and Information Engineering, National Quemoy University, Kinmen, Taiwan

Email: smallko@gmail.com