xref: /openbsd-src/share/man/man4/ifmedia.4 (revision d13be5d47e4149db2549a9828e244d59dbc43f15)
1.\"	$OpenBSD: ifmedia.4,v 1.20 2011/09/03 22:59:07 jmc Exp $
2.\"	$NetBSD: ifmedia.4,v 1.14 2001/06/30 17:57:56 bjh21 Exp $
3.\"
4.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
5.\" All rights reserved.
6.\"
7.\" This code is derived from software contributed to The NetBSD Foundation
8.\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9.\" NASA Ames Research Center.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30.\" POSSIBILITY OF SUCH DAMAGE.
31.\"
32.Dd $Mdocdate: September 3 2011 $
33.Dt IFMEDIA 4
34.Os
35.Sh NAME
36.Nm ifmedia
37.Nd network interface media settings
38.Sh SYNOPSIS
39.Fd #include <sys/socket.h>
40.Fd #include <net/if.h>
41.Fd #include <net/if_media.h>
42.Sh DESCRIPTION
43The
44.Nm
45interface provides a consistent method for querying and setting
46network interface media and media options.
47The media is typically set using the
48.Xr ifconfig 8
49command.
50.Pp
51Currently these link types are supported by
52.Nm ifmedia :
53.Pp
54.Bl -tag -offset indent -width IFM_IEEE80211 -compact
55.It Dv IFM_ETHER
56Ethernet
57.It Dv IFM_FDDI
58FDDI
59.It Dv IFM_IEEE80211
60IEEE802.11 Wireless LAN
61.It Dv IFM_TDM
62Time Division Multiplex
63.It Dv IFM_CARP
64CARP
65.El
66.Pp
67The following sections describe the possible media settings for each
68link type.
69Not all of these are supported by every device; refer to
70your device's manual page for more information.
71.Pp
72The lists below provide the possible names of each media type or option.
73The first name in the list is the canonical name of the media type or
74option.
75Additional names are acceptable aliases for the media type or option.
76.Sh COMMON MEDIA TYPES AND OPTIONS
77The following media types are shared by all link types:
78.Pp
79.Bl -tag -offset indent -width IFM_MANUAL -compact
80.It Dv IFM_AUTO
81Autoselect the best media.
82[autoselect, auto]
83.It Dv IFM_MANUAL
84Jumper or switch on device selects media.
85[manual]
86.It Dv IFM_NONE
87Deselect all media.
88[none]
89.El
90.Pp
91The following media options are shared by all link types:
92.Bl -tag -offset indent -width IFM_FLAG0
93.It Dv IFM_FDX
94Place the device into full-duplex mode.
95This option only has meaning if the device is normally not full-duplex.
96.It Dv IFM_HDX
97Place the device into half-duplex mode.
98This option only has meaning if the device is normally not half-duplex.
99[half-duplex, hdx]
100.It Dv IFM_FLOW
101Enable hardware flow control on device.
102.It Dv IFM_FLAG0
103Driver-defined flag.
104[flag0]
105.It Dv IFM_FLAG1
106Driver-defined flag.
107[flag1]
108.It Dv IFM_FLAG2
109Driver-defined flag.
110[flag2]
111.It Dv IFM_LOOP
112Place the device into hardware loopback mode.
113[loopback, hw-loopback, loop]
114.El
115.Sh MEDIA TYPES AND OPTIONS FOR ETHERNET
116The following media types are defined for Ethernet:
117.Bl -tag -offset indent -width IFM_10G_SFP_CU
118.It Dv IFM_10_T
11910BASE-T, 10Mb/s over unshielded twisted pair, RJ45 connector.
120[10baseT, UTP, 10UTP]
121.It Dv IFM_10_2
12210BASE2, 10Mb/s over coaxial cable, BNC connector; also called Thinnet.
123[10base2, BNC, 10BNC]
124.It Dv IFM_10_5
12510BASE5, 10Mb/s over 15-wire cables, DB15 connector; also called AUI.
126[10base5, AUI, 10AUI]
127.It Dv IFM_10_STP
12810BASE-STP, 10Mb/s over shielded twisted pair, DB9 connector.
129[10baseSTP, STP, 10STP]
130.It Dv IFM_10_FL
13110BASE-FL, 10Mb/s over fiber optic cables.
132[10baseFL, FL, 10FL]
133.It Dv IFM_100_TX
134100BASE-TX, 100Mb/s over unshielded twisted pair, RJ45 connector.
135[100baseTX, 100TX]
136.It Dv IFM_100_FX
137100BASE-FX, 100Mb/s over fiber optic cables.
138[100baseFX, 100FX]
139.It Dv IFM_100_T4
140100BASE-T4, 100Mb/s over 4-wire (category 3) unshielded twisted pair, RJ45
141connector.
142[100baseT4, 100T4]
143.It Dv IFM_100_T2
144100BASE-T2.
145[100baseT2, 100T2]
146.It Dv IFM_100_VG
147100VG-AnyLAN.
148[100baseVG, 100VG]
149.It Dv IFM_1000_SX
1501000BASE-SX, 1Gb/s over multi-mode fiber optic cables.
151[1000baseSX, 1000SX]
152.It Dv IFM_1000_LX
1531000BASE-LX, 1Gb/s over single-mode fiber optic cables.
154[1000baseLX, 1000LX]
155.It Dv IFM_1000_CX
1561000BASE-CX, 1Gb/s over shielded twisted pair.
157[1000baseCX, 1000CX]
158.It Dv IFM_1000_T
1591000BASE-T, 1Gb/s over category 5 unshielded twisted pair, RJ45 connector.
160[1000baseT, 1000T]
161.It Dv IFM_1000_TX
162Compatibility for 1000BASE-T.
163[1000baseTX, 1000TX]
164.It Dv IFM_2500_SX
1652500BASE-SX, 2.5Gb/s over multi-mode fiber optic cables.
166[2500baseSX, 2500SX]
167.It Dv IFM_10G_CX4
16810GBASE-CX4, 10Gb/s over XAUI 4-lane PCS and copper cables.
169[10GbaseCX4, 10GCX4, 10GBASE-CX4]
170.It Dv IFM_10G_LR
17110GBASE-LR, 10Gb/s over single-mode fiber optic cables.
172[10GbaseLR, 10GLR, 10GBASE-LR]
173.It Dv IFM_10G_SFP_CU
17410GSFP+Cu, 10Gb/s over SFP+ Direct Attach cables.
175[10GSFP+Cu, 10GCu]
176.It Dv IFM_10G_SR
17710GBASE-SR, 10Gb/s over multi-mode fiber optic cables.
178[10GbaseSR, 10GSR, 10GBASE-SR]
179.It Dv IFM_10G_T
18010GBASE-T, 10Gb/s over unshielded twisted pair, RJ45 connector.
181[10GbaseT, 10GT, 10GBASE-T]
182.It Dv IFM_HPNA_1
183HomePNA 1.0, 1Mb/s over 2-wire (category 3) unshielded twisted pair
184[HomePNA1, HPNA1]
185.El
186.Pp
187The following media options are defined for Ethernet:
188.Bl -tag -offset indent -width IFM_ETH_RXPAUSE
189.It Dv IFM_ETH_MASTER
190Configure a 1000BASE-T PHY as a MASTER PHY.
191.It Dv IFM_ETH_RXPAUSE
192Receive flow control is enabled on the 1000BASE-T PHY.
193.It Dv IFM_ETH_TXPAUSE
194Transmit flow control is enabled on the 1000BASE-T PHY.
195.El
196.Sh MEDIA TYPES AND OPTIONS FOR FDDI
197The following media types are defined for FDDI:
198.Pp
199.Bl -tag -offset indent -width IFM_FDDI_SMF -compact
200.It Dv IFM_FDDI_SMF
201Single-mode fiber.
202[Single-mode, SMF]
203.It Dv IFM_FDDI_MMF
204Multi-mode fiber.
205[Multi-mode, MMF]
206.It Dv IFM_FDDI_UTP
207Unshielded twisted pair, RJ45 connector.
208[UTP, CDDI]
209.El
210.Pp
211The following media options are defined for FDDI:
212.Bl -tag -offset indent -width IFM_FDDI_DA
213.It Dv IFM_FDDI_DA
214Dual-attached station vs. Single-attached station.
215[dual-attach, das]
216.El
217.Sh MEDIA TYPES AND OPTIONS FOR IEEE802.11 WIRELESS LAN
218The following media types are defined for IEEE802.11 Wireless LAN:
219.Pp
220.Bl -tag -offset indent -width IFM_IEEE80211_OFDM22 -compact
221.It Dv IFM_IEEE80211_FH1
222Frequency Hopping 1Mbps.
223[FH1]
224.It Dv IFM_IEEE80211_FH2
225Frequency Hopping 2Mbps.
226[FH2]
227.It Dv IFM_IEEE80211_DS1
228Direct Sequence 1Mbps.
229[DS1]
230.It Dv IFM_IEEE80211_DS2
231Direct Sequence 2Mbps.
232[DS2]
233.It Dv IFM_IEEE80211_DS5
234Direct Sequence 5.5Mbps.
235[DS5]
236.It Dv IFM_IEEE80211_DS11
237Direct Sequence 11Mbps.
238[DS11]
239.It Dv IFM_IEEE80211_DS22
240Direct Sequence 22Mbps.
241[DS22]
242.It Dv IFM_IEEE80211_OFDM6
243Orthogonal Frequency Division Multiplexing (OFDM) 6Mbps.
244[OFDM6]
245.It Dv IFM_IEEE80211_OFDM9
246OFDM 9Mbps.
247[OFDM9]
248.It Dv IFM_IEEE80211_OFDM12
249OFDM 12Mbps.
250[OFDM12]
251.It Dv IFM_IEEE80211_OFDM18
252OFDM 18Mbps.
253[OFDM18]
254.It Dv IFM_IEEE80211_OFDM24
255OFDM 24Mbps.
256[OFDM24]
257.It Dv IFM_IEEE80211_OFDM36
258OFDM 36Mbps.
259[OFDM36]
260.It Dv IFM_IEEE80211_OFDM48
261OFDM 48Mbps.
262[OFDM48]
263.It Dv IFM_IEEE80211_OFDM54
264OFDM 54Mbps.
265[OFDM54]
266.It Dv IFM_IEEE80211_OFDM72
267OFDM 72Mbps.
268[OFDM72]
269.El
270.Pp
271The following media options are defined for IEEE802.11 Wireless LAN:
272.Pp
273.Bl -tag -offset indent -width IFM_IEEE80211_IBSSMASTER -compact
274.It Dv IFM_IEEE80211_ADHOC
275Ad-hoc mode.
276[adhoc]
277.It Dv IFM_IEEE80211_HOSTAP
278Host Access Point mode.
279[hostap]
280.It Dv IFM_IEEE80211_IBSS
281IBSS mode.
282[ibss]
283.It Dv IFM_IEEE80211_IBSSMASTER
284IBSS master mode.
285[ibssmaster]
286.It Dv IFM_IEEE80211_MONITOR
287Monitor mode.
288[monitor]
289.It Dv IFM_IEEE80211_TURBO
290Turbo mode.
291[turbo]
292.El
293.Pp
294The following media modes are defined for IEEE802.11 Wireless LAN:
295.Pp
296.Bl -tag -offset indent -width IFM_IEEE80211_11A -compact
297.It Dv IFM_IEEE80211_11A
2985Ghz, OFDM mode.
299[11a]
300.It Dv IFM_IEEE80211_11B
3012GHz, Direct Sequence mode.
302[11b]
303.It Dv IFM_IEEE80211_11G
3042GHz, CCK mode.
305[11g]
306.It Dv IFM_IEEE80211_FH
3072GHz, GFSK mode.
308[fh]
309.El
310.Pp
311The channels detailed below are defined for IEEE802.11 Wireless LAN.
312The list of available frequencies is dependent on radio regulations
313specified by regional authorities.
314Recognized regulatory authorities include
315the FCC (United States), ETSI (Europe), France, and Japan.
316Frequencies in the table are specified in MHz.
317.Bl -column "Channel " "2412" "ETSI" "France" "Japan" -offset indent
318.It Em Channel Ta Em FCC Ta Em ETSI Ta Em France Ta Em Japan
319.It 1 Ta 2412 Ta 2412 Ta - Ta 2412
320.It 2 Ta 2417 Ta 2417 Ta - Ta 2417
321.It 3 Ta 2422 Ta 2422 Ta - Ta 2422
322.It 4 Ta 2427 Ta 2427 Ta - Ta 2427
323.It 5 Ta 2432 Ta 2432 Ta - Ta 2432
324.It 6 Ta 2437 Ta 2437 Ta - Ta 2437
325.It 7 Ta 2442 Ta 2442 Ta - Ta 2442
326.It 8 Ta 2447 Ta 2447 Ta - Ta 2447
327.It 9 Ta 2452 Ta 2452 Ta - Ta 2452
328.It 10 Ta 2457 Ta 2457 Ta 2457 Ta 2457
329.It 11 Ta 2462 Ta 2462 Ta 2462 Ta 2462
330.It 12 Ta - Ta 2467 Ta 2467 Ta 2467
331.It 13 Ta - Ta 2472 Ta 2472 Ta 2472
332.It 14 Ta - Ta - Ta - Ta 2484
333.El
334.Pp
335Note that the channels do overlap; the bandwidth required for
336each channel is about 20MHz.
337When using multiple channels in close proximity it is suggested
338that channels be separated by at least 25MHz.
339In the US, this means that only channels 1, 6, and 11 may be used
340simultaneously without interference.
341.Sh MEDIA TYPES AND OPTIONS FOR TDM
342The following media types are defined for TDM:
343.Bl -tag -offset indent -width IFM_TDM_E1_G704_CRC4
344.It Dv IFM_TDM_E1
345E1, 2048kb/s HDB3 encoded, G.703 clearchannel serial line.
346[e1]
347.It Dv IFM_TDM_E1_AMI
348E1, 2048kb/s AMI encoded, G.703 clearchannel serial line.
349[e1-ami]
350.It Dv IFM_TDM_E1_AMI_G704
351E1, 2048kb/s AMI encoded, G.704 structured serial line.
352[e1-ami-g.704]
353.It Dv IFM_TDM_E1_G704
354E1, 2048kb/s HDB3 encoded, G.704 structured serial line.
355[e1-g.704]
356.It Dv IFM_TDM_E1_G704_CRC4
357E1, 2048kb/s HDB3 encoded, G.704 structured serial line with CRC4 checksum.
358[e1-g.704-crc4]
359.It Dv IFM_TDM_E3
360E3, 34368kb/s HDB3 encoded, G.703 clearchannel serial line.
361[e3]
362.It Dv IFM_TDM_E3_G751
363E3, 34368kb/s HDB3 encoded, G.751 structured serial line.
364[e3-g.751]
365.It Dv IFM_TDM_E3_G832
366E3, 34368kb/s HDB3 encoded, G.832 structured serial line.
367[e3-g.832]
368.It Dv IFM_TDM_T1
369T1, 1536xkb/s B8ZS encoded, extended super frame (ESF) structured serial line.
370[t1]
371.It Dv IFM_TDM_T1_AMI
372T1, 1536kb/s AMI encoded, super frame (SF) structured serial line.
373[t1-ami]
374.It Dv IFM_TDM_T3
375T3, 44736kb/s B3ZS, C-bit structured serial line.
376[t3]
377.It Dv IFM_TDM_T3_M13
378T3, 44736kb/s B3ZS, M13 structured serial line.
379[t3-m13]
380.El
381.Pp
382The following media options are defined for TDM:
383.Bl -tag -offset indent -width IFM_TDM_HDLC_CRC16
384.It Dv IFM_TDM_HDLC_CRC16
385Cisco HDLC with 16-bit CRC checksum encoding.
386[hdlc-crc16]
387.It Dv IFM_TDM_FR_ANSI
388ANSI/ITU Framerelay encoding.
389[framerelay-ansi, framerelay-itu]
390.It Dv IFM_TDM_FR_CISCO
391Cisco Framerelay encoding.
392[framerelay-cisco]
393.It Dv IFM_TDM_PPP
394PPP encoding.
395[ppp]
396.El
397.Pp
398By default TDM interfaces will use Cisco HDLC encoding with a 32-bit CRC
399checksum.
400.Pp
401The following media modes are defined for TDM:
402.Bl -tag -offset indent -width IFM_TDM_MASTER
403.It Dv IFM_TDM_MASTER
404Use local clock source as master clock.
405[master]
406.El
407.Sh MEDIA TYPES AND OPTIONS FOR CARP
408.Xr carp 4
409does not support any media types or options.
410.Sh SEE ALSO
411.Xr netintro 4 ,
412.Xr ifconfig 8
413.Sh HISTORY
414The
415.Nm
416interface first appeared in
417.Bsx 3.0 .
418The implementation that appeared in
419.Nx 1.3
420was written by Jonathan Stone and Jason R. Thorpe to be compatible with
421the BSDI API.
422It has since gone through several revisions which have extended the
423API while maintaining backwards compatibility with the original API.
424.Pp
425Support for the
426.Sy IEEE802.11 Wireless LAN
427link type was added in
428.Nx 1.5 .
429.Pp
430.Sy Host AP
431mode was added in
432.Ox 3.1 .
433