SlideShare a Scribd company logo
1 of 34
Networks: Data Link Layer 1
Data Link Layer
Networks: Data Link Layer 2
Data Link Layer
• Provides a well-defined service interface to the
network layer.
• Determines how the bits of the physical layer
are grouped into frames (framing).
• Deals with transmission errors (CRC and ARQ).
• Regulates the flow of frames.
• Performs general link layer management.
Networks: Data Link Layer 3
3 2 1
1 2 3 2 1
1 2
2
1
Medium
1
2
Physical layer entity
Data link layer entity
3 Network layer entity
Physical
Layer
Data link
Layer
Physical
Layer
Data link
Layer
A B
A B
Packets Packets
Frames
(a)
(b)
Figure 5.2
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
Networks: Data Link Layer 4
1 2 3 4 5
Data Data Data
ACK/NAK
Data
1 2 3 4 5
Data Data Data Data
ACK/
NAK
ACK/
NAK
ACK/
NAK
ACK/
NAK
Figure 5.7
End to End
Hop by Hop
Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies
Networks: Data Link Layer 5
Tanenbaum’s Data Link
Treatment
• Concerned with communication between two
adjacent nodes in the subnet (node to node).
• Assumptions:
– Bits delivered in the order sent.
– Rigid interface between the HOST and the node
 the communications policy and the Host
protocol (with OS effects) can evolve separately.
– uses a simplified model.
Networks: Data Link Layer 6
Host
A
Host
B
Layer 4
Node
2
Node
1
Layer 4
Layer 2
frame
Data Link Layer Model
Assume Host has infinite supply of messages.
Node constructs frame from a single packet message.
Checksum is automatically appended in the hardware.
Protocols are developed in increasing complexity to help
students understand the data link layer issues.
Networks: Data Link Layer 7
Packet
sequence
Error-free
packet
sequence
Information
frames
Control
frames
Transmitter Receiver
CRC
Information
packet
Header
Station A Station B
Information Frame
Control frame
CRC Header
Figure 5.8
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
Basic Elements of ARQ
Networks: Data Link Layer 8
Tanenbaum’s Protocol Definitions
Continued 
Figure 3-9. Some definitions needed in the protocols to
follow. These are located in the file protocol.h.
Networks: Data Link Layer 9
Protocol
Definitions
(continued.)
Figure 3-9. Some
definitions needed in
the protocols to follow.
These are located in
the file protocol.h.
Networks: Data Link Layer 10
ack seq kind
info
buffer
physical layer
network layer
data link layer
frame
packet
Networks: Data Link Layer 11
Figure 3-10.
Unrestricted
Simplex
Protocol
Networks: Data Link Layer 12
Figure 3-11.
Simplex
Stop-and-
Wait
Protocol
Networks: Data Link Layer 13
(a) Frame 1 lost
A
B
frame
0
frame
1
ACK
frame
1
ACK
time
Time-out
frame
2
(b) ACK lost
A
B
frame
0
frame
1
ACK
frame
1
ACK
time
Time-out
frame
2
ACK
In parts (a) and (b) transmitting station A acts the same way, but part (b)
receiving station B accepts frame 1 twice.
Figure 5.9
Ambiguities with Stop-and-Wait
[unnumbered frames]
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
Networks: Data Link Layer 14
Transmitter Receiver
Slast
Rnext
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
(0,0) (0,1)
(1,0) (1,1)
Timer
Global State:
(Slast, Rnext)
Error-free frame 0
arrives at receiver
ACK for
frame 0
arrives at
transmitter
ACK for
frame 1
arrives at
transmitter Error-free frame 1
arrives at receiver
Station A Station B
Rnext
Slast
Figure 5.11
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
State Machine for Stop-and-Wait
Networks: Data Link Layer 15
#define MAX_SEQ 1
typedef enum {frame_arrival, cksum_err, timeout} event_type;
include “protocol.h”
void sender_par (void)
{
seq_nr next_frame_to_send;
frame s;
packet buffer;
event_type event;
next_frame_to_send = 0;
from_network_layer (&buffer);
while (true)
{ s.info = buffer;
s.seq = next_frame_to_send;
to_physical_layer (&s);
start_timer (s.seq);
wait_for_event(&event);
if (event == frame_arrival) {
from_network_layer (&buffer);
inc (next_frame_to_send);
}
}
}
Protocol 3
(PAR) Positive ACK
with Retransmission
[Old Tanenbaum Version]
Networks: Data Link Layer 16
void receiver_par (void)
{
seq_nr next_frame_to_send;
frame r, s;
event_type event;
frame_expected = 0;
while (true)
{ wait_for_event (&event);
if (event == frame_arrival)
{ from_physical_layer (&r);
if (r.seq == frame_expected) {
to_network_layer(&r.info);
inc (frame_expected);
}
to_physical_layer (&s); /* Note – no sequence number on ACK */
}
}
}
Protocol 3
(PAR) Positive ACK
with Retransmission
[Old Tanenbaum Version]
Networks: Data Link Layer 17
A
B
frame
0 frame
0
ACK
frame
1
ACK
time
time-out
frame
2
Transmitting station A misinterprets duplicate ACKs
Figure 5.10
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
PAR [OLD] problem
Ambiguities when ACKs are not numbered
Networks: Data Link Layer 18
Simplex
Protocol
for a
Noisy
Channel
Figure 3-12.A positive acknowledgement with retransmission protocol.
Continued 
Networks: Data Link Layer 19
A Simplex Protocol for a Noisy Channel
Figure 3-12.A positive acknowledgement with retransmission protocol.
Networks: Data Link Layer 20
Sliding Window Protocols
[Tanenbaum]
• Must be able to transmit data in both directions.
• Choices for utilization of the reverse channel:
– mix DATA frames with ACK frames.
– Piggyback the ACK
• Receiver waits for DATA traffic in the opposite direction.
• Use the ACK field in the frame header to send sequence
number of frame being ACKed.
–  better use of the channel capacity.
Networks: Data Link Layer 21
Sliding Window Protocols
• ACKs introduce a new issue – how long does
receiver wait before sending ONLY an ACK
frame.
We need an ACKTimer!!
 sender timeout period needs to set longer.
