ch03 - Data Link Layer

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/46

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:24 PM on 8/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

47 Terms

1
New cards

What is the overall goal of the Data Link Layer (L2)?How does it do it?

Provides reliable and efficient data transfer between adjacent stations through framing.
This is done over a physical link using the L1 Bitstream.

2
New cards

What does L1 provide to L2? What are its deficiencies and possible errors?

L1 provides raw bit transmission with no error-free garantee, limited data rate and propagation speed.
The errors are not sequence errors, they are bit insertion/losses/flips.

3
New cards

What are the four main L2 functions?

(1) Data transmission through Framing,

(2) Error detection/correction,

(3) Flow control,

(4) Configuration management.

4
New cards
<p>Name the three L2 service classes.</p>

Name the three L2 service classes.

  • Unconfirmed connectionless – no ACK, no flow control; used in LANs with low error rates

  • Confirmed connectionless – each frame ACKed individually; used on high-error channels (e.g. wireless)

  • Connection-oriented – connection setup → data transfer (with ACK, flow control) → disconnect

<ul><li><p><strong>Unconfirmed connectionless</strong> – no ACK, no flow control; used in LANs with low error rates</p></li><li><p><strong>Confirmed connectionless</strong> – each frame ACKed individually; used on high-error channels (e.g. wireless)</p></li><li><p><strong>Connection-oriented</strong> – connection setup → data transfer (with ACK, flow control) → disconnect</p></li></ul><p></p>
5
New cards

Why are L2 ACKs not strictly required?

Higher layers (L4) can also do error correction.
L4 Messages are a large number of L2 Frames. If there is one error in these frames, the whole message has to be retransmitted→ loss of time and efficiency

6
New cards

What is the purpose of framing at L2?

Structure the raw L1 bit stream into delimited units (frames)

→error correction and flow control can be applied per frame.

<p>Structure the raw L1 bit stream into <strong>delimited units (frames)</strong> </p><p>→error correction and flow control can be applied per frame.</p>
7
New cards

What are the four framing methods?What does each one do?

  • Character-oriented – control characters mark boundaries (DLE, STX, ETX)

  • Count-oriented – frame contains a length count field

  • Bit-oriented – special flag bit pattern (e.g. 01111110) marks boundaries → requires bit stuffing

  • Invalid L1 characters – use encoding-specific invalid symbols as delimiters

8
New cards

What is character stuffing and when is it used?

Used in character-oriented protocols.

Sender prepends DLE(Data Link Escape) before any control character in user data.

Receiver only interprets control characters preceded by DLE. If user data contains DLE itself, an extra DLE is inserted before it.

<p>Used in character-oriented protocols. </p><p><strong>Sender </strong>prepends DLE(Data Link Escape) before any control character in user data. </p><p></p><p><strong>Receiver </strong>only interprets control characters preceded by DLE. If user data contains DLE itself, an extra DLE is inserted before it.</p>
9
New cards

What is bit stuffing and when is it used?

Used in bit-oriented protocols (e.g. HDLC). Sender inserts a 0 after every five consecutive 1s in user data. Receiver removes 0 after five 1s. Prevents the flag pattern 01111110 from appearing in data.

<p>Used in bit-oriented protocols (e.g. HDLC). Sender inserts a <code>0</code> after every five consecutive <code>1</code>s in user data. Receiver removes <code>0</code> after five <code>1</code>s. Prevents the flag pattern <code>01111110</code> from appearing in data.</p>
10
New cards

What is the problem with count-oriented framing?

A transmission error in the length count field desynchronizes sender and receiver — it's unclear where the next frame starts.

11
New cards

What is the problem with the "idle time" framing approach?

L1 may not have a reliable notion of time; inefficient if idle periods are required between frames.

12
New cards

What causes transmission errors?

Thermal noise, impulse disruptions (~10 ms, from lightning/power lines), crosstalk, echo, interference, signal distortion. Errors typically occur in bursts.

13
New cards

What is the Hamming distance between two code words?

The number of bit positions in which they differ (computed via XOR, count the 1s).

<p>The number of bit positions in which they differ (computed via XOR, count the 1s).</p>
14
New cards

What is the Hamming distance of a code?

The minimum Hamming distance between any two valid code words in the code.

<p>The minimum Hamming distance between any two valid code words in the code.</p>
15
New cards

For detection off bit errors, what Hamming distance d is required

d ≥ f + 1

<p>d ≥ f + 1</p>
16
New cards

For correction off bit errors, what Hamming distance d is required?

d ≥ 2f + 1 (received word is "closer" to the original than to any other valid word)

<p>d ≥ 2f + 1 (received word is "closer" to the original than to any other valid word)</p>
17
New cards

Lower bound for check bits r to correct 1-bit errors in m data bits?

(m + r + 1) ≤ 2^r. Example: m=8 → r=4; m=1000 → r=10

<p>(m + r + 1) ≤ 2^r. Example: m=8 → r=4; m=1000 → r=10</p>
18
New cards

What is a parity bit and what can it detect?

A single redundant bit making the total number of 1s even (or odd). Detects all single-bit errors (d=2, detects f=1). Cannot correct errors.

19
New cards
<p>What is CRC (Cyclic Redundancy Check)?</p>

What is CRC (Cyclic Redundancy Check)?

Error detection method treating bit strings as polynomials. Sender appends remainder R(x) of B(x)·x^r / G(x) to the message. Receiver divides received word by G(x); zero remainder → no error detected.

<p>Error detection method treating bit strings as polynomials. Sender appends remainder R(x) of B(x)·x^r / G(x) to the message. Receiver divides received word by G(x); zero remainder → no error detected.</p>
20
New cards

What are the CRC sender steps?

1. Append r zeros to block B → B_E (= x^r · B(x))

2. Divide B_E(x) by G(x) (mod 2) → quotient Q(x) + remainder R(x)

3. Transmit B_E − R(x) (i.e. B with R replacing the appended zeros)

21
New cards

What does G(x) require for CRC?

Degree r < degree of B(x); highest and lowest order bit must be 1.

22
New cards

What errors does CRC-CCITT (x^16 + x^12 + x^5 + 1) detect?

All single/double bit errors, all odd-bit errors, all burst errors ≤ 16 bits, 99.99% of burst errors > 16 bits.

23
New cards

Why is error correction less common than detection at L2?

Correction requires high redundancy per block. For the same overhead, error detection + retransmission is usually more efficient given typical error distributions

24
New cards

Why is flow control needed?

The sender can transmit faster than the receiver can process frames → receiver loses frames even on an error-free channel.

25
New cards

Protocol 1 (Utopia) – assumptions and problem?

Assumes error-free channel, infinite receiver buffer and processing speed. In reality: sender floods receiver

<p>Assumes error-free channel, infinite receiver buffer and processing speed. In reality: sender floods receiver</p>
26
New cards

Protocol 2 (Stop-and-Wait) – principle and problem?

Sender transmits one frame and waits forACK before sending next. Solves buffer overflow. Problem: locks up on frame orACK loss.

<p>Sender transmits one frame and waits forACK before sending next. Solves buffer overflow. Problem: locks up on frame orACK loss.</p>
27
New cards

Protocol 3a (Stop-and-Wait ARQ) – what does ARQ add?

Automatic Repeat reQuest: sender sets a timer; if no ACK received within timeout, retransmit. Problem: lost ACK causes duplicate frames at receiver

<p>Automatic Repeat reQuest: sender sets a timer; if no ACK received within timeout, retransmit. Problem: lost ACK causes duplicate frames at receiver</p>
28
New cards

Protocol 3b – what do sequence numbers solve?

Duplicate detection. Receiver uses SeqNo to identify retransmissions. For Stop-and-Wait: only 2 sequence numbers needed (0 and 1).

<p>Duplicate detection. Receiver uses SeqNo to identify retransmissions. For Stop-and-Wait: only 2 sequence numbers needed (0 and 1).</p>
29
New cards
<p>Protocol 3c – what does NAK add</p>

Protocol 3c – what does NAK add

Active error control: receiver immediately sends NAK on corrupted frame, instead of waiting for sender timeout → faster retransmission.

<p>Active error control: receiver immediately sends NAK on corrupted frame, instead of waiting for sender timeout → faster retransmission.</p>
30
New cards

Why is Stop-and-Wait inefficient on high-delay links?

Channel utilization U ≈ T_it / (T_it + 2T_p). Example: 50 kbps satellite, RTT=500ms, 1000-bit frame → U < 4%.

31
New cards

What is the sliding window mechanism?

Sender can have multiple unACKed frames "in flight" simultaneously (up to window size k)→ fills the pipe on high-latency links instead of waiting idle.

32
New cards

Define S-Window and R-Window.

  • S-Window (sender): set of SeqNos sent but not yet ACKed

  • R-Window (receiver): set of SeqNos the receiver is willing to accept

33
New cards

What do LB and UB mean in a sliding window?

LB (Lower Bound):

sender = oldest unACKed SeqNo;

receiver = next expected SeqNo

UB (Upper Bound):

sender = next SeqNo to send;

receiver = highest SeqNo accepted + 1

34
New cards

Channel utilization formula with sliding window (window size k)?

U = k / (1 + 2·T_p/T_it) if k < 1 + 2T_p/T_it, else U = 1

35
New cards

What is piggybacking?

ACK is embedded in a data frame going the other direction (full-duplex), reducing the number of separate ACK frames. Frame format: Frame(SeqNo, ACK-SeqNo, …Data…).

36
New cards

Go-Back-N – principle and properties?

On error, receiver discards all subsequent frames until the faulty one is correctly received. Sender retransmits from the faulty frame onwards. Simple (no out-of-order buffering), but poor throughput.

37
New cards

Selective Repeat – principle and properties?

Receiver buffers correctly received frames that follow a faulty one. Sender only retransmits the faulty frame. More complex (buffering required), higher throughput

38
New cards

Maximum window size for Go-Back-N vs. Selective Repeat?

Go-Back-N: window size ≤ 2^n − 1 (SeqNo range = 2^n)

Selective Repeat: window size ≤ 2^n / 2 = 2^(n−1) (half the SeqNo range)

39
New cards

Why must the SeqNo space be at least twice the window size?

To distinguish new frames from retransmissions when all ACKs are lost. If window = half the SeqNo range, no ambiguity is possible.

40
New cards

What is HDLC?

High-Level Data Link Control. Bit-oriented, full-duplex L2 protocol. Uses bit stuffing (insert 0 after five 1s). Frame: 01111110 | Address | Control | Data | FCS | 01111110 . FCS = CRC variant.

41
New cards

What are the three HDLC frame types?

1. I-frame (Information): data transfer; carries SeqNo and piggybacked ACK

2. S-frame (Supervisory): flow/error control (RR, REJ, RNR, SREJ)

3. U-frame (Unnumbered): connection management (SABM, DISC, UA, FRMR)

42
New cards

What do the four HDLC supervisory frame types do?

  • RR (00): Receive Ready = ACK, ready for more

  • REJ (01): Reject = NAK, Go-Back-N retransmit from NEXT

  • RNR (10): Receive Not Ready = ACK but stop sending (temporary problem)

  • SREJ (11): Selective Reject = retransmit only specific frame

43
New cards

What is SABM and DISC in HDLC?

SABM (Set Asynchronous Balanced Mode): establishes peer-to-peer connection, resets SeqNos to 0. DISC (Disconnect): terminates connection.

44
New cards

SLIP – protocol and limitations?

Serial Line IP. Frames IP packets with flag byte 0xC0 at end; character stuffing if 0xC0 in data. Limitations: no error detection, no authentication, IP only, no dynamic address assignment, no standard.

45
New cards

PPP – three phases and what each does?

1. LCP (Link Control Protocol): establish/test/release L2 connection, negotiate options, authenticate

2. NCP (Network Control Protocol): configure L3 (e.g. assign IP address dynamically)

3. Data transfer: carry L3 packets (IP, etc.)

46
New cards

PPP frame format fields?

Flag (01111110) | Address (11111111) | Control (00000011) | Protocol (1–2B) | Payload | Checksum (CRC) | Flag

47
New cards

PPP vs. SLIP – key improvements?

PPP adds: error detection, multi-protocol support (not just IP), dynamic IP addressing, authentication, standardized (RFC 1661).