vrnetlab / vrnetlab

Run virtual routers with docker
MIT License
1.2k stars 349 forks source link

Propagate link down to virtual machine/router #174

Open plajjan opened 6 years ago

plajjan commented 6 years ago

The interfaces of our virtual routers never go down. I suspect this is a consequence of using the qemu socket stuff for exposing the interfaces on the VM host level. It would be really sweet if they did go down.

It seems pretty straight forward to me to have the interface go down simply based on if the qemu TCP socket is connected or not. This would probably work quite well with vr-xcon. Maybe we would need a shutdown function for vr-xcon where it would explicitly terminate its TCP connetcions using FIN etc instead of just waiting for some timeout. I want "kill vr-xcon" to lead to link down on the virtual routers "immediately". In the end we want to be able to measure convergence time (roughly) based on this.

sbng commented 6 years ago

Just a suggestion. Instead of using vr-xcon, can we use a tap interface instead of a socket? Then we insert the tap interface into a Linuxbridge and bridge it to a ethX interface. That way, we can use docker networking to interconnect the VR. What do u see the downside of this approach?

plajjan commented 5 years ago

@sbng I think I avoided the docker networking when I started this because it wasn't very workable using multiple networks and it does things that I wasn't interested in. For example, vr-xcon only deals with L2 connectivity and doesn't try to meddle with IP addresses - that's up to the configuration of the virtual routers. Docker on the other hand likes to assign IP addresses to networks and containers connected to those networks. This in turn means we either have to provide dummy data or actually use it.. but that would interfere with higher layer IP assignment.

I also quite liked how contained the vr-xcon solution is. We don't need to create any bridges or similar on the host machine. If you want to explore this option further I suggest opening a new issue about it since it's really orthogonal to this one.