Code Monkey home page Code Monkey logo

p4-controller's Introduction

## Run the mininet topology (similar to the last chapter in the reader)

```bash
sudo python run_mininet.py --p4-file simple.p4
```
For all options run: python run_mininet.py -h

## Run the controller (different terminal)

```bash
python controller.py

```

For all options run: python controller.py -h

## Expected output from the controller:

Installed P4 Program using SetForwardingPipelineConfig on s1
Installed ingress forwarding rule on s0
Installed ingress forwarding rule on s0
Installed ingress forwarding rule on s0

----- Reading tables rules for s0 -----
MyIngress.ipv4_lpm:  hdr.ipv4.dstAddr ('\n\n\n\x01', 32) -> MyIngress.ipv4_forward port '\x00\x01'
MyIngress.ipv4_lpm:  hdr.ipv4.dstAddr ('\n\n\n\x02', 32) -> MyIngress.ipv4_forward port '\x00\x02'
MyIngress.ipv4_lpm:  hdr.ipv4.dstAddr ('\n\n\x03\x03', 32) -> MyIngress.ipv4_forward port '\x00\x03'



## Test your application using ping (h1 ping s1, h2 ping s1). Output:
mininet> h1 ping s1
PING 10.10.3.3 (10.10.3.3) 56(84) bytes of data.
64 bytes from 10.10.3.3: icmp_seq=1 ttl=64 time=0.348 ms
64 bytes from 10.10.3.3: icmp_seq=2 ttl=64 time=0.286 ms

--- 10.10.3.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 0.286/0.317/0.348/0.031 ms
mininet> h2 ping s1
PING 10.10.3.3 (10.10.3.3) 56(84) bytes of data.
64 bytes from 10.10.3.3: icmp_seq=1 ttl=64 time=0.336 ms
64 bytes from 10.10.3.3: icmp_seq=2 ttl=64 time=0.272 ms

--- 10.10.3.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1029ms
rtt min/avg/max/mdev = 0.272/0.304/0.336/0.032 ms

p4-controller's People

Contributors

xvllinihao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.