VLAN(4)                   OpenBSD Programmer's Manual                  VLAN(4)

NAME
     vlan - IEEE 802.1Q encapsulation/decapsulation pseudo-device

SYNOPSIS
     pseudo-device vlan [count]

DESCRIPTION
     The vlan Ethernet interface allows construction of virtual LANs when used
     in conjunction with IEEE 802.1Q-compliant Ethernet devices.

     This driver currently supports the following modes of operation:

     802.1Q encapsulation over Ethernet (Ethernet protocol 0x8100)

          The 802.1Q header specifies the virtual LAN number, and thus allows
          an Ethernet switch (or other 802.1Q compliant network devices) to be
          aware of which LAN the frame is part of, and in the case of a
          switch, which port(s) the frame can go to.  Frames transmitted
          through the vlan interface will be diverted to the specified physi-
          cal interface with 802.1Q vlan encapsulation.  Frames with 802.1Q
          encapsulation received by the parent interface with the correct vlan
          tag will be diverted to the associated vlan pseudo-interface.

     Frame headers which normally contain the destination host, source host,
     and protocol, are altered with additional information.  After the source
     host, a 32-bit 802.1Q header is included, with 16 bits for the ether type
     (0x8100), 3 bits for the priority field (not used in this implementa-
     tion), 1 bit for the canonical field (always 0), and 12 bits for the vlan
     identifier.  Following the vlan header is the actual ether type for the
     frame and length information.

     The network interfaces are named vlan0, vlan1, etc.  The number of inter-
     faces is given by the corresponding pseudo-device line in the system con-
     fig file.  vlan(4) interfaces support the following unique ioctl(2)s:

     SIOCSETVLAN:
          Set the vlan tag and parent for a given vlan interface.

     SIOCGETVLAN:
          Get the vlan tag and parent for a given vlan interface.

     vlan(4) interfaces use the following interface capabilities:

     IFCAP_VLAN_MTU:
          The parent interface can handle full sized frames, plus the size of
          the vlan tag.

     IFCAP_VLAN_HWTAGGING:
          The parent interface will participate in the tagging and untagging
          of frames.

DIAGNOSTICS
     vlan%d: initialized with non-standard mtu %d (parent %s)  The IF-
     CAP_VLAN_MTU capability was not set on the parent interface.  We assume
     in this event that the parent interface is not capable of handling frames
     larger then its MTU.  This will generally result in a non-compliant
     802.1Q implementation.

     Some Ethernet chips will either discard or truncate Ethernet frames that
     are larger then 1514 bytes.  This causes a problem as 802.1Q tagged
     frames can be up to 1518 bytes.  Most controller chips can be told not to
     discard large frames and/or to increase the allowed frame size.  Refer to
     the hardware manual for your chip to do this.

     If the IFCAP_VLAN_MTU capability is set on a vlan parent, vlan(4) assumes
     that Ethernet chip on the parent can handle oversized frames.  Either the
     chip allows 1518 byte frames by default (such as rl(4)), the driver has
     instructed the chip to do so (such as fxp(4) and dc(4)), or the driver
     also takes advantage of a hardware tagging capability, and thus oversized
     frames are never actually sent or received by OpenBSD (such as txp(4) and
     ti(4)).

SEE ALSO
     bridge(4), inet(4), ip(4), netintro(4), ifconfig(8)

     IEEE 802.1Q standard, http://standards.ieee.org/getieee802/802.1.html.

     The vlan interface is to be configured with ifconfig(8), see its manual
     page for more information.

BUGS
     The 802.1Q specification allows for operation over FDDI and Token Ring as
     well as Ethernet.  This driver only supports such operation with Ethernet
     devices.

     When the IFCAP_VLAN_HWTAGGING capability is set on the parent interface,
     vlan(4) does not participate in the actual tagging or untagging of Ether-
     net frames.  It simply passes the vlan ID on to the parent interface for
     tagging on transmit, and gets a vlan ID for each packet on receive.  The
     vlan tagged packet is not actually visible to OpenBSD. Thus, bpf(4) will
     show untagged packets on the parent interface, although frames are actu-
     ally being transmitted and received with tags on the wire.

     This driver could be the basis for support of the Cisco ISL VLAN proto-
     col, detailed at http://www.cisco.com/warp/public/741/4.html .  Unfortu-
     nately, public reimplementation of this protocol is currently prevented
     by patent (at least in the USA).

AUTHORS
     Originally wollman@freebsd.org.

OpenBSD 3.0                     January 9, 2000                              2
