Jiarre / SDN-distributed-controllers

Traineeship project. Implementation of distributed, flat SDN controllers that interact via east/west bound communication using Zenoh
https://iris.unitn.it/retrieve/handle/11572/355882/586477/Flat_Multi_Zone_Multi_Controller_SDNs_using_Zenoh.pdf
4 stars 0 forks source link

steps to use it #1

Open stevebobaaa opened 11 months ago

stevebobaaa commented 11 months ago

Hello, I am very interested in this project and would like to further investigate it. Could you please tell me the steps to use it

Jiarre commented 11 months ago

Hello,

The general usage of this repo consists of starting the controllers in different hosts using Ryu (you can use the scripts c1.sh, c2.sh, and c3.sh), and then starting the mininet topology (network.py). The other files present on the repo are mostly related to the testing I was performing. You can read more about the setup and parameters I used for testing on the paper that was published on this work:

F. Giarré, L. Cominardi and P. Casari, "Realizing Flat Multi-Zone Multi-Controller Software-Defined Networks using Zenoh," 2022 IEEE Conference on Network Function Virtualization and Software Defined Networks (NFV-SDN), Phoenix, AZ, USA, 2022, pp. 45-51, doi: 10.1109/NFV-SDN56302.2022.9974876.

Please note that has been a while since this was originally run, and I'm pretty sure that Zenoh's APIs were quite different at the time, I recommend having a look at their documentation in order to fix the problems or using the old version as reported in the paper.

Feel free to ask any other question if needed!

stevebobaaa commented 11 months ago

Thank you very much for your reply!! Do I need to run c1, c2, and c3 controllers on three different hosts? Why are the three controller IPs in network.py the same?

CONTROLLER1 = "192.168.86.15:6633" CONTROLLER2 = "192.168.86.15:6634" CONTROLLER3 = `"192.168.86.15:6635"

And Zenoh is already embedded in controllerz *. py, right? I don't need to start Zenoh additionally, do I?

Jiarre commented 11 months ago

You're right!

For development and testing purposes the controllers were started on the same hosts in different ports (as you pointed out), but in order to test distribution in a wider network you would want to initialize the controllers in different hosts. This may vary on the setup you want to test (you may be more interested on multiple controllers on a single host).

For what concerns Zenoh, you don't need to start the Zenoh-router daemon if you run everything on the same host, but the latter is required if you use multiple hosts because the different daemons will connect with each other.

You may check the Zenoh configuration that suits you more on this page: https://zenoh.io/docs/getting-started/deployment/

stevebobaaa commented 11 months ago

Ok, I'll try to run it and I'll ask you if I have any more questions.Thank you so much!

stevebobaaa commented 11 months ago

Hello, may I ask what version of Zenoh should I install? Is it Zenoh-Python? I tried to install using pip install eclipse-zenoh and ranryu-manager controllerz1.py --observe-links --ofp-tcp-listen-port 6633 &, but encountered an error: ImportError: cannot import name 'SubMode' from 'zenoh' (/home/jkc/.local/lib/python3.8/site-packages/zenoh/init.py)

Jiarre commented 11 months ago

Unfortunately I have no record of the version of Zenoh-Python used (apart from the fact that it was a nightly release and that the project is from early 2022).

Fortunately, the usage of Zenoh in those scripts is quite basic, hence you should be able to change the syntax to the latest one with ease.

I should also mention that Zenoh's team is pretty fast with replies, so for implementation-related question I recommend to refer to them.

stevebobaaa commented 11 months ago

OK, Thank you, I will try to change the syntax. So, it's okay to use install eclipse-zenoh to install zenoh, or do I need to install it from source code?

Jiarre commented 11 months ago

Exactly! The Python package should contain all you need to run the scripts locally (and in a LAN). In order to displace Zenoh in multiple networks you may need to install (by compiling from source or downloading the docker container for instance) Zenoh router.

stevebobaaa commented 11 months ago

Okay, I really appreciate your guidance. I will try it now.

stevebobaaa commented 11 months ago

I'm sorry to bother you again, but I don't know how to modify the code to adapt to the current version of Zenoh because there have been too many changes in Zenoh. TAT

stevebobaaa commented 11 months ago

OMG, I found that many APIs in the code are from Zenoh Net, but the (https://zenoh.io/docs/migration/migrationguide-python-v0.5.x-v0.6.x/) link says that Zenoh Net has been removed. What do you think should be done next?

Jiarre commented 11 months ago

Sorry to hear that. The Zenoh infrastructure of the project as you can read on the paper (and as you can read in the code) is quite limited (lines 219 to 232 in controllerz1.py) and simple:

For what I recall, there was nothing more to these implementation than what is contained in the basic tutorials, so you should be able to change it even if starting from scratch following the new docs (https://zenoh-python.readthedocs.io/en/0.10.0-rc/).

Anyways, I would recommend you to contact the team on their discord channel for any clarification on functions and new features (or how to replace old ones) that may have been added, since they are usually quick and very helpful!

stevebobaaa commented 11 months ago

Hello, I have modified the section of the code regarding Zenoh configuration according to the documentation on the Zenoh official website (lines 219-232 in controller1, 226-239 in controller2, and 233-247 in controller3).

Now the controller can run, but only loading app controllerz1.py appears after running, and there is no other response.

Moreover, after running network.py, I found that the network is not ping properly using pingall. What is the reason? Thank you!

stevebobaaa commented 11 months ago

May I ask where else I need to try to modify?

Jiarre commented 11 months ago

Hi, sorry I made you wait.

For what concerns network.py:

For what concerns the controller scripts:

To sum up, 3 kinds of problems:

As mentioned in previous comments there is nothing really complicated in the logic of these scripts, so playing around printing logs and using console tools should lead to the root of the problem pretty quickly.

stevebobaaa commented 11 months ago

Oh, It doesn't matter.

When I started three controllers and ran mininet, running the pingall command resulted in a 100% drop. I also have tried using mininet to create a simple linear topology, separately starting controllerz1 and connecting it with mininet, but the network is not working.

stevebobaaa commented 11 months ago

Is there any difference between the controller in reactive and the controller in hybrid? I was wondering if it might be this problem