Docker weave introduction or working principles

Source: Internet
Author: User

Docker weave Network

Weave implements an overlay network between docker hosts. It uses industry-standard vxlan encapsulation and UDP-based transmission, which can also be encrypted.

Weave net creates a virtual network that connects multiple docker hosts. Similar to an Ethernet switch, all containers are connected to this network and communicate with each other.

Weave net is composed of multiple peers. The weave router runs a user space process on different docker hosts. Each peer has a name, and the restart remains unchanged. They connect to each other over TCP, and then exchange topology information.

Weave net can route data packets in some connected networks with a numbered topology.

For example, in the following network, peer1 connects 2 and 3 directly, but if 1 needs to send data packets to 4 and 5, it must first be sent to peer3.

"Fast data path" in weave net uses the openvswich datapath module of the Linux kernel. This module enables the weave net router to tell the kernel how to process data packets.

Openvswich datapath and vxlan functions are supported in Linux kernel version 3.12 +. If the kernel does not support them, weave net uses the "user mode" data packet path. Weave net automatically selects the fastest path between two hosts to transmit data, providing near native throughput and latency.

Features:

# IP Address Management (IPAM) weave automatically assigns a unique IP address to the container. You can use weave PS to view # The containers named and discovered are automatically registered to weave DNS and can be accessed by container name. Note: weave maintains a micro-DNS server. Host Name communication is supported. # Server Load balancer allows you to register multiple containers with the same name. Weave DNS randomly returns the address for each request and provides basic Server Load balancer functions. Note: If the access container name is the same, it will automatically poll the access to the container to achieve load balancing. # Manually specify the IP address docker run-it-e weave_cidr = 10.32.0.100/24 busybox # The dynamic topology can be added to or from the weave network without stopping or re-configuring the remaining docker host delete in weave Network # Fault-Tolerant weave peer constantly exchanges topology information, monitors and establishes network connections with other peers. If a host or network fault occurs, weave bypasses the host and ensures that the containers on both sides can continue to communicate. When the fault is recovered, the full connection will be restored.

How docker weave works

  • Nic Device
  • Container eth0: Eth0 is the default network of the container host. It mainly provides services provided by the container to access the Internet and adopts the default docker network architecture, except that it creates the bridge docker_gwbridge.
  • Docker_gwbridge: Docker_gwbridge is the bridge created by the container. It replaces the docker0 service.
  • Contailner ethwe: It is a veth pair Virtual Device pair that communicates with other containers.
  • Vethwe-Bridge: The weave bridge created by the ethwe device. The specific IP address and gateway allocated in the bridge.
  • Weave: Weave bridge, locate the target through the route table, and forward data packets to the peer port node through the port.
  • Eth0: A real Nic is connected to an external Nic. It is used to forward packets from the vxlan and Nat containers to the specified peer node.
  • Note: weave learns from each other, communicates with each other through the route table, and sends data through a separate port. Similar to Static Routing.

Contailner ethwe sends data packets to the peer container for communication

1,Ethwe sends the packet to the vethwe-bridge.
2,After the vethwe-bridge receives the data packet, weave processes the data and forwards the data to the next route by using the udp6783 data port according to the route table of weave.
3,If the node is the destination, the local weave forwards the information to the TCP protocol site of the kernel and then forwards it to the destination node.

 

Docker weave introduction or working principles

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.