---
# System prepended metadata

title: 'Act 2 - Mininet-WiFi: Deeper hands-on: Mobility & RSS'
tags: [mininet-wifi-tutorials]

---

---
tags: mininet-wifi-tutorials
---

#  Act 2 - Mininet-WiFi: Deeper hands-on: Mobility & RSS

## Activity 1: Mobility

Open examples/mobilityModel.py with any text editor:
```~/mininet-wifi$ sudo vim examples/mobilityModel.py```

And then change the speed of stations (from): 
```net.setMobilityModel(time=0, model='RandomDirection', max_x=100, max_y=100, seed=20)```
to: 
```net.setMobilityModel(time=0, model='RandomDirection', max_x=100, max_y=100, seed=1, min_v=0.1, max_v=0.1)```

Run _examples/mobilityModel.py_ and then ping sta1 and sta2:
```
~/mininet-wifi$ sudo python examples/mobilityModel.py
mininet-wifi>sta1 ping -c 10 sta2
```

**Question 1.1**: What can you conclude about the observed latency?
Tip: you can issue ```sta1 tc qdisc```, repeatedly, to see the values applied by tc.


:::info
You may want to have total control over the mobility of the nodes. If this is your case you can take a look at /examples/mobility.py  :mega:
:::


## Activity 2: Received Signal Strength
Open examples/position.py and add sta3 at position='40,20,10' and set max_z=100 in order to plot a 3D graph. Then, run examples/position.py.

```
~/mininet-wifi$ sudo python examples/position.py
```

**Question 2.1**: What is the Received Signal Strength Indicator (RSSI) observed from sta3?

**Question 2.2**: What is the average ping response time between sta2 and sta1? And between sta3 and sta1? Note: set the number of packets to 10 (ping -c10)


You can also observe the RSSI by using monitor interfaces. To do so you will run examples/wmediumd_interferece.py.

```
~/mininet-wifi$ sudo python examples/wmediumd_interference.py
```

Then, you need to create the monitor interface in sta1:
```
mininet-wifi> sta1 iw dev sta1-wlan0 interface add mon0 type monitor
```

Bring it up:
```
mininet-wifi> sta1 ifconfig mon0 up
```

and open Wireshark
```
mininet-wifi> sta1 wireshark
```

Right now, you can start sniffing beacons that are sent by ap1. Beacons contain RSSI, channel, among other things. 


:::info
The way we create the monitor interface in Mininet-WiFi is the same as compared to the physical nodes that run Linux systems.
:::