You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/P4sim/README.md
+70-1Lines changed: 70 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,75 @@ In the [paper](https://dl.acm.org/doi/10.1145/3747204.3747210), P4sim is evaluat
116
116
117
117
More use cases can be found [here](https://github.com/HapCommSys/p4sim/blob/main/doc/examples.md), demonstrating that P4sim can serve both research and educational purposes, enabling exploration of programmable data-plane behaviors in realistic network contexts.
118
118
119
+
### High-Performance Simulation with P4sim
120
+
121
+
**Some of the examples have results and plots for analysis in [link](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result), include the `parameters`, `pcaps` for running, please have a look with more detail.**
122
+
123
+
| Name | Description | ns-3 script | p4 script |
124
+
|-----|-------------|--------------|------|
125
+
|[p4-basic-example](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result/p4-basic-example)|[basic](https://github.com/p4lang/tutorials/tree/master/exercises/basic) example |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-basic-example.cc)| basic pipeline verification [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/p4_basic)|
126
+
|[p4-basic-tunnel](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result/p4-basic-tunnel)|[basic tunnel](https://github.com/p4lang/tutorials/tree/master/exercises/basic_tunnel) example |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-basic-tunnel.cc)| encapsulation / decapsulation test [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/basic_tunnel)|
127
+
|[p4-fat-tree](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result/p4-fat-tree)| fat tree topo testing |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/topo-fattree.cc)| multi-switch forwarding validation [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/fat-tree)|
128
+
|[p4-firewall](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result/p4-firewall)|[firewall](https://github.com/p4lang/tutorials/tree/master/exercises/firewall) example |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-firewall.cc)| ACL rule verification [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/firewall)|
129
+
|[p4-psa-ipv4-forwarding](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result/p4-psa-ipv4-forwarding)| ipv4 forwarding in psa arch |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-psa-ipv4-forwarding.cc)| PSA pipeline example [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/simple_psa)|
130
+
|[p4-spine-leaf-topo](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result/p4-spine-leaf-topo)| Spine leaf topo testing |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-spine-leaf-topo.cc)| datacenter fabric test [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/load_balance)|
131
+
|[p4-v1model-ipv4-forwarding](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/examples_test_result/p4-v1model-ipv4-forwarding)| ipv4 forwarding in v1model arch |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-v1model-ipv4-forwarding.cc)| v1model pipeline example [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/ipv4_forward)|
132
+
|[queuing_test](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/queuing_test)| queuing test with qos priority mapping |[ns-3](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-queue-test.cc)| QoS / priority queue experiment [p4src](https://github.com/HapCommSys/p4sim/tree/main/examples/p4src/qos)|
133
+
134
+
Following we give two simple examples: `IPv4 Forwarding Benchmark` and `Queue and Packet Scheduling Test` show how run the examples.
135
+
136
+
#### IPv4 Forwarding Benchmark
137
+
138
+
The following example runs a simple two-host, one-switch topology with IPv4 forwarding at 100 Mbps. The link rate (`--linkRate`), application data rate (`--appDataRate`), and other parameters can be tuned as needed:
To evaluate queuing and packet scheduling behavior on the P4 switch, use the [`p4-queue-test.cc`](https://github.com/HapCommSys/p4sim/blob/main/examples/p4-queue-test.cc) example. It accepts three independent traffic flows with configurable data rates:
Mote details, results, plots please check [Queue Status Monitor](https://github.com/HapCommSys/p4sim-artifact-icns3/tree/main/queuing_test)
169
+
170
+
> **Note:** Per-port queue parameters cannot currently be set via command-line arguments. Instead, configure them at runtime using the P4 controller command interface:
> The bottleneck processing rate is controlled by `--switchRate` (in packets per second). In this example it is set to `1500`.
185
+
186
+
After the simulation completes, inspect the generated PCAP files to observe how packets from the three flows are scheduled and reordered according to their assigned priorities.
187
+
119
188
## Known Limitations
120
189
121
190
The packet processing rate `SwitchRate` (in packets per second, pps) must currently be configured manually for each switch. An inappropriate value can cause the switch to enter an idle polling loop, leading to wasted CPU cycles. Automatic rate tuning is planned for a future release.
@@ -129,4 +198,4 @@ The packet processing rate `SwitchRate` (in packets per second, pps) must curren
-**Contributors**: Thanks to [GSoC 2025](https://summerofcode.withgoogle.com/) with [Davide](mailto:d.scano89@gmail.com) support and contributor [Vineet](https://github.com/Vineet1101).
201
+
- **Contributors**: Thanks to [GSoC 2025](https://summerofcode.withgoogle.com/) with [Davide](mailto:d.scano89@gmail.com) support and contributor [Vineet](https://github.com/Vineet1101).
0 commit comments