data link layer what does it do l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Data Link Layer What does it do? PowerPoint Presentation
Download Presentation
Data Link Layer What does it do?

Loading in 2 Seconds...

play fullscreen
1 / 35

Data Link Layer What does it do? - PowerPoint PPT Presentation


  • 310 Views
  • Uploaded on

Data Link Layer What does it do?. What functions it performs? Typically: Handling transmission errors. Error control. Flow control. Framing. Framing. The DDL and PHY. The Physical Layer delivers raw sequence of bits. Unreliable service.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Data Link Layer What does it do?' - ewa


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
data link layer what does it do

Data Link LayerWhat does it do?

What functions it performs?

Typically:

Handling transmission errors.

Error control.

Flow control.

Framing.

the ddl and phy
The DDL and PHY
  • The Physical Layer delivers raw sequence of bits.
    • Unreliable service.
  • The Data Link Layer must detect and, in some cases, correct errors.
dll s error control
DLL’s Error Control
  • Break bit stream into frames.
  • Check if frames arrived correctly.
  • If not:
    • Discards frame.
    • In some cases also request retransmission.
framing using counters
Framing: Using Counters

(a) Without errors. (b) With one error.

framing flag byte
Framing: Flag Byte
  • Each frame starts and ends with special bytes: flag bytes.
  • Two consecutive flag bytes indicate end of frame and beginning on new frame.
  • What if flag bit pattern occurs in data?
byte stuffing cont d
Byte Stuffing (Cont’d)
  • Single ESC: part of the escape sequence.
  • Doubled ESC: single ESC is part of data.
  • De-stuffing.
  • Problem:
    • What if character encoding does not use 8-bit characters?
bit stuffing
Bit Stuffing
  • Allows character codes with arbitrary bits per character.
  • Each frames begins and ends with special pattern.
  • Example: 01111110.
  • When sender’s DLL finds 5 consecutive 1’s in data stream, stuffs 0.
  • When receiver sees 5 1’s followed by 0, de-stuffs.
bit stuffing example
Bit Stuffing: Example
  • (a) Original data.
  • (b) Data as they appear on the line.
  • (c) Data after de-stuffing.
error control
Error Control
  • Reliable delivery.
    • Hop-by-hop!
  • Detecting errors.
  • Detecting and correcting errors.
acknowledgments
Acknowledgments
  • Special control info (in the case of the DLL, control frame) acknowledging receipt of data.
  • Positive and negative ACKs.
    • ACKs.
    • NACKs.
  • Are ACKs sufficient?
reliable delivery
Reliable Delivery
  • Timers.
  • Retransmission.
  • Duplicate detection
flow control
Flow Control
  • Handles mismatch between sender’s and receiver’s speed.
    • Receiver’s buffer limitation.
  • Feedback-based flow control.
    • Explicit permission from receiver.
  • Rate-based flow control.
    • Implicit mechanism for limiting sending rate.
  • DLL typically uses feedback-based flow control.
error detection and correction
Error Detection and Correction
  • Add control information to the original data being transmitted.
  • Error detection: enough info to detect error.
    • Need retransmissions.
  • Error correction: enough info to detect and correct error.
    • forward error correction (FEC).
what s an error
What’s an error?
  • Frame = m data bits + r bits for error control.

n = m + r.

  • Given the original frame f and the received frame f’, how many corresponding bits differ?
    • Hamming distance (Hamming, 1950).
parity bit
Parity Bit
  • Simple error detecting code.
  • Even- or odd parity.
  • Example:
    • Transmit 1011010.
    • Add parity bit 1011010 0 (even parity) or 1011010 1 (odd parity).
  • Code with single parity bit has Hamming distance of 2!
    • Any single bit error produces frame with wrong parity.
hamming code
Hamming Code
  • Bits in positions that are power of 2 are check bits. The rest are data bits.
  • Each check bit used in parity (even or odd) computation of collection of bits.
    • Example: check bit in position 11, checks for bits in positions, 11 = 1+2+8. Similarly, bit 11 is checked by bits 1, 2, and 8.
error detecting codes
Error Detecting Codes
  • Typically used in reliable media.
  • Examples: parity bit, polynomial codes (CRC, or Cyclic redundancy Check).
slide22
CRC
  • Checksum appended to frame being transmitted.
    • Resulting polynomial divisible by G(x).
  • When receiver gets checksummed frame, it divides it by G(x).
    • If remainder, then error!
cyclic redunancy check
Cyclic Redunancy Check

T = 2rM + R [note G starts and ends with “1” ]

At Transmitter, with M = 1 1 1 0 1 1, compute

2rM= 1 1 1 0 1 1 0 0 0 with G = 1 1 0 1

 R = 1 1 1

Transmit T= 1 1 1 0 1 1 1 1 1

cyclic redundancy check

Cyclic Redundancy Check

At the Receiver, compute

Note remainder = 0  no errors detected

flow error control
Flow + Error Control
  • How do Layer 2 protocols implement them?
  • What’s a frame?
  • F H Payload T F

What’s F?

. What’s in T?

. What’s in H?

header and trailer
Header and Trailer
  • Trailer typically has checksum.
    • How is it used/processed?
  • Header has: type, sequence number, and ack.
stop and wait
Stop-and-Wait
  • Simplest form of flow control.
  • How does it work? (assume error-free channel)
    • (1) Send 1 frame;
    • (2) Wait for ACK.
    • (3) Go to 1.
  • Poor link utilization.
    • High data rates.
    • Long propagation delay.
arq protocols
ARQ Protocols
  • Automatic Repeat Request.
    • Protocols that wait for ACK before sending more data.
  • ACKs now are used for flow AND error control.
  • What can happen?
    • At receiver: frame arrives correctly, frame arrives damaged, frame does not arrive.
    • At sender: ACK arrives correctly, ACK arrives damaged, ACK does not arrive.
arq protocols29
ARQ Protocols
  • Receiver:
    • **Waits for frame.
    • If frame arrives, check if correct sequence number.
    • Then send ACK for that frame.
    • Go to (**)
  • Sender:
    • Send frame 0.
    • Start timer.
    • If ACK 0, arrives, send frame 1.
    • If timeout, re-send frame 0.
simplex versus duplex transmission
Simplex versus Duplex Transmission
  • Simplex:
    • Send data in one channel and control in another channel.
  • Duplex:
    • Send data and control on the same chanel.
can we do better
Can we do better?
  • Can we do better?
    • Piggybacking.
    • Bi-directional transmission.
    • Wait for data packet and use that to piggyback the ACK.
    • Use ACK field: only a few additional bits in the header.
  • But, how long should Layer 2 wait to send an ACK?
    • ACK timers!
sliding window protocols
Sliding Window Protocols
  • Window: number of “outstanding” frames at any given point in time.
  • Every ACK received, window slides…
sliding window basics
Sliding Window: Basics
  • Allows multiple frames to be in transit at the same time.
  • Receiver allocates buffer space for n frames.
  • Transmitter is allowed to send n (window size) frames without receiving ACK.
  • Frame sequence number: labels frames.
sliding window receiver
Sliding Window: Receiver
  • Receiver ack’s frame by including sequence number of next expected frame.
    • Cumulative ACK: ack’s multiple frames.
  • Example: if receiver receives frames 2,3, and 4, it sends an ACK with sequence number 5, which ack’s receipt of 2, 3, and 4.
pipelining
Pipelining

Go Back N

Selective Repeat