Skip to content
/ DPTP Public
forked from praveingk/DPTP

Data-Plane Time synchronization Protocol

Notifications You must be signed in to change notification settings

P4-WCZ/DPTP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DPTP

Data-Plane Time synchronization Protocol (https://www.comp.nus.edu.sg/~pravein/papers/DPTP_SOSR19.pdf) This source code synchronizes two Barefoot Tofino switches to support a global timing (64-bit) in the data-plane.

p4_14 : v_14/ (Tested on SDE 8.x.x)

p4_16 : v_16/ (Tested on SDE 9.x.x)

Topology

The Topology used in as below :

DPTP Topology

A single tofino switch named "tofino1" is virtualized into two switches Master(M) and Switch1. To do this virtualization, you will need to add a loopback link between port3 (160-163) and port5 (176-179). Once done, it will be configured as 10G ports, and we will be using only one link (160-176) as the connection between Switch1 and Master. Additionally, you will need atleast one host connected to port 1(128-131) to send DPTP requests.

Steps to run p4_14 based DPTP in Tofino:

  1. Navigate to the SDE PATH :
     cd ~/bf-sde-8.x.x
     export DPTP_PATH=<PATH TO DPTP FOLDER>
  1. Set the env variables :
     . ./set_sde.bash
  1. Build the p4 program using the command :
     ./p4_build.sh $DPTP_PATH/v_14/dptp_topo.p4
  1. Load the p4 program, and run the control plane API code using :
     "cd $DPTP_PATH/v_14/CP"
     "./run.sh"
  1. This should automatically start the synchronization between Switch1 and master through packets from control-plane.

Steps to run p4_16 based DPTP in Tofino:

  1. Navigate to the SDE PATH :
     cd ~/bf-sde-9.x.x
     export DPTP_PATH=<PATH TO DPTP FOLDER>
  1. Set the env variables :
     . ./set_sde.bash
  1. DPTP program in p4_16 has multiple profiles :

    a) DPTP with logical switches to get measurements and to do a sanity check.

         ./p4_build.sh -DLOGICAL_SWITCHES $DPTP_PATH/v_16/p4_src/dptp.p4

    b) DPTP without logical switches. This is basically the program that can be included in any p4 programs

         ./p4_build.sh $DPTP_PATH/v_16/p4_src/dptp.p4
  2. Load the p4 program, and run the control plane API code using :

     "cd $DPTP_PATH/v_16/CP"
     "./run.sh"
  1. This should automatically start the synchronization between Switch1 and master through packets from control-plane.

Steps to run MoonGen for host synchronization:

Moongen script sends synchronization requests packets between switches Pull from https://github.com/praveingk/moongen/, Make sure the submodule libmoon is also pulled. Follow the readme instructions in moongen to build it.

  1. Enable the NIC to work with DPDK:
sudo ./libmoon/deps/dpdk/usertools/dpdk-devbind.py --b igb_uio <NIC Port>
  1. To start DPTP in the network between switch 1 and master:
 sudo ./build/MoonGen examples/dptp_topo.lua <DPDK PORT id1> <DPDK Port id2>

Note that "DPDK Port id2" is redundant and is used only for switch-to-host DPTP accuracy measurement.

Steps to Create CrossTraffic in the Link(160-176) during DPTP

  1. To create cross-traffic in the link being used for synchronization towards the SW1 (i.e. 160 --> 176), we simply craft a packet to destination address of SW1 (0x100000000001) and send it from any host link.
 sudo ./build/MoonGen examples/dptp_topo.lua -d 1 <DPDK PORT id1> <DPDK Port id2>

Note that "DPDK Port id2" is redundant and is used only for switch-to-host DPTP accuracy measurement.

  1. To create oversubscribed traffic, run the above example from two 10G host-links.

About

Data-Plane Time synchronization Protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • P4 44.6%
  • C++ 30.0%
  • C 21.6%
  • Makefile 1.9%
  • Python 1.4%
  • Shell 0.5%