SDN vxlan隧道
官方介绍
:
VXLAN(Virtual eXtensible Local Area Network,虚拟扩展局域网),是由IETF定义的NVO3(Network Virtualization over Layer 3)标准技术之一,是对传统VLAN协议的一种扩展。VXLAN的特点是将L2的以太帧封装到UDP报文(即L2 over L4)中,并在L3网络中传输。VXLAN本质上是一种隧道技术,在源网络设备与目的网络设备之间的IP网络上,建立一条逻辑隧道,将用户侧报文经过特定的封装后通过这条隧道转发。
vxlan 是一种网络协议,将原始数据封装到UDP数据包中传输。vxlan被广泛应用到云计算网络环境中,耳熟能详的云计算框架openstack
主要的网络架构就是vxlan,kubernetes
也有vxlan的网络插件。vxlan 有许多优点,诸如:
- 连接两个局域网,可以将局域网内主机之间流量互通。就像是在局域网之间架起桥梁
- 支持隔离。vlan最多支持4096个隔离,而vxlan支持2的次方数32即 4294967296据隔离
本篇文章使用ovs搭建vxlan网桥,连接两个mininet构建的局域网。
实验环境:两台虚拟机 ubuntu1804桌面版+ubuntu1604桌面版+mininet
一、安装mininet
分别在两台机器上安装mininet
1.1安装git工具
root@ubuntu:~# apt install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
git-man liberror-perl
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
git git-man liberror-perl
0 upgraded, 3 newly installed, 0 to remove and 406 not upgraded.
Need to get 3,932 kB of archives.
After this operation, 25.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
1.2从github上拉取mininet源码
root@openlab:~# git clone https://github.com/mininet/mininet.git
Cloning into 'mininet'...
remote: Enumerating objects: 9752, done.
remote: Total 9752 (delta 0), reused 0 (delta 0), pack-reused 9752
Receiving objects: 100% (9752/9752), 3.03 MiB | 1.35 MiB/s, done.
Resolving deltas: 100% (6472/6472), done.
1.3 安装mininet
mininet的安装是进入mininet/util
目录中,然后执行 ./install -a
。-a
表示安装全部的组件。mininet的安装可以有很多备选项。
root@openlab:~/mininet/util# ./install.sh -a
Detected Linux distribution: Ubuntu 18.04 bionic amd64
sys.version_info(major=3, minor=6, micro=7, releaselevel='final', serial=0)
Detected Python (python3) version 3
Installing all packages except for -eix (doxypy, ivs, nox-classic)...
Install Mininet-compatible kernel if necessary
.......
.......
.......
libtool: install: /usr/bin/install -c cbench /usr/local/bin/cbench
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/root/oflops/cbench'
make[1]: Leaving directory '/root/oflops/cbench'
Making install in doc
make[1]: Entering directory '/root/oflops/doc'
make[1]: Nothing to be done for 'install'.
make[1]: Leaving directory '/root/oflops/doc'
Enjoy Mininet!
1.4验证安装
安装完成之后,ovs
会安装好,使用ovs-vsctl show
命令,查看ovs版本
root@openlab:~/mininet/util# ovs-vsctl show
58cc7b02-ef48-4de7-a96b-ee1c0259472d
ovs_version: "2.9.5"
使用命令 mn