Docker uses the concept of the Container Network Model (CNM). In essence, CNM allows you to create small, segmented networks for groups of containers to communicate over. Let's explain the model using the following diagram:
There are three entities present in the CNM:
sandbox: This is an isolated environment holding the networking configuration for a container.
endpoint: This is a network interface that can be used for communication over a specific network. Endpoints join to exactly one network. Multiple endpoints can exist within a single network sandbox.
network: It's a group of endpoints that are able to communicate with each other. You could create, for example, two separate networks, and they will be completely isolated. Network can be identified by their names (such as backend and frontend) or IDs (generated automatically by Docker during the network creation).
Docker networking model also introduces the concept of network drivers. By default, two network drivers...