I changed my script and it is now using default wireless connection.The scripts is as follow:
mininet-wifi> pingall
*** Ping: testing ping reachability
h1 -> *** h1 : ('ping -c1 10.0.0.5',)
PING 10.0.0.5 (10.0.0.5) 56(84) bytes of data.
64 bytes from
10.0.0.5: icmp_seq=1 ttl=64 time=4.69 ms
--- 10.0.0.5 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 4.693/4.693/4.693/0.000 ms
h2 *** h1 : ('ping -c1 10.0.0.1',)
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from
10.0.0.1: icmp_seq=1 ttl=64 time=5.29 ms
--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 5.293/5.293/5.293/0.000 ms
sta1
h2 -> *** h2 : ('ping -c1 10.0.0.4',)
PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
64 bytes from
10.0.0.4: icmp_seq=1 ttl=64 time=0.150 ms
--- 10.0.0.4 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.150/0.150/0.150/0.000 ms
h1 *** h2 : ('ping -c1 10.0.0.1',)
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from
10.0.0.1: icmp_seq=1 ttl=64 time=7.52 ms
--- 10.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.519/7.519/7.519/0.000 ms
sta1
sta1 -> *** sta1 : ('ping -c1 10.0.0.4',)
PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
64 bytes from
10.0.0.4: icmp_seq=1 ttl=64 time=1.23 ms
--- 10.0.0.4 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.233/1.233/1.233/0.000 ms
h1 *** sta1 : ('ping -c1 10.0.0.5',)
PING 10.0.0.5 (10.0.0.5) 56(84) bytes of data.
64 bytes from
10.0.0.5: icmp_seq=1 ttl=64 time=1.22 ms
--- 10.0.0.5 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.216/1.216/1.216/0.000 ms
h2
*** Results: 0% dropped (6/6 received)
I did the same steps on h2 to create a fake link between ap1 and s2, it works as I expected. Here is the result.
The link is forged successfully by sending forged LLDP packet on h2 and if the sta1 works well(works the same as h2), there will be a new link between s2 and ap1.
I did this in vanet-sumo.py and got the same result as my customized script.I refer to the source code of mn_wifi and find that the 'car' is similar to 'station' , so I thought if there is some function I need to add to my script to do such things.