0
# Wireless Management
1
2
Wireless infrastructure management including radio profiles, wireless networks, supported data rates, and device group assignments. Provides comprehensive modeling of wireless access point configurations and network broadcasting capabilities.
3
4
## Capabilities
5
6
### Supported Data Rate Management
7
8
Define data rates supported by wireless access point radios.
9
10
```python { .api }
11
class SupportedDataRate:
12
"""
13
Data rate that can be used by an access point radio.
14
15
Attributes:
16
standard (str): Wireless standard (802.11a/b/g/n/ac/ax/be)
17
rate (int): Data rate in Kbps
18
mcs_index (int, optional): Modulation and Coding Scheme index
19
"""
20
```
21
22
### Radio Profile Management
23
24
Configuration profiles for wireless access point radios.
25
26
```python { .api }
27
class RadioProfile:
28
"""
29
Collection of settings that can be applied to an access point radio.
30
31
Attributes:
32
name (str): Profile name (unique)
33
frequency (str): Frequency band (2.4GHz/5GHz/6GHz)
34
tx_power_min (int): Minimum transmit power
35
tx_power_max (int): Maximum transmit power
36
rx_power_min (int): Minimum receive power
37
channel_width (list): Supported channel widths (20/40/80/160 MHz)
38
allowed_channel_list (list): List of allowed channel numbers
39
regulatory_domain (str): Country/region regulatory domain
40
supported_data_rates (ManyToManyField): Associated data rates
41
"""
42
```
43
44
### Wireless Network Management
45
46
Wireless networks that can be broadcast by access points.
47
48
```python { .api }
49
class WirelessNetwork:
50
"""
51
Wireless network that can be broadcast by an access point.
52
53
Attributes:
54
name (str): Network name (unique)
55
description (str): Optional description
56
ssid (str): Service Set Identifier
57
mode (str): Network mode (Central/Fabric/Standalone/Local/Mesh/Bridge)
58
enabled (bool): Whether network is enabled
59
authentication (str): Authentication type (Open/WPA2/WPA3 variants)
60
hidden (bool): Whether SSID is hidden
61
secrets_group (ForeignKey, optional): Authentication secrets
62
tenant (ForeignKey, optional): Tenant ownership
63
"""
64
```
65
66
### Device Group Assignments
67
68
Assignment models linking wireless configurations to device groups.
69
70
```python { .api }
71
class ControllerManagedDeviceGroupWirelessNetworkAssignment:
72
"""
73
Assigns a WirelessNetwork to a ControllerManagedDeviceGroup.
74
75
Attributes:
76
controller_managed_device_group (ForeignKey): Target device group
77
wireless_network (ForeignKey): Assigned wireless network
78
vlan (ForeignKey, optional): Associated VLAN
79
"""
80
81
class ControllerManagedDeviceGroupRadioProfileAssignment:
82
"""
83
Assigns a RadioProfile to a ControllerManagedDeviceGroup.
84
85
Attributes:
86
controller_managed_device_group (ForeignKey): Target device group
87
radio_profile (ForeignKey): Assigned radio profile
88
"""
89
```
90
91
### Choice Constants
92
93
Predefined choices for wireless configuration options.
94
95
```python { .api }
96
class RadioProfileChannelWidthChoices:
97
"""Channel width options for radio profiles."""
98
WIDTH_20MHZ = 20
99
WIDTH_40MHZ = 40
100
WIDTH_80MHZ = 80
101
WIDTH_160MHZ = 160
102
103
class RadioProfileFrequencyChoices:
104
"""Frequency band options for radio profiles."""
105
FREQUENCY_2_4G = "2.4GHz"
106
FREQUENCY_5G = "5GHz"
107
FREQUENCY_6G = "6GHz"
108
109
class SupportedDataRateStandardChoices:
110
"""Wireless standard options for data rates."""
111
A = "802.11a"
112
B = "802.11b"
113
G = "802.11g"
114
N = "802.11n"
115
AC = "802.11ac"
116
AX = "802.11ax"
117
BE = "802.11be"
118
119
class WirelessNetworkModeChoices:
120
"""Network mode options for wireless networks."""
121
CENTRAL = "Central"
122
FABRIC = "Fabric"
123
STANDALONE = "Standalone (Autonomous)"
124
LOCAL = "Local (Flex)"
125
MESH = "Mesh"
126
BRIDGE = "Bridge"
127
128
class WirelessNetworkAuthenticationChoices:
129
"""Authentication options for wireless networks."""
130
OPEN = "Open"
131
WPA2_PERSONAL = "WPA2 Personal"
132
WPA2_ENTERPRISE = "WPA2 Enterprise"
133
ENHANCED_OPEN = "Enhanced Open"
134
WPA3_PERSONAL = "WPA3 Personal"
135
WPA3_SAE = "WPA3 SAE"
136
WPA3_ENTERPRISE = "WPA3 Enterprise"
137
WPA3_ENTERPRISE_192_BIT = "WPA3 Enterprise 192Bit"
138
139
class RadioProfileRegulatoryDomainChoices:
140
"""Country/region regulatory domain options for radio profiles."""
141
US = "US"
142
EU = "EU"
143
JP = "JP"
144
# ... extensive list of country codes available
145
```
146
147
### API Serializers
148
149
REST API serializers for wireless resources.
150
151
```python { .api }
152
class SupportedDataRateSerializer:
153
"""Serializer for SupportedDataRate with tagging support."""
154
155
class RadioProfileSerializer:
156
"""Serializer for RadioProfile with JSON array field handling."""
157
158
class WirelessNetworkSerializer:
159
"""Serializer for WirelessNetwork with tagging support."""
160
161
class ControllerManagedDeviceGroupWirelessNetworkAssignmentSerializer:
162
"""Serializer for wireless network assignments."""
163
164
class ControllerManagedDeviceGroupRadioProfileAssignmentSerializer:
165
"""Serializer for radio profile assignments."""
166
```
167
168
### API ViewSets
169
170
REST API viewsets for wireless resource management.
171
172
```python { .api }
173
class SupportedDataRateViewSet:
174
"""ViewSet for SupportedDataRate CRUD operations with filtering."""
175
176
class RadioProfileViewSet:
177
"""ViewSet for RadioProfile CRUD operations with filtering."""
178
179
class WirelessNetworkViewSet:
180
"""ViewSet for WirelessNetwork CRUD operations with filtering."""
181
182
class ControllerManagedDeviceGroupWirelessNetworkAssignmentViewSet:
183
"""ViewSet for wireless network assignment operations."""
184
185
class ControllerManagedDeviceGroupRadioProfileAssignmentViewSet:
186
"""ViewSet for radio profile assignment operations."""
187
```
188
189
## Usage Examples
190
191
### Creating Supported Data Rates
192
193
```python
194
from nautobot.wireless.models import SupportedDataRate
195
from nautobot.wireless.choices import SupportedDataRateStandardChoices
196
197
# Create 802.11ax data rates
198
data_rates = [
199
SupportedDataRate.objects.create(
200
standard=SupportedDataRateStandardChoices.AX,
201
rate=150000, # 150 Mbps
202
mcs_index=7
203
),
204
SupportedDataRate.objects.create(
205
standard=SupportedDataRateStandardChoices.AX,
206
rate=300000, # 300 Mbps
207
mcs_index=9
208
),
209
SupportedDataRate.objects.create(
210
standard=SupportedDataRateStandardChoices.AX,
211
rate=600000, # 600 Mbps
212
mcs_index=11
213
)
214
]
215
```
216
217
### Creating Radio Profiles
218
219
```python
220
from nautobot.wireless.models import RadioProfile
221
from nautobot.wireless.choices import (
222
RadioProfileFrequencyChoices,
223
RadioProfileChannelWidthChoices,
224
RadioProfileRegulatoryDomainChoices
225
)
226
227
# Create a high-performance 5GHz radio profile
228
radio_profile = RadioProfile.objects.create(
229
name="High Performance 5GHz",
230
frequency=RadioProfileFrequencyChoices.FREQUENCY_5G,
231
tx_power_min=5,
232
tx_power_max=25,
233
rx_power_min=-85,
234
channel_width=[
235
RadioProfileChannelWidthChoices.WIDTH_40MHZ,
236
RadioProfileChannelWidthChoices.WIDTH_80MHZ,
237
RadioProfileChannelWidthChoices.WIDTH_160MHZ
238
],
239
allowed_channel_list=[36, 40, 44, 48, 52, 56, 60, 64],
240
regulatory_domain=RadioProfileRegulatoryDomainChoices.US
241
)
242
243
# Associate supported data rates
244
radio_profile.supported_data_rates.set(data_rates)
245
```
246
247
### Creating Wireless Networks
248
249
```python
250
from nautobot.wireless.models import WirelessNetwork
251
from nautobot.wireless.choices import (
252
WirelessNetworkModeChoices,
253
WirelessNetworkAuthenticationChoices
254
)
255
from nautobot.extras.models import SecretsGroup
256
from nautobot.tenancy.models import Tenant
257
258
# Create a corporate wireless network
259
secrets_group = SecretsGroup.objects.create(name="WiFi Secrets")
260
tenant = Tenant.objects.create(name="Corporate")
261
262
corporate_wifi = WirelessNetwork.objects.create(
263
name="Corporate WiFi",
264
description="Primary corporate wireless network",
265
ssid="CORP-WIFI",
266
mode=WirelessNetworkModeChoices.CENTRAL,
267
authentication=WirelessNetworkAuthenticationChoices.WPA3_ENTERPRISE,
268
enabled=True,
269
hidden=False,
270
secrets_group=secrets_group,
271
tenant=tenant
272
)
273
274
# Create a guest network
275
guest_wifi = WirelessNetwork.objects.create(
276
name="Guest WiFi",
277
description="Guest access wireless network",
278
ssid="GUEST-WIFI",
279
mode=WirelessNetworkModeChoices.CENTRAL,
280
authentication=WirelessNetworkAuthenticationChoices.WPA2_PERSONAL,
281
enabled=True,
282
hidden=False,
283
tenant=tenant
284
)
285
```
286
287
### Device Group Assignments
288
289
```python
290
from nautobot.wireless.models import (
291
ControllerManagedDeviceGroupWirelessNetworkAssignment,
292
ControllerManagedDeviceGroupRadioProfileAssignment
293
)
294
from nautobot.dcim.models import ControllerManagedDeviceGroup
295
from nautobot.ipam.models import VLAN
296
297
# Assume we have a device group and VLAN
298
device_group = ControllerManagedDeviceGroup.objects.get(name="Building-A APs")
299
corporate_vlan = VLAN.objects.get(name="Corporate")
300
guest_vlan = VLAN.objects.get(name="Guest")
301
302
# Assign wireless networks to device group
303
corporate_assignment = ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
304
controller_managed_device_group=device_group,
305
wireless_network=corporate_wifi,
306
vlan=corporate_vlan
307
)
308
309
guest_assignment = ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
310
controller_managed_device_group=device_group,
311
wireless_network=guest_wifi,
312
vlan=guest_vlan
313
)
314
315
# Assign radio profile to device group
316
radio_assignment = ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
317
controller_managed_device_group=device_group,
318
radio_profile=radio_profile
319
)
320
```
321
322
### Multi-frequency Radio Configuration
323
324
```python
325
# Create 2.4GHz radio profile for compatibility
326
radio_profile_24g = RadioProfile.objects.create(
327
name="Standard 2.4GHz",
328
frequency=RadioProfileFrequencyChoices.FREQUENCY_2_4G,
329
tx_power_min=5,
330
tx_power_max=20,
331
rx_power_min=-80,
332
channel_width=[
333
RadioProfileChannelWidthChoices.WIDTH_20MHZ,
334
RadioProfileChannelWidthChoices.WIDTH_40MHZ
335
],
336
allowed_channel_list=[1, 6, 11], # Non-overlapping channels
337
regulatory_domain=RadioProfileRegulatoryDomainChoices.US
338
)
339
340
# Create 802.11g/n data rates for 2.4GHz
341
data_rate_24g = SupportedDataRate.objects.create(
342
standard=SupportedDataRateStandardChoices.N,
343
rate=72200, # 72.2 Mbps
344
mcs_index=7
345
)
346
347
radio_profile_24g.supported_data_rates.add(data_rate_24g)
348
349
# Assign both radio profiles to the same device group
350
radio_assignment_24g = ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
351
controller_managed_device_group=device_group,
352
radio_profile=radio_profile_24g
353
)
354
```
355
356
### API Usage
357
358
```python
359
from nautobot.wireless.api.serializers import (
360
RadioProfileSerializer,
361
WirelessNetworkSerializer
362
)
363
364
# Serialize radio profile data
365
radio_serializer = RadioProfileSerializer(radio_profile)
366
radio_data = radio_serializer.data
367
368
# Query wireless networks via API
369
networks = WirelessNetwork.objects.filter(enabled=True)
370
network_serializer = WirelessNetworkSerializer(networks, many=True)
371
network_data = network_serializer.data
372
```
373
374
### Filtering and Search
375
376
```python
377
from nautobot.wireless.filters import RadioProfileFilterSet, WirelessNetworkFilterSet
378
379
# Filter radio profiles by frequency
380
profiles_5g = RadioProfile.objects.filter(
381
frequency=RadioProfileFrequencyChoices.FREQUENCY_5G
382
)
383
384
# Filter by channel width capabilities
385
profiles_160mhz = RadioProfile.objects.filter(
386
channel_width__contains=[RadioProfileChannelWidthChoices.WIDTH_160MHZ]
387
)
388
389
# Search wireless networks
390
enterprise_networks = WirelessNetwork.objects.filter(
391
authentication__icontains="enterprise"
392
)
393
394
# Filter by mode
395
central_networks = WirelessNetwork.objects.filter(
396
mode=WirelessNetworkModeChoices.CENTRAL
397
)
398
```
399
400
## API Endpoints
401
402
The wireless module exposes the following REST API endpoints:
403
404
- `/api/wireless/supported-data-rates/` - Data rate management
405
- `/api/wireless/radio-profiles/` - Radio profile management
406
- `/api/wireless/wireless-networks/` - Wireless network management
407
- `/api/wireless/controller-managed-device-group-radio-profile-assignments/` - Radio profile assignments
408
- `/api/wireless/controller-managed-device-group-wireless-network-assignments/` - Wireless network assignments
409
410
## Error Handling
411
412
Common validation patterns for wireless resources:
413
414
```python
415
from django.core.exceptions import ValidationError
416
from nautobot.wireless.models import RadioProfile
417
418
try:
419
# Invalid channel width configuration
420
profile = RadioProfile.objects.create(
421
name="Invalid Profile",
422
frequency=RadioProfileFrequencyChoices.FREQUENCY_2_4G,
423
channel_width=[RadioProfileChannelWidthChoices.WIDTH_160MHZ], # Not valid for 2.4GHz
424
tx_power_min=10,
425
tx_power_max=5, # Min > Max
426
regulatory_domain=RadioProfileRegulatoryDomainChoices.US
427
)
428
except ValidationError as e:
429
print(f"Validation error: {e}")
430
431
try:
432
# Duplicate assignment
433
from nautobot.wireless.models import ControllerManagedDeviceGroupRadioProfileAssignment
434
435
# This would fail if the assignment already exists
436
duplicate_assignment = ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
437
controller_managed_device_group=device_group,
438
radio_profile=radio_profile
439
)
440
except ValidationError as e:
441
print(f"Duplicate assignment error: {e}")
442
```
443
444
## Advanced Configuration Examples
445
446
### Creating a Complete Wireless Infrastructure
447
448
```python
449
# Create comprehensive wireless infrastructure for a building
450
from nautobot.wireless.models import *
451
from nautobot.dcim.models import ControllerManagedDeviceGroup
452
453
# Create device groups for different floors
454
floors = ['Floor-1', 'Floor-2', 'Floor-3']
455
device_groups = []
456
457
for floor in floors:
458
group = ControllerManagedDeviceGroup.objects.create(
459
name=f"{floor} Access Points",
460
description=f"Access points on {floor}"
461
)
462
device_groups.append(group)
463
464
# Assign radio profiles (both 2.4GHz and 5GHz)
465
ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
466
controller_managed_device_group=group,
467
radio_profile=radio_profile_24g
468
)
469
470
ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
471
controller_managed_device_group=group,
472
radio_profile=radio_profile
473
)
474
475
# Assign wireless networks
476
ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
477
controller_managed_device_group=group,
478
wireless_network=corporate_wifi,
479
vlan=corporate_vlan
480
)
481
482
ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
483
controller_managed_device_group=group,
484
wireless_network=guest_wifi,
485
vlan=guest_vlan
486
)
487
```