Skip to content

Commit c79dfcd

Browse files
authored
Merge pull request #36 from tomeshnet/module-3
Worksheet Module 3
2 parents 6a7b0b5 + 55f9948 commit c79dfcd

14 files changed

+305
-8
lines changed

module-3/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ Group activity to wirelessly mesh with other groups by configuring Raspberry Pis
4444

4545
### Activity
4646

47-
- As a class review the purpose of each command in a sample starter script
47+
- As a class review the purpose of each command in a sample starter script:
4848
```
49-
ip link set dev wlan1 down
50-
iw wlan1 set type mp
51-
ip link set dev wlan1 up
52-
iw dev wlan1 mesh join MY_MESH_NAME_HERE freq 2412
53-
ip addr add 192.168.0.1/24 dev wlan0
49+
ip link set dev wlanX down
50+
iw wlanX set type mp
51+
ip link set dev wlanX up
52+
iw dev wlanX mesh join MY_MESH_NAME freq 2412
53+
ip addr add 192.168.0.Y/24 dev wlanX
5454
```
5555
- Break into groups of two
5656
- Each group needs a pair of Raspberry Pis
5757
- Each group will connect to their Raspberry Pi's Host AP and initiate a SSH session
5858
- Use ifconfig to identify which wlan interface is which (Hint: look for 10.0.0.1)
5959
- Use ifconfig and iw to create a mesh between the nodes with this sample starter script
60-
- Use `iw wlan1 station dump` to see if connections are established
61-
- Use `iperf3 -s` on one node and `iperf3 -c 192.168.1.x` on another node to test the speed across the link
60+
- Use `iw wlanX station dump` to see if connections are established
61+
- Use `iperf3 -s` on one node and `iperf3 -c 192.168.0.Y` on another node to test the speed across the link
6262
- Once the nodes are properly meshed, have groups seek out another group that has finished
6363
- Work together to integrate all 4 nodes into one mesh
6464
- Encourage group to continue to merge meshes until all the groups are meshed into one

module-3/presentation/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Module 3: Building a node
2+
3+
1. Recap from last week
4+
1. Parts of a node and radio frequency
5+
1. Meshing your nodes
6+
1. Building your own node
7+
1. Wrap-up & homework

