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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
|
.\" $OpenBSD: ifmedia.4,v 1.19 2010/02/09 15:25:29 claudio Exp $
.\" $NetBSD: ifmedia.4,v 1.14 2001/06/30 17:57:56 bjh21 Exp $
.\"
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
.\" NASA Ames Research Center.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: February 9 2010 $
.Dt IFMEDIA 4
.Os
.Sh NAME
.Nm ifmedia
.Nd network interface media settings
.Sh SYNOPSIS
.Fd #include <sys/socket.h>
.Fd #include <net/if.h>
.Fd #include <net/if_media.h>
.Sh DESCRIPTION
The
.Nm
interface provides a consistent method for querying and setting
network interface media and media options.
The media is typically set using the
.Xr ifconfig 8
command.
.Pp
Currently these link types are supported by
.Nm ifmedia :
.Pp
.Bl -tag -offset indent -width IFM_IEEE80211 -compact
.It Dv IFM_ETHER
Ethernet
.It Dv IFM_FDDI
FDDI
.It Dv IFM_IEEE80211
IEEE802.11 Wireless LAN
.It Dv IFM_TDM
Time Division Multiplex
.It Dv IFM_CARP
CARP
.El
.Pp
The following sections describe the possible media settings for each
link type.
Not all of these are supported by every device; refer to
your device's manual page for more information.
.Pp
The lists below provide the possible names of each media type or option.
The first name in the list is the canonical name of the media type or
option.
Additional names are acceptable aliases for the media type or option.
.Sh COMMON MEDIA TYPES AND OPTIONS
The following media types are shared by all link types:
.Pp
.Bl -tag -offset indent -width IFM_MANUAL -compact
.It Dv IFM_AUTO
Autoselect the best media.
[autoselect, auto]
.It Dv IFM_MANUAL
Jumper or switch on device selects media.
[manual]
.It Dv IFM_NONE
Deselect all media.
[none]
.El
.Pp
The following media options are shared by all link types:
.Bl -tag -offset indent -width IFM_FLAG0
.It Dv IFM_FDX
Place the device into full-duplex mode.
This option only has meaning if the device is normally not full-duplex.
.It Dv IFM_HDX
Place the device into half-duplex mode.
This option only has meaning if the device is normally not half-duplex.
[half-duplex, hdx]
.It Dv IFM_FLOW
Enable hardware flow control on device.
.It Dv IFM_FLAG0
Driver-defined flag.
[flag0]
.It Dv IFM_FLAG1
Driver-defined flag.
[flag1]
.It Dv IFM_FLAG2
Driver-defined flag.
[flag2]
.It Dv IFM_LOOP
Place the device into hardware loopback mode.
[loopback, hw-loopback, loop]
.El
.Sh MEDIA TYPES AND OPTIONS FOR ETHERNET
The following media types are defined for Ethernet:
.Bl -tag -offset indent -width IFM_10G_SFP_CU
.It Dv IFM_10_T
10BASE-T, 10Mb/s over unshielded twisted pair, RJ45 connector.
[10baseT, UTP, 10UTP]
.It Dv IFM_10_2
10BASE2, 10Mb/s over coaxial cable, BNC connector; also called Thinnet.
[10base2, BNC, 10BNC]
.It Dv IFM_10_5
10BASE5, 10Mb/s over 15-wire cables, DB15 connector; also called AUI.
[10base5, AUI, 10AUI]
.It Dv IFM_10_STP
10BASE-STP, 10Mb/s over shielded twisted pair, DB9 connector.
[10baseSTP, STP, 10STP]
.It Dv IFM_10_FL
10BASE-FL, 10Mb/s over fiber optic cables.
[10baseFL, FL, 10FL]
.It Dv IFM_100_TX
100BASE-TX, 100Mb/s over unshielded twisted pair, RJ45 connector.
[100baseTX, 100TX]
.It Dv IFM_100_FX
100BASE-FX, 100Mb/s over fiber optic cables.
[100baseFX, 100FX]
.It Dv IFM_100_T4
100BASE-T4, 100Mb/s over 4-wire (category 3) unshielded twisted pair, RJ45
connector.
[100baseT4, 100T4]
.It Dv IFM_100_T2
100BASE-T2.
[100baseT2, 100T2]
.It Dv IFM_100_VG
100VG-AnyLAN.
[100baseVG, 100VG]
.It Dv IFM_1000_SX
1000BASE-SX, 1Gb/s over multi-mode fiber optic cables.
[1000baseSX, 1000SX]
.It Dv IFM_1000_LX
1000BASE-LX, 1Gb/s over single-mode fiber optic cables.
[1000baseLX, 1000LX]
.It Dv IFM_1000_CX
1000BASE-CX, 1Gb/s over shielded twisted pair.
[1000baseCX, 1000CX]
.It Dv IFM_1000_T
1000BASE-T, 1Gb/s over category 5 unshielded twisted pair, RJ45 connector.
[1000baseT, 1000T]
.It Dv IFM_1000_TX
Compatibility for 1000BASE-T.
[1000baseTX, 1000TX]
.It Dv IFM_2500_SX
2500BASE-SX, 2.5Gb/s over multi-mode fiber optic cables.
[2500baseSX, 2500SX]
.It Dv IFM_10G_CX4
10GBASE-CX4, 10Gb/s over XAUI 4-lane PCS and copper cables.
[10GbaseCX4, 10GCX4, 10GBASE-CX4]
.It Dv IFM_10G_LR
10GBASE-LR, 10Gb/s over single-mode fiber optic cables.
[10GbaseLR, 10GLR, 10GBASE-LR]
.It Dv IFM_10G_SFP_CU
10GSFP+Cu, 10Gb/s over SFP+ Direct Attach cables.
[10GSFP+Cu, 10GCu]
.It Dv IFM_10G_SR
10GBASE-SR, 10Gb/s over multi-mode fiber optic cables.
[10GbaseSR, 10GSR, 10GBASE-SR]
.It Dv IFM_10G_T
10GBASE-T, 10Gb/s over unshielded twisted pair, RJ45 connector.
[10GbaseT, 10GT, 10GBASE-T]
.It Dv IFM_HPNA_1
HomePNA 1.0, 1Mb/s over 2-wire (category 3) unshielded twisted pair
[HomePNA1, HPNA1]
.El
.Pp
The following media options are defined for Ethernet:
.Bl -tag -offset indent -width IFM_ETH_RXPAUSE
.It Dv IFM_ETH_MASTER
Configure a 1000BASE-T PHY as a MASTER PHY.
.It Dv IFM_ETH_RXPAUSE
Receive flow control is enabled on the 1000BASE-T PHY.
.It Dv IFM_ETH_TXPAUSE
Transmit flow control is enabled on the 1000BASE-T PHY.
.El
.Sh MEDIA TYPES AND OPTIONS FOR FDDI
The following media types are defined for FDDI:
.Pp
.Bl -tag -offset indent -width IFM_FDDI_SMF -compact
.It Dv IFM_FDDI_SMF
Single-mode fiber.
[Single-mode, SMF]
.It Dv IFM_FDDI_MMF
Multi-mode fiber.
[Multi-mode, MMF]
.It Dv IFM_FDDI_UTP
Unshielded twisted pair, RJ45 connector.
[UTP, CDDI]
.El
.Pp
The following media options are defined for FDDI:
.Bl -tag -offset indent -width IFM_FDDI_DA
.It Dv IFM_FDDI_DA
Dual-attached station vs. Single-attached station.
[dual-attach, das]
.El
.Sh MEDIA TYPES AND OPTIONS FOR IEEE802.11 WIRELESS LAN
The following media types are defined for IEEE802.11 Wireless LAN:
.Pp
.Bl -tag -offset indent -width IFM_IEEE80211_OFDM22 -compact
.It Dv IFM_IEEE80211_FH1
Frequency Hopping 1Mbps.
[FH1]
.It Dv IFM_IEEE80211_FH2
Frequency Hopping 2Mbps.
[FH2]
.It Dv IFM_IEEE80211_DS1
Direct Sequence 1Mbps.
[DS1]
.It Dv IFM_IEEE80211_DS2
Direct Sequence 2Mbps.
[DS2]
.It Dv IFM_IEEE80211_DS5
Direct Sequence 5.5Mbps.
[DS5]
.It Dv IFM_IEEE80211_DS11
Direct Sequence 11Mbps.
[DS11]
.It Dv IFM_IEEE80211_DS22
Direct Sequence 22Mbps.
[DS22]
.It Dv IFM_IEEE80211_OFDM6
Orthogonal Frequency Division Multiplexing (OFDM) 6Mbps.
[OFDM6]
.It Dv IFM_IEEE80211_OFDM9
OFDM 9Mbps.
[OFDM9]
.It Dv IFM_IEEE80211_OFDM12
OFDM 12Mbps.
[OFDM12]
.It Dv IFM_IEEE80211_OFDM18
OFDM 18Mbps.
[OFDM18]
.It Dv IFM_IEEE80211_OFDM24
OFDM 24Mbps.
[OFDM24]
.It Dv IFM_IEEE80211_OFDM36
OFDM 36Mbps.
[OFDM36]
.It Dv IFM_IEEE80211_OFDM48
OFDM 48Mbps.
[OFDM48]
.It Dv IFM_IEEE80211_OFDM54
OFDM 54Mbps.
[OFDM54]
.It Dv IFM_IEEE80211_OFDM72
OFDM 72Mbps.
[OFDM72]
.El
.Pp
The following media options are defined for IEEE802.11 Wireless LAN:
.Pp
.Bl -tag -offset indent -width IFM_IEEE80211_IBSSMASTER -compact
.It Dv IFM_IEEE80211_ADHOC
Ad-hoc mode.
[adhoc]
.It Dv IFM_IEEE80211_HOSTAP
Host Access Point mode.
[hostap]
.It Dv IFM_IEEE80211_IBSS
IBSS mode.
[ibss]
.It Dv IFM_IEEE80211_IBSSMASTER
IBSS master mode.
[ibssmaster]
.It Dv IFM_IEEE80211_MONITOR
Monitor mode.
[monitor]
.It Dv IFM_IEEE80211_TURBO
Turbo mode.
[turbo]
.El
.Pp
The following media modes are defined for IEEE802.11 Wireless LAN:
.Pp
.Bl -tag -offset indent -width IFM_IEEE80211_11A -compact
.It Dv IFM_IEEE80211_11A
5Ghz, OFDM mode.
[11a]
.It Dv IFM_IEEE80211_11B
2GHz, Direct Sequence mode.
[11b]
.It Dv IFM_IEEE80211_11G
2GHz, CCK mode.
[11g]
.It Dv IFM_IEEE80211_FH
2GHz, GFSK mode.
[fh]
.El
.Pp
The channels detailed below are defined for IEEE802.11 Wireless LAN.
The list of available frequencies is dependent on radio regulations
specified by regional authorities.
Recognized regulatory authorities include
the FCC (United States), ETSI (Europe), France, and Japan.
Frequencies in the table are specified in MHz.
.Pp
.Bd -ragged -offset indent
.Bl -column "Channel " "FCC" "ETSI" "France" "Japan"
.It Em "Channel FCC ETSI France Japan"
.It 1 2412 2412 - 2412
.It 2 2417 2417 - 2417
.It 3 2422 2422 - 2422
.It 4 2427 2427 - 2427
.It 5 2432 2432 - 2432
.It 6 2437 2437 - 2437
.It 7 2442 2442 - 2442
.It 8 2447 2447 - 2447
.It 9 2452 2452 - 2452
.It 10 2457 2457 2457 2457
.It 11 2462 2462 2462 2462
.It 12 - 2467 2467 2467
.It 13 - 2472 2472 2472
.It 14 - - - 2484
.El
.Ed
.Pp
Note that the channels do overlap; the bandwidth required for
each channel is about 20MHz.
When using multiple channels in close proximity it is suggested
that channels be separated by at least 25MHz.
In the US, this means that only channels 1, 6, and 11 may be used
simultaneously without interference.
.Sh MEDIA TYPES AND OPTIONS FOR TDM
The following media types are defined for TDM:
.Bl -tag -offset indent -width IFM_TDM_E1_G704_CRC4
.It Dv IFM_TDM_E1
E1, 2048kb/s HDB3 encoded, G.703 clearchannel serial line.
[e1]
.It Dv IFM_TDM_E1_AMI
E1, 2048kb/s AMI encoded, G.703 clearchannel serial line.
[e1-ami]
.It Dv IFM_TDM_E1_AMI_G704
E1, 2048kb/s AMI encoded, G.704 structured serial line.
[e1-ami-g.704]
.It Dv IFM_TDM_E1_G704
E1, 2048kb/s HDB3 encoded, G.704 structured serial line.
[e1-g.704]
.It Dv IFM_TDM_E1_G704_CRC4
E1, 2048kb/s HDB3 encoded, G.704 structured serial line with CRC4 checksum.
[e1-g.704-crc4]
.It Dv IFM_TDM_E3
E3, 34368kb/s HDB3 encoded, G.703 clearchannel serial line.
[e3]
.It Dv IFM_TDM_E3_G751
E3, 34368kb/s HDB3 encoded, G.751 structured serial line.
[e3-g.751]
.It Dv IFM_TDM_E3_G832
E3, 34368kb/s HDB3 encoded, G.832 structured serial line.
[e3-g.832]
.It Dv IFM_TDM_T1
T1, 1536xkb/s B8ZS encoded, extended super frame (ESF) structured serial line.
[t1]
.It Dv IFM_TDM_T1_AMI
T1, 1536kb/s AMI encoded, super frame (SF) structured serial line.
[t1-ami]
.It Dv IFM_TDM_T3
T3, 44736kb/s B3ZS, C-bit structured serial line.
[t3]
.It Dv IFM_TDM_T3_M13
T3, 44736kb/s B3ZS, M13 structured serial line.
[t3-m13]
.El
.Pp
The following media options are defined for TDM:
.Bl -tag -offset indent -width IFM_TDM_HDLC_CRC16
.It Dv IFM_TDM_HDLC_CRC16
Cisco HDLC with 16-bit CRC checksum encoding.
[hdlc-crc16]
.It Dv IFM_TDM_FR_ANSI
ANSI/ITU Framerelay encoding.
[framerelay-ansi, framerelay-itu]
.It Dv IFM_TDM_FR_CISCO
Cisco Framerelay encoding.
[framerelay-cisco]
.It Dv IFM_TDM_PPP
PPP encoding.
[ppp]
.El
.Pp
By default TDM interfaces will use Cisco HDLC encoding with a 32-bit CRC
checksum.
.Pp
The following media modes are defined for TDM:
.Bl -tag -offset indent -width IFM_TDM_MASTER
.It Dv IFM_TDM_MASTER
Use local clock source as master clock.
[master]
.El
.Sh MEDIA TYPES AND OPTIONS FOR CARP
.Xr carp 4
does not support any media types or options.
.Sh SEE ALSO
.Xr netintro 4 ,
.Xr ifconfig 8
.Sh HISTORY
The
.Nm
interface first appeared in
.Bsx 3.0 .
The implementation that appeared in
.Nx 1.3
was written by Jonathan Stone and Jason R. Thorpe to be compatible with
the BSDI API.
It has since gone through several revisions which have extended the
API while maintaining backwards compatibility with the original API.
.Pp
Support for the
.Sy IEEE802.11 Wireless LAN
link type was added in
.Nx 1.5 .
.Pp
.Sy Host AP
mode was added in
.Ox 3.1 .
|