Commit Graph

10 Commits

Author SHA1 Message Date
Solomon Hykes 793c1ad990 Merge remote-tracking branch 'origin/219-default-bridge-2' 2013-04-05 14:02:16 -07:00
Solomon Hykes febaeebfb8 Add tests of tcp port allocator 2013-04-05 13:03:24 -07:00
Guillaume J. Charmes 90a6e310fe Add an helper function to check if two network overlaps. Also add unit tests for this function 2013-04-03 16:15:43 -07:00
Dominik Honnef 6f9a67a7c7 Make IP allocator lazy
Instead of allocating all possible IPs in advance, generate them as
needed.

A loop will cycle through all possible IPs in sequential order,
allocating them as needed and marking them as in use. Once the loop
exhausts all IPs, it will wrap back to the beginning. IPs that are
already in use will be skipped. When an IP is released, it will be
cleared and be available for allocation again.

Two decisions went into this design:

1) Minimize memory footprint by only allocating IPs that are actually
in use

2) Minimize reuse of released IP addresses to avoid sending traffic to
the wrong containers

As a side effect, the functions for IP/Mask<->int conversion have been
rewritten to never be able to fail in order to reduce the amount of
error returns.

Fixes gh-231
2013-04-01 06:02:44 +02:00
Solomon Hykes ba33d67a1a Test that iptables() looks for iptables in the PATH 2013-03-28 18:44:47 -07:00
creack d8fa52b7b5 Comply the tests with golang TIP 2013-03-21 10:31:02 -07:00
Andrea Luzzardi 799ffa1763 Network: Port mapping support.
Implemented a port allocator and a port mapper that is able to forward TCP ports
from the host to the container.
2013-02-28 11:50:02 -08:00
Andrea Luzzardi c08f5b2b84 Integrated the network allocator into Docker. A networking environment
is assigned to each container upon Start and released whenever the
container exits.
2013-02-25 14:06:22 -08:00
Andrea Luzzardi 797bb6e75b Network allocator 2013-02-25 10:45:23 -08:00
Andrea Luzzardi 149badc22b Network tests 2013-02-21 18:34:35 -08:00