docklet/doc/devdoc/network-arch.md

29 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2017-06-19 00:29:36 +08:00
# Architecture of Network
2017-06-30 11:39:18 +08:00
## Architecture of containers networks
In current version, to avoid VLAN ID using up, docklet employs a new architecture of containers networks. According to the new architecture, users' networks are exclusive, while the network were shared by all users before. And the new architecture gets rid of VLAN, so it solves the problem of VLAN ID using up. The architecture is shown as follows:
2017-06-19 00:29:36 +08:00
![](./ovs_arch.png)
2017-06-30 11:39:18 +08:00
There are some points to describe the architecture:
2017-06-19 00:29:36 +08:00
2017-06-30 11:39:18 +08:00
1.Each user has an unique and exclusive virtual network. The container inside the network communicates with outside via gateway.
2017-06-19 00:29:36 +08:00
2017-06-30 11:39:18 +08:00
2.If there is a container in the host, then there will be a user's OVS bridge. Each user's container will connect to user's OVS bridge by Veth Pair. A user's OVS bridge will be named after "docklet-br-<userid>".
2017-06-19 00:29:36 +08:00
2017-06-30 11:39:18 +08:00
3.Each user's network is star topology, each host on which there is no gateway will connect to the host on which the user's gateway is by GRE tunnel. Thus, there may be many GRE tunnels between two hosts(Each GRE tunnels belongs to different user.), Docklet takes user's id as keys to distinguish from each other.
2017-06-19 00:29:36 +08:00
2017-06-30 11:39:18 +08:00
4.OVS bridge and GRE tunnels are created and destroyed dynamically, which means that network including bridge and GRE tunnels is created only when user starts the container and is destroyed by calling '/conf/lxc-script/lxc-ifdown' script only when user stops the container.
2017-06-19 00:29:36 +08:00
2017-06-30 11:39:18 +08:00
5.There are two modes to set up gateways: distributed or centralized. Centralized gateways is the default mode and it will set up the gateways only on Master host, while distributed gateways mode will set up gateways on different workers, just like the picture shown above. NAT/iptables in Linux Kernel is needed when container communicate with outside network via gateway.
2017-06-19 00:29:36 +08:00
## Processing users' requests (Workspace requests)
2017-06-30 11:39:18 +08:00
The picture of processing user's requests will show the whole architecture of Docklet. The process is shown as follows, firstly, these are the requests to Workspace:
2017-06-19 00:29:36 +08:00
![](./workspace_requests.png)
## Processing users' requests (Other requests)
2017-06-30 11:39:18 +08:00
Other requests.
2017-06-19 00:29:36 +08:00
![](./other_requests.png)