一些常用的指令mininet & sflow & floodlight qos

来源:互联网 发布:中标数据查询360 编辑:程序博客网 时间:2024/06/07 02:31

1、mininet

//四个switch,四个host,每个switch链接一个host

sudo mn --topo linear,4 --switch ovsk --controller=remote,ip=127.0.0.1,port=6633 --ipbase=10.0.0.0/8

//默认topo,一个switch,两个host

sudo mn --switch ovsk --controller=remote,ip=127.0.0.1,port=6633 --ipbase=10.0.0.0/8

//自定义topo

sudo mn --custom /home/ubuntu/sdn/mininet/mininet/custom/mytopo.py --topo mytopo --mac --controller=remote,ip=127.0.0.1,port=6633

//mn启动之后会在每个节点自动打开一个xterm,方便某些情况下对多个节点分别操作

sudo mn -x

2、sflow

//查看各个端口序号

ip link

//设置agent端口转发

sudo ovs-vsctl -- --id=@sflow create sflow agent=eth0 target=\"ip:6343\" header=128 sampling=10 polling=1 -- set bridge s1 sflow=@sflow

agent是要监听的网卡,这个网卡一定要能监听到我们所需的交换机的流量,target是sflow collector所在的ip地址,bridge设定需要监听的交换机。

3、floodlight qos

OVS常用的两个 command line tool
ovs-vsctl 用来查询和配置ovs-vswitchd
ovs-ofctl 管理配置openflow switch


sudo ovs-vsctl list qos

sudo ovs-vsctl destroy qos _uuid

sudo ovs-vsctl list qos

sudo ovs-vsctl destroy queue _uuid


example:

sudo ovs-vsctl set port s1-eth4 qos=@newqos -- --id=@newqos create qos type=linux-htb other-config:max-rate=10000000 queues=0=@q0,1=@q1,2=@q2 -- --id=@q0 create queue other-config:min-rate=3000000 other-config:max-rate=10000000 -- --id=@q1 create queue other-config:min-rate=1000000 other-config:max-rate=10000000 -- --id=@q2 create queue other-config:min-rate=6000000 other-config:max-rate=10000000 

sudo ovs-ofctl add-flow s1 "in_port=1 nw_src=10.10.10.1 actions=enqueue:4:0"

sudo ovs-ofctl add-flow s1 "in_port=2 nw_src=10.10.10.2 actions=enqueue:4:1"

sudo ovs-ofctl add-flow s1 "in_port=3 nw_src=10.10.10.3 actions=enqueue:4:2"

sudo ovs-ofctl dump-flows s1



0 0
原创粉丝点击