THE DATA LINK LAYER - LAYER 2
The Data Link layer performs a number of separate activities, including:
Different data link layer specifications define different network and protocol characteristics, including physical addressing, network topology, error notification, sequencing of frames, and flow control.
Physical addressing, is not to be confused with network or IP addresing. The physical address defines how devices are labeled in the data link layer. This physical address is most commonly called the Media Access Control (MAC) address. The MAC address is a unique number assigned by the manufacturer. This numbering system is actually administered by one of the networking governing bodies.
Network topology consists of the data-link layer specifications that often define how devices are to be physically connected, such as in a bus or a ring topology. Error notification alerts upper layer protocols that a transmission error has occurred, and the sequencing of data frames reorders frames that are transmitted out of sequence. Finally, flow control moderates the transmission of data so that the receiving device is not overwhelmed with more traffic than it can handle at one time.
Switches and bridges use MAC addressing to make networking decisions and therefore these types of equipment function on the data link layer.
IEEE 802 Standards
The 802 Project defines 12-plus subcommittee standards groups. Some are as follows:
| 802.1 | Internetworking/LAN Protocols | Defines routing, bridging, and internetwork communications |
| 802.2 | Logical Link Control (LLC) | Allows Network layer protocols to link to Physical layer and MAC sublayer protocols |
| 802.3 | Ethernet | The Ethernet standard; defines CSMA/CD |
| 802.5 | Token Ring | Defines logical ring topology, media, and interfaces |
| 802.12 | High-speed networks | Defines 100 Mbps technologies |
Ethernet - 802.3
The Data Link layer is divided into two sublayer by the 802 standards: the Logical Link Control (LLC) and Media Access Control (MAC) sublayers. The LLC sublayer is defined in 802.1 and 802.2. The MAC sublayer is defined in the 802.1, 802.3, 802.5 and 802.12.
Logical Link Control (LLC)
Conceptually, the LLC sublayer sits on top of the MAC sublayer. It's defined by the 802.2 standard to be topology independent.
The LLC functions include:
The LLC works with the transport layer by providing connection-oriented and connectionless services. It manages and creates the communication link.
The LLC sublayer transfers data in
two ways:
Flow Control
Another communications control defined on the LLC sublayer is flow control. The Transport layer of the OSI model actually manages the mechanisms used to control the flow of data between two hosts. The Data Link layer defines the data values used in the flow control signaling between two transmitting hosts.
There are two types of flow control
implemented in data communications - software and hardware:
Error Detection
Another function of the Data Link layer is error detection. Error detection is the process of detecting whether errors occurred during the transmission of the bits across the wire. The Data Link layer uses a calculated value called the CRC (Cyclic Redundancy Check) that's placed into the Data Link trailer that's added to the message frame before it's sent to the Physical layer. The receiving computer recalculates the CRC and compares it to the one sent with the data. If the two alues are equal, it's assumed that the data arrived without errors. Otherwise, the message frame may need to be retransmitted under control of an upper layer. Although the Data Link layer implements error detection, it does not include a function to perform error recovery. This is left for the upper layers to deal with, primarily on the Transport layer.
MAC
The MAC sublayer carries the physical address of each device on the network. This address is more commonly called a device's MAC address. The MAC address is a 48-bit address that's encoded on each network device by its manufacturer. It's the MAC address that the Physical layer uses to move data between nodes of the network.
ARP (Address Resolution Protocol)
ARP maintains a small database in memory, called the ARP cache, that crossreferences physical and logical addresses. When a device wants to communicate with a local device, it checks its ARP cache to determine whether it has that device's MAC address. If it doesn't, it sends out an ARP broadcast request to all devices on the local network. Each device examines the message to see whether the request is intended for it. If it is, the device responds with its MAC address, which is stored in the sending device's ARP cache.
CSMA/CD (Carrier Sense Multiple Access/Collision Detection)
CSMA/CD is the method used in Ehternet networks for controlling access to the physical media by network nodes.
CSMA/CD process can be described as follows:
Segmentation
Dividing up a LAN into smaller collision domains (segments) is called segmentation.
General benefits of LAN segmentation:
Bridge
A bridge is used to break larger network segments into smaller network segments. It works much like a reapeater, but because a bridge works solely with Layer 2 protocols and layer 2 MAC sublayer addresses, it operates at the Data Link layer.
A bridge uses the MAC address to perform its tasks, including:
Know the following about bridges:
Switch
In networking, a switch is a device responsible for multiple functions such as filtering, flooding, and sending frames. Broadly, a switch is any electronic/mechanical device allowing connections to be established as needed and terminated if no longer necessary.
Layer-2 switching is shardware based, which means it uses the MAC address from the host's NIC cards to filter the network. Layer-2 switches are fast because they do not look at the Network layer header information, looking instead at the frame's hardware addresses before deciding to either forward the frame or drop it.
Three Switch Functions at layer 2
Bridging versus LAN Switching
Layer-2 switches are really just bridges with more ports. However, there are some important differences you should be aware of:
Five steps of encapsulation:
|
|
Five steps of encapsulation that
occur when a user uses a browser to open a Web page:
1. The user requests that the browser open a Web page.
2. The transport layer adds a header indicating that an HTTP process is requested.
3. The Network layer puts a source and destination address into its packet header
that helps indicate the path across the network.
4. The Data Link layer frame puts in the hardware addresses of both the source
node and the next directly connected network device.
5. The frame is converted into bits for transmission over the media.
Data encapsulation by OSI Layer:
| OSI Layer | Encapsulation |
| Transport | Segment |
| Network | Packet |
| Data Link | Frame |
| Physical | Bits |