Computer Networking Lecture Notes

23 October 2012 • The Data-Link Layer


Outline

The Application Layer

The Transport Layer

The Network Layer

The Data-Link Layer

A Little More Detail

End-Point Connectivity

Data-Link Sublayers

Data Link Services

Channel Characteristics

Framing

framing in action

Byte Counts

Byte Flags

Byte Stuffing

Byte-Stuffing Example

Bit Stuffing

Stuffing Bits

Error Control

Flow Control

Basic Data-Link Protocols

Perfect Links

Perfect Link Protocol

data-link-sender()
  frame f

  while true
    f.payload = from-network-layer()
    to-physical-layer(f)


data-link-receiver()

  while true
    frame f = from-physical-layer()
    to-network-layer(f.payload)

Rate Mismatches

Stop-and-Wait Sender

data-link-sender()

  frame f, ack

  while true
    f.payload = from-network-layer()
    to-physical-layer(f)
    ack = from-physical-layer()

Stop-and-Wait Receiver

data-link-receiver()

  frame ack

  while true
    frame f = from-physical-layer()
    to-network-layer(f.payload)
    to-physical-layer(ack)

Link Errors

Error-Handling Sender

data-link-sender()
  frame f, ack
  event e

  f.seq-no = 0
  f.payload = from-network-layer()
  while true
    to-physical-layer(f)
    start-timer(f.seq-no)
    e = wait-for-event()
    if e == frame-arrival
      ack = from-physical-layer()
      if ack.seq-no == f.seq-no
        stop-timer(f.seq-no)
        f.payload = from-network-layer()
        f.seq-no = (f.seq-no + 1) mod 2
    // else time-out, corruption 

Error-Handling Receiver

data-link-receiver()
  unsigned expected-seq-no = 0

  while true
    frame f = from-physical-layer()
    if frame-uncorrupted(f)
      if f.seq-no == expected-seq-no
        to-network-layer(f.payload)
        expected-seq-no = (expected-seq-no + 1) mod 2

      f.payload = []
      f.seq-no = 1 - expected-seq-no
      to-physical-layer(f)

Summary

References


This page last modified on 2012 October 23.

Creative
    Commons License