Skip to content

Commit e09abf2

Browse files
committed
Merge pull request #36 from mavenugo/master
Added initial README and ROADMAP files
2 parents a6e19cd + b343267 commit e09abf2

File tree

2 files changed

+88
-2
lines changed

2 files changed

+88
-2
lines changed

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,59 @@
1-
# libnetwork
2-
The Go package to manage Linux network namespaces
1+
# libnetwork - networking for containers
2+
Libnetwork provides a native Go implementation for connecting containers
3+
4+
The goal of libnetwork is to deliver a robust Container Network Model that provides a consistent programming interface and the required network abstractions for applications.
5+
6+
**NOTE**: libnetwork project is under heavy development and is not ready for general use.
7+
8+
#### Current Status
9+
Please watch this space for updates on the progress.
10+
11+
Currently libnetwork is nothing more than an attempt to modularize the Docker platform's networking subsystem by moving it into libnetwork as a library.
12+
13+
Please refer to the [roadmap](ROADMAP.md) for more information.
14+
15+
#### Using libnetwork
16+
17+
There are many networking solutions available to suit a broad range of use-cases. libnetwork uses a driver / plugin model to support all of these solutions while abstracting the complexity of the driver implementations by exposing a simple and consistent Network Model to users.
18+
19+
```go
20+
//Create a network for containers to join.
21+
network, err := libnetwork.NewNetwork("simplebridge", &Options{})
22+
if err != nil {
23+
return err
24+
}
25+
//
26+
// For a new container: create network namespace (providing the path).
27+
networkPath := "/var/lib/docker/.../4d23e"
28+
networkNamespace, err := libnetwork.NewNetworkNamespace(networkPath)
29+
if err != nil {
30+
return err
31+
}
32+
//
33+
// For each new container: allocate IP and interfaces. The returned network
34+
// settings will be used for container infos (inspect and such), as well as
35+
// iptables rules for port publishing.
36+
interfaces, err := network.Link(containerID)
37+
if err != nil {
38+
return err
39+
}
40+
//
41+
// Add interfaces to the namespace.
42+
for _, interface := range interfaces {
43+
if err := networkNamespace.AddInterface(interface); err != nil {
44+
return err
45+
}
46+
}
47+
//
48+
```
49+
50+
## Future
51+
See the [roadmap](ROADMAP.md).
352

453
## Contributing
554

655
Want to hack on libnetwork? [Docker's contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) apply.
756

57+
## Copyright and license
58+
Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.
59+

ROADMAP.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# libnetwork: what's next?
2+
3+
This document is a high-level overview of where we want to take libnetwork next.
4+
It is a curated selection of planned improvements which are either important, difficult, or both.
5+
6+
For a more complete view of planned and requested improvements, see [the Github issues](https://github.com/docker/libnetwork/issues).
7+
8+
To suggest changes to the roadmap, including additions, please write the change as if it were already in effect, and make a pull request.
9+
10+
## Container Network Model (CNM)
11+
12+
#### Concepts
13+
14+
1. Sandbox: An isolated environment. This is more or less a standard docker container.
15+
2. Endpoint: An addressable endpoint used for communication over a specific network. Endpoints join exactly one network and are expected to create a method of network communication for a container. Endpoints are garbage collected when they no longer belong to any Sandboxes. Example : veth pair
16+
3. Network: A collection of endpoints that are able to communicate to each other. These networks are intended to be isolated from each other and do not cross communicate. Networks house endpoints which can communicate with each other.
17+
18+
#### axioms
19+
The container network model is a few axioms about how libnetwork wishes to supply
20+
interoperation between networks and containers.
21+
22+
1. All containers on a specific network can communicate with each other freely.
23+
2. Multiple networks are the way to segment traffic between containers and should be supported by all drivers.
24+
3. Multiple endpoints per container are the way to join a container to multiple networks.
25+
4. An endpoint is added to a sandbox to provide it with network connectivity.
26+
27+
## Bridge Driver using CNM
28+
Existing native networking functionality of Docker will be implemented as a Bridge Driver using the above CNM. In order to prove the effectiveness of the Bridge Driver, we will make necessary modifications to Docker Daemon and LibContainer to replace the existing networking functionality with libnetwork & Bridge Driver.
29+
30+
## Plugin support
31+
The Driver model provides a modular way to allow different networking solutions to be used as the backend. But they are static in nature.
32+
Plugins solves that problem by supporting dynamic pluggable networking backend for libnetwork.
33+
There are other community efforts in developing Plugin support on the Docker platform.libnetwork project will also make use of it when available.
34+

0 commit comments

Comments
 (0)