• The protocol must deal with the premature
timeout problem and be “robust” under
pathological conditions.
Networks: Data Link Layer 22
Networks: Data Link Layer 23
Sliding Window Protocols
Each outbound frame must contain a sequence number. With n
bits for the sequence number field, maxseq = 2n - 1 and the
numbers range from 0 to maxseq.
Sliding window :: sender has a window of frames and maintains a
list of consecutive sequence numbers for frames that it is
permitted to send without waiting for ACKs.
receiver has a window that is a list of frame sequence numbers it
is permitted to accept.
Note – sending and receiving windows do NOT have to be the
same size.
Windows can be fixed size or dynamically growing and shrinking.
Networks: Data Link Layer 24
Sliding Window Protocols
• Host is oblivious, message order at transport
level is maintained.
sender’s window :: frames sent but not yet
ACKed.
– new packets from the Host cause the
upper edge inside sender window to be
incremented.
– ACKed frames from the receiver cause
the lower edge inside window to be
incremented.
Networks: Data Link Layer 25
Sliding Window Protocols
• All frames in the sender’s window must be
saved for possible retransmission and we
need one timer per frame in the window.
• If the maximum sender window size is B,
the sender needs B buffers.
• If the sender window gets full (i.e., reaches
its maximum window size, the protocol
must shut off the Host (the network layer)
until buffers become available.
Networks: Data Link Layer 26
Sliding Window Protocols
receiver window
– Frames received with sequence numbers
outside the receiver window are not accepted.
– The receiver window size is normally static.
The set of acceptable sequence numbers is
rotated as “acceptable” frames arrive.
a receiver window size = 1  the protocol
only accepts frames in order.
There is referred to as Go Back N.
Networks: Data Link Layer 27
Standard Ways to ACK
1. ACK sequence number indicates the last
frame successfully received.
- OR -
2. ACK sequence number indicates the next
frame the receiver expects to receive.
Both of these can be strictly individual ACKs
or represent cumulative ACKing.
Cumulative ACKing is the most common
technique.
Networks: Data Link Layer 28
A
B
fr
0
time
fr
1
fr
2
fr
3
fr
4
fr
5
fr
6
fr
3
A
C
K
1 error
Out-of-sequence frames
Go-Back-4: 4 frames are outstanding; so go back 4
fr
5
fr
6
fr
4
fr
7
fr
8
fr
9
A
C
K
2
A
C
K
3
A
C
K
4
A
C
K
5
A
C
K
6
A
C
K
7
A
C
K
8
A
C
K
9
Figure 5.13
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
Go Back N
ACKing next frame expected
Networks: Data Link Layer 29
A
B
fr
0
time
fr
1
fr
2
fr
3
fr
4
fr
5
fr
1
fr
2
A
C
K
1
error
Out-of-sequence
frames
Go-Back-7:
fr
4
fr
5
fr
3
fr
6
fr
7
fr
0
N
A
K
1
A
C
K
3
A
C
K
4
A
C
K
5
A
C
K
6
A
C
K
7
A
C
K
2
Transmitter goes back to frame 1
Figure 5.17
Go Back N
with NAK error recovery
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
Networks: Data Link Layer 30
Networks: Data Link Layer 31
Networks: Data Link Layer 32
A
B
fr
0
time
fr
1
fr
2
fr
3
fr
4
fr
5
fr
6
fr
2
A
C
K
1 error
fr
8
fr
9
fr
7
fr
10
fr
11
fr
12
A
C
K
2
N
A
K
2
A
C
K
7
A
C
K
8
A
C
K
9
A
C
K
1
0
A
C
K
1
1
A
C
K
1
2
A
C
K
2
A
C
K
2
A
C
K
2
Figure 5.21
Selective Repeat
with NAK error recovery
Leon-Garcia & Widjaja: Communication Networks
Copyright ©2000 The McGraw Hill Companies
Networks: Data Link Layer 33
Networks: Data Link Layer 34

More Related Content

Similar to Data_Link_Layer.ppt

Unit 2 data link control
Unit 2 data link controlUnit 2 data link control
Unit 2 data link controlVishal kakade
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSDr. SELVAGANESAN S
 
unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdfssuser3aa461
 
Redesigning MPTCP in Edge clouds
Redesigning MPTCP in Edge cloudsRedesigning MPTCP in Edge clouds
Redesigning MPTCP in Edge cloudsNitinder Mohan
 
Mac protocol for wmn
Mac protocol for wmnMac protocol for wmn
Mac protocol for wmnmmjalbiaty
 
CS8591 Computer Networks - Unit II
CS8591 Computer Networks - Unit II CS8591 Computer Networks - Unit II
CS8591 Computer Networks - Unit II pkaviya
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxk2w9psdb96
 
Data link layer
Data link layerData link layer
Data link layersbkbca
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxlathass5
 
Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1Ronoh Kennedy
 
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerIntroduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerVNIT-ACM Student Chapter
 
Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol conceptsRaji Lakshmi
 
3a data link layer
3a data link layer 3a data link layer
3a data link layer kavish dani
 
DataLinkControl.ppt
DataLinkControl.pptDataLinkControl.ppt
DataLinkControl.pptMaddalaSeshu
 

Similar to Data_Link_Layer.ppt (20)

Unit 2 data link control
Unit 2 data link controlUnit 2 data link control
Unit 2 data link control
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdf
 
Redesigning MPTCP in Edge clouds
Redesigning MPTCP in Edge cloudsRedesigning MPTCP in Edge clouds
Redesigning MPTCP in Edge clouds
 
Mac protocol for wmn
Mac protocol for wmnMac protocol for wmn
Mac protocol for wmn
 
Data Link Layer
Data Link LayerData Link Layer
Data Link Layer
 
CS8591 Computer Networks - Unit II
CS8591 Computer Networks - Unit II CS8591 Computer Networks - Unit II
CS8591 Computer Networks - Unit II
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
 
Unit 2
Unit 2Unit 2
Unit 2
 
Data link layer
Data link layerData link layer
Data link layer
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
 
Chapter3
Chapter3Chapter3
Chapter3
 
Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1Lecture 2 data link layer 1 v1
Lecture 2 data link layer 1 v1
 
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerIntroduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
 
Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol concepts
 
DLL
DLLDLL
DLL
 
3a data link layer
3a data link layer 3a data link layer
3a data link layer
 
DataLinkControl.ppt
DataLinkControl.pptDataLinkControl.ppt
DataLinkControl.ppt
 
R2 itesm-02
R2 itesm-02R2 itesm-02
R2 itesm-02
 
Lecture14
Lecture14Lecture14
Lecture14
 

Recently uploaded

Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 

Data_Link_Layer.ppt

  • 1. Networks: Data Link Layer 1 Data Link Layer
  • 2. Networks: Data Link Layer 2 Data Link Layer • Provides a well-defined service interface to the network layer. • Determines how the bits of the physical layer are grouped into frames (framing). • Deals with transmission errors (CRC and ARQ). • Regulates the flow of frames. • Performs general link layer management.
  • 3. Networks: Data Link Layer 3 3 2 1 1 2 3 2 1 1 2 2 1 Medium 1 2 Physical layer entity Data link layer entity 3 Network layer entity Physical Layer Data link Layer Physical Layer Data link Layer A B A B Packets Packets Frames (a) (b) Figure 5.2 Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies
  • 4. Networks: Data Link Layer 4 1 2 3 4 5 Data Data Data ACK/NAK Data 1 2 3 4 5 Data Data Data Data ACK/ NAK ACK/ NAK ACK/ NAK ACK/ NAK Figure 5.7 End to End Hop by Hop Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies
  • 5. Networks: Data Link Layer 5 Tanenbaum’s Data Link Treatment • Concerned with communication between two adjacent nodes in the subnet (node to node). • Assumptions: – Bits delivered in the order sent. – Rigid interface between the HOST and the node  the communications policy and the Host protocol (with OS effects) can evolve separately. – uses a simplified model.
  • 6. Networks: Data Link Layer 6 Host A Host B Layer 4 Node 2 Node 1 Layer 4 Layer 2 frame Data Link Layer Model Assume Host has infinite supply of messages. Node constructs frame from a single packet message. Checksum is automatically appended in the hardware. Protocols are developed in increasing complexity to help students understand the data link layer issues.
  • 7. Networks: Data Link Layer 7 Packet sequence Error-free packet sequence Information frames Control frames Transmitter Receiver CRC Information packet Header Station A Station B Information Frame Control frame CRC Header Figure 5.8 Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies Basic Elements of ARQ
  • 8. Networks: Data Link Layer 8 Tanenbaum’s Protocol Definitions Continued  Figure 3-9. Some definitions needed in the protocols to follow. These are located in the file protocol.h.
  • 9. Networks: Data Link Layer 9 Protocol Definitions (continued.) Figure 3-9. Some definitions needed in the protocols to follow. These are located in the file protocol.h.
  • 10. Networks: Data Link Layer 10 ack seq kind info buffer physical layer network layer data link layer frame packet
  • 11. Networks: Data Link Layer 11 Figure 3-10. Unrestricted Simplex Protocol
  • 12. Networks: Data Link Layer 12 Figure 3-11. Simplex Stop-and- Wait Protocol
  • 13. Networks: Data Link Layer 13 (a) Frame 1 lost A B frame 0 frame 1 ACK frame 1 ACK time Time-out frame 2 (b) ACK lost A B frame 0 frame 1 ACK frame 1 ACK time Time-out frame 2 ACK In parts (a) and (b) transmitting station A acts the same way, but part (b) receiving station B accepts frame 1 twice. Figure 5.9 Ambiguities with Stop-and-Wait [unnumbered frames] Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies
  • 14. Networks: Data Link Layer 14 Transmitter Receiver Slast Rnext 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 (0,0) (0,1) (1,0) (1,1) Timer Global State: (Slast, Rnext) Error-free frame 0 arrives at receiver ACK for frame 0 arrives at transmitter ACK for frame 1 arrives at transmitter Error-free frame 1 arrives at receiver Station A Station B Rnext Slast Figure 5.11 Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies State Machine for Stop-and-Wait
  • 15. Networks: Data Link Layer 15 #define MAX_SEQ 1 typedef enum {frame_arrival, cksum_err, timeout} event_type; include “protocol.h” void sender_par (void) { seq_nr next_frame_to_send; frame s; packet buffer; event_type event; next_frame_to_send = 0; from_network_layer (&buffer); while (true) { s.info = buffer; s.seq = next_frame_to_send; to_physical_layer (&s); start_timer (s.seq); wait_for_event(&event); if (event == frame_arrival) { from_network_layer (&buffer); inc (next_frame_to_send); } } } Protocol 3 (PAR) Positive ACK with Retransmission [Old Tanenbaum Version]
  • 16. Networks: Data Link Layer 16 void receiver_par (void) { seq_nr next_frame_to_send; frame r, s; event_type event; frame_expected = 0; while (true) { wait_for_event (&event); if (event == frame_arrival) { from_physical_layer (&r); if (r.seq == frame_expected) { to_network_layer(&r.info); inc (frame_expected); } to_physical_layer (&s); /* Note – no sequence number on ACK */ } } } Protocol 3 (PAR) Positive ACK with Retransmission [Old Tanenbaum Version]
  • 17. Networks: Data Link Layer 17 A B frame 0 frame 0 ACK frame 1 ACK time time-out frame 2 Transmitting station A misinterprets duplicate ACKs Figure 5.10 Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies PAR [OLD] problem Ambiguities when ACKs are not numbered
  • 18. Networks: Data Link Layer 18 Simplex Protocol for a Noisy Channel Figure 3-12.A positive acknowledgement with retransmission protocol. Continued 
  • 19. Networks: Data Link Layer 19 A Simplex Protocol for a Noisy Channel Figure 3-12.A positive acknowledgement with retransmission protocol.
  • 20. Networks: Data Link Layer 20 Sliding Window Protocols [Tanenbaum] • Must be able to transmit data in both directions. • Choices for utilization of the reverse channel: – mix DATA frames with ACK frames. – Piggyback the ACK • Receiver waits for DATA traffic in the opposite direction. • Use the ACK field in the frame header to send sequence number of frame being ACKed. –  better use of the channel capacity.
  • 21. Networks: Data Link Layer 21 Sliding Window Protocols • ACKs introduce a new issue – how long does receiver wait before sending ONLY an ACK frame. We need an ACKTimer!!  sender timeout period needs to set longer. • The protocol must deal with the premature timeout problem and be “robust” under pathological conditions.
  • 23. Networks: Data Link Layer 23 Sliding Window Protocols Each outbound frame must contain a sequence number. With n bits for the sequence number field, maxseq = 2n - 1 and the numbers range from 0 to maxseq. Sliding window :: sender has a window of frames and maintains a list of consecutive sequence numbers for frames that it is permitted to send without waiting for ACKs. receiver has a window that is a list of frame sequence numbers it is permitted to accept. Note – sending and receiving windows do NOT have to be the same size. Windows can be fixed size or dynamically growing and shrinking.
  • 24. Networks: Data Link Layer 24 Sliding Window Protocols • Host is oblivious, message order at transport level is maintained. sender’s window :: frames sent but not yet ACKed. – new packets from the Host cause the upper edge inside sender window to be incremented. – ACKed frames from the receiver cause the lower edge inside window to be incremented.
  • 25. Networks: Data Link Layer 25 Sliding Window Protocols • All frames in the sender’s window must be saved for possible retransmission and we need one timer per frame in the window. • If the maximum sender window size is B, the sender needs B buffers. • If the sender window gets full (i.e., reaches its maximum window size, the protocol must shut off the Host (the network layer) until buffers become available.
  • 26. Networks: Data Link Layer 26 Sliding Window Protocols receiver window – Frames received with sequence numbers outside the receiver window are not accepted. – The receiver window size is normally static. The set of acceptable sequence numbers is rotated as “acceptable” frames arrive. a receiver window size = 1  the protocol only accepts frames in order. There is referred to as Go Back N.
  • 27. Networks: Data Link Layer 27 Standard Ways to ACK 1. ACK sequence number indicates the last frame successfully received. - OR - 2. ACK sequence number indicates the next frame the receiver expects to receive. Both of these can be strictly individual ACKs or represent cumulative ACKing. Cumulative ACKing is the most common technique.
  • 28. Networks: Data Link Layer 28 A B fr 0 time fr 1 fr 2 fr 3 fr 4 fr 5 fr 6 fr 3 A C K 1 error Out-of-sequence frames Go-Back-4: 4 frames are outstanding; so go back 4 fr 5 fr 6 fr 4 fr 7 fr 8 fr 9 A C K 2 A C K 3 A C K 4 A C K 5 A C K 6 A C K 7 A C K 8 A C K 9 Figure 5.13 Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies Go Back N ACKing next frame expected
  • 29. Networks: Data Link Layer 29 A B fr 0 time fr 1 fr 2 fr 3 fr 4 fr 5 fr 1 fr 2 A C K 1 error Out-of-sequence frames Go-Back-7: fr 4 fr 5 fr 3 fr 6 fr 7 fr 0 N A K 1 A C K 3 A C K 4 A C K 5 A C K 6 A C K 7 A C K 2 Transmitter goes back to frame 1 Figure 5.17 Go Back N with NAK error recovery Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies
  • 32. Networks: Data Link Layer 32 A B fr 0 time fr 1 fr 2 fr 3 fr 4 fr 5 fr 6 fr 2 A C K 1 error fr 8 fr 9 fr 7 fr 10 fr 11 fr 12 A C K 2 N A K 2 A C K 7 A C K 8 A C K 9 A C K 1 0 A C K 1 1 A C K 1 2 A C K 2 A C K 2 A C K 2 Figure 5.21 Selective Repeat with NAK error recovery Leon-Garcia & Widjaja: Communication Networks Copyright ©2000 The McGraw Hill Companies