<?xml version='1.0'?>
<chapter>
<title>Supporting Technology, 802.2, Ethernet and Token Ring</title>
<para>
Although NetBIOS is often encapsulated, it can be implemented "on the wire".  This chapter
looks at the implementation of NetBIOS on two popular networking technologies, Ethernet
and Token Ring as well as the 802.2 Logical Link Control layer used with these technologies.
This documentation looks at the technologies in relation to NetBIOS rather than attempting
to provide a full description of the protocols; there are many excellent books on 802.2,
 Ethernet and Token Ring that describe those subjects in detail.
</para>
<section>
<title>IEEE 802.2 Logical Link Control</title>
<para>
In the OSI Reference Model, the Datalink layer sits above the Physical layer and below 
the Network layer.  When considering IEEE LAN technology the situation is a little more complex.  
There are a number of LAN systems such as Token Ring and Ethernet and the physical 
characteristics of these are defined in the Physical Layer of the OSI model.  
Characteristics such as the frame format for systems such as Token Ring and Ethernet 
are defined in the Datalink layer in standards such as 802.3, 802.5 etc.  A common 
interface was required between these standards and the protocols in layer 3 and this is 
implemented in 802.2.
A full description of IEEE 802.2 Logical Link Control is beyond the scope of this
document; a brief overview is given below.
</para>
<para>IEEE 802.2 Logical Link Control frames often provide the data link layer support
for implementations of NetBIOS.  This is the case when NetBIOS frames are being
carried "on the wire" rather than encapsulated in another protocol.  The
relationship is illustrated in the 
<xref linkend='osi-OSI'/>
Open Systems Interconnection (OSI) Reference Model
</para>
<para>
802.2 supports both connection-oriented and connection-less oriented communications.
The Logical Link Control offers services to the Network layer through Service
Access Points (SAPs).  The SAP is used to identify the process at the Network
layer.
</para>
<para>IEEE 802.2 frames have the following form:
</para>
<variablelist>
<varlistentry>
<term>
DSAP 1 byte
</term>
<listitem>
<para>Destination Service Access Point
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
SSAP 1 byte
</term>
<listitem>
<para>source  Service Access Point
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Control 1 or 2 bytes
</term>
<listitem>
<para>field length depends on the service
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Information
</term>
<listitem>
<para>This variable length field carries any data
</para>
</listitem>
</varlistentry>
</variablelist>
<para>Some examples of DSAP and SSAP values are given below.</para>
<para>For IPX (the network protocol traditionally used with NetWare networks),
 DSAP = 0xE0 (224), SSAP = 0xE0 and Control is 1 byte 0x03 which denotes
 the 802.2 unnumbered format.
