Chapter 3 The Data Link Layer Data Link

  • Slides: 14
Download presentation
Chapter 3 The Data Link Layer

Chapter 3 The Data Link Layer

Data Link Layer Design Issues • • Services Provided to the Network Layer Framing

Data Link Layer Design Issues • • Services Provided to the Network Layer Framing Error Control Flow Control

Functions of the Data Link Layer • • • Provide service interface to the

Functions of the Data Link Layer • • • Provide service interface to the network layer Dealing with transmission errors Regulating data flow • Slow receivers not swamped by fast senders

Functions of the Data Link Layer (2) Relationship between packets and frames.

Functions of the Data Link Layer (2) Relationship between packets and frames.

Framing A character stream. (a) Without errors. (b) With one error.

Framing A character stream. (a) Without errors. (b) With one error.

Error Detection and Correction • Error-Correcting Codes • Error-Detecting Codes

Error Detection and Correction • Error-Correcting Codes • Error-Detecting Codes

Sliding Window Protocols • A One-Bit Sliding Window Protocol • A Protocol Using Go

Sliding Window Protocols • A One-Bit Sliding Window Protocol • A Protocol Using Go Back N • A Protocol Using Selective Repeat

Buffering on Sender and Receiver a) Sender needs to buffer data so that if

Buffering on Sender and Receiver a) Sender needs to buffer data so that if data is lost, it can be resent Receiver needs to buffer data so that if data is received out of order, it can be held until all packets are received b) – c) Flow control How can we prevent sender overflowing receiver’s buffer? – d) Receiver tells sender its buffer size during connection setup How can we insure reliability in pipelined transmissions? – Go-Back-N • • – Send all N un. ACKed packets when a loss is signaled Inefficient Selective repeat • • Only send specifically un. ACKed packets A bit trickier to implement

Stop-and-Wait Process Sender a) b) c) d) Receiver Sender doesn’t send next packet until

Stop-and-Wait Process Sender a) b) c) d) Receiver Sender doesn’t send next packet until he’s sure receiver has last packet The packet/Ack sequence enables reliability Sequence numbers help avoid problem of duplicate packets Problem: keeping the pipe full

Stop & wait sequence numbers Sender Receiver Sender ACK 0 Timeout Fram e 0

Stop & wait sequence numbers Sender Receiver Sender ACK 0 Timeout Fram e 0 0 ACK Timeout e 0 Timeout Fram Receiver Fram e 0 ACK 0 Fram e 0 0 ACK Sender Receiver Fram e 0 ACK 0 Fram e 1 ACK 1 Fram e 0 (c) (d) ACK 0 (e) 1. Simple sequence numbers enable the client to discard duplicate copies of the same frame 2. Stop & wait allows one outstanding frame, requires two distinct sequence numbers

Solution: Pipelining via Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed

Solution: Pipelining via Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window Receiver … … Sender Time a) b)

Sliding Window Protocols A sliding window of size 1, with a 3 -bit sequence

Sliding Window Protocols A sliding window of size 1, with a 3 -bit sequence number. (a) Initially. (b) After the first frame has been sent. (c) After the first frame has been received. (d) After the first acknowledgement has been received.

A Protocol Using Go Back N Pipelining and error recovery. Effect on an error

A Protocol Using Go Back N Pipelining and error recovery. Effect on an error when (a) Receiver’s window size is 1. (b) Receiver’s window size is large.

A Sliding Window Protocol Using Selective Repeat (a) Initial situation with a window size

A Sliding Window Protocol Using Selective Repeat (a) Initial situation with a window size seven. (b) After seven frames sent and received, but not acknowledged. (c) Initial situation with a window size of four. (d) After four frames sent and received, but not acknowledged.