{"id":21519276,"url":"https://github.com/praveingk/dptp","last_synced_at":"2026-02-01T05:31:31.408Z","repository":{"id":55958751,"uuid":"190673270","full_name":"praveingk/DPTP","owner":"praveingk","description":"Data-Plane Time synchronization Protocol (P4-Tofino \u0026 DPDK)","archived":false,"fork":false,"pushed_at":"2021-01-20T08:51:04.000Z","size":618,"stargazers_count":24,"open_issues_count":3,"forks_count":9,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-13T20:06:33.490Z","etag":null,"topics":["barefoot","data","data-plane","dpdk","moongen","p4","p4language","sdn","synchronization","time-synchronization","timesync","tofino"],"latest_commit_sha":null,"homepage":"","language":"P4","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/praveingk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-07T01:36:27.000Z","updated_at":"2025-05-08T22:40:08.000Z","dependencies_parsed_at":"2022-08-15T10:20:22.030Z","dependency_job_id":null,"html_url":"https://github.com/praveingk/DPTP","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/praveingk/DPTP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/praveingk%2FDPTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/praveingk%2FDPTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/praveingk%2FDPTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/praveingk%2FDPTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/praveingk","download_url":"https://codeload.github.com/praveingk/DPTP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/praveingk%2FDPTP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28969989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T04:44:20.970Z","status":"ssl_error","status_checked_at":"2026-02-01T04:44:19.994Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barefoot","data","data-plane","dpdk","moongen","p4","p4language","sdn","synchronization","time-synchronization","timesync","tofino"],"created_at":"2024-11-24T00:57:19.110Z","updated_at":"2026-02-01T05:31:31.382Z","avatar_url":"https://github.com/praveingk.png","language":"P4","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DPTP (**D**ata-**P**lane **T**ime synchronization **P**rotocol)\n\nThis source code synchronizes the network consisting of programmable (Barefoot Tofino) switches and IEEE1588 PTP-compatible NICs to support the global timing (64-bit) in the network data-plane (Switch and NICs). \nOnce DPTP is running, packets can have a global timing context, which is useful for several applications like latency tracking, monitoring, updates, ordering of events, distributed applications, etc.\n\nPaper Link :point_right:\t https://dl.acm.org/doi/10.1145/3314148.3314353?cid=82658740957\n\n## Source Code Pointers\n\n### Switch Code\nThe switch data-plane code is written in [P4](https://github.com/p4lang) programming language. Once this code is up and running, two virtual switches are synchronized to a global time.\n\np4_14 : [v_14/](https://github.com/praveingk/DPTP/tree/master/v_14) (Tested on SDE 8.x.x)\n\np4_16 : [v_16/](https://github.com/praveingk/DPTP/tree/master/v_16) (Tested on SDE 9.x.x)\n\n### End-Host Code\n\n[dptpclient](https://github.com/praveingk/DPTP/tree/master/dptpclient) : Once Switches are synchronized, end-hosts connected to the switch could run the dpdk-based dptpclient to synchronize end-hosts/nic with the network time.\n\n# Topology \nThe Topology used in as below : \n\n![DPTP Topology](Tofino-minibed-timesync.png)\n\n\nA 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.\n\n### Steps to run p4_14 based DPTP in Tofino:\n\n1) Navigate to the SDE PATH :\n```shell\n     cd ~/bf-sde-8.x.x\n     export DPTP_PATH=\u003cPATH TO DPTP FOLDER\u003e\n```\n2) Set the env variables : \n```shell\n     . ./set_sde.bash\n```\n3) Build the p4 program using the command :\n```shell\n     ./p4_build.sh $DPTP_PATH/v_14/dptp_topo.p4\n```\n4) Load the p4 program, and run the control plane API code using :\n```shell\n     cd $DPTP_PATH/v_14/CP\n     ./run.sh\n```\n5) This should automatically start the synchronization between Switch1 and master through packets from control-plane.\n\n\n### Steps to run p4_16 based DPTP in Tofino:\n\n1) Navigate to the SDE PATH :\n```shell\n     cd ~/bf-sde-9.x.x\n     export DPTP_PATH=\u003cPATH TO DPTP FOLDER\u003e\n```\n2) Set the env variables : \n```shell\n     . ./set_sde.bash\n```\n3) DPTP program in p4_16 has multiple profiles :\n\n     a) DPTP with logical switches to get measurements and to do a sanity check.\n     ```shell\n          ./p4_build.sh -DLOGICAL_SWITCHES $DPTP_PATH/v_16/p4_src/dptp.p4\n     ```\n     \n     b) DPTP without logical switches. This is basically the program that can be included in any p4 programs\n     ```shell\n          ./p4_build.sh $DPTP_PATH/v_16/p4_src/dptp.p4\n     ``` \n     \n4) Load the p4 program, and run the control plane API code using :\n```shell\n     cd $DPTP_PATH/v_16/CP\n     ./run.sh\n```\n   If you want to enable debugs the command is :\n\n```shell\n     ./run.sh debug\n```\n\n5) This should automatically start the synchronization between Switch1 and master through packets from control-plane.\n\n### Steps to run DPTPClient for host synchronization:\nRefer [Readme](https://github.com/praveingk/DPTP/tree/master/dptpclient)\n\n### Steps to run MoonGen for host synchronization:\nMoongen script sends synchronization requests packets between switches\nPull from https://github.com/praveingk/moongen/, Make sure the submodule libmoon is also pulled. \nFollow the readme instructions in moongen to build it.\n1) Enable the NIC to work with DPDK:\n```shell\nsudo ./libmoon/deps/dpdk/usertools/dpdk-devbind.py --b igb_uio \u003cNIC Ports\u003e\n```\n\n2) To start DPTP in the network between switch 1 and master:\n```shell\n sudo ./build/MoonGen examples/dptp_host.lua \u003cDPDK PORT id1\u003e \u003cDPDK Port id2\u003e\n```\nNote that \"DPDK Port id2\" is redundant and is used only for switch-to-host DPTP accuracy measurement. \n\n### Steps to Create CrossTraffic in the Link(160-176) during DPTP\n\n1) To create cross-traffic in the link being used for synchronization towards the SW1 (i.e. 160 --\u003e 176),\nwe simply craft a packet to destination address of SW1 (0x100000000001) and send it from any host link.\n```shell\n sudo ./build/MoonGen examples/dptp_host.lua -d 1 \u003cDPDK PORT id1\u003e \u003cDPDK Port id2\u003e\n```\nNote that \"DPDK Port id2\" is redundant and is used only for switch-to-host DPTP accuracy measurement. \n\n2) To create oversubscribed traffic, run the above example from two 10G host-links.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpraveingk%2Fdptp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpraveingk%2Fdptp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpraveingk%2Fdptp/lists"}