All Projects → redhat-nfvpe → koko

redhat-nfvpe / koko

Licence: Apache-2.0 License
Connect containers as point-to-point connection, using veth/vxlan/vlan/macvlan

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to koko

hybridnet
A CNI plugin, provides networking environment where overlay and underlay containers can run on the same node and have cluster-wide bidirectional network connectivity.
Stars: ✭ 188 (+144.16%)
Mutual labels:  vlan, vxlan
dperf
dperf is a DPDK based 100Gbps network performance and load testing software.
Stars: ✭ 1,320 (+1614.29%)
Mutual labels:  vlan, vxlan
ipdecap
Decapsulate traffic encapsulated within GRE, IPIP, 6in4, ESP (ipsec) protocols, can also remove IEEE 802.1Q (virtual lan) header. Works with pcap files.
Stars: ✭ 32 (-58.44%)
Mutual labels:  vlan
tunfish-vxlan
A proof-of-concept for creating convenient VPN environments on top of secure WireGuard tunnels, with VXLAN.
Stars: ✭ 22 (-71.43%)
Mutual labels:  vxlan
butterfly
Butterfly connects Virtual Machines and control their traffic flow
Stars: ✭ 48 (-37.66%)
Mutual labels:  vxlan
dock
dock try to re-implement docker 🐳
Stars: ✭ 32 (-58.44%)
Mutual labels:  veth
vmam
VLAN Mac-address Authentication Manager
Stars: ✭ 19 (-75.32%)
Mutual labels:  vlan
TProxy
透明代理的旁路由虚拟网关
Stars: ✭ 39 (-49.35%)
Mutual labels:  macvlan
L2-Emulator
Implementing a Layer-2 Emulator in C using Graphs and LinkedList
Stars: ✭ 17 (-77.92%)
Mutual labels:  vlan
locize-cli
locize cli to import / export locales, add / edit / remove sync segments
Stars: ✭ 44 (-42.86%)
Mutual labels:  namespace
proposal-symbol-thenable
gus.host/proposal-symbol-thenable
Stars: ✭ 18 (-76.62%)
Mutual labels:  namespace
NamingThings
Content on tips, tricks, advice, practices for naming things in in software/technology
Stars: ✭ 31 (-59.74%)
Mutual labels:  namespace
kubeswitch
visually select kubernetes context/namespace from tree
Stars: ✭ 15 (-80.52%)
Mutual labels:  namespace
PackageProject.cmake
🏛️ Help other developers use your project. A CMake script for packaging C/C++ projects for simple project installation while employing best-practices for maximum compatibility.
Stars: ✭ 48 (-37.66%)
Mutual labels:  namespace
phpcs-psr4-sniff
[READ-ONLY] PHP_CodeSniffer sniff that checks class name matches PSR-4 project structure.
Stars: ✭ 23 (-70.13%)
Mutual labels:  namespace
numerifides
A proposal for a system of decentralized trust, built on an open, public blockchain.
Stars: ✭ 14 (-81.82%)
Mutual labels:  namespace
phaser-super-storage
A cross platform storage plugin for Phaser
Stars: ✭ 49 (-36.36%)
Mutual labels:  namespace
bagpipe-cni
CNI plugin for BaGPipe BGP
Stars: ✭ 14 (-81.82%)
Mutual labels:  vxlan
dpdk
A comprehensive rust binding for DPDK allowing high speed userspace networking across 256 cores and 32 NICs
Stars: ✭ 30 (-61.04%)
Mutual labels:  vlan
lxroot
A lightweight, flexible, and safer alternative to chroot and/or Docker.
Stars: ✭ 69 (-10.39%)
Mutual labels:  namespace

koko: Container connector (for chaining)

Build Status Go Report Card License

Logo1

What is 'koko'?

koko is a simple tool which connects between Docker containers/linux netns processes with veth devices/vxlan of linux kernel. Using koko, you can simply make point-to-point connection for containers without linux bridges.

Koko's abstruct design

Support Container Type and Interfaces

koko supports following container:

  • Docker
  • Linux netns namespace (i.e. 'ip netns' or see 'man ip-netns' for its detail)

koko supports following linux interface to connect above:

  • veth: Virtual Ethernet Interface
  • vxlan: Virtual eXtensible Local Area Network

Get Releases

See releases page.

Build Requirements

  • golang 1.7 or later

Build

koko is written in go, so following commands makes koko single binary. Build and put it in your container host.

go get github.com/redhat-nfvpe/koko

Syntax

koko takes two arguments: two endpoints of container and koko connects both. koko supports veth for two containers in one host and vxlan for two containers in separate host.

Connecting containers in container host using veth

