-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
283 lines (225 loc) · 15 KB
/
README
File metadata and controls
283 lines (225 loc) · 15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# letce2-emane-example
1) These demo require letce2 and optional mgen-analytics to be installed or sourced in via env
2) You will need to add root and yourself to the appropriate group see scripts/set_frr_groups.sh to run frr router
for example frrvty:x:989:frr,root,your_user_name
3) To build config simply type make in the experiment directory
4) to run, letce2 lxc start --scenario-delay=30 and letce2 lxc stop, or use the demo_start.sh and demo_stop.sh scripts
see https://github.com/adjacentlink/letce2
To setup usb to ethernet adapters (adjust ether mac address to match your adapters)
create or edit /etc/udev/rules.d/70-persistent-net.rules/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:50:b6:04:04:98", KERNEL=="eth*", NAME="adapt1"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:50:b6:05:7c:85", KERNEL=="eth*", NAME="adapt2"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:50:b6:09:f5:94", KERNEL=="eth*", NAME="adapt3"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:50:b6:08:72:34", KERNEL=="eth*", NAME="adapt4"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="9c:69:d3:39:fe:0f", KERNEL=="eth*", NAME="adapt5"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="9c:69:d3:39:fe:0c", KERNEL=="eth*", NAME="adapt6"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="9c:69:d3:39:fe:73", KERNEL=="eth*", NAME="adapt7"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="9c:69:d3:39:fd:a1", KERNEL=="eth*", NAME="adapt8"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:e0:4c:68:08:f3", KERNEL=="eth*", NAME="adapt9"
----------- simple ipforwarding radio -----------
This experiment relies oon ipforwarding within the radio container between lan0 and emane0.
The lan0 interface is bridged to the real external NIC which has its address set to 0.0.0.0.
The attached device should set the IP address of the container lan0 IP address. This will allow
the container to respond to ARP's from the attached device. Since the radio system is a simple RF Pipe
there is no routing protocol running OTA. For this simple test static routes were added to map each
cleitn device to a radio.
---------------- radio with router --------------
This experiment relies on IP forwarding to move traffic from end to end.
The demo has 1 router running in an LXC container attached to 4 radios each running in its own LXC container in a different RF network.
Let PLID be the platform ID (1 router and 4 radios).
Let RFID be the radio network id (1-4)
The router has 1 lan interface 10.101.RFID.1 and 4 wlan interfaces that map to a radio 10.100.RFID.PLID
The IP address for the ethernet adapters are not used since they are used to bridge the external world to the LXC containers.
demo-platform
_______________________ ________________________________________________________________________________________________________________ ______________________
| esternal host 1 | | | (lxc router1) | (lxc emane ) | (lxc router2) | | | external host 2 |
| | | | | | | | | |
| | | | aveth | | aveth | | | |
| | | eth | wlan1 --|-- radio net 1 --|-- wlan1 | eth | | |
| | | adapt1 | lan0 wlan2 --|-- radio net 2 --|-- wlan2 lan0 | adapt2 | | |
| ip 10.101.1.2 --|-|- xxx.xxx.xxx.x --|-- 10.101.1.1 wlan3 --|-- radio net 3 --|-- wlan3 10.101.2.1 --|-- xxx.xxx.xxx.x -|-|-- 10.101.2.2 ip |
| gw 10.101.1.1 | | | wlan4 --|-- radio net 4 --|-- wlan4 | | | 10.101.2.1 gw |
| | | bridge | | bridge | | |
| | | | | | | | | |
|______________________| |__________________|_________________________|__________________|____________________________|__________________| |_____________________|
1) view containers
# sudo lxc-ls -f
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
radio-1 RUNNING 0 - 10.99.0.2 - false
radio-10 RUNNING 0 - 10.99.0.13 - false
radio-11 RUNNING 0 - 10.99.0.14 - false
radio-12 RUNNING 0 - 10.99.0.15 - false
radio-13 RUNNING 0 - 10.99.0.12 - false
radio-14 RUNNING 0 - 10.99.0.13 - false
radio-15 RUNNING 0 - 10.99.0.14 - false
radio-16 RUNNING 0 - 10.99.0.15 - false
radio-2 RUNNING 0 - 10.99.0.3 - false
radio-3 RUNNING 0 - 10.99.0.4 - false
radio-4 RUNNING 0 - 10.99.0.5 - false
radio-5 RUNNING 0 - 10.99.0.7 - false
radio-6 RUNNING 0 - 10.99.0.8 - false
radio-7 RUNNING 0 - 10.99.0.9 - false
radio-8 RUNNING 0 - 10.99.0.10 - false
radio-9 RUNNING 0 - 10.99.0.12 - false
router-1 RUNNING 0 - 10.100.1.1, 10.100.2.1, 10.100.3.1, 10.100.4.1, 10.101.1.1, 10.99.0.1 - false
router-2 RUNNING 0 - 10.100.1.2, 10.100.2.2, 10.100.3.2, 10.100.4.2, 10.101.2.1, 10.99.0.6 - false
router-3 RUNNING 0 - 10.100.1.3, 10.100.2.3, 10.100.3.3, 10.100.4.3, 10.101.3.1, 10.99.0.11 - false
router-4 RUNNING 0 - 10.100.1.4, 10.100.2.4, 10.100.3.4, 10.100.4.4, 10.101.4.1, 10.99.0.16 - false
2) view container routing table
# ssh node-1 route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.99.0.0 0.0.0.0 255.255.255.0 U 0 0 0 backchan0
10.100.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wan1
10.100.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wan2
10.100.3.0 0.0.0.0 255.255.255.0 U 0 0 0 wan3
10.100.4.0 0.0.0.0 255.255.255.0 U 0 0 0 wan4
10.101.1.0 0.0.0.0 255.255.255.0 U 0 0 0 lan0
10.101.2.0 10.100.4.2 255.255.255.0 UG 20 0 0 wan4
10.101.3.0 10.100.4.3 255.255.255.0 UG 20 0 0 wan4
10.101.4.0 10.100.4.4 255.255.255.0 UG 20 0 0 wan4
3) brctl show
bridge name bridge id STP enabled interfaces
# platform 1
br_pl_1_lan_1 8000.0050b6087234 no adapt1
aveth.17.5
br_pl_1_wf_1 8000.fe17982e0a0f no aveth.1.1
aveth.17.1
br_pl_1_wf_2 8000.fe3f06ef5cd5 no aveth.17.2
aveth.5.1
br_pl_1_wf_3 8000.fe88506c471b no aveth.17.3
aveth.9.1
br_pl_1_wf_4 8000.febd86b42723 no aveth.13.1
aveth.17.4
# paltform 2
br_pl_2_lan_1 8000.0050b6040498 no adapt2
aveth.18.5
br_pl_2_wf_1 8000.fe793d6751d4 no aveth.18.1
aveth.2.1
br_pl_2_wf_2 8000.fee60a627df0 no aveth.18.2
aveth.6.1
br_pl_2_wf_3 8000.fe0fb623599d no aveth.10.1
aveth.18.3
br_pl_2_wf_4 8000.fe5a6402b40c no aveth.14.1
aveth.18.4
# platform 3
br_pl_3_lan_1 8000.0050b6057c85 no adapt3
aveth.19.5
br_pl_3_wf_1 8000.fe8581982e7d no aveth.19.1
aveth.3.1
br_pl_3_wf_2 8000.fe46703022a0 no aveth.19.2
aveth.7.1
br_pl_3_wf_3 8000.fe74f1b49303 no aveth.11.1
aveth.19.3
br_pl_3_wf_4 8000.fe2c8bdec6a7 no aveth.15.1
aveth.19.4
# paltform 4
br_pl_4_lan_1 8000.0050b609f594 no adapt4
aveth.20.5
br_pl_4_wf_1 8000.fe563bf0ed65 no aveth.20.1
aveth.4.1
br_pl_4_wf_2 8000.fe2918873ab0 no aveth.20.2
aveth.8.1
br_pl_4_wf_3 8000.fe0d258cb99d no aveth.12.1
aveth.20.3
br_pl_4_wf_4 8000.fe14540dc9ee no aveth.16.1
aveth.20.4
3) vtysh --vty_socket /var/run/frr/router-1
router-1# sh ip ospf
OSPF Routing Process, Router ID: 10.101.1.1
Supports only single TOS (TOS0) routes
This implementation conforms to RFC2328
RFC1583Compatibility flag is disabled
OpaqueCapability flag is disabled
Initial SPF scheduling delay 0 millisec(s)
Minimum hold time between consecutive SPFs 50 millisec(s)
Maximum hold time between consecutive SPFs 5000 millisec(s)
Hold time multiplier is currently 1
SPF algorithm last executed 6m58s ago
Last SPF duration 0.001s
SPF timer is inactive
LSA minimum interval 5000 msecs
LSA minimum arrival 1000 msecs
Write Multiplier set to 20
Refresh timer 10 secs
Maximum multiple paths(ECMP) supported 8
Administrative distance 110
Number of external LSA 0. Checksum Sum 0x00000000
Number of opaque AS LSA 0. Checksum Sum 0x00000000
Number of areas attached to this router: 1
Area ID: 0.0.0.0 (Backbone)
Number of interfaces in this area: Total: 5, Active: 5
Number of fully adjacent neighbors in this area: 8
Area has no authentication
SPF algorithm executed 27 times
Number of LSA 8
Number of router LSA 4. Checksum Sum 0x000235e6
Number of network LSA 4. Checksum Sum 0x00023733
Number of summary LSA 0. Checksum Sum 0x00000000
Number of ASBR summary LSA 0. Checksum Sum 0x00000000
Number of NSSA LSA 0. Checksum Sum 0x00000000
Number of opaque link LSA 0. Checksum Sum 0x00000000
Number of opaque area LSA 0. Checksum Sum 0x00000000
---------------- layer2 multi channel --------------
This experiment relies on bridging to connect external hosts as if they were on the same subnet.
Each external node connects to a real ethernet interface which is bridged to an LXC container that runs EMANE.
Each EMANE will read the ethernet frame from the aveth inteface and send it OTA to the other EMANE node(s) which will forward the frame out to the external host.
There are (4) external interfaces per platform. Each interface is bridge to an LXC container running an EMANE network.
external platform 1 demo-platform external platform 2
_______________________ ____________________________________________________________________________ _____________________
| | | | (lxc emane ) | | | |
| | | eth | aveth aveth | eth | | |
| ip 10.101.1.1 ----|-|---- adapt1 ------- lan0 ---- radio net 1 ---- lan0 ------ adapt5 ----|-|---- 10.101.1.2 ip |
| | | | | | | |
| ip 10.101.2.1 ----|-|---- adapt2 ------- lan0 ---- radio net 2 ---- lan0 ------ adapt6 ----|-|---- 10.101.2.2 ip |
| | | | | | | |
| ip 10.101.3.1 ----|-|---- adapt3 ------- lan0 ---- radio net 3 ---- lan0 ------ adapt7 ----|-|---- 10.101.3.2 ip |
| | | | | | | |
| ip 10.101.4.1 ----|-|---- adapt4 ------- lan0 ---- radio net 4 ---- lan0 ------ adapt8 ----|-|---- 10.101.4.2 ip |
| | | | | | | |
| | | bridge bridge | | |
| | | | | | | |
|_____________________| |________________|__________________________________________|______________| |____________________|
1) brctl show
# paltform 1
br_pl_1_wf_1 8000.0050b6087234 no adapt1
aveth.1.1
br_pl_1_wf_2 8000.0050b6040498 no adapt2
aveth.2.1
br_pl_1_wf_3 8000.0050b6057c85 no adapt3
aveth.3.1
br_pl_1_wf_4 8000.0050b609f594 no adapt4
aveth.4.1
# platform 2
br_pl_2_wf_1 8000.9c69d339fe0f no adapt5
aveth.5.1
br_pl_2_wf_2 8000.9c69d339fe0c no adapt6
aveth.6.1
br_pl_2_wf_3 8000.9c69d339fe73 no adapt7
aveth.7.1
br_pl_2_wf_4 8000.9c69d339fda1 no adapt8
aveth.8.1
Notes on using vlans instead of multiple physical USB NIC devices
# 1. Create the VLAN connection (e.g., VLAN 100 on eth0)
sudo nmcli con add type vlan con-name VLAN100 dev eth0 id 100
# Or using ifname if you prefer:
# sudo nmcli con add type vlan ifname eth0.100 id 100
# 2. Bring the new VLAN connection up
sudo nmcli con up VLAN100
# You might need to add IP address info here (static/DHCP) if not bridging
# sudo nmcli con modify VLAN100 ipv4.method manual ipv4.addresses 192.168.100.1/24
# 1. Create a bridge (e.g., br-vlan100)
sudo nmcli con add type bridge con-name br-vlan100 ifname br-vlan100
# 2. Add the VLAN interface as a slave to the bridge
sudo nmcli con add type bridge-slave con-name br-vlan100-slave ifname eth0.100 master br-vlan100
# 3. Bring bridge and slave up (if not already)
sudo nmcli con up br-vlan100
sudo nmcli con up br-vlan100-slave
# Inside /var/lib/lxc/your-container/config
lxc.net.0.type = veth
lxc.net.0.link = br-vlan100 # Connect to the bridge we created
lxc.net.0.flags = up
lxc.net.0.name = eth0 # Container's interface name
# Optional: Add static IP for the container
lxc.net.0.ipv4.address = 192.168.100.10/24
# lxc.net.0.ipv4.gateway = 192.168.100.1 # If using DHCP or gateway