mininet> sdnh2 ping sdnh1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.443 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.037 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.025 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=0.022 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=0.045 ms
64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=0.027 ms
64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=0.030 ms
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=0.025 ms
64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=0.023 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=0.026 ms
64 bytes from 192.168.0.1: icmp_seq=11 ttl=64 time=0.025 ms
^CsendInt: writing chr(3)
--- 192.168.0.1 ping statistics ---
11 packets transmitted, 11 received, 0% packet loss, time 10221ms
rtt min/avg/max/mdev = 0.022/0.066/0.443/0.119 ms
mininet> sdnh2 ip a
1: 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
268: sdnh2-eth0@if267: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether f2:e7:67:58:2c:2d brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.0.2/8 brd 192.255.255.255 scope global sdnh2-eth0
valid_lft forever preferred_lft forever
inet6 fe80::f0e7:67ff:fe58:2c2d/64 scope link
valid_lft forever preferred_lft forever
mininet> sdnh1 ip a
1: 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
266: sdnh1-eth0@if265: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ca:e6:c2:fc:da:77 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.0.1/8 brd 192.255.255.255 scope global sdnh1-eth0
valid_lft forever preferred_lft forever
inet6 fe80::c8e6:c2ff:fefc:da77/64 scope link
valid_lft forever preferred_lft forever
mininet>
sdnh1-eth0<->s3-eth5 (OK OK)
sdnh2-eth0<->s4-eth4 (OK OK)
root@ubuntu:~# ovs-ofctl dump-flows s4 --protocol=openflow13
cookie=0x0, duration=660.820s, table=0, n_packets=8787, n_bytes=527220, priority=65535,dl_dst=01:80:c2:00:00:0e,dl_type=0x88cc actions=CONTROLLER:65535
cookie=0x0, duration=659.961s, table=0, n_packets=233, n_bytes=19675, priority=1,ip,dl_dst=00:00:00:00:00:01,nw_dst=10.0.4.101 actions=output:"s4-eth2"
cookie=0x0, duration=658.270s, table=0, n_packets=445, n_bytes=33862, priority=1,ip,dl_dst=00:00:00:00:04:01,nw_dst=10.0.4.1 actions=output:"s4-eth3"
cookie=0x0, duration=656.266s, table=0, n_packets=0, n_bytes=0, priority=1,ip,nw_dst=192.168.1.0/24 actions=set_field:00:00:00:00:01:01->eth_dst,output:"s4-eth1"
cookie=0x0, duration=656.254s, table=0, n_packets=0, n_bytes=0, priority=1,ip,nw_dst=192.168.2.0/24 actions=set_field:00:00:00:00:02:01->eth_dst,output:"s4-eth1"
cookie=0x0, duration=656.243s, table=0, n_packets=0, n_bytes=0, priority=1,ip,nw_dst=192.168.3.0/24 actions=set_field:00:00:00:00:03:01->eth_dst,output:"s4-eth2"
cookie=0x0, duration=227.970s, table=0, n_packets=32, n_bytes=3136, priority=1,ip,nw_dst=192.168.0.2 actions=set_field:f2:e7:67:58:2c:2d->eth_dst,output:"s4-eth4"
cookie=0x0, duration=226.950s, table=0, n_packets=31, n_bytes=3038, priority=1,ip,nw_dst=192.168.0.1 actions=set_field:ca:e6:c2:fc:da:77->eth_dst,output:"s4-eth2"
cookie=0x0, duration=660.826s, table=0, n_packets=4515, n_bytes=336246, priority=0 actions=CONTROLLER:65535
root@ubuntu:~# ovs-ofctl dump-flows s4 --protocol=openflow13 | grep 192.168.0.1
cookie=0x0, duration=381.032s, table=0, n_packets=31, n_bytes=3038, priority=1,ip,nw_dst=192.168.0.1 actions=set_field:ca:e6:c2:fc:da:77->eth_dst,output:2
root@ubuntu:~#
ca:e6:c2:fc:da:77是sdnh1-eth0的mac,output:2是s4-eth2
s3-eth3<->s4-eth2
root@ubuntu:~# ovs-ofctl show s4 --protocol=openflow13
OFPT_FEATURES_REPLY (OF1.3) (xid=0x2): dpid:00000000000000a4
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):
1(s4-eth1): addr:62:35:76:d5:fe:25
config: 0
state: LIVE
current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
2(s4-eth2): addr:a6:64:31:78:4a:ec
config: 0
state: LIVE
current: 10GB-FD COPPER
speed: 10000 Mbps now, 0 Mbps max
mininet> sdnh2 ip n
192.168.0.1 dev sdnh2-eth0 lladdr 00:00:00:00:00:01 STALE
mininet>