{"id":25711611,"url":"https://github.com/dscano/gtpv1-p4","last_synced_at":"2026-03-03T10:34:09.735Z","repository":{"id":49367323,"uuid":"341514984","full_name":"Dscano/GTPV1-P4","owner":"Dscano","description":"This p4 program provides GTP.v1 encapsulation/decapsulation/steering. Furthermore you can get hop latency via postcard telemetry from each node of the network.","archived":false,"fork":false,"pushed_at":"2021-04-24T10:49:49.000Z","size":123,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T10:55:14.414Z","etag":null,"topics":["5g","5g-protocol","bmv2","p4","p4language","sdn","sdn-network"],"latest_commit_sha":null,"homepage":"","language":"P4","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dscano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-23T10:25:42.000Z","updated_at":"2023-03-16T15:44:36.000Z","dependencies_parsed_at":"2022-09-17T00:01:20.349Z","dependency_job_id":null,"html_url":"https://github.com/Dscano/GTPV1-P4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Dscano/GTPV1-P4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dscano%2FGTPV1-P4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dscano%2FGTPV1-P4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dscano%2FGTPV1-P4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dscano%2FGTPV1-P4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dscano","download_url":"https://codeload.github.com/Dscano/GTPV1-P4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dscano%2FGTPV1-P4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30041288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T10:28:37.494Z","status":"ssl_error","status_checked_at":"2026-03-03T10:28:28.686Z","response_time":61,"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":["5g","5g-protocol","bmv2","p4","p4language","sdn","sdn-network"],"created_at":"2025-02-25T10:54:32.639Z","updated_at":"2026-03-03T10:34:09.695Z","avatar_url":"https://github.com/Dscano.png","language":"P4","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GTPV1-P4\n\nThis P4 programm provides [GTP.v1][GTP.v1] encapsulation/decapsulation/steering for ICMP and UDP traffic. Furthermore you can get hop latency via postcard telemetry from each node of the network.\n\nThe folder/files contain:\n* `Graph`: contains the workflows of each part of the P4 piplenies, e.i., parser, ingress pipeline, egress pipeline, etc.\n* `Include`: contains the P4 program files. The P4 file `main.p4` defines the \"total pipeline\" and the files contained in `Include` folder specifies:  headers, parser, tables, etc.\n* `Command files`: These files contain a set of flow rules for configuring a P4 switch loaded with GTPV1-P4 pipeline. More in detail these three files are referred to a specified network topology.\n* `Parsing_INT_pkt`: is a python script for parsing a report packet and send the telemetry infortaions, contained in the packet, to Grafana.\n* `Simpe_network_topology`: is a python script for creating a mininet network.\n* `Write_entries_scan`: is a python script for creating flow rules.\n\n## Table0 in GTPV1-P4 pipeline\n\nThis table is redundant, because it's steer the traffic. In other word, the `table_encap_gtp` and  the `table_decap_gtp` have actions that are able to apply the GTP encap/decap and forward the traffic to a certain port. The `table0` have an action that simply forward a pkt from an input port to a certain aotput port. This table was introduced in the pipeline bacause during the development phase of the P4 program I used `iperf3` as a traffic generator, without this table the `iperf3` \"management pkt\" are not forwarded from the client to the server. In other word the `iperf3` connection fails. When I moved the GTPV1-P4 pipeline in a real enviroment I removed the `table0` from the pipeline and the real traffic generated in my real network is succesfully GTP encapsulated/decapsulated/steered.\n\n## Steps to run GTPV1-P4 on Mininet\n\nCopy the file `Simpe_network_topology` in the folder `behavioral-model/mininet`.\n\nTo run the mininet topology populated with [BMv2][BMv2] switches that have as a pipeline GTPV1-P4:\n\n    sudo python Simpe_network_topology.py --behavioral-exe ../targets/simple_switch/simple_switch --json ../main.json --num-host 4\n\nAfter running this command, you get a network topology formed by 3 bmv2 switches, `A,B,C`, connected in series. In the network are 4 hosts, `h1,h2,h3,h4`, where `h1,h2` are attached to `A`, `h3` is attached to `B` and `h4` is attached to `C`. \n\nTo configure/inspect the flow rules in each switch by hand, you have to access the switch via `Simple_switch_CLI`, provided by behavioral model, e.g., \n\n    sudo Simple_switch_CLI --thrift-port portNumber\n    \nOnce you accessed the switch via CLI you are able to configure the flow rules in each table via the commands provided by the CLI, e.g. `table_add`.\n\nTo load a set of flow rules in a switch from a file you can use:\n\n    sudo Simple_switch_CLI --thrift-port portNumber \u003c .../Commands_s1.txt\n\nThe `Command files`, in this repository, are written taking into account:\n* `h1 -\u003e h4`, the switch `A` provides GTP encap, `B` provides GTP steering ,`C` provides GTP decap.\n* `h2 -\u003e h3`, the switch `A` provides GTP encap, `B` provides GTP decap\n* the switch `A` send the postcard telemetry related to the flow `h1 -\u003e h4`, identified as a flow 1, and `h2 -\u003e h3` identified as a flow 2.\n* the switch `B` send the postcard telemetry related to the flow `h1 -\u003e h4`, identified as a flow 1.\n\n    \n## Steps to run GTPV1-P4 on a single switch\n\nTo run a single [BMv2][BMv2] switch with GTPV1-P4 pipeline:\n\n    sudo ./simple_switch -i 0@\u003ciface0\u003e -i 1@\u003ciface1\u003e ../main.json \n    \nTo configure/inspect the flow rules in each switch by hand, you have to access the switch via `Simple_switch_CLI`, provided by behavioral model, e.g., \n\n    sudo Simple_switch_CLI --thrift-port portNumber\n    \nOnce you accessed the switch via CLI you are able to configure the flow rules in each table via the commands provided by the CLI, e.g. `table_add`.\n\nTo load a set of flow rules in a switch from a file you can use:\n\n    sudo Simple_switch_CLI --thrift-port portNumber \u003c .../Commands_s1.txt\n    \n[GTP.v1]: https://en.wikipedia.org/wiki/GPRS_Tunnelling_Protocol\n[BMv2]: https://github.com/p4lang/behavioral-model\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdscano%2Fgtpv1-p4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdscano%2Fgtpv1-p4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdscano%2Fgtpv1-p4/lists"}