Floodlight REST Interface
We can use the browser to view Floodlight's real time information. The URL can be http://172.16.0.179:8080/ui/index.html or http://127.0.0.1:8080/ui/index.html if users access it from Controller PC.
Figure 17 – Access Floodlight Info
User should pay attention to the DPID in the picture above. User needs to replace it with user's own DPID in the following tests.
curl
Use the command line tool curl for transferring data with URL syntax. It is also the tool to send Floodlight REST APIs to configure Pica8 switch flows. We can use apt-get to install it on Controller PC:
- sudo apt-get install curl
Add Flows
Here is the command to add a flow from port 1 to port 2:
- curl -d '{"switch": "67:8c:08:9e:01:82:38:26", "name":"pc1-pc2", "cookie":"0", "priority":"0", "ingress-port":"1", "active":"true", "actions":"output=2"}' http://127.0.0.1:8080/wm/staticflowentrypusher/json
We need another flow from port 2 to port 1 in order to make the ping between PC1 and PC2 work.
- curl -d '{"switch": "67:8c:08:9e:01:82:38:26", "name":"pc2-pc1", "cookie":"0", "priority":"0", "ingress-port":"2", "active":"true", "actions":"output=1"}' http://127.0.0.1:8080/wm/staticflowentrypusher/json
Now, the ping from PC1 to PC2 works.
Figure 18 – Ping Successes
We can add the same flows between port 3 and port 4 to make ping working between them.
Figure 19 – Flows Added
Delete Flows
We can remove all of the flows by issuing:
Copyright © 2024 Pica8 Inc. All Rights Reserved.