module-3/presentation/SUMMARY.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Summary
2+
3+
* [Recap from last week](part-0/README.md)
4+
* [Parts of a node and radio frequency](part-1/README.md)
5+
* [What is in a node](part-1/what-is-in-a-node.md)
6+
* [Radio and waves](part-1/radio-and-waves.md)
7+
* [Meshing your nodes](part-2/README.md)
8+
* [Connecting with WiFi](part-2/connecting-with-wifi.md)
9+
* [Worksheet](part-2/worksheet.md)
10+
* [Building your own node](part-3/README.md)
11+
* [Wrap-up & homework](part-4/README.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Recap from last week
2+
3+
**First Week**
4+
5+
Using Raspberry Pis, we formed a `wireless mesh network`.
6+
7+
**Last week**
8+
9+
Using Raspberry Pis, we configured a `wired network`.
10+
11+
**This Week**
12+
13+
Using Raspberry Pis, we will configure a `wireless mesh network`.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Parts of a node and radio frequency
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Radio and waves
2+
3+
Radio - the technology of using electromagnetic waves to carry information
4+
5+
## Properties of waves
6+
7+
### Frequency
8+
9+
* Measured in Hertz (Hz), or cycles per second
10+
* We tune the radio to hear other people on the same frequency
11+
12+
### Amplitude
13+
14+
* How much power the wave has
15+
* How loud we are talking
16+
17+
### Polarity
18+
19+
* Which direction is the wave cycling
20+
* Orientation of the antenna is important
21+
22+
### Phase
23+
24+
* The offset of peaks and valleys of two waves
25+
* You add the values at each point to calculate the new amplitude
26+
* Two peeks or valleys - wave has double the amplitude
27+
* A peek and a valley - amplitude closer to zero
28+
* Interference happens when waves bounce off walls
29+
30+
### Channel width
31+
32+
* Defines how wide of a frequency band does the signal take up
33+
* Larger channel width:
34+
* Provides more frequencies
35+
* Allows for more data to be sent at once
36+
* Is more susceptible to mode noise
37+
38+
## Frequencies and channels
39+
40+
Channels - human defined numbers that point to a specific frequency
41+
42+
* There are 13 channels defined for WiFi
43+
* In Canada we can only use the first 11
44+
* First channel starts at 2.412 GHz (or 2,412 MHz)
45+
* The channels are spaced out by 5 MHz
46+
* Standard WiFi signals use a channel width of 20 Mhz
47+
* There are only 3 non-overlapping signals in the 2.4 GHz range (1, 6, and 11)
48+
49+
## Licensing
50+
51+
* There are many frequencies coexisting in the air
52+
* Most of them are designated to a specific function
53+
* Government agency tasked with controlling them in Canada is the CRTC
54+
* 2.4 Ghz and 5.0 Ghz do not require any licensing
55+
* Used by many devices, such as microwave ovens, not just WiFi devices
56+
* They look like noise to WiFi devices
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# What is in a node?
2+
3+
## Single Board Computer
4+
5+
* All the components of a computer on one board
6+
* Components include processors, memory, storage, peripherals
7+
* Smart phone revolution modernized these types of computers
8+
* A node runs our software, processing signals and routing traffic
9+
10+
## Storage
11+
12+
* Many types of storage, each good for different reasons
13+
* Some properties to be aware of:
14+
* Format - how the physical device works?
15+
* Speed - how fast can it access and store data?
16+
* Capacity - how much data can it store?
17+
* Endurance - how long can it store the data for?
18+
19+
## Power supply
20+
21+
* Allow us to power the node
22+
* Consider what power you have available:
23+
* Wall plug - city's power gird
24+
* Batteries - stored power from another source
25+
* Solar, wind, etc. - alternative sources
26+
27+
## Antenna
28+
29+
* Used to receive (Rx) and transmit (Tx)
30+
* Designed for specific frequency ranges and purposes
31+
32+
## Radio
33+
34+
* We use the 802.11 standard known as "WiFi"
35+
* Radios can come in many formats
36+
* They connect to an antenna
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Meshing your nodes
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Connecting with WiFi
2+
3+
## Infrastructure mode
4+
5+
Most common setup for WiFi:
6+
7+
* Router acts as an Access Point (AP)
8+
* Each device connects to it to communicate
9+
* Single point of failure, the router
10+
11+
## Mesh mode
12+
13+
There are two different modes that we can use to create a mesh:
14+
15+
* Independent Basic Service Set (IBSS)
16+
* Also known as Ad-hoc
17+
* Much older and more supported
18+
* Mesh Point (802.11s)
19+
* A new specification
20+
* Not many devices support this mode
21+
* Many useful features
22+
23+
## Meshing in Linux
24+
25+
To mesh in Linux you issue the following commands:
26+
27+
* Turn off the interface:
28+
* `ip link set dev <interface> down`
29+
* Switch to a mesh mode:
30+
* `iw <interface> set type <mode>`
31+
* Turn on the interface:
32+
* `ip link set dev <interface> up`
33+
* Join a group at a particular frequency:
34+
* `iw dev <interface> <mode> join <group name> <frequency>`
35+
* Assign an IP address:
36+
* `ip addr add <ip address>/24 dev <interface>`
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Worksheet
2+
3+
* Break into groups of 2
4+
* Configure the two nodes to mesh together
5+
* Assign IP addresses
6+
* Ping each IP address
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Building your own node
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Homework
2+
3+
Next session we will discuss wireless links more extensively, both theoretically and the practical aspects when configuring a wireless mesh network.
4+
5+
📝 [A quick tour of a mesh networking installation](https://www.youtube.com/watch?v=aLusYsScrv0) from the [Metamesh YouTube channel](https://www.youtube.com/channel/UCGEnntxbGKMU9J9GIZ1LQUQ)
6+
7+
_Optionally:_
8+
9+
- Read [Wireless Networking in the Developing World](http://wndw.net/pdf/wndw3-en/ch10-deployment-planning.pdf), Chapter 10: Deployment Planning
10+
- Watch [How to install a Smartrek wireless mesh network for sugar making purposes](https://www.youtube.com/watch?v=eKkVEeVNhm8) (4:31)
11+
- Watch [Rural Next Generation Broadband Project](https://www.youtube.com/watch?v=QM7MUWDcNxk) (6:12)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
```
2+
ip link set dev wlanX down
3+
iw wlanX set type mp
4+
ip link set dev wlanX up
5+
iw dev wlanX mesh join MY_MESH_NAME freq 2412
6+
ip addr add 192.168.0.Y/24 dev wlanX
7+
```
8+
9+
---
10+
11+
```
12+
ip link set dev wlanX down
13+
iw wlanX set type mp
14+
ip link set dev wlanX up
15+
iw dev wlanX mesh join MY_MESH_NAME freq 5240
16+
ip addr add 192.168.0.Y/24 dev wlanX
17+
```
18+
19+
---
20+
21+
```
22+
ip link set dev wlanX down
23+
iw wlanX set type mp
24+
ip link set dev wlanX up
25+
iw dev wlanX mesh join MY_MESH_NAME freq 2437
26+
ip addr add 192.168.0.Y/24 dev wlanX
27+
```
28+
29+
---
30+
31+
```
32+
ip link set dev wlanX down
33+
iw wlanX set type ibss
34+
ip link set dev wlanX up
35+
iw dev wlanX ibss join MY_MESH_NAME 2437
36+
ip addr add 192.168.0.Y/24 dev wlanX
37+
```
38+
39+
---
40+
41+
```
42+
ip link set dev wlanX down
43+
iw wlanX set type ibss
44+
ip link set dev wlanX up
45+
iw dev wlanX ibss join MY_MESH_NAME 5745
46+
ip addr add 192.168.0.Y/24 dev wlanX
47+
```
48+
49+
---
50+
51+
```
52+
ip link set dev wlanX down
53+
iw wlanX set type ibss
54+
ip link set dev wlanX up
55+
iw dev wlanX ibss join MY_MESH_NAME 5180
56+
ip addr add 192.168.0.Y/24 dev wlanX
57+
```
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Mesh your node wirelessly
2+
===========================
3+
4+
## Connecting to your Raspberry Pi
5+
6+
1. Verify that the Raspberry Pi has the SD card in place. Power on the device and wait for a solid green light with a flashing red light.
7+
8+
1. Connect your computer's WiFi Client to the Raspberry Pi's WiFi Access Point:
9+
10+
- SSID: `<hostname>`
11+
- Password: `password`
12+
13+
1. Once your computer is connected to the WiFi Access Point, you can access the Raspberry Pi via a Secure Shell (SSH):
14+
15+
- Host: `<hostname>.local` (or `10.0.0.1`)
16+
- Username: `root`
17+
- Password: `root`
18+
19+
On **macOS or Linux** using **Terminal**, enter `ssh root@example.local` followed by the password `root`.
20+
21+
On **Windows** using the **PuTTY** graphical interface, enter the `Host` and select `SSH` then click `Open` to initiate an SSH session. Enter the `Username` and `Password` when prompted.
22+
23+
You are now connected to and able to run commands from your Raspberry Pi. The Raspberry Pis are currently not connected to all the other ones in the room. Find a partner and we will manually get the two Raspberry Pis to talk over a wireless mesh with a series of commands provided. For the rest of this activity, we will use `example` to represent your node.
24+
25+
## Finding your mesh interface
26+
27+
1. The Raspberry Pi may prepare network interfaces out of order. To make sure we do not accidentally change the settings on the interface running the Access Point (and disconnect us from the Pi) we will first confirm the interface names:
28+
29+
**root@example:~#** `iw dev`
30+
31+
You should see one of the interfaces with `type: AP`. This is the Access Point that your computer uses to connect to the node wirelessly.
32+
33+
1. Make note of the interface that is _not_ your `AP`. It will most likely be `wlan1`.
34+
35+
## Creating your mesh network
36+
37+
1. Partner up with someone at the table to form a new mesh group.
38+
39+
1. Decide on a name for your newly formed mesh. Keep it simple and a single word. Don't spend too much time on this.
40+
41+
1. Use the commands provided to create a mesh network between the two nodes, with the following substitutions:
42+
43+
* Make sure you use the correct `wlanX` network interface that you noted above.
44+
* Replace `MY_MESH_NAME` with the mesh name you decided on.
45+
* Assign each node a different IP address. For example, `192.168.0.1` for the first and `192.168.0.2` for the second.
46+
47+
## Testing your mesh network
48+
49+
1. Use `ping` to ping the other connected node and see if it responds.
50+
51+
1. You can check to see what nodes are connected by doing a station dump:
52+
53+
**root@example:~#** `iw wlanX station dump`
54+
55+
## Growing your mesh network
56+
57+
1. Now that you have successfully created your small mesh network, find another group in your proximity.
58+
59+
1. Expand your mesh to include the new group.
60+
61+
1. Now repeat it with another group.

0 commit comments

Comments
 (0)