Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. ofctl##V1
  2. sudo mn --custom custom_ring2.py --topo customringtopo2
  3.  
  4. sudo ./bin/ryu-manager --verbose ryu/app/rest_router.py
  5.  
  6. sudo mn --topo=linear,2 --switch ovsk --mac --controller=remote -x
  7.  
  8. ##V2
  9. #No ryu controller>>>
  10. ryu-manager ryu.app.simple_switch ryu.app.ofctl_rest
  11.  
  12. ryu-manager ryu.app.rest_router ryu.app.ofctl_rest
  13.  
  14. #mininet>>>>
  15. sudo mn --custom custom_ring2.py --topo customringtopo2 --mac --switch ovs --controller remote
  16. ## --link=tc,bw=1
  17.  
  18. h1 ifconfig h1-eth0 inet 1.1.1.2/30
  19. h1 ifconfig h1-eth0 up
  20. h2 ifconfig h2-eth0 inet 2.2.2.2/30
  21. h2 ifconfig h2-eth0 up
  22. h3 ifconfig h3-eth0 inet 3.3.3.2/30
  23. h3 ifconfig h3-eth0 up
  24. h4 ifconfig h4-eth0 inet 4.4.4.2/30
  25. h4 ifconfig h4-eth0 up
  26. h5 ifconfig h5-eth0 inet 5.5.5.2/30
  27. h5 ifconfig h5-eth0 up
  28. h6 ifconfig h6-eth0 inet 6.6.6.2/30
  29. h6 ifconfig h6-eth0 up
  30.  
  31. #No mininet>>>
  32. #Nos xterms>>>
  33. #config switches
  34. xterm s1
  35. ovs-vsctl set Bridge s1 protocols=OpenFlow13
  36.  
  37. curl -X POST -d '{"address":"1.1.1.1/30"}' http://localhost:8080/router/0000000000000001
  38. curl -X POST -d '{"address":"12.12.12.1/30"}' http://localhost:8080/router/0000000000000001
  39. curl -X POST -d '{"address":"2.2.2.1/30"}' http://localhost:8080/router/0000000000000002
  40. curl -X POST -d '{"address":"12.12.12.2/30"}' http://localhost:8080/router/0000000000000002
  41. curl -X POST -d '{"address":"3.3.3.1/30"}' http://localhost:8080/router/0000000000000003
  42. curl -X POST -d '{"address":"12.12.12.3/30"}' http://localhost:8080/router/0000000000000003
  43. ##Visualizacao de configs
  44. curl http://localhost:8080/router/0000000000000001
  45. #config gateways
  46. curl -X POST -d '{"gateway":"12.12.12.1"}' http://localhost:8080/router/0000000000000001
  47.  
  48. curl -X POST -d '{"gateway":"12.12.12.2"}' http://localhost:8080/router/0000000000000002
  49.  
  50. curl -X POST -d '{"gateway":"12.12.12.3"}' http://localhost:8080/router/0000000000000003
  51.  
  52. #no mininet>>>
  53. sh ovs-ofctl del-flows s1
  54. sh ovs-ofctl del-flows s2
  55. sh ovs-ofctl del-flows s3
  56.  
  57. #switches
  58. 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
  59.  
  60. #hosts
  61. sh ovs-ofctl add-flow s1 priority=500,in_port=1,actions=output:2
  62.  
  63.  
  64.  
  65.  
  66. ##cmds para checkagem
  67. sh ovs-ofctl show s1
  68. sh ovs-ofctl dump-flows
  69. net
  70. pingall
  71.  
  72.  
  73. ryu-manager ryu.app.qos_rest_router ryu.app.rest_qos ryu.app.rest_conf_switch
  74.  
  75.  
  76. sed '/OFPFlowMod(/,/)/s/)/, table_id=1)/'ryu/ryu/app/simple_switch_13.py > ryu/ryu/app/qos_simple_switch_13.py
  77.  
  78. ryu-manager ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87. curl -X POST -d '{"address":"1.1.1.1/30"}' http://localhost:8080/router/0000000000000001
  88.  
  89. curl http://localhost:8080/router/0000000000000001
  90.  
  91. #sudo mn --mac --switch ovsk --controller remote -x
  92.  
  93. ###>>Ryu manager
  94.  
  95. ##xterm s1
  96. ovs-vsctl set Bridge s1 protocols=OpenFlow13
  97. ovs-vsctl set-manager ptcp:6632
  98. #
  99. terminal do ryu
  100. #1 vez
  101. sed '/OFPFlowMod(/,/)/s/)/, table_id=1)/' ryu/ryu/app/simple_switch_13.py > ryu/ryu/app/qos_simple_switch_13.py
  102. sed '/OFPFlowMod(/,/)/s/0, cmd/1, cmd/' ryu/ryu/app/rest_router.py > ryu/ryu/app/qos_rest_router.py
  103. cd ryu/; python ./setup.py install
  104.  
  105. ryu-manager ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch
  106. ryu-manager ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch ryu.app.qos_rest_router
  107.  
  108. ryu-manager ryu.app.rest_qos ryu.app.qos_rest_router ryu.app.rest_conf_switch
  109.  
  110. #xterm c0 (NODE)
  111. curl -X PUT -d '"tcp:127.0.0.1:6632"' http://localhost:8080/v1.0/conf/switches/0000000000000001/ovsdb_addr
  112.  
  113. 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
  114.  
  115. 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
  116.  
  117. ##Checking
  118. curl -X GET http://localhost:8080/qos/rules/0000000000000001
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement