https://github.com/sdnds-tw/Ryu-SDN-IP
[root@kunpeng82 Ryu-SDN-IP]# pip3 install networkx
./bin/sdnip-mgr --sdn-ip-cfg-file ./config.json --observe-links sdnip.arp_proxy sdnip.fwd_bgp sdnip.sdn_ip
[root@kunpeng82 Ryu-SDN-IP]# pwd /root/ryu/sdn-ip/Ryu-SDN-IP [root@kunpeng82 Ryu-SDN-IP]# ./bin/sdnip-mgr --sdn-ip-cfg-file ./config.json --observe-links sdnip.arp_proxy sdnip.fwd_bgp sdnip.sdn_ip
[root@kunpeng82 Ryu-SDN-IP]# ./bin/sdnip-mgr --sdn-ip-cfg-file ./config.json --observe-links sdnip.arp_proxy sdnip.fwd_bgp sdnip.sdn_ip Traceback (most recent call last): File "./bin/sdnip-mgr", line 4, in <module> from sdnip import conf_mgr, arp_proxy ModuleNotFoundError: No module named 'sdnip' [root@kunpeng82 Ryu-SDN-IP]# export PYTHONPATH=`pwd`:$PYTHONPATH [root@kunpeng82 Ryu-SDN-IP]# ./bin/sdnip-mgr --sdn-ip-cfg-file ./config.json --observe-links sdnip.arp_proxy sdnip.fwd_bgp sdnip.sdn_ip
instantiating app ryu.controller.ofp_handler of OFPHandler instantiating app ryu.topology.switches of Switches Will try to reconnect to 192.168.1.11 after 30 secs: True Will try to reconnect to 192.168.1.12 after 30 secs: True Will try to reconnect to 192.168.1.11 after 30 secs: True Will try to reconnect to 192.168.1.12 after 30 secs: True Will try to reconnect to 192.168.1.11 after 30 secs: True Will try to reconnect to 192.168.1.12 after 30 secs: True
mininet> bgp ps -elf | grep zebra *** errRun: ['stty', '-icanon', 'min', '1'] 01 S quagga 36047 1 0 80 0 - 418 do_sel 03:48 ? 00:00:00 /usr/sbin/zebra -d -A 127.0.0.1 -f /etc/quagga/zebra.conf 0 S root 65243 57128 0 80 0 - 1730 pipe_w 11:38 pts/4 00:00:00 grep zebra mininet>
bgp *** bgp : ("ps ax | egrep 'bgpdbgp.pid|zebrabgp.pid' | awk '{print $1}' | xargs kill",) kill: sending signal to 3035 failed: No such process h1 h2 h3 h4 r1 *** r1 : ("ps ax | egrep 'bgpdr1.pid|zebrar1.pid' | awk '{print $1}' | xargs kill",) kill: sending signal to 3040 failed: No such process r2 *** r2 : ("ps ax | egrep 'bgpdr2.pid|zebrar2.pid' | awk '{print $1}' | xargs kill",) kill: sending signal to 3045 failed: No such process r3 *** r3 : ("ps ax | egrep 'bgpdr3.pid|zebrar3.pid' | awk '{print $1}' | xargs kill",) kill: sending signal to 3050 failed: No such process r4 *** r4 : ("ps ax | egrep 'bgpdr4.pid|zebrar4.pid' | awk '{print $1}' | xargs kill",) kill: sending signal to 3055 failed: No such process root sdnh1 sdnh2 *** Done done
[root@kunpeng82 sdn-ip-topology]# zebra -d -f quagga-sdn.conf vty_read_config: failed to open configuration file /root/ryu/SDN-IP-Ryu/sdn-ip-topology/quagga-sdn.conf: Permission denied can't open configuration file [quagga-sdn.conf] [root@kunpeng82 sdn-ip-topology]#
[root@kunpeng82 SDN-IP-Ryu]# cp -r sdn-ip-topology /etc/quagga/ [root@kunpeng82 SDN-IP-Ryu]# ls /etc/quagga/ sdn-ip-topology vtysh.conf zebra.conf [root@kunpeng82 SDN-IP-Ryu]# chown -R quagga:quagga /etc/quagga/sdn-ip-topology
[root@kunpeng82 Ryu-SDN-IP]# ovs-ofctl show s1 2020-07-12T10:31:23Z|00001|vconn|WARN|unix:/var/run/openvswitch/s1.mgmt: version negotiation failed (we support version 0x01, peer supports version 0x04) ovs-ofctl: s1: failed to connect to socket (Protocol error) [root@kunpeng82 Ryu-SDN-IP]# ovs-ofctl show s6 --protocols=OpenFlow13 OFPT_FEATURES_REPLY (OF1.3) (xid=0x2): dpid:00000000000000a6 n_tables:254, n_buffers:0 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS OFPST_PORT_DESC reply (OF1.3) (xid=0x3):
mininet> net bgp bgp-eth0:s3-eth1 bgp-eth1:root-eth0 h1 h1-eth0:r1-eth1 h2 h2-eth0:r2-eth1 h3 h3-eth0:r3-eth1 h4 h4-eth0:r4-eth1 r1 r1-eth0:s1-eth1 r1-eth1:h1-eth0 r2 r2-eth0:s2-eth1 r2-eth1:h2-eth0 r3 r3-eth0:s5-eth1 r3-eth1:h3-eth0 r4 r4-eth0:s6-eth1 r4-eth1:h4-eth0 root root-eth0:bgp-eth1 sdnh1 sdnh1-eth0:s3-eth5 sdnh2 sdnh2-eth0:s4-eth4 s1 lo: s1-eth1:r1-eth0 s1-eth2:s2-eth2 s1-eth3:s3-eth2 s2 lo: s2-eth1:r2-eth0 s2-eth2:s1-eth2 s2-eth3:s4-eth1 s3 lo: s3-eth1:bgp-eth0 s3-eth2:s1-eth3 s3-eth3:s4-eth2 s3-eth4:s5-eth2 s3-eth5:sdnh1-eth0 s4 lo: s4-eth1:s2-eth3 s4-eth2:s3-eth3 s4-eth3:s6-eth2 s4-eth4:sdnh2-eth0 s5 lo: s5-eth1:r3-eth0 s5-eth2:s3-eth4 s5-eth3:s6-eth3 s6 lo: s6-eth1:r4-eth0 s6-eth2:s4-eth3 s6-eth3:s5-eth3 c0 mininet> bgp ip a *** errRun: ['stty', '-icanon', 'min', '1'] 01: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: bgp-eth0@if395: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 00:00:00:00:00:01 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 10.0.1.101/24 scope global bgp-eth0 valid_lft forever preferred_lft forever inet 10.0.2.101/24 scope global bgp-eth0 valid_lft forever preferred_lft forever inet 10.0.3.101/24 scope global bgp-eth0 valid_lft forever preferred_lft forever inet 10.0.4.101/24 scope global bgp-eth0 valid_lft forever preferred_lft forever inet6 fe80::200:ff:fe00:1/64 scope link valid_lft forever preferred_lft forever 3: bgp-eth1@if400: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 9e:6b:53:c9:00:d5 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 10.10.10.1/24 scope global bgp-eth1 valid_lft forever preferred_lft forever mininet>
拓扑生成
https://github.com/ruicao93/SDN-IP-Ryu
[root@kunpeng82 sdn-ip-topology]# pwd /root/ryu/SDN-IP-Ryu/sdn-ip-topology [root@kunpeng82 sdn-ip-topology]# python quagga-test1.py