Data Link Layer:Data Link Control... Process of wrapping data with certain info before sending out A frame typically consists of Flag: indication for start and end of a frame He
Trang 1Data Link Layer:
Data Link Control
Trang 2Outline
Byte vs bit oriented protocols
Flow control
Error control
Trang 3 Process of wrapping data with certain info
before sending out
A frame typically consists of
Flag: indication for start and end of a frame
Header: source/destination addresses, as well
as other control information
Data from the upper layer
Trailer: error detection/correction code
Trang 4Byte vs Bit Oriented
Trang 5Byte Stuffing
Process of adding extra byte whenever
there is an escape or a flag character in
the data
Trang 6Bit Stuffing
flag sequence does not appear in the
data
01111110
Trang 7Flow Control and Error
Control
A set of procedures that tells the sender
how much data can be sent before
waiting for acknowledgment
Trang 8Data Link Protocols
Trang 9Protocols for Noiseless
Trang 11"Simplest" : Pseudo Code
Trang 12"Simplest": Flow
Diagram
Trang 13Stop-and-Wait
Mechanism
Requires flow control
and wait for an acknowledgment
Trang 14Stop-and-Wait: Overview
Trang 15Stop-and-Wait: Pseudo
Code
Trang 16Stop-and-Wait: Pseudo
Code
Trang 17Stop-and-Wait: Flow
Diagram
Trang 18Noisy Channel
Error can and will happen
Require error control
Trang 19Stop-and-Wait ARQ
until successful delivery is ensured
it successfully receives a frame
numbered
within certain time, it assumes frame
is lost, then retransmits the same
frame
Trang 20Stop-and-Wait ARQ
Trang 21Flow Diagram: Normal
Trang 22 Thinking Corner
numbered?
Trang 23Flow Diagram: Lost
Trang 24Deliver
Trang 25 Thinking Corner
numbered?
Trang 27Bidirectional
Transmission
frames
Trang 28Example
Assuming a communication system where:
Stop-and-Wait ARQ is used
Bandwidth of the link is 1 Mbps
Propagation delay is 10 ms
One-way data flow
Questions
What should be an appropriate time-out value?
What is the bandwidth-roundtrip-delay
product?
If the system data frames are 1000 bits in
length, what is the utilization percentage of the link?
Trang 29Improving Link
Utilization
major disadvantage of Stop-and-Wait
ARQ
waiting for ACK
Recalculate the link utilization if we
allow up to 15 frames to be sent before
waiting for an ACK
Trang 30Go-Back-N ARQ
before waiting for ACK
These frames must be numbered
all of the following frames must be
retransmitted
Trang 32Sending Window
Sending more than one frame at once
requires sender to buffer multiple frames
Known as "sending window"
Any of these frames in the window can be lost
Trang 33"Sliding" Window
Once the first frames in the window is
ACKed
ACKed frames are removed from the buffer
More frames are transmitted
Result: The window slides to the right
Trang 34Receiving Window
Trang 35Send vs Receive
Windows
Trang 36Go-Back-N: Window
Sizes
Up to 2m-1 frames can be sent without
ACK
Frames must be received in order
Trang 37Go-Back-N: Normal
Operation
Trang 38Go-Back-N: Lost Frame
ACKs are cumulative
Trang 39Lost ACK: Window Size <
2m
Trang 40 Thinking Corner
Trang 41Lost ACK: Window Size =
2m
Trang 43Selective Repeat ARQ
out-of-order frames
Losing one frame may result in
retransmission of multiple frames
Very inefficient in noisy link
Therefore, receive window > 1
Trang 45Send Window
Trang 46Receive Window
Trang 47Negative ACK
Used by receiver to indicate missing frame
Trang 48Selective Repeat: Window
Size
Trang 49Data Link Control
Protocols: HDLC and PPP
Trang 51Normal Response Mode
"NRM" mode
Used in both point-to-point and multi-point link
Trang 52Asynchronous Balance
Mode
"ABM"
secondary
Trang 53HDLC Frames
Information frame (I-frame)
Supervisory frame (S-frame)
Unnumbered frame (U-frame)
Frame Check Sequence (error detection code)
Trang 54Control Field Format
N(S) – Frame sequence number
N(R) – Ack sequence number
Trang 55U-Frame Codes
Trang 56Connection and
Disconnection
Trang 57Data Transfer: No Error
Trang 58Data Transfer: With Error
Trang 61PPP Transition States
Trang 62Multiplexing in PPP
Trang 63PPP Stack
Trang 64LCP: Link Control
Protocol
maintaining, configuring, and
terminating links
Trang 65PPP Authentication
Password Authentication Protocol (PAP)
Challenge Handshake Authentication
Protocol (CHAP)
Trang 66PAP
Trang 67CHAP
Trang 68NCP: Network Control
Protocol
A set of control protocols to allow data
from the network layer to be encapsulated
into a PPP frame
One common protocol: IPCP
(Internetwork Protocol Control Protocol)
Allow negotiation at the network layer
Trang 69Data Encapsulation
Trang 70Example: PPP Session
Trang 71Example: PPP Session
(cont'd)