Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 61

The Data Link Layer

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Elementary Data Link Protocols

• Unrestricted Simplex Protocol


• Simplex Stop-and-Wait Protocol
Error-Free Channel
• Simplex Stop-and-Wait Protocol
Noisy Channel

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Elementary Data Link Protocols

...

Some definitions needed in the protocols to follow. These


definitions are located in the file protocol.h.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Unrestricted Simplex Protocol
Unrealistic protocol with:
• Data are transmitted in one direction only.
• Both transmitting and receiving network layers are
always ready.
• Processing time can be ignored.
• Infinite buffer space is available.
• Communication channel is error free!!

So this protocol is also called “Utopia”

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Unrestricted Simplex Protocol
• The protocol consists of two procedures.-
• sender and receiver procedure

• The sender runs in the data link layer of the source


machine and receiver runs in destination machine.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Utopian Simplex Protocol

...

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Utopian Simplex Protocol

A utopian simplex protocol.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Simplex Stop-and-Wait Protocol

• We have to take care about the flooding situation.

• i.e prevent the sender from flooding the receiver with


data faster than the latter is able to process them.

• One method is to insert a delay into protocol1 to slow it


down sufficiently to keep from swamping the receiver.

• It leads to bandwidth utilization that is far below the


optimum.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Simplex Stop-and-Wait Protocol

• A general solution is receiver provide feedback to the


sender.

• After sending packets to the network layer, receiver


sends a little dummy frame back to the sender which
gives the permission to send the next frame.

• Protocol in which the sender sends one frame and then


waits for ack before proceeding are called Stop-and-
wait.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Simplex Stop-and-Wait Protocol

...
A simplex stop-and-wait protocol.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Simplex Stop-and-Wait Protocol

A simplex stop-and-wait protocol.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
A simplex protocol for noisy channel

• Channel with errors.


• Frames may be damaged or lost completely.
• Timer- may leads to duplication.
• Sequence no.
• 1 bit sequence no (0 or 1) -modulo 2
• Sender waits for a positive ack before sending next.
• Also called PAR(Positive Ack with Retransmission)
or ARQ(Automatic Repeat reQuest)
• This protocol also transmit data in one direction.
A simplex protocol for noisy channel

• Here both sender and receiver have a variable,


whose value is remembered while the data link layer
in wait state.
• The sender remembers the sequence no.of the next
frame to send and receiver remembers the
sequence no. of next frame expected.
Data Frame Transmission
• Unidirectional assumption in previous
elementary protocols
 Not general
• Full-duplex - approach 1
– Two separate communication channels
• Forward channel for data
• Reverse channel for acknowledgement
 Problems: 1. reverse channel bandwidth wasted
2. cost

14
Data Frame Transmission
• Full-duplex - approach 2
– Same circuit for both directions
– Data and acknowledgement are intermixed
– How do we tell acknowledgement from data?
"kind" field telling data or acknowledgement
– Can it be improved?
• Approach 3
– Attaching acknowledgement to outgoing data
frames
 Piggybacking
15
Piggybacking
• Temporarily delaying transmission of outgoing
acknowledgement so that they can be hooked
onto the next outgoing data frame
• Advantage: higher channel bandwidth
utilization
• Complication:
– How long to wait for a packet to piggyback?
– If longer than sender timeout period then
sender retransmit
 Purpose of acknowledgement is lost

16
Piggybacking
• Solution for timing complexion
– If a new packet arrives quickly
 Piggybacking
– If no new packet arrives after a receiver ack
timeout
 Sending a separate acknowledgement frame

