openflow tutorial 开始openflow的学习(一)

首先不废话介绍openflow了,本身也还搞不清楚到底是个什么玩意儿,归纳不出什么内容来,先作试验,有个大致的感性了解回来再总结吧。windows

第一步,搭建环境,这一步就是安装工具,不一样的系统环境搭建不一致,个人环境大致以下:网络

首先把虚拟机搞起来,Set up Virtual Machine,这一步主要是下载OpenFlowTutorial-101311.zip,里面是虚拟机的镜像OpenFlowTutorial-disk1.vdissh

For the .zip archive, you need to set up a new VirtualBox VM. Open VirtualBox.tcp

  • Select New
  • Press Continue in the next prompt.
  • Name your VM OpenFlowTutorial, Operating System Linux, Version Ubuntu. Click Continue.
  • Set the memory at 512MB and click Continue
  • At that point VB should ask you to Create a new hard disk, or use the existing one. Select "Use existing hard disk".
  • Click the icon to select the hard disk. This will open the Virtual Media Manager Window.
  • Press Add, and find the extracted OpenFlowTutorial*.vdi from the previous steps. Click Select and then Continue.
  • Your VM installation is complete. Press Done.

接下来要给虚拟机配置一下网络,首先要明确咱们配置网络是干啥:工具

1.虚拟机能够上网;测试

2.宿主机能够经过putty访问虚拟机;spa

这就是tutorial里面要设置NAT和host-only两个网卡选项的缘由。3d

从虚拟机ping主机和外网均可以ping通了。blog

接下来就要在主机上经过SSH登录虚拟机了。由于我是win7,因此使用putty,首先在Hostname中输入hostonly对应的IP地址。ip

而后打开下面的SSH,选中enable X11 forwarding

另外再主机中将本地链接设置为共享给hostonly,而且hostonly的IPv4要自动获取ip。不然不能从putty打开ssh。

经过ssh进入虚拟机以后,要在主机windows下安装Xming,而后打开Xming,而后在ssh中输入xterm -sb 500,就能够打开一个设置后的窗口Xming。

接下来就是在实验中使用各类工具:openflow controller ,openflow switch,dpctl,wireshark,iperf,mininet,cbench。

Start Network

接下里就是跟着手册输入命令,作实验。

 第一个实验主要是尝试创建如上图的拓扑结构,而后,h2和h3之间进行ping操做,修改流表进行控制。另外这里还介绍了两个工具,一个是wireshark抓包工具和iperf用于checking speeds between two computers.

首先在拓扑刚创建的时候,h2和h3是ping不通的,由于没有添加流表。

 这里涉及dpctl dump-flows tcp:127.0.0.1:6634,查看流表的命令。接下来经过

$ dpctl add-flow tcp:127.0.0.1:6634 in_port=2,actions=output:3
$ dpctl add-flow tcp:127.0.0.1:6634 in_port=3,actions=output:2

 添加流表,我这里是h3和h4的,因此测试mininet> h3 ping -c3 h4,以下:

这个流表是有时间限制的,默认是60秒,能够经过

$ dpctl add-flow tcp:127.0.0.1:6634 in_port=2,idle_timeout=120,actions=output:3

来进行修改流表存在的时间。另外下面介绍了两个工具:wireshark和iperf,能够尝试着看看。

iperf只是一个命令,能够直接在ssh中输入,查看speed。

相关文章
相关标签/搜索