LLC2 Documentation

 

Documentation for the Linux IEEE 802.2 and Linux LLC UI layers.
Written by: Jay Schulist <jschlst@samba.org>

Logical Link Control (LLC) is a sublayer of the IEEE 802.2 LAN Protocol Suite. LLC is the top sub-layer in the data link layer and is the common access method to the different medium access technologies such as TokenRing, Ethernet and FDDI.

Linux LLC provides two access facilities. Kernel level access and User Space Socket access.

Linux LLC User Interface Service Access Points (SAPs): Provides for simple socket based LLC communications facility for Class One, Two and Three LLC SAPs. This facility enables a user to create entire user-space network layers.

LLC provides four (4) classes of communications the current Linux LLC implementation supports Class One and Class Two LLC, support for Class Three is being worked on. Definition of the Classes follows:

Linux Socket type mappings to LLC Class Types.

The following data structure is required for some/most socket calls to the LLC layer.

struct sockaddr_llc {

	sa_family_t	    sllc_family;

	unsigned char 	sllc_dmac[14];

	unsigned char   sllc_dsap;

	unsigned char	sllc_smac[14];

	unsigned char	sllc_ssap;

	unsigned char	sllc_test;

};

sllc_family should be PF_LLC.
sllc_dmac is the destination MAC address to contact, in some cases this can be left blank. sllc_dsap is the destination SAP a complete list of publicly known SAPs can be found in /usr/src/linux/include/linux/llc.h.
sllc_smac is the source MAC address and must be a MAC address linked to a actual device on the local system.
sllc_ssap is the source SAP to send the data from.
sllc_test is a fast-path function to allow the sending of an LLC test frame.

SAPS:

 

LLC Kernel networking layer access facilities:
Initialization/LLC load:
1). LLC scans for LLC interfaces in the IFF_UP state. For each interface
found a independent Station Component (SC) is created. *
2). We register a device notifier to alert us of devices going up and/or
down. We then either add or delete a SC for the appropriate device. *

* Required for protocol compliance.

Operation:

The following commands are available depending on the socket llc class type.
([] = only available by this command)

Class One:

- LLC_STATE_SAP_ACTIVATION_REQUEST	    [register_8022_client()]

- LLC_STATE_SAP_DEACTIVATION_REQUEST	[unregister_8022_client()]

- LLC_STATE_XID_REQUEST

- LLC_STATE_TEST_REQUEST		        [dl->datalink_header()]

					                    [dev_queue_xmit() or llc_queue_xmit()]

- LLC_STATE_UNITDATA_REQUEST		    [dl->datalink_header()]

					                    [dev_queue_xmit() or llc_queue_xmit()]

Class Two:

- LLC_STATE_CONNECT_REQUEST		        [llc_connect()]

- LLC_STATE_CONNECT_RESPONSE		    [llc_connect()]

- LLC_STATE_DISCONNECT_REQUEST		    [llc_disconnect()]

- LLC_STATE_DISCONNECT_RESPONSE		    [llc_disconnect()]

- LLC_STATE_RESET_REQUEST		        [llc_reset()]

- LLC_STATE_RESET_RESPONSE		        [llc_reset()]

- LLC_STATE_DATA_REQUEST		        [dl->datalink_header()]

					                    [llc_queue_xmit()]

Check linux/net/llc/af_llc.c for a great reference on how to connect your
networking layer into the llc layer, it is great fun and worth a try.

For any additions or changes to this file please contact Jay Schulist.