Layer 2 OpenFlow switch

While we have lots of choices when it comes to learning and dissecting Ryu OpenFlow applications, we want to pick something simple that we have already worked with. By simple, I mean we want to pick something in which we know how the technology works so we can focus on just the new information, such as how Ryu uses Python to implement OpenFlow technologies. To that end, the Layer 2 OpenFlow switch application that we saw earlier would be a good candidate. Most of us network engineers know how switching works, especially in a single-switch setup (without spanning tree, which is not so simple).

As a reminder, if you are using the SDNHub virtual machine and are logged in as the default user Ubuntu, the application file is located under /home/ubuntu/ryu/ryu/app/simple_switch_13.py:

ubuntu@sdnhubvm:~[21:28]$ ls ryu/ryu/app/simple_switch_13.py
ryu/ryu/app/simple_switch_13.py

The file is surprisingly short: fewer than 100 lines of code minus the comments and import statements. This is mainly due to the fact that we are able to abstract and reuse common Python codes such as packet decode, controller, and ofprotocol. Let's start by thinking about what a controller and switch should do in this scenario.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.139.168