opened
MadhavChoudhary
username_0
This command: 
```
sudo ./simple_switch -i 0@<iface0> -i 1@<iface1> <path to JSON file>
```
is supposed to create network interfaces ``iface0`` and ``iface1``, but after running the command, i see in ifconfig that they are not created.
But upon running netstat, I see that the port 9090 is active and that simple_switch program is running it. 
Is this supposed to happen? I have to run a test by connecting to this interface. (p4benchmark test)
simple_switch not creating interfaces
issue
created
jafingerhut
username_1
simple_switch does not create veth virtual Ethernet interfaces -- they must be created before running simple_switch.  The `-i` command line option tells simple_switch which interfaces to use as switch ports.

See the `veth_setup.sh` shell script, which you can run as root using the command `sudo veth_setup.sh`, to create many veth interfaces for your use.
comment
created
MadhavChoudhary
username_0
Actually I am working on macOS, so that ``veth_setup.sh`` is not working for me.
On ubuntu VM,
I ran the ``simple_switch`` with an input json file in one terminal, 
applied some runtime commands with ``runtime_CLI.py`` in another terminal.
And tried sending some packets to simple_switch from another terminal. 
I got this error message:
```
sudo $SWITCH_PATH $PROG.json -i 0@veth0 -i 1@veth2 -i 2@veth4 -i 3@veth6 -i 4@veth8 --log-console
[11:27:38.910] [bmv2] [D] [thread 3086] [0.0] [cxt 0] Processing packet received on port 0
[11:27:38.910] [bmv2] [D] [thread 3086] [0.0] [cxt 0] Parser 'parser': start
[11:27:38.910] [bmv2] [D] [thread 3086] [0.0] [cxt 0] Parser state 'start' has no switch, going to default next state
[11:27:38.910] [bmv2] [T] [thread 3086] [0.0] [cxt 0] Bytes parsed: 0
./run_switch.sh: line 35:  3065 Segmentation fault      (core dumped) sudo $SWITCH_PATH $PROG.json -i 0@veth0 -i 1@veth2 -i 2@veth4 -i 3@veth6 -i 4@veth8 --log-console
```
I ran the same in my friends computer with ubuntu, I got no error and the packets were received.
comment
created
jafingerhut
username_1
The crash that you were able to cause in simple_switch could be a bug in either simple_switch, or perhaps in the p4c compiler in producing a $PROG.json file that does not conform to simple_switch's expectations.  If you can reproduce it and provide the P4 source file, JSON file, and preferably also the table entries you added and packet you sent, then if someone else can reproduce it, they might be able to fix it.

Before doing all of that, though, it would be worth verifying that you are using the latest versions of p4c and simple_switch.  Assuming you built them from source code, the latest 'git commit' is the best indication right now of what version you are running, e.g.:

```
$ cd <your copy of the p4lang/p4c repository>
$ git log . | head
commit 9ea3890f6bcd650432a495f3e01d2db8efd3f05d
Author: Antonin Bas <antonin@barefootnetworks.com>
Date:   Fri May 11 13:21:07 2018 -0700
```
comment
closed
MadhavChoudhary
username_0
issue