mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #200 from codergr/orthographic-corrections2
Proofing design and bridge documentations
This commit is contained in:
commit
2ba2884981
2 changed files with 15 additions and 15 deletions
|
@ -1,7 +1,7 @@
|
|||
Bridge Driver
|
||||
=============
|
||||
|
||||
The bridge driver is an implementation that uses Linux Bridging and iptables to provide connectvity for containers
|
||||
The bridge driver is an implementation that uses Linux Bridging and iptables to provide connectivity for containers
|
||||
It creates a single bridge, called `docker0` by default, and attaches a `veth pair` between the bridge and every endpoint.
|
||||
|
||||
## Configuration
|
||||
|
|
|
@ -2,8 +2,8 @@ Design
|
|||
======
|
||||
|
||||
The vision and goals of libnetwork are highlighted in [roadmap](../ROADMAP.md).
|
||||
This document describes how libnetwork has been designed in order to acheive this.
|
||||
Requirements for individual releases can be found on the [Project Page](https://github.com/docker/libnetwork/wiki)
|
||||
This document describes how libnetwork has been designed in order to achieve this.
|
||||
Requirements for individual releases can be found on the [Project Page](https://github.com/docker/libnetwork/wiki).
|
||||
|
||||
Many of the design decisions are inspired by the learnings from the Docker networking design as of Docker v1.6.
|
||||
Please refer to this [Docker v1.6 Design](legacy.md) document for more information on networking design as of Docker v1.6.
|
||||
|
@ -22,19 +22,19 @@ Libnetwork implements Container Network Model (CNM) which formalizes the steps r
|
|||
A Sandbox contains the configuration of a container's network stack.
|
||||
This includes management of the container's interfaces, routing table and DNS settings.
|
||||
An implementation of a Sandbox could be a Linux Network Namespace, a FreeBSD Jail or other similar concept.
|
||||
A Sandbox may contain *many* endpoints from *multiple* networks
|
||||
A Sandbox may contain *many* endpoints from *multiple* networks.
|
||||
|
||||
**Endpoint**
|
||||
|
||||
An Endpoint joins a Sandbox to a Network.
|
||||
An implementation of an Endpoint could be a `veth` pair, an Open vSwitch internal port or similar.
|
||||
An Endpoint can belong to *only one* network but may only belong to *one* Sandbox
|
||||
An Endpoint can belong to *only one* network but may only belong to *one* Sandbox.
|
||||
|
||||
**Network**
|
||||
|
||||
A Network is a group of Endpoints that are able to communicate with each-other directly.
|
||||
An implementation of a Network could be a Linux bridge, a VLAN etc...
|
||||
Networks consist of *many* endpoints
|
||||
An implementation of a Network could be a Linux bridge, a VLAN, etc.
|
||||
Networks consist of *many* endpoints.
|
||||
|
||||
## CNM Objects
|
||||
|
||||
|
@ -59,7 +59,7 @@ Networks consist of *many* endpoints
|
|||
`Options` provides a generic and flexible mechanism to pass `Driver` specific configuration option from the user to the `Driver` directly. `Options` are just key-value pairs of data with `key` represented by a string and `value` represented by a generic object (such as golang `interface{}`). Libnetwork will operate on the `Options` ONLY if the `key` matches any of the well-known `Label` defined in the `net-labels` package. `Options` also encompasses `Labels` as explained below. `Options` are generally NOT end-user visible (in UI), while `Labels` are.
|
||||
|
||||
***Labels***
|
||||
`Labels` are very similar to `Options` & infact they are just a subset of `Options`. `Labels` are typically end-user visible and are represented in the UI explicitely using the `--labels` option. They are passed from the UI to the `Driver` so that `Driver` can make use of it and perform any `Driver` specific operation (such as a subnet to allocate IP-Addresses from in a Network).
|
||||
`Labels` are very similar to `Options` & in fact they are just a subset of `Options`. `Labels` are typically end-user visible and are represented in the UI explicitly using the `--labels` option. They are passed from the UI to the `Driver` so that `Driver` can make use of it and perform any `Driver` specific operation (such as a subnet to allocate IP-Addresses from in a Network).
|
||||
|
||||
## CNM Lifecycle
|
||||
|
||||
|
@ -75,9 +75,9 @@ Consumers of the CNM, like Docker for example, interact through the CNM Objects
|
|||
|
||||
4. `network.CreateEndpoint()` can be called to create a new Endpoint in a given network. This API also accepts optional `options` parameter which drivers can make use of. These 'options' carry both well-known labels and driver-specific labels. Drivers will in turn be called with `driver.CreateEndpoint` and it can choose to reserve IPv4/IPv6 addresses when an `Endpoint` is created in a `Network`. The `Driver` will assign these addresses using `InterfaceInfo` interface defined in the `driverapi`. The IP/IPv6 are needed to complete the endpoint as service definition along with the ports the endpoint exposes since essentially a service endpoint is nothing but a network address and the port number that the application container is listening on.
|
||||
|
||||
5. `endpoint.Join()` can be used to attach a container to a `Endpoint`. The Join operation will create a `Sandbox` if it doesnt exist already for that container. The Drivers can make use of the Sandbox Key to identify multiple endpoints attached to a same container. This API also accepts optional `options` parameter which drivers can make use of.
|
||||
5. `endpoint.Join()` can be used to attach a container to an `Endpoint`. The Join operation will create a `Sandbox` if it doesnt exist already for that container. The Drivers can make use of the Sandbox Key to identify multiple endpoints attached to a same container. This API also accepts optional `options` parameter which drivers can make use of.
|
||||
* Though it is not a direct design issue of LibNetwork, it is highly encouraged to have users like `Docker` to call the endpoint.Join() during Container's `Start()` lifecycle that is invoked *before* the container is made operational. As part of Docker integration, this will be taken care of.
|
||||
* one of a FAQ on endpoint join() API is that, why do we need an API to create an Endpoint and another to join the endpoint.
|
||||
* One of a FAQ on endpoint join() API is that, why do we need an API to create an Endpoint and another to join the endpoint.
|
||||
- The answer is based on the fact that Endpoint represents a Service which may or may not be backed by a Container. When an Endpoint is created, it will have its resources reserved so that any container can get attached to the endpoint later and get a consistent networking behaviour.
|
||||
|
||||
6. `endpoint.Leave()` can be invoked when a container is stopped. The `Driver` can cleanup the states that it allocated during the `Join()` call. LibNetwork will delete the `Sandbox` when the last referencing endpoint leaves the network. But LibNetwork keeps hold of the IP addresses as long as the endpoint is still present and will be reused when the container(or any container) joins again. This ensures that the container's resources are reused when they are Stopped and Started again.
|
||||
|
@ -91,11 +91,11 @@ Consumers of the CNM, like Docker for example, interact through the CNM Objects
|
|||
|
||||
### Networks & Endpoints
|
||||
|
||||
LibNetwork's Network and Endpoint APIs are primiarly for managing the corresponding Objects and book-keeping them to provide a level of abstraction as required by the CNM. It delegates the actual implementation to the drivers which realizes the functionality as promised in the CNM. For more information on these details, please see [the drivers section](#Drivers)
|
||||
LibNetwork's Network and Endpoint APIs are primarily for managing the corresponding Objects and book-keeping them to provide a level of abstraction as required by the CNM. It delegates the actual implementation to the drivers which realize the functionality as promised in the CNM. For more information on these details, please see [the drivers section](#Drivers)
|
||||
|
||||
### Sandbox
|
||||
|
||||
Libnetwork provides a framework to implement of a Sandbox in multiple Operating Systems. Currently we have implemented Sandbox for Linux using `namespace_linux.go` and `configure_linux.go` in `sandbox` package
|
||||
Libnetwork provides a framework to implement of a Sandbox in multiple operating systems. Currently we have implemented Sandbox for Linux using `namespace_linux.go` and `configure_linux.go` in `sandbox` package
|
||||
This creates a Network Namespace for each sandbox which is uniquely identified by a path on the host filesystem.
|
||||
Netlink calls are used to move interfaces from the global namespace to the Sandbox namespace.
|
||||
Netlink is also used to manage the routing table in the namespace.
|
||||
|
@ -133,16 +133,16 @@ The null driver is a `noop` implementation of the driver API, used only in cases
|
|||
### Bridge
|
||||
|
||||
The `bridge` driver provides a Linux-specific bridging implementation based on the Linux Bridge.
|
||||
For more details, please [see the Bridge Driver documentation](bridge.md)
|
||||
For more details, please [see the Bridge Driver documentation](bridge.md).
|
||||
|
||||
### Overlay
|
||||
|
||||
The `overlay` driver implements networking that can span multiple hosts using overlay network encapsulations such as VXLAN.
|
||||
For more details on its design, please see the [Overlay Driver Design](overlay.md)
|
||||
For more details on its design, please see the [Overlay Driver Design](overlay.md).
|
||||
|
||||
### Remote
|
||||
|
||||
The `remote` package does not provide a driver, but provides a means of supporting drivers over a remote transport.
|
||||
This allows a driver to be written in a language of your choice.
|
||||
For further details, please see the [Remote Driver Design](remote.md)
|
||||
For further details, please see the [Remote Driver Design](remote.md).
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue