0% found this document useful (0 votes)
39 views5 pages

Data Link Layer & MAC Study Guide

The document provides an overview of the Data Link Layer and Medium Access Control (MAC) in networking, detailing the OSI and TCP/IP models. It explains the services provided by the Data Link Layer, including framing, flow control, error detection, and correction techniques. Additionally, it covers various access methods for shared media, including random access, controlled access, and channelization techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views5 pages

Data Link Layer & MAC Study Guide

The document provides an overview of the Data Link Layer and Medium Access Control (MAC) in networking, detailing the OSI and TCP/IP models. It explains the services provided by the Data Link Layer, including framing, flow control, error detection, and correction techniques. Additionally, it covers various access methods for shared media, including random access, controlled access, and channelization techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module 1: Data Link Layer & MAC Study Notes

1. Network Models

1.1 OSI Model (Open Systems Interconnection)

The OSI model is a 7-layer theoretical model that standardizes the functions of a communication
system.

1. Physical Layer: Responsible for the actual transmission of unstructured bits over a physical
medium (e.g., cables, radio waves).

2. Data Link Layer (DLL): Transforms the physical layer into a reliable link. It handles framing,
physical addressing (MAC address), flow control, and error control.
3. Network Layer: Responsible for routing packets from the source host to the destination host
across multiple networks. It handles logical addressing (IP address) and routing.

4. Transport Layer: Responsible for process-to-process delivery of the entire message. It


provides services like connection control, flow control, and error control (e.g., TCP, UDP).

5. Session Layer: Acts as the "dialog controller." It establishes, maintains, and synchronizes the
interaction between communicating systems.

6. Presentation Layer: Responsible for translation, compression, and encryption. It ensures that
information sent by one system is readable by another.

7. Application Layer: Provides services directly to the user or application (e.g., web browsers,
email clients).

1.2 TCP/IP Model

The TCP/IP model is a 4-layer practical model that is the foundation of the modern internet.

1. Host-to-Network (Link) Layer: Combines the OSI's Physical and Data Link layers.

2. Internet (Network) Layer: Corresponds to the OSI Network Layer (e.g., IP, ICMP).

3. Transport Layer: Corresponds to the OSI Transport Layer (e.g., TCP, UDP).

4. Application Layer: Combines the OSI's Session, Presentation, and Application layers (e.g.,
HTTP, FTP, DNS).

2. Data Link Layer (DLL)

2.1 Data Link Layer Services

The DLL is responsible for node-to-node (or hop-to-hop) delivery of data. Its primary services
include:

 Framing: Divides the stream of bits received from the network layer into manageable data
units called frames.

 Flow Control: A mechanism that prevents a fast sender from overwhelming a slow receiver.
 Error Control: Detects and/or corrects errors that occur during transmission. It often involves
retransmitting lost or damaged frames.

 Access Control: When multiple devices share the same link (like Wi-Fi), this determines
which device has control over the link at any given time.

2.2 Error Detection and Correction

 Errors: Data can be corrupted during transmission from a 0 to a 1, or vice versa.

 Error Detection: The ability to detect if errors have occurred. This is simpler and more
common.

 Error Correction: The ability to detect and correct the errors without retransmission. This
requires more redundant information.

2.3 Linear Block Codes

 Parity Check Code: A simple error-detection method. A parity bit (0 or 1) is added to a block
of data to make the total number of '1's either even (even parity) or odd (odd parity). The
receiver checks the parity; if it doesn't match, an error is detected.

 Hamming Distance: The number of bit positions in which two codewords differ. To detect 'd'
errors, you need a code with a minimum Hamming distance of d + 1. To correct 'd' errors, you
need a minimum Hamming distance of 2d + 1.

 Hamming Code: A specific type of error-correcting code that can correct single-bit errors.

2.4 Cyclic Codes (CRC)

 Cyclic Redundancy Check (CRC): A powerful error-detection method that treats data as a
polynomial.

 Process:

1. A "generator" polynomial is agreed upon by the sender and receiver.

2. The sender performs polynomial division on the data and appends the remainder
(the CRC checksum) to the data.

3. The receiver divides the entire received message (data + CRC) by the same generator.
If the remainder is zero, the data is accepted as correct.

2.5 Internet Checksum

 A simpler error-detection method used by Internet protocols (like IP, TCP, UDP).

 Process:

1. The sender divides the data into 16-bit words, adds them all together (using 1's
complement arithmetic), and then takes the 1's complement of the final sum. This
result is the checksum.

