Abstraction for interface parameters
jadinm opened this issue · comments
Mathieu Jadin commented
I think that it would be interesting to have an abstraction for interface parameters (IP addresses, tc parameters, radvd parameters,...) like with have for daemons (router.addDaemon()
).
Instead of
self.addLink(r1, r2, params1={"ip": ("2001:1341::1/64", "2001:2141::1/64"), "delay": "1ms","bw": 10}, params2={"ip": ("2001:1341::2/64", "2001:2141::2/64"), "delay": "1ms","bw": 10})
we could have
l = self.addLink(r1, r2)
l[r1].addParams(ip=("2001:1341::1/64", "2001:2141::1/64"), delay="1ms", bw=10)
l[r2].addParams(ip=("2001:1341::2/64", "2001:2141::2/64"), delay="1ms", bw=10)
or when we have parameters for both interfaces
l.addSymParams(delay="1ms", bw=10)
We could also have a separate abstraction for adding IP subnets (with first interface address always ending by ::1 and the second one ending by ::2)
l.addSubnets("2001:1341::/64", "2001:2141::/64")
Do you have any though on this @oliviertilmans ?
Olivier Tilmans commented
l = self.addLink(r1, r2)
l[r1].addParams(ip=("2001:1341::1/64", "2001:2141::1/64"), delay="1ms",
bw=10)
l[r2].addParams(ip=("2001:1341::2/64", "2001:2141::2/64"), delay="1ms",
bw=10)
You would probably need to override the underlying multigraph used in mininet
to store links and their attributes for that. One issue here is that mininet keys
the link parameters using params1/params2 and not the src/dst node names
so you would need to track which node is at what end of the link to properly
map your addParams to either params1 or params2.
or when we have parameters for both interfaces
l.addSymParams(delay="1ms", bw=10)
This is (should be) the current behavior if you append those parameters at the
end of the link creation.
See https://github.com/mininet/mininet/blob/master/mininet/link.py#L443
We could also have a separate abstraction for adding IP subnets (with first
interface address always ending by ::1 and the second one ending by ::2)
l.addSubnets("2001:1341::/64", "2001:2141::/64")
The issue is that subnets can span across multiple links in L2-switched domains.
This nonetheless sounds like a valuable feature.
Could this maybe find its way through an overlay? E.g.
- Add an SubnetOverlay with the links it should contain
* Perform a basic connectivity check on the graph and warn if the links are not all part of the same connected component of the network graph
- Apply the overlay _before_ instantiating the network through IPNet() so that it overrides all the needed ip addresses
- Check in the auto-allocation code in IPNet that the current broadcast domain does not have already an assigned subnet
- Add a filter in the auto-allocation code in IPNet to check that the subnets it allocates were not already allocated through overlays or direct editing of the link/interface params
…
Do you have any though on this @oliviertilmans
<https://github.com/oliviertilmans> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#37?email_source=notifications&e
mail_token=AAJVCUMWXQMDQLPXA6GAGJLQBFUBRA5CNFSM4IGYPDV2YY3P
NVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HBNSUBQ> ,
or mute the thread <https://github.com/notifications/unsubscribe-
auth/AAJVCUNFJYO2DUKYXCIB5TTQBFUBRANCNFSM4IGYPDVQ> .
<https://github.com/notifications/beacon/AAJVCUMPW4C5ULCDUZGW47TQB
FUBRA5CNFSM4IGYPDV2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NN
VSW45C7NFSM4HBNSUBQ.gif>