xref: /openbsd-src/share/man/man4/vlan.4 (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1.\" $OpenBSD: vlan.4,v 1.12 2001/08/03 23:21:20 chris Exp $
2.\"
3.Dd January 9, 2000
4.Dt VLAN 4
5.Os
6.Sh NAME
7.Nm vlan
8.Nd "IEEE 802.1Q encapsulation/decapsulation pseudo-device"
9.Sh SYNOPSIS
10.Cd pseudo-device vlan Op Ar count
11.Sh DESCRIPTION
12The
13.Nm
14Ethernet interface allows construction of virtual LANs when used in
15conjunction with IEEE 802.1Q-compliant Ethernet devices.
16.Pp
17This driver currently supports the following modes of operation:
18.Bl -tag -width abc
19.It 802.1Q encapsulation over Ethernet (Ethernet protocol 0x8100)
20.Pp
21The 802.1Q header specifies the virtual LAN number, and thus allows an
22Ethernet switch (or other 802.1Q compliant network devices) to be aware of
23which LAN the frame is part of, and in the case of a switch, which
24port(s) the frame can go to.
25Frames transmitted through the vlan interface will be diverted to the specified
26physical interface with 802.1Q vlan encapsulation.
27Frames with 802.1Q encapsulation received by the parent interface with the
28correct vlan tag will be diverted to the associated vlan pseudo-interface.
29.El
30.Pp
31Frame headers which normally contain the destination host, source host, and
32protocol, are altered with additional information.
33After the source host,
34a 32-bit 802.1Q header is included, with 16 bits for the ether type (0x8100), 3
35bits for the priority field (not used in this implementation), 1 bit for
36the canonical field (always 0), and 12 bits for the vlan identifier.
37Following the vlan header is the actual ether type for the frame and length
38information.
39.Pp
40The network interfaces are named
41.Sy vlan Ns Ar 0 ,
42.Sy vlan Ns Ar 1 ,
43etc.
44The number of interfaces is given by the corresponding
45.Sy pseudo-device
46line in the system config file.
47.Xr vlan 4
48interfaces support the following unique
49.Xr ioctl 2 Ns s :
50.Bl -tag -width aaa
51.It SIOCSETVLAN:
52Set the vlan tag and parent for a given vlan interface.
53.It SIOCGETVLAN:
54Get the vlan tag and parent for a given vlan interface.
55.Pp
56.El
57.Xr vlan 4
58interfaces use the following interface capabilities:
59.Bl -tag -width aaa
60.It IFCAP_VLAN_MTU:
61The parent interface can handle full sized frames, plus the size
62of the vlan tag.
63.It IFCAP_VLAN_HWTAGGING:
64The parent interface will participate in the tagging and untagging of frames.
65.El
66.Sh DIAGNOSTICS
67.Bl -diag
68.It "vlan%d: initialized with non-standard mtu %d (parent %s)"
69The IFCAP_VLAN_MTU capability was not set on the parent interface.
70We assume in this event that the parent interface is not capable of handling
71frames larger then its MTU.   This will generally result in a non-compliant
72802.1Q implementation.
73.Pp
74Some Ethernet chips will either discard or truncate
75Ethernet frames that are larger then 1514 bytes.  This causes a problem as
76802.1Q tagged frames can be up to 1518 bytes.
77Most controller chips can be told not to discard large frames
78and/or to increase the allowed frame size.  Refer to the hardware manual
79for your chip to do this.
80.El
81.Pp
82If the IFCAP_VLAN_MTU capability is set on a vlan parent,
83.Xr vlan 4
84assumes that Ethernet chip on the parent can handle
85oversized frames.
86Either the chip allows 1518 byte frames by default (such as
87.Xr rl 4 ),
88the driver has instructed the chip to do so (such as
89.Xr fxp 4
90and
91.Xr dc 4 ),
92or the driver also takes advantage of a hardware tagging capability,
93and thus oversized frames are never actually sent or received by
94.Ox
95(such as
96.Xr txp 4
97and
98.Xr ti 4 .)
99.Sh SEE ALSO
100.Xr bridge 4 ,
101.Xr inet 4 ,
102.Xr ip 4 ,
103.Xr netintro 4 ,
104.Xr ifconfig 8
105.Pp
106.Rs
107.%T IEEE 802.1Q standard
108.%O http://standards.ieee.org/getieee802/802.1.html
109.Re
110.Pp
111The vlan interface is to be configured with
112.Xr ifconfig 8 ,
113see its manual page for more information.
114.Sh BUGS
115The 802.1Q specification allows for operation over FDDI and Token Ring
116as well as Ethernet.
117This driver only supports such operation with Ethernet devices.
118.Pp
119When the IFCAP_VLAN_HWTAGGING capability is set on the parent interface,
120.Xr vlan 4
121does not participate in the actual tagging or untagging of Ethernet frames.
122It simply passes the vlan ID on to the parent interface for tagging on transmit,
123and gets a vlan ID for each packet on receive.
124The vlan tagged packet is not actually visible to
125.Ox .
126Thus,
127.Xr bpf 4
128will show untagged packets on the parent interface, although frames
129are actually being transmitted and received with tags on the wire.
130.Pp
131This driver could be the basis for support of the Cisco ISL VLAN protocol,
132detailed at http://www.cisco.com/warp/public/741/4.html .
133Unfortunately, public reimplementation of this protocol is currently prevented
134by patent (at least in the USA).
135.Sh AUTHORS
136Originally wollman@freebsd.org.
137