GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - cssivision/vxlan: overlay network base on linux virtual VXLan switch.

BranchesTags
Open more actions menu

Latest commit

 

History

35 Commits
35 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
Gopkg.lock
Gopkg.lock
 
 
Gopkg.toml
Gopkg.toml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
device.go
device.go
 
 
encapsulates.png
encapsulates.png
 
 
etcd.go
etcd.go
 
 
iptables.go
iptables.go
 
 
main.go
main.go
 
 
subnet.go
subnet.go
 
 
vxlan.sh
vxlan.sh
 
 
vxlan_overview.png
vxlan_overview.png
 
 

Repository files navigation

VXLAN

This is a toy used to learn VXLAN.

Virtual Extensible LAN (VXLAN) is a network virtualization technology that attempts to address the scalability problems associated with large cloud computing deployments. It uses a VLAN-like encapsulation technique to encapsulate OSI layer 2 Ethernet frames within layer 4 UDP datagrams.

The objective of VXLan

1, Create virtual L2 network over physical L3 network

2, VXLan encpasulates L2 packet inside L3 packet

3, VTEP implementaion

packet encpasulates is not enought for L2 over L3. VXLan device need to implement the following features.

  • ARP resolution: Need to reply to ARP request from local servers without broadcasting the ARP packet.
  • Destination search: Need to find the destination location corresponding to the destination MAC.

those features refered as VTEP(VXLAN endpoints, which terminate VXLAN tunnels and may be either virtual or physical switch ports, are known as VXLAN tunnel endpoints (VTEPs)).

there are some variations of VETP implementation, we use local agent and virtual VXLan switch run on Linux servers.

Implementation VTEP in this project.

Create the vxlan device, Then as each remote host is discovered (either on startup or when they are added), do the following

  • Create routing table entry for the remote subnet. It goes via the vxlan device but also specifies a next hop (of the remote host).
  • Create a static ARP entry for the remote host IP address (and the VTEP MAC)
  • Create an FDB entry with the VTEP MAC and the public IP of the remote daemon.

In this scheme the scaling of table entries is linear to the number of remote hosts - 1 route, 1 arp entry and 1 FDB entry per host.

use etcd as the key-value store to exchange information when remote host status changed(add, delete, update, etc...).

Usage

get the lastest release binary.

Run

sudo ./vxlan -etcdEndpoint http://etcd:2379

you will get log similar to the following.

INFO[0000] Determining IP address of default interface
INFO[0000] Using interface with name eth0 and address 10.146.0.3
INFO[0000] Defaulting external address to interface address (10.146.0.3)
INFO[0000] VXLAN device already exists
INFO[0000] Returning existing device
INFO[0000] subnet key expired in: 2018-02-25 09:23:53.467058164 +0000 UTC
INFO[0000] create subnet: 10.10.238.0, net mask: 24
INFO[0000] MTU: 1410
INFO[0000] VXLan HardwareAddr: 1a:0f:87:98:5e:c7
INFO[0000] Running backend.
INFO[0000] adding subnet: 10.5.10.0/24 PublicIP: 10.140.0.3 VtepMAC: f6:ad:73:33:de:0b
INFO[0000] calling AddARP: 10.5.10.0, f6:ad:73:33:de:0b
INFO[0000] calling AddFDB: 10.140.0.3, f6:ad:73:33:de:0b

Use with docker

Docker daemon accepts --bip argument to configure the subnet of the docker0 bridge. It also accepts --mtu to set the MTU for docker0 and veth devices that it will be creating.

use subnet and MTU in log

INFO[0000] create subnet: 10.10.238.0, net mask: 24
INFO[0000] MTU: 1410

instead of 10.10.238.0/24 use 10.10.238.1/24 as the ip of the docker0 bridge.

dockerd --bip=${10.10.238.1/24} --mtu=1410 &

Reference

  • Flannel https://github.com/coreos/flannel
  • VXLan attributes, Please consult the man page for ip link and see the vxlan section for more details.
  • How VXLan work? https://www.slideshare.net/enakai/how-vxlan-works-on-linux
  • how-vxlan-works-on-l2-and-across-l3-networks https://www.slideshare.net/anandnande/how-vxlan-works-on-l2-and-across-l3-networks
  • IP route fundamental
    • https://www.thegeekstuff.com/2012/04/ip-routing-intro/
    • https://www.thegeekstuff.com/2012/04/route-examples/
    • https://www.thegeekstuff.com/2012/05/route-flags/

About

overlay network base on linux virtual VXLan switch.

Topics

overlay-networkvxlan

Resources

Readme
MIT license
Activity

Stars

64 stars

Watchers

4 watching

Forks

10 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.