./koko {-c <linkname> |
        -d <container>,<linkname>[,<IP addr>/<prefixlen>,...] |
        -n <netns name>,<linkname>[,<IP addr>/<prefixlen>,...]|
        -p <pid>,<linkname>[,<IP addr>/<prefixlen>,...]|
        -c <linkname> }
       {-d <container>,<linkname>[,<IP addr>/<prefixlen>,...] |
        -n <netns name>,<linkname>[,<IP addr>/<prefixlen>,...]|
        -p <pid>,<linkname>[,<IP addr>/<prefixlen>,...]|
        -c <linkname> }

Connecting containers using vxlan (interconnecting container hosts)

Connecting containers which are in separate hosts with vxlan. Following command makes vxlan interface and put this interface into given container with/without IP address.

./koko {-c <linkname> |
        -d <container>,<linkname>[,<IP/mirror>,...] |
        -n <netns name>,<linkname>[,<IP/mirror>,...]|
        -p <pid>,<linkname>[,<IP/mirror>,...] }
        -x <parent interface>,<remote endpoint IP addr>,<vxlan id>
<IP/mirror> = {<IP addr>/<prefixlen> |
                mirror:{ingress|egress|both},<mirror IF>}

Connecting containers using VLAN

Connecting containers which are in separate hosts with vlan. Following command makes vlan interface and put this interface into given container with/without IP address.

./koko {-c <linkname> |
        -d <container>,<linkname>[,<IP/mirror>,...] |
        -n <netns name>,<linkname>[,<IP/mirror>,...]|
        -p <pid>,<linkname>[,<IP/mirror>,...] }
        -V <parent interface>,<vlan id>
<IP/mirror> = {<IP addr>/<prefixlen> |
                mirror:{ingress|egress|both},<mirror IF>}

Connecting containers using macvlan

Connecting containers which are in separate hosts with macvlan. Following command makes macvlan interface and put this interface into given container with/without IP address.

./koko {-c <linkname> |
        -d <container>,<linkname>[,<IP/mirror>,...] |
        -n <netns name>,<linkname>[,<IP/mirror>,...]|
        -p <pid>,<linkname>[,<IP/mirror>,...] }
        -M <parent interface>,<macvlan mode, {default|private|vepa|bridge|passthru}>
<IP/mirror> = {<IP addr>/<prefixlen> |
                mirror:{ingress|egress|both},<mirror IF>}

Delete link in containers

koko -D and koko -N deletes veth interface or vxlan interface. In case of veth, peering interface is also removed in this command.

./koko {-D <container>,<linkname> | -N <netns name>,<linkname> }

Note (for egress mirroring)

In case of 'egress' (and 'both'), the target interface (i.e. ) needs to be configured to have a queue because veth does not have tx queue in default (see moby/moby#33162 for the details). ip link set <mirror IF> qlen <queue length> sets queue length to corresponding veth device.

Command option summary

  • -c is to create veth and put it in current namespace
  • -C is to delete veth in current namespace
  • -d is to create interface and put it in docker container namespace
  • -D is to delete interface of docker container namespace
  • -e is to create interface and put it in cri-o container namespace
  • -E is to delete interface of cri-o container namespace
  • -n is to create interface and put it in linux netns namespace
  • -N is to delete interface of linux netns namespace
  • -p is to create interface and put it in pid's netns namespace
  • -P is to delete interface of pid's netns namespace
  • -X is to create vxlan interface
  • -V is to create vlan interface
  • -M is to create macvlan interface
  • -h is to show help
  • -v is to show version

Printing help

./koko -h

Usage

Please see Examples in Wiki.

Example

# connect between docker containers with IPv4 address
sudo ./koko -d centos1,link1,192.168.1.1/24 -d centos2,link2,192.168.1.2/24
# connect between docker containers with IPv6 address
sudo ./koko -d centos1,link1,2001:DB8::1/64 -d centos2,link2,2001:DB8::2/64
# connect between docker containers with IPv4/IPv6 address
sudo ./koko -d centos1,link1,192.168.1.1/24,2001:DB8::1/64 -d centos2,link2,192.168.1.2/24,2001:DB8::2/64
# connect between netns namespaces
sudo ./koko -n testns1,link1,192.168.1.1/24 -n testns2,link2,192.168.1.2/24
# connect between docker container and netns namespace
sudo ./koko -d centos1,link1,192.168.1.1/24 -n testns2,link2,192.168.1.2/24
# create vxlan interface and put it into docker container
sudo ./koko -d centos1,link1,192.168.1.1/24 -x eth1,10.1.1.1,1

Todo

  • Document

Authors

  • Tomofumi Hayashi (s1061123)
  • Doug Smith (dougbtv)

Contributers

  • Antonio Ojea (aojea)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].