17
Sliding window protocols
• 3 bidirectional sliding window protocols:
– One-bit sliding window protocol (1, 1)
– Go back N (>1, 1)
– Selective repeat (>1, >1)
(max sending window size, receiving window size)
• Here, at any instant of time, the sender maintains a set
of sequence nos corresponding to frames it is permitted
to send.
• These frames are said to fall within sending window.
• Similarly receiver maintains receiving window
corresponding to the set of frames it is permitted to
receive.
A one-bit sliding window protocol
• Here max window size is 1.
• Uses stop-and-wait.
• i.e sender sends frame and waits for ack
• Two variables:
• Next_frame_to_send tells which frame the sender is
trying to send.
• Frame_expected tells which frame the receiver is
expecting.
Go Back N
Go back N
• Here after occuring an error, the receiver simply discard
the incoming frames.

• The sender, unaware of this problem, continues to send


frames until the timer for damaged frame(here frame 2)
expires.

• Then it go back and starts sending the frames from 2


onwards.
Selective repeat
• Here bad frames that is received is discarded, but good
frames received after it are buffered.
• When the sender times out, only the oldest
unacknowledged frame is retransmitted.
• Receiver produce a Neg ack (NAK)when it detects an
error.
Sliding Window Protocols (1)

...

A positive acknowledgement with retransmission protocol.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Sliding Window Protocols (2)

...
A positive acknowledgement with retransmission protocol.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Sliding Window Protocols (3)

A positive acknowledgement with retransmission protocol.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Sliding Window Protocols (4)

A sliding window of size 1, with a 3-bit sequence number.


(a) Initially. (b) After the first frame has been sent.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Sliding Window Protocols (5)

A sliding window of size 1, with a 3-bit sequence number


(c) After the first frame has been received. (d) After the first
acknowledgement has been received.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
One-Bit Sliding Window Protocol (1)

...

A 1-bit sliding window protocol.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
One-Bit Sliding Window Protocol (2)

...

A 1-bit sliding window protocol.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
One-Bit Sliding Window Protocol (3)

A 1-bit sliding window protocol.


Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
One-Bit Sliding Window Protocol (4)

Two scenarios for protocol 4. (a) Normal case. (b) Abnormal


case. The notation is (seq, ack, packet number). An asterisk
indicates where a network layer accepts a packet
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (1)

Pipelining and error recovery. Effect of an error when


(a) receiver’s window size is 1
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (2)

Pipelining and error recovery. Effect of an error when


(b) receiver’s window size is large.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (3)

...
A sliding window protocol using go-back-n.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (4)

...

A sliding window protocol using go-back-n.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (5)

...

A sliding window protocol using go-back-n.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (6)

...

A sliding window protocol using go-back-n.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (7)

...
A sliding window protocol using go-back-n.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (8)

...
A sliding window protocol using go-back-n.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (9)

A sliding window protocol using go-back-n.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Go-Back-N (10)

Simulation of multiple timers in software. (a) The queued


timeouts (b) The situation after the first timeout has expired.
Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (1)

...
A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (2)

...
A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (3)

...
A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (4)

...

A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (5)

...

A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (6)

...

A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (7)

...

A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (8)

...

A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (9)

A sliding window protocol using selective repeat.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Protocol Using Selective Repeat (10)

a) Initial situation with a window of size7


b) After 7 frames sent and received but not acknowledged.
c) Initial situation with a window size of 4.
d) After 4 frames sent and received but not acknowledged.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Example Data Link Protocols

1. Packet over SONET


2. ADSL (Asymmetric Digital Subscriber Loop)

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet over SONET (1)

Packet over SONET. (a) A protocol stack. (b) Frame relationships

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet over SONET (2)

PPP Features
1. Separate packets, error detection
2. Link Control Protocol
3. Network Control Protocol

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet over SONET (3)

The PPP full frame format for unnumbered mode operation

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
Packet over SONET (4)

State diagram for bringing a PPP link up and down

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ADSL (Asymmetric Digital
Subscriber Loop) (1)

ADSL protocol stacks.

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
ADSL (Asymmetric Digital
Subscriber Loop) (1)

AAL5 frame carrying PPP data

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011
End

Chapter 3

Computer Networks, Fifth Edition by Andrew Tanenbaum and David Wetherall, © Pearson Education-Prentice Hall, 2011

You might also like