In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to analyze Docker cross-host network, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
You have learned several Docker network schemes: none, host, bridge, and joined containers, which solve the problem of container communication within a single Docker Host.
Cross-host network solutions include:
Docker native overlay and macvlan.
Third-party solutions: commonly used include flannel, weave, and calico.
Docker network is a very active technical field, and new solutions are constantly being developed, so there is a very important question to ask:
How are so many solutions integrated with docker?
The answer is: libnetwork and CNM.
Libnetwork & CNM
Libnetwork is a docker container network library, and the core content is its defined Container Network Model (CNM). This model abstracts the container network and is composed of the following three types of components:
Sandbox
Sandbox is the network stack of the container and contains the container's interface, routing table, and DNS settings. Linux Network Namespace is the standard implementation of Sandbox. Sandbox can contain Endpoint from different Network.
Endpoint
The purpose of Endpoint is to connect Sandbox to Network. A typical implementation of Endpoint is veth pair, which we will give an example later. An Endpoint can only belong to one network, and can only belong to one Sandbox.
Network
Network contains a set of Endpoint, and Endpoint of the same Network can communicate directly. The implementation of Network can be Linux Bridge, VLAN, and so on.
The following is an example of CNM:
As shown in the figure, there are two containers, one container and one Sandbox, each Sandbox has an Endpoint connected to Network 1, and the second Sandbox has an Endpoint to connect it to Network 2.
Libnetwork CNM defines the network model of docker container, and the driver developed according to this model can work with docker daemon to realize the container network. The native driver of docker includes none, bridge, overlay and macvlan, and the third-party driver includes flannel, weave, calico and so on.
Let's take docker bridge driver as an example to discuss how libnetwork CNM is implemented.
This is a container environment that we discussed earlier:
Two Network: the default network "bridge" and the custom network "my_net2". The implementation is Linux Bridge: "docker0" and "br-5d863e9f78b6".
Three Enpoint, implemented by veth pair, with one end (vethxxx) hanging on the Linux Bridge and the other end (eth0) hanging in the container.
Three Sandbox, implemented by Network Namespace, each container has its own Sanbox.
On how to analyze Docker cross-host network to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.