2. The receiver performs the same calculation (adds all data words + the checksum). If
the final result is all 1s (a value of 0 in 1's complement), the data is accepted.

2.6 Framing
This is the process of creating "frames" by adding a header and trailer to the network layer data.

 Fixed-Size Framing: Frames are all the same size. This is simple but can be inefficient if data
is small.

 Variable-Size Framing: Frames can have different sizes. This requires a way to define the
beginning and end of a frame:

o Byte Stuffing (Character-Oriented): A special "flag" byte marks the start and end of a
frame. If the flag byte appears in the data, a special "escape" byte is "stuffed" in
front of it.

o Bit Stuffing (Bit-Oriented): A special bit pattern (e.g., 01111110) marks the start and
end. If this pattern appears in the data, the sender "stuffs" an extra 0 bit to break up
the pattern. The receiver removes the stuffed bit.

2.7 Flow Control Protocols (ARQ)

These protocols manage the flow of data and provide error control.

 Stop-and-Wait ARQ:

o The sender sends one frame and then stops and waits for an acknowledgment
(ACK).

o If the ACK arrives, the sender sends the next frame.

o If a timer expires (no ACK received) or a negative ACK (NAK) is received, the sender
retransmits the same frame.

o It's simple but very inefficient, as the link is idle most of the time.

 Go-Back-N ARQ (Sliding Window):

o The sender can send up to 'N' frames (the "window") without waiting for an ACK.

o The receiver only accepts frames in the correct order.

o If a frame is lost (e.g., frame 3), the receiver discards all subsequent frames (4, 5,
etc.).

o When the sender's timer for frame 3 expires, it goes back and retransmits all frames
starting from frame 3 (i.e., 3, 4, 5...).

 Selective Repeat ARQ (Sliding Window):

o The sender can send up to 'N' frames.

o The receiver has a buffer and accepts and buffers frames even if they arrive out of
order.
o If a frame is lost (e.g., frame 3), the receiver sends a NAK for frame 3 but continues
to accept and buffer frames 4, 5, etc.

o The sender selectively retransmits only the lost frame (frame 3).

o This is the most efficient but also the most complex ARQ protocol.
 Piggybacking: A method to improve efficiency. Instead of sending a separate ACK packet, the
receiver "piggybacks" the acknowledgment onto an outgoing data frame that it is sending
back to the sender.

3. Medium Access Control (MAC)

This is a sublayer of the Data Link Layer that controls access to a shared medium.

3.1 Random Access Techniques

These are "contention" methods where there is no central control; devices compete for the medium.

 CSMA (Carrier Sense Multiple Access): "Listen before you talk."

o A device first senses the carrier (listens to the channel) to see if it is idle.

o If the channel is idle, it transmits. If it's busy, it waits.

o This reduces (but doesn't eliminate) collisions.

 CSMA/CD (Collision Detection): "Listen while you talk."

o Used in classic Ethernet.

1. A device senses the channel (CSMA).

2. If idle, it transmits.

3. It continues to listen while transmitting.


4. If it detects a collision (another device's signal), it immediately stops, sends
a "jam" signal, and waits a random backoff time before trying again.

 CSMA/CA (Collision Avoidance): "Try to avoid collisions."

o Used in Wi-Fi (IEEE 802.11).

o Collisions are harder to detect in wireless, so the goal is to avoid them.

o The device senses the channel. If idle, it waits an additional random time (Inter-
Frame Space or IFS). If still idle, it transmits.

o It also uses ACKs. If the sender doesn't receive an ACK, it assumes a collision
occurred and retransmits.

3.2 Controlled Access Techniques

These are "collision-free" methods where devices take turns.

 Reservation: A device must make a reservation in a mini-slot before it can transmit data in its
corresponding data slot.

 Polling: A primary device (master) "polls" each secondary device one by one, asking if it has
data to send. A device only transmits when polled.
 Token Passing: A special frame called a "token" is passed from device to device in a logical
ring. A device can only transmit if it is holding the token.
3.3 Channelization

Divides the shared channel into smaller, separate "sub-channels."

 FDMA (Frequency-Division Multiple Access): Divides the channel by frequency.

 TDMA (Time-Division Multiple Access): Divides the channel by time slots.

 CDMA (Code-Division Multiple Access): Allows all users to transmit at the same time and
frequency, but separates them using a unique code.

3.4 Ethernet (IEEE 802.3)

 The dominant LAN technology, originally using CSMA/CD.

 IEEE 802.3 Frame Format:

o Preamble: 7 bytes for synchronization.

o SFD (Start Frame Delimiter): 1 byte (10101011) to signal the start of the frame.

o Destination Address (MAC): 6 bytes.

o Source Address (MAC): 6 bytes.

o Length/Type: 2 bytes; indicates either the length of the data or the type of network
layer protocol.

o Data (Payload): The data from the upper layer (46-1500 bytes).

o CRC: 4 bytes for error detection.

 Comparison of Ethernet Standards:

Standard Speed Media

Standard (10Base-T) 10 Mbps Twisted-pair copper

Fast (100Base-TX) 100 Mbps Twisted-pair copper

Gigabit (1000Base-T) 1 Gbps Twisted-pair copper

10-Gigabit (10GBase-T) 10 Gbps Twisted-pair copper

You might also like