Unit 3 of 4 · B.Sc IT Sem 4

Unit 3: Data link layer and multiplexing

Computer Networks notes · PTU syllabus (BSIT404/BSBC603)

3 min read6 topics10 exam questions
On this page
  1. Unit summary
  2. Data link layer: design issues and framing
  3. Services provided to the network layer
  4. Error control: detection and correction codes
  5. Flow control
  6. SLIP and PPP
  7. Multiplexing: FDM, TDM and CDMA
  8. Key terms
  9. Quick revision
  10. Important questions

Unit summary

The data link layer turns a raw bit pipe into a reliable link between neighbours, and multiplexing shares links. This unit covers services to the network layer, framing, error control with detection and correction codes, flow control, SLIP and PPP, and FDM, TDM and CDMA.

After this unit you can

  • Explain the services of the data link layer
  • Explain framing methods
  • Detect and correct errors and control flow
  • Explain SLIP, PPP and multiplexing techniques

PTU syllabus topics

  • Services to the network layer
  • framing
  • error control (detection and correction codes)
  • flow control
  • SLIP and PPP
  • FDM/TDM/CDMA multiplexing
ComparisonMultiplexing techniques
Shares by
Used in

FDM

Different frequency bands

Radio, cable TV

TDM

Different time slots

Digital telephony

CDMA

Different codes on the same band

Mobile networks

1

Topic 1

Data link layer: design issues and framing

The data link layer provides framing, physical (MAC) addressing, error control, flow control and access control (who may use the shared medium). It has two sublayers: LLC (logical link control) and MAC (media access control). Framing methods: character count, byte stuffing (flag bytes with escape characters), bit stuffing (insert a 0 after five 1s) and physical-layer coding violations.

2

Topic 2

Services provided to the network layer

ComparisonData link services
Description
Used on

Unacknowledged connectionless

Frames sent without acknowledgement or connection

Low-error links such as Ethernet

Acknowledged connectionless

Each frame acknowledged; lost frames resent

Unreliable links such as wireless

Acknowledged connection-oriented

Connection set up; frames numbered, delivered once and in order

Long, unreliable links such as satellite

3

Topic 3

Error control: detection and correction codes

ComparisonError detection methods
How it works
Detects

Parity check

Adds one bit to make the number of 1s even (or odd)

Single-bit errors

Checksum

Adds data segments; sends the complement of the sum

Most errors; used in IP, TCP

CRC

Divides data by a generator polynomial; sends the remainder

Burst errors; used in Ethernet

Hamming code both detects and corrects single-bit errors by placing parity bits at positions 1, 2, 4, 8 … The Hamming distance between two codewords is the number of bit positions in which they differ.

Example

Hamming distance between 10110 and 11100 is 2 (positions 2 and 4 differ). A code with minimum distance d detects d − 1 errors and corrects (d − 1)/2.

Example

CRC: data 1101, generator 1011 (x³ + x + 1). Append three 0s → 1101000; divide by 1011 using XOR → remainder 001; transmit 1101001. The receiver divides by 1011 and gets remainder 0 if no error.

4

Topic 4

Flow control

  • Stop-and-wait: the sender sends one frame and waits for an acknowledgement (ACK). Simple but slow.
  • Sliding window: the sender may send several frames (the window size) before needing ACKs. Error recovery uses Go-Back-N (resend from the lost frame) or Selective Repeat (resend only the lost frame).
5

Topic 5

SLIP and PPP

ComparisonSLIP and PPP
SLIP
PPP

Full form

Serial Line Internet Protocol

Point-to-Point Protocol

Protocols carried

IP only

IP and others (multiprotocol)

Error detection

None

FCS (CRC) on every frame

Authentication

None

PAP and CHAP

Addressing

Static, set manually

Dynamic IP assignment via IPCP

Status

Obsolete

Used in dial-up, DSL (PPPoE) and links

ProcessPPP connection phases
  1. 1

    Dead

    No link

  2. 2

    Establish

    LCP negotiates options

  3. 3

    Authenticate

    PAP or CHAP

  4. 4

    Network

    NCP (IPCP) configures IP

  5. 5

    Open

    Data transfer

  6. 6

    Terminate

    Link closed

  • PPP frame: flag (01111110), address (11111111), control, protocol, data, FCS, flag; byte stuffing avoids confusion with the flag.
6

Topic 6

Multiplexing: FDM, TDM and CDMA

ComparisonMultiplexing techniques
How the link is shared
Examples

FDM (frequency division)

Each signal gets its own frequency band with guard bands

Radio, cable TV, FM stations

TDM (time division)

Each signal gets time slots in turn; synchronous or statistical

Digital telephony (T1, E1), GSM

CDMA (code division)

All transmit together on the whole band; each uses a unique orthogonal code

3G mobile, GPS

  • WDM (wavelength division): FDM for optical fibre — different colours of light.
  • Statistical TDM gives slots only to active sources, wasting less capacity than synchronous TDM.

Example

CDMA with codes A = (+1, +1) and B = (+1, −1): A sends 1, B sends 0 (−1). Channel = (+1, +1) + (−1, +1) = (0, 2). Receiver for A: (0 × 1 + 2 × 1) ÷ 2 = +1 → bit 1.

Key terms

Framing
Dividing a bit stream into frames
CRC
Error detection using polynomial division
Sliding window
Flow control allowing several unacknowledged frames
PPP
Point-to-point data link protocol with authentication
CDMA
Multiplexing by unique codes over the whole bandwidth

Quick revision

  • Services: unacknowledged connectionless, acknowledged connectionless, connection-oriented.
  • Framing: character count, byte stuffing, bit stuffing.
  • Parity, checksum, CRC; Hamming code corrects single-bit errors.
  • Stop-and-wait, sliding window, Go-back-N, selective repeat.
  • SLIP vs PPP; FDM, TDM, CDMA, WDM.

Important exam questions

Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).

Short-answer questions

  1. Q1.Name the services of the data link layer.
  2. Q2.What is bit stuffing?
  3. Q3.Find the even parity bit for 1011001.
  4. Q4.Distinguish SLIP and PPP.
  5. Q5.What is a guard band in FDM?
  6. Q6.What is statistical TDM?

Long-answer questions

  1. Q1.Explain framing methods with examples.
  2. Q2.Explain error detection and correction codes.
  3. Q3.Explain flow control protocols.
  4. Q4.Explain SLIP, PPP and the multiplexing techniques.

Stuck on this unit?

Message SBS on WhatsApp for help with Computer Networks, or to ask about studying B.Sc IT at Synetic.

WhatsApp us