A network is a collection of two or more devices that can connect, whether physically or virtually. The Docker network is a virtual network developed by Docker to facilitate communication between Docker containers.
Following are the types of Docker Networking:
Docker Single Host Networking provides communication between containers on the same host via a virtual network bridge, allowing for smooth interaction while isolating them from external networks.
Docker Multi-Host Networking enables containers running on various hosts to communicate with one another via overlay networks, offering seamless connectivity across distributed settings while abstracting underlying network difficulties.
Docker network drivers define networking behavior, allowing containers to communicate with one another.
An IP address consists of four numbers separated by periods. In general, it looks like 147.181.183.86. The numbers will range from 0 to 255. So, 255 is the greatest number in an IP address, and 0 is the smallest value.
Similar to an IP address, and used to group IP addresses. The common subnet mask is 255.255.255.0. These numbers range from zero to 255.
The default bridge driver in Docker creates a private network for a single host, with each container having its network namespace. It allows containers to communicate within the bridge but limits communication between containers on different bridges, while also permitting external access via port mapping.
The Host Network Driver allows containers to use the host's network stack directly, removing network isolation between the host and the containers. It is useful for deploying one or more containers on a single host while ensuring that each container uses a unique port.
The Overlay driver enables communication between Docker daemons in a swarm, resulting in simple and secure multi-host networking. It facilitates seamless communication between all containers in the overlay network.
IPvlan in Docker allows each container to have its own unique MAC address and IP address on the same subnet, allowing network isolation while directly accessing the host's physical network interface.
Macvlan in Docker assigns a unique MAC address to each container on the host's physical network, allowing them to communicate with external networks as if they were physical devices. This provides network isolation and boosts performance for containerized apps.