Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ofctl##V1
- sudo mn --custom custom_ring2.py --topo customringtopo2
- sudo ./bin/ryu-manager --verbose ryu/app/rest_router.py
- sudo mn --topo=linear,2 --switch ovsk --mac --controller=remote -x
- ##V2
- #No ryu controller>>>
- ryu-manager ryu.app.simple_switch ryu.app.ofctl_rest
- ryu-manager ryu.app.rest_router ryu.app.ofctl_rest
- #mininet>>>>
- sudo mn --custom custom_ring2.py --topo customringtopo2 --mac --switch ovs --controller remote
- ## --link=tc,bw=1
- h1 ifconfig h1-eth0 inet 1.1.1.2/30
- h1 ifconfig h1-eth0 up
- h2 ifconfig h2-eth0 inet 2.2.2.2/30
- h2 ifconfig h2-eth0 up
- h3 ifconfig h3-eth0 inet 3.3.3.2/30
- h3 ifconfig h3-eth0 up
- h4 ifconfig h4-eth0 inet 4.4.4.2/30
- h4 ifconfig h4-eth0 up
- h5 ifconfig h5-eth0 inet 5.5.5.2/30
- h5 ifconfig h5-eth0 up
- h6 ifconfig h6-eth0 inet 6.6.6.2/30
- h6 ifconfig h6-eth0 up
- #No mininet>>>
- #Nos xterms>>>
- #config switches
- xterm s1
- ovs-vsctl set Bridge s1 protocols=OpenFlow13
- curl -X POST -d '{"address":"1.1.1.1/30"}' http://localhost:8080/router/0000000000000001
- curl -X POST -d '{"address":"12.12.12.1/30"}' http://localhost:8080/router/0000000000000001
- curl -X POST -d '{"address":"2.2.2.1/30"}' http://localhost:8080/router/0000000000000002
- curl -X POST -d '{"address":"12.12.12.2/30"}' http://localhost:8080/router/0000000000000002
- curl -X POST -d '{"address":"3.3.3.1/30"}' http://localhost:8080/router/0000000000000003
- curl -X POST -d '{"address":"12.12.12.3/30"}' http://localhost:8080/router/0000000000000003
- ##Visualizacao de configs
- curl http://localhost:8080/router/0000000000000001
- #config gateways
- curl -X POST -d '{"gateway":"12.12.12.1"}' http://localhost:8080/router/0000000000000001
- curl -X POST -d '{"gateway":"12.12.12.2"}' http://localhost:8080/router/0000000000000002
- curl -X POST -d '{"gateway":"12.12.12.3"}' http://localhost:8080/router/0000000000000003
- #no mininet>>>
- sh ovs-ofctl del-flows s1
- sh ovs-ofctl del-flows s2
- sh ovs-ofctl del-flows s3
- #switches
- sh ovs-ofctl add-flow s1 priority=500, ip, nw_src="1.1.1.1/30", dst_src="2.2.2.1/30",actions=normal
- #hosts
- sh ovs-ofctl add-flow s1 priority=500,in_port=1,actions=output:2
- ##cmds para checkagem
- sh ovs-ofctl show s1
- sh ovs-ofctl dump-flows
- net
- pingall
- ryu-manager ryu.app.qos_rest_router ryu.app.rest_qos ryu.app.rest_conf_switch
- sed '/OFPFlowMod(/,/)/s/)/, table_id=1)/'ryu/ryu/app/simple_switch_13.py > ryu/ryu/app/qos_simple_switch_13.py
- ryu-manager ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch
- curl -X POST -d '{"address":"1.1.1.1/30"}' http://localhost:8080/router/0000000000000001
- curl http://localhost:8080/router/0000000000000001
- #sudo mn --mac --switch ovsk --controller remote -x
- ###>>Ryu manager
- ##xterm s1
- ovs-vsctl set Bridge s1 protocols=OpenFlow13
- ovs-vsctl set-manager ptcp:6632
- #
- terminal do ryu
- #1 vez
- sed '/OFPFlowMod(/,/)/s/)/, table_id=1)/' ryu/ryu/app/simple_switch_13.py > ryu/ryu/app/qos_simple_switch_13.py
- sed '/OFPFlowMod(/,/)/s/0, cmd/1, cmd/' ryu/ryu/app/rest_router.py > ryu/ryu/app/qos_rest_router.py
- cd ryu/; python ./setup.py install
- ryu-manager ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch
- ryu-manager ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch ryu.app.qos_rest_router
- ryu-manager ryu.app.rest_qos ryu.app.qos_rest_router ryu.app.rest_conf_switch
- #xterm c0 (NODE)
- curl -X PUT -d '"tcp:127.0.0.1:6632"' http://localhost:8080/v1.0/conf/switches/0000000000000001/ovsdb_addr
- curl -X POST -d '{"port_name": "s1-eth1", "type":"linux-htb", "max_rate": "1000000", "queues":[{"max_rate": "500000"}, {"min_rate":"800000"}]}' http://localhost:8080/qos/queue/0000000000000001
- curl -X POST -d '{"match": {"nw_dst": "10.0.0.1","nw_proto": "UDP", "tp_dst": "5002"},"actions":{"queue": "1"}}' http://localhost:8080/qos/rules/0000000000000001
- ##Checking
- curl -X GET http://localhost:8080/qos/rules/0000000000000001
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement