|
1 | | -[Quick Note with Google Docs](https://docs.google.com/document/d/18QQqo4PK8ycuZovrbAacRtFtqWSIqS0v9hRiiUYgvU8/edit?usp=sharing) |
| 1 | +⭐ GSoC 2025 with P4Language: Check out the [project idea](https://github.com/p4lang/gsoc/blob/main/2025/ideas_list.md#project-5) and become a contributor to P4 through Google Summer of Code! |
2 | 2 |
|
3 | 3 | # P4sim module in ns-3 for Programmable Data Plane simulation |
4 | 4 |
|
5 | 5 | P4sim is a P4-driven network simulator aiming at combining P4, the state-of-the-art programmable data plane language and ns-3, one of the most popular network simulators. P4sim is an open-source project under Apache License 2.0. |
6 | 6 |
|
| 7 | +P4sim with reference to behavioral models: [behavioral-model](https://github.com/p4lang/behavioral-model). |
| 8 | + |
7 | 9 | Our implementation was built upon the the P4-driven Network Simulator Module, as outlined in: |
8 | | -> Bai, Jiasong, Jun Bi, Peng Kuang, Chengze Fan, Yu Zhou, and Cheng Zhang. **NS4: Enabling programmable data plane simulation.** In Proceedings of the Symposium on SDN Research, pp. 1-7. 2018. Available at [ACM DL](https://dl.acm.org/doi/abs/10.1145/3185467.3185470) |
| 10 | +> Bai, Jiasong, Jun Bi, Peng Kuang, Chengze Fan, Yu Zhou, and Cheng Zhang. **"NS4: Enabling programmable data plane simulation."** In Proceedings of the Symposium on SDN Research, pp. 1-7. 2018. Available at [ACM DL](https://dl.acm.org/doi/abs/10.1145/3185467.3185470) |
| 11 | +
|
| 12 | +> Fan, Chengze, Jun Bi, Yu Zhou, Cheng Zhang, and Haisu Yu. **"NS4: A P4-driven network simulator."** In Proceedings of the SIGCOMM Posters and Demos, pp. 105-107. 2017. Available at [ACM DL](https://dl.acm.org/doi/10.1145/3123878.3132002) |
| 13 | +
|
| 14 | +⭐ More detail check our paper submitted on 21 March 2025: [P4sim: Programming Protocol-independent Packet Processors in ns-3](https://arxiv.org/abs/2503.17554) |
| 15 | + |
| 16 | +## P4Sim: NS-3-Based P4 Simulation Environment |
| 17 | + |
| 18 | +See [here](doc/vm-env.md). |
9 | 19 |
|
10 | | -# P4Sim: NS-3-Based P4 Simulation Environment |
| 20 | +## Simulation Parameters for P4 switch ## |
11 | 21 |
|
12 | | -See `vm-env.md`. |
| 22 | +In a P4 switch, the functionality is defined by the user's P4 program and the configuration of the flow table. But the following parameters can also be configured in ns-3 `ns3::P4SwitchNetDevice`. |
13 | 23 |
|
14 | | -## Simulation Parameters ## |
| 24 | +| Parameter | Description | |
| 25 | +|-----------------------|----------------------------------------------------------------------| |
| 26 | +| EnableTracing | Enable or disable tracing in the switch | |
| 27 | +| EnableSwap | Enable or disable swapping of the P4 configuration | |
| 28 | +| P4SwitchArch | Switch architecture: 0 for v1model, 1 for PSA, 2 for PNA | |
| 29 | +| JsonPath | Path to the compiled P4 JSON file (*.json) | |
| 30 | +| FlowTablePath | Path to the flow table configuration file | |
| 31 | +| InputBufferSizeLow | Input buffer size for low-priority packets (external packets) | |
| 32 | +| InputBufferSizeHigh | Input buffer size for high-priority packets (internal packets) | |
| 33 | +| QueueBufferSize | Total size of the queue buffer | |
| 34 | +| SwitchRate | Switch processing rate in packets per second (pps) | |
| 35 | +| ChannelType | Channel type: 0 for CSMA, 1 for point-to-point (P2P), default is CSMA| |
15 | 36 |
|
16 | | -## Simulation Script: ## |
| 37 | +Note: 1. When using a CSMA channel, make sure the ARP packets are correctly handled in the P4 scripts. |
| 38 | + 2. Buffer configuration only useful if the P4SwitchArch include that buffer. |
| 39 | + 3. EnableTracing: The implementation is not yet complete and currently only supports basic measurements such as throughput. |
| 40 | + |
| 41 | +## Simulation Examples: ## |
| 42 | + |
| 43 | +See [here](doc/examples.md). |
17 | 44 |
|
18 | 45 | ## Results Subdirectory ## |
19 | 46 |
|
| 47 | + |
| 48 | + |
20 | 49 | ## Doxygen Documents ## |
21 | 50 |
|
22 | 51 | ```bash |
|
0 commit comments