Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

of_topology cannot get bidirectional links between host and switch #306

Open
xiangq27 opened this issue Oct 12, 2017 · 3 comments
Open

of_topology cannot get bidirectional links between host and switch #306

xiangq27 opened this issue Oct 12, 2017 · 3 comments

Comments

@xiangq27
Copy link

xiangq27 commented Oct 12, 2017

I ran a simple mininet topology: h1--s1--s2--h2, let h1 ping h2 and then h2 ping h1. Both way work. Then I use the API provided by of_topology to get all the links. However, I notice that only 4 links are discovered, i.e., h1->s1, s1->s2, s2->s1 and s2->h2. The other two links s1->h1 and h2->s2 are not captured. Wonder if this was noticed before?

@xiangq27
Copy link
Author

Update:

I report the wrong observation. The links returned are s1->h1, s1->s2, s2->s1 and s2->h2. And I think I found the cause in the following snipped in of_topology/main.py:

103 if endpoint in switches_mac_address:
104 continue
105
106 link = {'source': interface.id,
107 'target': endpoint.value,
108 'type': 'link'}
109 host = {"type": 'host',
110 "id": endpoint.value,
111 "name": endpoint.value,
112 "mac": endpoint.value}
113 if host not in nodes:
114 nodes.append(host)
115 if not interface.is_link_between_switches():
116 links.append(link)

When adding the link between host and a switch interface, only one link (switch intercace, hsot) is added, where the other direction should be added, too.

Comments?

@xiangq27
Copy link
Author

Update:

I created a pull request (#307) to fix this issue. Please comment and let me know. Thank you very much.

@renanrodrigo
Copy link
Contributor

Hello @xiangq27 ,
First of all, thanks for your collaboration.
Due to the holiday this weekend, the team will be able to send you proper feedback only next monday.
Besides that, we are working on a new version of the topology NApp, which shall be released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants