I want to study more on the architecture of simple_switch. The kind of queue it uses, packet I/O. I was referring to this document (behavioral-model/simple_switch.md at main · p4lang/behavioral-model · GitHub) but it doesn’t specify the overall architecture. Does the simple switch uses the queue of the physical NIC driver that it binds to as a port?
I am not aware of any high level documentation of simple_switch. There is the source code, of course, but I realize that is not a quick introduction.
When starting simple_switch, it is typical for users to provide command line options of the form
-i 0@veth0 -i 1@eth17, with one
-i option per simulated switch port. One typically also runs simple_switch with root privileges, e.g. using
I was not able to quickly find the source code in the behavioral-model repo that shows where packets are read from interfaces, or written to interfaces, but I am pretty sure it must be something available to user space processes running as root, perhaps putting the interface in promiscuous mode.
In case you were unaware, simple_switch is NOT intended to achieve the highest possible performance that one can possibly do with a Linux user space process. It is intended for debug and development of P4 programs. See more details here: behavioral-model/performance.md at main · p4lang/behavioral-model (github.com)
@andyfingerhut Thank you for your reply. Even I am not able to find a high level documentation of simple_switch. Would be helpful if someone could point me to it if it was documented. Reading the source code directly is bit hard.