Commit Graph

45 Commits

Author SHA1 Message Date
Michael Crosby 378491e907 Remove hairpin nat on veth create
Writing to this file within /sys is casuing some issues for
older kernels, specifically with 2.6.xx, where the write is failing
because /sys is becoming ro.  We will continue to work on the 2.6 issues
but for the time being we cannot ship this with it enabled as it's
breaking all container runs.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-11-19 17:08:49 -08:00
Patrick Hemmer 2d4a713602 enable hairpin mode on virtual interface bridge port
This is to support being able to DNAT/MASQ traffic from a container back into itself (dotcloud/docker#4442)

Docker-DCO-1.1-Signed-off-by: Patrick Hemmer <patrick.hemmer@gmail.com> (github: phemmer)
2014-11-03 23:11:37 -05:00
Victor Marmol 26bda36e5d Only fetch network stats we use.
The dynamic version using WalkPath() was expensive and we only used some
of the stats anyways.

Signed-off-by: Victor Marmol <vmarmol@google.com>
2014-10-27 17:09:36 -07:00
Ye Yin 4ca4048d98 Adds a tx_queuelen setting for veth in the network configuration and defaults it to 0.
Signed-off-by: Ye Yin <hustcat@gmail.com>
2014-10-10 13:29:46 -04:00
Michael Crosby b9d08491f6 Add loop for veth pair creation on ErrInterfaceExists
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-02 22:03:25 +00:00
Michael Crosby 255989b835 Introduce more entropy in veth name generation
The current 4 chars are not enough, bumped to 7

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-02 21:56:48 +00:00
Malte Janduda d804790e8d MACAddress -> MacAddress
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-30 00:33:12 +02:00
Malte Janduda bf54bdfd7f implementing SetInterfaceMac
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-29 23:55:47 +02:00
Hugo Duncan 52f4743aba Fix leaking file descriptor in NetNs strategy
Docker-DCO-1.1-Signed-off-by: Hugo Duncan <hugo@hugoduncan.org> (github: hugoduncan)
2014-09-25 14:05:24 -04:00
Malte Janduda 4a14248dc8 Address6 -> IPv6Address and Gateway6 -> IPv6Gateway
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-24 20:48:00 +02:00
Malte Janduda dd9e42732e Adding IPv6 network support
Docker-DCO-1.1-Signed-off-by: Malte Janduda <mail@janduda.net> (github: MalteJ)
2014-09-24 11:36:40 +02:00
Michael Crosby f0278ac587 Expose setting interface by fd in network pkg
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-11 18:56:58 -07:00
Vishnu Kannan 47096e1ffd Fix veth network stats. Tx on the host vETH is ingress traffic and not egress.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-07-24 05:50:44 +00:00
Vishnu Kannan 469957ccd7 Do not mark any network stats as 'omitempty' since the value '0' is legal for those stats.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-07-23 22:12:23 +00:00
Vishnu Kannan 2a81a149da Make NetworkStats a pointer to help the callers ignore that stats if it cannot be returned for any reason.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-07-23 21:18:58 +00:00
Michael Crosby fb3d909c28 Merge pull request #98 from thockin/netperf
Don't set the MTU for loopback interfaces.
2014-07-14 18:07:46 -07:00
Tim Hockin d25aa3cee7 Don't set the MTU for loopback interfaces.
Setting the MTU for loopback has a huge performance impact on intra-container
traffic. The loopback interface is not an ethernet interface and does not need
the same limit. with this change I see a 4x speedup for loopback throughput.

Docker-DCO-1.1-Signed-off-by: Tim Hockin <thockin@google.com> (github: thockin)
2014-07-15 01:01:26 +00:00
Michael Crosby a2dc64cf30 Add initial system pkg to libcontainer
Port over console and ptmx code into console package
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-07-14 16:46:51 -07:00
Vishnu Kannan 813d247bc7 Fixing some nits.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-26 20:49:02 +00:00
Vishnu Kannan 3e5fe45417 Further refactoring.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-26 05:40:58 +00:00
Vishnu Kannan 98c2593cdc Refactores network Interface a bit to use NetworkState struct instead of a map for passing runtime information around.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 22:51:28 +00:00
Vishnu Kannan edf1e856a0 RuntimeCkpt is now State and the checkpoint file is called state.json.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 21:29:04 +00:00
Vishnu Kannan 481552c02b Created a global runtime checkpoint for libcontainer. Got rid of the network specific runtime checkpoint.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 19:20:07 +00:00
Vishnu Kannan 9253412ee1 1. Added a basic version of network stats inside network package.
2. Introducing a new checkpoint file 'network.stats' which will contain the network runtime information (veth interface names for now).
3. Adding network stats to 'nsinit stats'.
4. Added a libcontainer Stats API to get both network and cgroup stats

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-25 19:19:10 +00:00
Michael Crosby d2c7999a57 Fix cross compile for network and node pkgs
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-23 16:23:51 -07:00
Michael Crosby 1aff270a6c Fix veth json and tags
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-06-23 15:33:30 -07:00
Vishnu Kannan ad5286acd9 Addressed more comments.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-23 20:40:37 +00:00
Vishnu Kannan b50266335e Updated libcontainer subpackage dependencies. Most subpackages now do not depend on their parent ('libcontainer') package. 'namespaces' and 'nsinit' still do.
'namespaces' need to refactored a bit more to move the API part of it to 'libcontainer' package and keep the namespace specific code inside that package.
This change is not expected to break docker.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-06-20 22:52:43 +00:00
Michael Crosby 6ab3ef56f4 Update imports for new repository path 2014-06-10 08:14:16 -07:00
Michael Crosby 3b1acc34fb Move libcontainer deps into libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-06-09 15:52:12 -07:00
William Thurston d931738466 Fixes #5749
libcontainer support for arbitrary route table entries

Docker-DCO-1.1-Signed-off-by: William Thurston <me@williamthurston.com> (github: jhspaybar)
2014-05-28 17:42:02 +00:00
Alexander Larsson c2644a1bee Fix libcontainer network support on rhel6
It seems that netlink in older kernels, including RHEL6, does not
support RTM_SETLINK with IFLA_MASTER. It just silently ignores it, reporting
no error, causing netlink.NetworkSetMaster() to not do anything yet
return no error.

We fix this by introducing and using AddToBridge() in a very similar manner
to CreateBridge(), which use the old ioctls directly.

This fixes https://github.com/dotcloud/docker/issues/4668

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-04-09 15:44:18 +02:00
Michael Crosby 2e09f3d51c Allow containers to join the net namespace of other conatiners
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-21 00:48:17 +00:00
Johan Euphrosine 9b651b2afe libcontainer/network: add netns strategy
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-03-18 16:17:28 -07:00
Timothy Hobbs c549d6b643 Fix issue #4681 - No loopback interface within container when networking is disabled.
Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Remove loopback code from veth strategy

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Looback strategy: Get rid of uneeded code in Create
Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Use append when building network strategy list

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Swap loopback and veth strategies in Networks list

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Revert "Swap loopback and veth strategies in Networks list"

This reverts commit 3b8b2c8454171d79bed5e9a80165172617e92fc7.

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

When initializing networks, only return from the loop if there is an error

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
2014-03-17 22:01:24 +01:00
Michael Crosby 64401b859c Code review updates
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-26 19:21:46 -08:00
Michael Crosby 595d116827 Make network a slice to support multiple types
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-26 14:20:41 -08:00
Michael Crosby 5828e8e171 Refactor and improve libcontainer and driver
Remove logging for now because it is complicating things
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-24 21:11:52 -08:00
Michael Crosby 3502e47953 Improve logging for nsinit
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-24 18:38:36 -08:00
Michael Crosby 07992e6521 Refactor network creation and initialization into strategies
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 22:26:07 -08:00
Michael Crosby b992a5342f General cleanup of libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 14:56:16 -08:00
Michael Crosby 0223967711 Add dynamic veth name
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 14:56:16 -08:00
Michael Crosby e2e4b2c007 Implement init veth creation
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 14:56:15 -08:00
Michael Crosby d2612d7018 WIP moving to nsini
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 14:56:15 -08:00
Michael Crosby 6415e8becc Initial commit of libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-02-21 14:56:15 -08:00