Docker 101 : Containers networking and Flannel network plugin
To be able to communicate with applications outside of the host, we map the port of the application running inside the container to a port on the host.
Only the IP address of the host is used for external communications.
To be able to use the IP addresses of the containers outside of their host, we assign unique IP addresses to the containers and we use a network plugin like Flannel to route traffic between containers that "live" on different hosts.
Flannel runs as a daemon called "flanneld" on each host that is running containers .
Flannel uses the TUN/TAP Linux devices to create UDP - layer 3 - to encapsulate IP packets.
The TUN represents the IP layer in a way and TAP represents the hardware layer or the Ethernet layer.
Remark:
Flannel keeps track of the each container IP address along with the IP address of the host it "lives" on in some sort of routing table.
Example:
The containers IP addresses and the host IP addresses live on different networks.
Comments