</para>
<para>For SNAP (Sub-Network Access Protocol), DSAP = 0xAA (170), SSAP = 0xAA
</para>
<para>
<emphasis>For NetBIOS, DSAP = 0xF0 (240) , SSAP = 0xF0</emphasis>
</para>
<para>Some IEEE 802.2 Numbers of interest can be found at
<quote>The Internet Assigned Numbers Authority</quote>
web site, <quote>Protocol Numbers and Assignment Services</quote>
in <quote>IEEE 802 Numbers</quote>:
</para>
<para>
<ulink url='http://www.iana.org/assignments/ieee-802-numbers'>
http://www.iana.org/assignments/ieee-802-numbers</ulink>
</para>
<para>In 1985 IBM implemented NetBIOS over Token Ring and established the way in
which NetBIOS frames would map to 802.2 frames.
</para>
<para>When NetBIOS is implemented over Token Ring, the NetBIOS frames are mapped directly
on to the 802.2 frames; the NetBIOS frame is contained in the information field of the 
802.2 frame:
</para>
<itemizedlist>
<listitem>
<para>DSAP 1 byte Destination Service Access Point 0xF0
</para>
</listitem>
<listitem>
<para>SSAP 1 byte source  Service Access Point 0xF0
</para>
</listitem>
<listitem>
<para>Control 1 or 2 bytes field length depends on the service
</para>
</listitem>
<listitem>
<para>Information:
<itemizedlist>
<listitem><para>NetBIOS header</para></listitem>
<listitem><para>Optional data</para></listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
<para>The above scheme is general to implementations of NetBIOS over 802.2 where
other underlying technologies are used such as Ethernet.
</para>
</section>
<section>
<title>Token Ring</title>
<para>Token Ring is becoming less popular with many organizations moving to
Ethernet.  Token Ring is discussed here because of it's importance in the
history of NetBIOS and understanding of NetBIOS.</para>
<para>When IBM introduced Token-Ring, an emulator for NetBIOS was produced. 
The NetBIOS Extended User Interface (NetBEUI) was introduced in 1985.
NetBIOS was no longer implemented only on a set of propriety protocols, but
also on 802.2 frames.  The implementation on Token-Ring was the first
implementation over 802.2 and provides a reference model.  Detailed information
can be found in the IBM manual:
IBM LAN Technical Reference, see
<xref linkend='refs-References'/>
IBM LAN Technical Reference IEEE 802.2 and NetBIOS Application Program
Interfaces.
</para>
<para>A full description of Token Ring is beyond the scope of this document; some
basic information on Token Ring and its use with NetBIOS is given below.
</para>
<para>There are two kinds of Token Ring frames: Media Access Control (MAC) frames and
Non-MAC frames.  MAC frames carry Token Ring management information between
nodes, Non-MAC frames carry user data.  The non-MAC frames contain
IEEE 802.2 Logical Link Control frames which in turn can contain NetBIOS frames.
</para>
<section>
<title>Non-MAC Frame Structure</title>
<table frame='all'>
<title>Non-MAC Token Ring Frame Structure</title>
<tgroup cols='3'>
<thead>
<row>
<entry>Token Ring frame</entry>
<entry>802.2 Frame detail</entry>
<entry>NBF frame</entry>
</row>
</thead>
<tbody>
<row><entry>Start Delimiter (SDEL) 1 octet</entry>
<entry morerows='4'> </entry>
<entry morerows='7'> </entry>
</row>
<row><entry>Access Control (AC) 1 octet</entry></row>
<row><entry>Frame Control (FC) 1 octet</entry></row>
<row><entry>Destination Address 6 octets</entry></row>
<row><entry>Source Address 6 octets</entry></row>
<row><entry morerows='5'>IEEE 802.2 Logical Link Control</entry>
<entry>DSAP 2 octets</entry></row>
<row>
<entry>SSAP 2 octets</entry></row>
<row>
<entry>Control 1 or 2 octets</entry></row>
<row>
<entry morerows='2'> Data 46-1500 octets</entry>
<entry>NetBIOS header</entry></row>
<row>
<entry>Optional data</entry></row>
<row><entry>Frame Check sequence (FCS) 4 octets</entry></row>
<row><entry>End Delimiter (EDEL) 1 octet</entry>
<entry morerows='1'> </entry>
<entry morerows='1'> </entry>
</row>
<row><entry>Frame Status (FS) Check sequence 1 octet</entry></row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Further information</title>
<para>Many manuals and documents describe Token-Ring in detail including
</para>
<para>
Novell's Guide to NetWare LAN Analysis, see
<xref linkend='refs-References'/>
</para>
</section>
</section>
<section>
<title>Ethernet</title>
<para>A full description of Ethernet is beyond the scope of this document; some
basic information on Ethernet and its use with NetBIOS is given below.
</para>
<para>Ethernet is widely used today and well documented.
Four types of Ethernet frames have been in common use.  For convenience the
notation used by Novell is used to describe the four Ethernet frame types:
</para>
<variablelist>
<varlistentry>
<term>Ethernet_802.3</term>
<listitem>
<para>Known as Ethernet 802.3 raw, this frame type
is used in NetWare networks and was the default type in NetWare v2.x and v3.x
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Ethernet_II</term>
<listitem>
<para>
Known as Ethernet DIX (Developed by Digital Intel Xerox)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Ethernet_802.2</term>
<listitem>
<para>
IEEE Ethernet
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Ethernet_SNAP</term>
<listitem>
<para>
SNAP (Sub-Network Access Protocol) derived from the 
Ethernet 802.2 structure
</para>
</listitem>
</varlistentry>
</variablelist>
<section>
<title>Ethernet_802.3</title>
<para>
Known as Ethernet 802.3 raw, this frame type
is used in NetWare networks and was the default type in NetWare v2.x and v3.x
Because of the nature of these frames they are unlikely to carry NBF frames,
unless encapsulated in IPX.
</para>
<table frame='all'>
<title>Ethernet_802.3 Frame Structure</title>
<tgroup cols='1'>
<tbody>
<row><entry>Preamble 7 octets</entry></row>
<row><entry>Start frame deliminator 1 octet</entry></row>
<row><entry>Destination Address 6 octets</entry></row>
<row><entry>Source Address 6 octets</entry></row>
<row><entry>Length 2 octets</entry></row>
<row><entry>Data 46-1500 octets</entry></row>
<row><entry>Frame Check sequence 4 octets</entry></row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Ethernet_802.2</title>
<para>
NBF frames are found in Ethernet_802.2 frames more than in other
Ethernet frames when NBF is implemented "on the wire" rather than
encapsulated.
</para>
<para>
Ethernet_802.2 frames are also used with IPX/SPX and FTAM (File Transfer
Access and Management) protocol.
</para>
<table frame='all'>
<title>Ethernet_802.2 Frame Structure</title>
<tgroup cols='3'>
<thead>
<row>
<entry>Ethernet frame</entry>
<entry>802.2 Frame detail</entry>
<entry>NBF frame</entry>
</row>
</thead>
<tbody>
<row>
<entry>Preamble 7 octets</entry>
<entry morerows='4'> </entry>
<entry morerows='7'> </entry>
</row>
<row>
<entry>Start frame deliminator 1 octet</entry>
</row>
<row>
<entry>Destination Address 6 octets</entry>
</row>
<row>
<entry>Source Address 6 octets</entry>
</row>
<row>
<entry>Length 2 octets</entry>
</row>
<row>
<entry morerows='4'>IEEE 802.2 Logical Link Control</entry>
<entry>DSAP 2 octets</entry>
</row>
<row>
<entry>SSAP 2 octets</entry>
</row>
<row>
<entry>Control 1 or 2 octets</entry>
</row>
<row>
<entry morerows='1'>Data 46-1500 octets</entry>
<entry>NetBIOS header</entry>
</row>
<row>			
<entry>Optional data</entry>
</row>
<row>
<entry>Frame Check sequence 4 octets</entry>
<entry> </entry>
<entry> </entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Ethernet_SNAP</title>
<para>
Ethernet_SNAP frames are used by IPX/SPX, TCP/IP and AppleTalk
Phase II.
</para>
<table frame='all'>
<title>Ethernet_SNAP Frame Structure</title>
<tgroup cols='1'>
<tbody>
<row><entry>Preamble 7 octets</entry></row>
<row><entry>Start frame deliminator 1 octet</entry></row>
<row><entry>Destination Address 6 octets</entry></row>
<row><entry>Source Address 6 octets</entry></row>
<row><entry>Length 2 octets</entry></row>
<row><entry>DSAP 2 octets value AA</entry></row>
<row><entry>SSAP 2 octets value AA</entry></row>
<row><entry>Control 1  octets</entry></row>
<row><entry>Organizational code 3 octets</entry></row>
<row><entry>Ethernet Type 2 octets</entry></row>
<row><entry>Data 46-1500 octets</entry></row>
<row><entry>Frame Check sequence 4 octets</entry></row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Ethernet_II</title>
<para>
Ethernet_II frames are used with IPX/SPX TCP/IP AppleTalk Phase I
</para>
<para>
Following the source address, is an Ethernet frame type.  Information on
Ethernet frame types can be found at:
<ulink url='http://www.iana.org/assignments/ethernet-numbers'>
<citetitle>http://www.iana.org/assignments/ethernet-numbers
</citetitle>
</ulink>
and at: 
<ulink url='http://www.cavebear.com/CaveBear/Ethernet/type.html'>
<citetitle>
http://www.cavebear.com/CaveBear/Ethernet/type.html
</citetitle>
</ulink>
</para>
<para>
For SNA (Systems Network Architecture)
communications the value registered for the type is <emphasis>0x80D5</emphasis>.
This value of 0x80D5 is also used for other systems using the IEEE 802.2 API
<emphasis>including NetBIOS</emphasis>
</para>
<table frame='all'>
<title>Ethernet_II Frame Structure</title>
<tgroup cols='1'>
<tbody>
<row><entry>Preamble 8 octets</entry></row>
<row><entry>Destination Address 6 octets</entry></row>
<row><entry>Source Address 6 octets</entry></row>
<row><entry>Ethernet Type 2 octets</entry></row>
<row><entry>Data 46-1500 octets</entry></row>
<row><entry>Frame Check sequence 4 octets</entry></row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Further information</title>
<para>
Many manuals and documents describe Ethernet in detail including
Novell's Guide to NetWare LAN Analysis, see
<xref linkend='refs-References'/>
</para>
</section>
</section>
</chapter>
