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
*[To build the virtual machine](#to-build-the-virtual-machine)
11
12
*[Accessing the VM](#accessing-the-vm)
@@ -83,6 +84,23 @@ All exercises in this repository use the v1model architecture, the documentation
83
84
1. The BMv2 Simple Switch target document accessible [here](https://github.com/p4lang/behavioral-model/blob/master/docs/simple_switch.md) talks mainly about the v1model architecture.
84
85
2. The include file `v1model.p4` has extensive comments and can be accessed [here](https://github.com/p4lang/p4c/blob/master/p4include/v1model.p4).
85
86
87
+
## P4sim – A Simple P4 Behavioral Simulator
88
+
89
+
**P4sim** is a lightweight, dependency-free P4 packet-processing simulator designed for learning and experimentation.
90
+
Unlike BMv2 or P4-DPDK, P4sim does **not** emulate a full switch pipeline. Instead, it provides a minimal execution environment that evaluates P4 parser, control, and deparser logic on user-provided packets.
91
+
92
+
P4sim is intended for:
93
+
94
+
* Running P4 programs without installing large data plane frameworks
95
+
* Quickly testing parser and control-flow behavior
96
+
* Understanding how P4 programs process packets step-by-step
97
+
98
+
P4sim is **not** a performance model and does not aim to replicate full-featured switch behavior (such as multitable pipelines, extern objects, or architecture-specific metadata).
99
+
It is mainly a **teaching and debugging tool**.
100
+
101
+
To learn more or try P4sim examples, see:
102
+
[`P4sim/README.md`](./doc/P4sim/README.md)
103
+
86
104
## Obtaining required software
87
105
88
106
If you are starting this tutorial at one of the proctored tutorial events,
It is recommended to use a **virtual machine** with Vagrant to simplify the installation and ensure compatibility.
14
14
15
-
## <aname="local-deployment-ns339"></a> Local Deployment (ns-3.39)[⤴️](#index)
15
+
## <aname="local-deployment-ns339"></a> Local Deployment (ns-3.39)
16
16
17
17
This guide walks you through setting up a local environment to run the P4Sim integrated with `ns-3.39` on Ubuntu 24.04. The full setup includes installing the behavioral model (`bmv2`), setting up SSH for remote access, and building the ns-3 project with P4Sim support. This is tested with `Ubuntu 24.04 LTS Desktop`.
18
18
19
-
> ⚠️ Note: The bmv2 and P4 software installation step will take **~3 hours** and consume up to **15GB** of disk space.
19
+
> Note: The bmv2 and P4 software installation step will take **~3 hours** and consume up to **15GB** of disk space.
20
20
21
21
---
22
22
23
-
## 📁 1. Initialize the Working Directory
23
+
## 1. Initialize the Working Directory
24
24
25
25
Create a workspace and install basic development tools.
26
26
@@ -33,7 +33,7 @@ sudo apt install git vim cmake
33
33
34
34
---
35
35
36
-
## 🛠️ 2. Install P4 Behavioral Model (bmv2) and Dependencies
36
+
## 2. Install P4 Behavioral Model (bmv2) and Dependencies
37
37
38
38
> This installs all necessary libraries and tools for P4 development (via the official `p4lang/tutorials` repo).
39
39
@@ -53,7 +53,7 @@ simple_switch
53
53
54
54
---
55
55
56
-
## 🧪 3. Clone and Build ns-3.39 with P4Simulator
56
+
## 3. Clone and Build ns-3.39 with P4Simulator
57
57
58
58
### Step 3.1: Clone ns-3.39
59
59
@@ -83,7 +83,7 @@ cd ../..
83
83
84
84
---
85
85
86
-
## ▶️ 4. Run an Example
86
+
## 4. Run an Example
87
87
88
88
You can run a built-in example using:
89
89
@@ -93,7 +93,7 @@ You can run a built-in example using:
93
93
94
94
---
95
95
96
-
## 🔧 5. Configure P4 Files in Your Simulation
96
+
## 5. Configure P4 Files in Your Simulation
97
97
98
98
You may need to **manually update file paths** for P4 artifacts in your simulation code.
99
99
@@ -110,17 +110,17 @@ Make sure these paths match your actual working directory and files.
110
110
111
111
---
112
112
113
-
## ✅ Done!
113
+
## Done!
114
114
115
115
You now have a working ns-3.39 simulator with P4 integration ready for your experiments.
116
116
117
117
---
118
118
119
-
## 📬 Feedback or Issues?
119
+
## Feedback or Issues?
120
120
121
121
If you encounter problems or have suggestions, feel free to open an issue or contact the maintainer.
122
122
123
-
✉️ **Contact:**mingyu.ma@tu-dresden.de
123
+
**Contact:**mingyu.ma@tu-dresden.de
124
124
125
125
126
126
@@ -141,7 +141,7 @@ Notes:
141
141
142
142
---
143
143
144
-
## <aname="setup-ns335"></a> Setup Instructions for ns-3 version 3.x - 3.35 (Build with `waf`)[⤴️](#index)
144
+
## <aname="setup-ns335"></a> Setup Instructions for ns-3 version 3.x - 3.35 (Build with `waf`)
145
145
146
146
This has been tested with ns-3 repo Tag `ns-3.35`.
## ⭐ <aname='setup-ns339'></a> Setup Instructions for ns-3 version 3.36 - 3.39 (Build with `Cmake`)[⤴️](#index)
217
+
## <aname='setup-ns339'></a> Setup Instructions for ns-3 version 3.36 - 3.39 (Build with `Cmake`)
218
218
219
219
This has been tested with ns-3 repo Tag `ns-3.39`. Because the virtual machine will build BMv2 and libs with **C++17**, and ns-3 p4simulator using the external inlucde file and libs, therefore the ns-3 also need to build with **C++17**.
220
220
The include file is: `/usr/local/include/bm`, the libs is `/usr/local/lib/libbmall.so`.
0 commit comments