- SDN
- 安装opendaylight、mininet、 Ovs软件平台启动OpenDayLight的kara程序,安装下组件: od-restconf、od-2switch-switch-ui、 od-mdsal-apidocs、odl-dluxapps-applications.使用Mininet和OpenVswitch构建拓扑,连接ODL的6653端口如下拓扑结构:
- 在浏览器上可以访问ODL管理页面查看网元拓扑结构。
- 通过OVS手工下发流表,H1可以ping通H3,H1、H3无法ping通H2.
- H1启动HTTP-Server功能,WEB端口为8080,H3作为HTTPClient,获取H1的html网页配置文件
opendaylight
一、上传openlight文件并下载
[root@Server01 sdn]# ls
anaconda-ks.cfg
distribution-karaf-0.6.0-Carbon.zip
mininet-2.2.2-2.el7.x86_64.rpm
openvswitch-2.5.0-2.el7.x86_64.rpm
python-networkx-1.8.1-12.el7.noarch.rpm
python-networkx-core-1.8.1-12.el7.noarch.rpm
[root@Server01 /]# yum install java-1.8.0-openjdk -y
#安装jdk环境
[root@Server01 /]# systemctl start openvswitch
二、进入ovs目录启动
[root@Server01 /]# unzip distribution-karaf-0.6.0-Carbon.zip
[root@Server01 /]# cd distribution-karaf-0.6.0-Carbon/bin/
[root@Server01 bin]# ./start
[root@Server01 bin]# ./client
三、安装组件
opendaylight-user@root>feature:install odl-restconf odl-l2switch-switch-ui odl-mdsal-apidocs odl-dluxapps-applications
四、安装完成进入网页查看
五、创建网络拓扑
[root@Server01 bin]# mn --controller=remote,ip=127.0.0.1,port=6653 --topo=tree,1,3
#创建完成设置流表 ping不通说明流表未启用,设置流表即可、
mininet> dpctl add-flow in_port=1,actions=output:3
*** s1 ------------------------------------------------------------------------
mininet> dpctl add-flow in_port=3,actions=output:1
*** s1 ------------------------------------------------------------------------
mininet> pingall
*** Ping: testing ping reachability
h1 -> X h3
h2 -> X X
h3 -> h1 X
*** Results: 66% dropped (2/6 received)
mininet>
六、启用http-server
mininet> h1 python -m SimpleHTTPServer 8080 &
mininet> sh apt install wget -y
mininet> h3 wget 10.0.0.1:8080
--2022-07-20 12:52:56-- http://10.0.0.1:8080/
Connecting to 10.0.0.1:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1052 (1.0K) [text/html]
Saving to: ‘index.html’
index.html 100%[===================>] 1.03K --.-KB/s in 0s
2022-07-20 12:52:56 (123 MB/s) - ‘index.html’ saved [1052/1052]
mininet>