0% found this document useful (0 votes)
28 views28 pages

M2 CCN Data Link Layer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views28 pages

M2 CCN Data Link Layer

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Chapter 3

The Data Link Layer


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 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.


Services Provided to Network Layer

(a) Virtual communication.


(b) Actual communication.
Services Provided to Network Layer (2)

Placement of the data link protocol.


Framing

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


Framing (2)

(a) A frame delimited by flag bytes.


(b) Four examples of byte sequences before and after stuffing.
Framing (3)

Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receiver’s memory after destuffing.
1. The following character encoding is used in a data link protocol:
A: 01000111; B: 11100011; FLAG: 01111110; ESC: 11100000
Show the bit sequence transmitted (in binary) for the four-character
frame: A B ESC FLAG when each of the following framing methods
are used:
a. Character count.
b. Flag bytes with byte stuffing.
c. Starting and ending flag bytes, with bit stuffing.

2. The following data fragment occurs in the middle of a data stream for
which the byte-stuffing algorithm is used: A B ESC C ESC FLAG FLAG D.
What is the output after stuffing?

3. A bit string, 0111101111101111110, needs to be transmitted at the


data link layer. What is the string actually transmitted after bit stuffing?
Error Detection and Correction

• Error-Correcting Codes
• Error-Detecting Codes
Error-Correcting Codes

Use of a Hamming code to correct burst errors.


Error-Detecting Codes
Calculation of the polynomial code checksum

.
Elementary Data Link Protocols
• An Unrestricted Simplex Protocol
• A Simplex Stop-and-Wait Protocol
• A Simplex Protocol for a Noisy Channel
An Unrestricted Simplex Protocol
protocol 1(utopia)
frames
• sender Receiver

• Data transmission in one direction only


• The communication channel is assumed to error free
• The receiver is assumed to be able to process all the input
infinitely quickly.
• The sender just sits is a loop pumping data out onto the line as
fast as it can
A Simplex Stop-and-Wait Protocol
Protocol 2
• frame

sender receiver
acknowledgement

One directional flow of data from sender to receiver

The communication channel is once again assumed to be error free

The receiver has only a finite buffer capacity and a finite processing speed

The protocol prevents the sender from flooding the receiver with data faster
than it can be handled
A Simplex Protocol for a Noisy Channel
Protocol 3 (par)
Frame with seq. no

sender receiver
acknowledgement
Sends frame with expects seq. no
One bit seq. no 0,1,0,1
0,1,0,1 (alternatively 0,1)

Error control through sequence number


Flow control through acknowledgement
Implementation of ack. Connection oriented service
Sliding Window Protocols
Full duplex: bi-directional communication
Kind field is used to differentiate frame / ack
Frame / ack

sender receiver
Frame / ack

Piggybacking:
Frame with ack.
sender receiver
Frame with ack
Sliding Window Protocols (2)

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.
Three sliding window protocols.
• A One-Bit Sliding Window Protocol
(protocol 4)
• A Protocol Using Go Back N (protocol 5)
• A Protocol Using Selective Repeat
(protocol 6)
A One-Bit Sliding Window Protocol (2)

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.
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.
Sliding Window Protocol Using Go Back N (2)

Simulation of multiple timers in software.


A Sliding Window Protocol Using Selective Repeat (5)

(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.
WINDOW SIZE <= (MAX_SEQ+1)/2
For 3 bit sequence numbers WINDOW SIZE <= (7+1)/2 = 4
Protocol Verification

• Finite State Machined Models


• Petri Net Models
Finite State Machined Models

(a) State diagram for protocol 3. (b) Transmissions.


Petri Net Models

A Petri net with two places and two transitions.


Petri Net Models (2)

A Petri net model for protocol 3.

You might also like