CS 352 Internet Technology Data Link Layer - PowerPoint PPT Presentation

1 / 117
About This Presentation
Title:

CS 352 Internet Technology Data Link Layer

Description:

Creating the illusion of a reliable link. 5. Modes of Operation. Simplex. Half Duplex ... Simplex Transmission. Data: one way only. One-Way Street. Data. Link ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 118
Provided by: brettv4
Category:

less

Transcript and Presenter's Notes

Title: CS 352 Internet Technology Data Link Layer


1
CS 352Internet TechnologyData Link Layer
  • Richard Martin
  • Dept. of Computer Science
  • Rutgers University

2
Data Link Layer
3
Data Link Layer
Host A
Host B
Application Protocol
Application Layer
Application Layer
Presentation Protocol
Presentation Layer
Presentation Layer
Session Protocol
Session Layer
Session Layer
Transport Protocol
Transport Layer
Transport Layer
Network Layer
Network Layer
Network Layer
Network Layer
Data Link Layer
Data Link Layer
Data Link Layer
Data Link Layer
Physical Layer
Physical Layer
Physical Layer
Physical Layer
Router
Router
4
Data Link Layer Functionality
  • Recall
  • Frame creation
  • Error detection and/or correction
  • Flow control

Creating the illusion of a reliable link
5
Modes of Operation
  • Simplex
  • Half Duplex
  • Full Duplex

6
Simplex Transmission
  • Data one way only


Data Link
One-Way Street
7
Half Duplex Transmission
  • Data One direction at a time


Sometimes
Data Link
Sometimes
8
Full Duplex Transmission
  • Data Both ways simultaneously


Forward Direction
Data Link
Reverse Direction
9
Framing
  • The data unit at the data link layer is called a
    frame
  • A frame is a group of bits, typically in sequence
  • Issues
  • Frame creation
  • Frame delineation

10
3.1 Frame Creation
Network Layer
one-to-one mapping
Data Link Layer
frame boundaries
control information
network layer data unit
11
Frame Creation (contd)
BAD
Network Layer
Data Link Layer
What would happen If the network address is split
between 2 frames?
12
Frame Delineation
  • How to tell when a new frame starts
  • Character count
  • Frame tags with character stuffing
  • Frame tags with bit stuffing

13
Delineation by character count
Control Field containing character count
  • Character count lists the number of characters in
    the data field of the frame
  • Problem corrupted control fields

14
Frame tagging with character stuffing
Frame tags (special characters)
  • Use starting and ending characters (tags) to mark
    boundaries of frame
  • Problem What if tag characters occur in the data
    or control portions of the frame?

15
Character stuffing
  • Insert extra escape characters when a tag appears
    in data field

STX
DLE
Start Tag
ETX
DLE
End Tag
DLE
DLE
Character Stuffed DLE code
16
Character Stuffing Example
DLE
DLE
ETX
I am a
jerk trying to
crash your network!
Tagging and Character Stuffing
Untagging and Character Unstuffing
DLE
DLE
ETX
I am a
jerk trying to
crash your network!
17
Character StuffingPPP
  • PPP Point-to-Point Protocol, used widely in the
    Internet
  • PPP uses frame tags with character stuffing

PPP Frame Format
01111110
Control Fields
Payload (up to 1500 bytes)
Checksum
01111110
Character Frame Tags
18
Frame tagging with bit stuffing
  • Bit strings may be used instead of character
    sequences to delineate frames
  • More efficient

19
Bit stuffing
  • Each frame begins with a start and end bit
    sequence, e.g., 01111110
  • When senders data link layer sees five 1s in a
    row, it stuffs a zero bit
  • The receiver unstuffs a zero after five
    consecutive 1s.

20
Bit Stuffing Example
00110010111111100010100
Tagging and Bit Stuffing
0111111000110010111110110001010001111110
Untagging and Bit Unstuffing
00110010111111100010100
21
Bit Stuffing HDLC
  • HDLC High-level Data Link Control. Used in
    X.25 networks
  • HDLC uses frame tags with bit stuffing

HDLC Frame Format
01111110
Control Fields
Payload (arbitrarily long)
Checksum
01111110
Character Frame Tags
22
Error Control
  • No physical link is perfect
  • Bits will be corrupted
  • turn on the microwave
  • We can either
  • detect errors and request retransmission
  • or correct errors without retransmission

23
Error Detection
  • Parity bits
  • Polynomial codes or checksums

24
Parity bits
  • Append a single parity bit to a sequence of bits
  • If using odd parity, the parity bit is chosen
    to make the total number of 1s in the bit
    sequence odd.
  • If even parity, the parity bit makes the total
    number of 1s in the bit sequence even

25
Parity bits Example
Transmitted Sequence
Parity
Parity Bit
00010101
even
1
01111
even
0
11111111
odd
1
0
10011
odd
26
Parity Bits
  • Only detects when there are an odd number of bit
    errors
  • Does not detect an even number of bit errors
  • It also has high overhead it requires 1 extra
    bit for every several bits transmitted

27
Polynomial Codes
  • Can detect errors on large chunks of data
  • Has low overhead
  • More robust than parity bit
  • Requires the use of a code polynomial
  • Example x2 1

28
Poly codes
  • Data is viewed a single long number,S(x)
  • Divide S(X) by an agreed upon divisor, G(X)
  • S(x)/G(x) C(x) remainder, R(x)
  • Transmit T(x) S(x) R(x)
  • Check if ( (T(x)/G(x) ) ! 0) then error!

29
Cyclic Redundancy Check
  • CRC Example of a polynomial code
  • Procedure
  • 1. Let r be the degree of the code polynomial.
    Append r zero bits to the end of the transmitted
    bit string. Call the entire bit string S(x)
  • 2. Divide S(x) by the code polynomial using
    modulo 2 division.
  • 3. Subtract the remainder from S(x) using modulo
    2 subtraction.
  • The result is the checksummed message
  • Easy to build in hardware

30
Why polynomial?
  • Treat numbers as polynomials, not as integers,
    Why?
  • Polynomial arithmetic has no carries
  • Arithmetic same a XOR gate
  • 0-0 0
  • 1-0 1
  • 0-1 1 (wraparound)
  • 1-1 0

31
Generating a CRCExample
Message 1011 1 x x3 0 x x2 1 x x 1
x3 x 1 Code Polynomial x2 1
(101)
Step 1 Compute S(x) r 2 S(x) 101100
32
Generating a CRCExample (contd)
Step 2 Modulo 2 divide
Remainder
33
Generating a CRCExample (contd)
Step 3 Modulo 2 subtract the remainder from S(x)
101100
- 01
101101
Checksummed Message
34
Decoding a CRC
  • Procedure
  • 1. Let n be the length of the checksummed message
    in bits
  • 2. Divide the checksummed message by the code
    polynomial using modulo 2 division. If the
    remainer is zero, there is no error detected.

35
Decoding a CRCExample
101101
Checksummed message (n 6)
1011
Original message (if there are
no errors)
Remainder 0 (No error detected)
36
Decoding a CRCAnother Example
  • When a bit error occurs, there is a large
    probability that it will produce a polynomial
    that is not an even multiple of the code
    polynomial, and thus errors can usually be
    detected.

Remainder 1 (Error detected)
37
Choosing a CRC polynomial
  • The longer the polynomial, the smaller the
    probability of undetected error
  • Common standard polynomials
  • (1) CRC-12 x12 x11 x3 x2 x1 1
  • (2) CRC-16 x16 x15 x2 1
  • (3) CRC-CCITT x16 x12 x5 1

38
Putting it all together
39
Error Correction
  • Parity bits and polynomial codes catch errors,
    but can we correct them without retransmitting
    information?
  • Yes, using Hamming Codes
  • Example of a Forward Error Correction (FEC) Scheme

40
Hamming Codes
  • Hamming codes, like polynomial codes, are
    appended to the transmitted message
  • Hamming codes, unlike polynomial codes, contain
    the information necessary to locate a single bit
    error

41
Calculating a Hamming Code
  • Procedure
  • Place message bits in their non-power-of-two
    Hamming positions
  • Build a table listing the binary representation
    of each of the message bit positions
  • Calculate the check bits

42
Hamming Code Example
1 0 1 1
Message to be sent
1 0 1 1 1 2 3 4 5 6
7 20 21 22
Position
2n check bits
43
Hamming Code Example
1 0 1 1
Message to be sent
1 0 1 1 1 2 3 4 5
6 7 20 21 22
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
44
Hamming Code Example
1 0 1 1
Message to be sent
1 0 1 1 1 2 3 4 5
6 7 20 21 22
1
Starting with the 20 position Look at positions
with 1s in them Count the number of 1s in
the corresponding message bits If even, place a
1 in the 20 check bit, i.e., use odd
parity Otherwise, place a 0
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
45
Hamming Code Example
1 0 1 1
Message to be sent
1 0 1 1 1 2 3 4 5
6 7 20 21 22
1
0
Repeat with the 21 position Look at positions
those positions with 1s in them Count the
number of 1s in the corresponding message
bits If even, place a 1 in the 21 check
bit Otherwise, place a 0
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
46
Hamming Code Example
1 0 1 1
Message to be sent
1 0 1 1 1 2 3 4 5
6 7 20 21 22
1
0
1
Repeat with the 22 position Look at positions
those positions with 1s in them Count the
number of 1s in the corresponding message
bits If even, place a 1 in the 22 check
bit Otherwise, place a 0
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
47
Hamming Code Example
  • Original message 1011
  • Sent message 1011011
  • Now, how do we check for a single-bit error in
    the sent message using the Hamming code?

48
Using Hamming Codes to Correct Single-Bit Errors
1 0 1 1 0 0 1
Received message
1 0 1 1 0 0 1 1 2 3 4 5 6
7 20 21 22
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
49
Using Hamming Codes to Correct Single-Bit Errors
1 0 1 1 0 0 1
Received message
1 0 1 1 0 0 1 1 2 3 4 5 6
7 20 21 22
Starting with the 20 position Look at positions
with 1s in them Count the number of 1s in
both the corresponding message bits and the 20
check bit and compute the parity. If even
parity, there is an error in one of the four bits
that were checked.
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
Odd parity No error in bits 1, 3, 5, 7
50
Using Hamming Codes to Correct Single-Bit Errors
1 0 1 1 0 0 1
Received message
1 0 1 1 0 0 1 1 2 3 4 5 6
7 20 21 22
Repeat with the 21 position Look at positions
with 1s in them Count the number of 1s in
both the corresponding message bits and the 21
check bit and compute the parity. If even
parity, there is an error in one of the four bits
that were checked.
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
Even parity ERROR in bit 2, 3, 6 or 7!
51
Using Hamming Codes to Correct Single-Bit Errors
1 0 1 1 0 0 1
Received message
1 0 1 1 0 0 1 1 2 3 4 5 6
7 20 21 22
Repeat with the 22 position Look at positions
with 1s in them Count the number of 1s in
both the corresponding message bits and the 22
check bit and compute the parity. If even
parity, there is an error in one of the four bits
that were checked.
Position
2n check bits
Calculate check bits
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
Even parity ERROR in bit 4, 5, 6 or 7!
52
Finding the errors location
1 0 1 1 0 0 1 1 2 3 4 5 6
7
Position
53
Finding the errors location
1 0 1 1 0 0 1 1 2 3 4 5 6
7
Position
No error in bits 1, 3, 5, 7
54
Finding the errors location
erroneous bit, change to 1
1 0 1 1 0 0 1 1 2 3 4 5 6
7
Position
Error must be in bit 6 because bits 3, 5, 7 are
correct, and all the remaining information agrees
on bit 6
ERROR in bit 2, 3, 6 or 7
ERROR in bit 4, 5, 6 or 7
55
Finding the errors locationAn Easier
Alternative to the Last Slide
Check bits
22 21 20
3 21 20 0 1 1 5 22 20
1 0 1 6 22 21 1 1 0 7
22 21 20 1 1 1
E
E
NE
6
1
1
0
E error in column NE no error in column
56
Hamming Codes
  • Hamming codes can be used to locate and correct a
    single-bit error
  • If more than one bit is in error, then a Hamming
    code cannot correct it
  • Hamming codes, like parity bits, are only useful
    on short messages

57
Flow Control
  • What happens if the sender tries to transmit
    faster than the receiver can accept?
  • Data will be lost unless flow control is
    implemented

58
Controlling the Flow of Data
Busy Client
Slow Server
59
Some Flow Control Algorithms
  • Flow control for the ideal network
  • Stop and Wait for noiseless channels
  • Stop and Wait for noisy channels
  • Sliding window protocols
  • Sliding window with error control
  • Go Back N
  • Selective Repeat

60
Flow control in the ideal network
  • Assumptions
  • Error free transmission link,
  • Infinite buffer at the receiver

No acknowledgement of frames necessary Since the
data link is error-free and the receiver can
buffer as many frames as it likes, no frame will
ever be lost
61
Flow control in the ideal network (contd)
Busy Client
Slow Server
Infinite Box
62
5.2 Stop and Wait with Noiseless Channels
  • Assumptions
  • Error free transmission link,
  • Finite buffer at the receiver
  • Problem of Buffer overflow at the receiver
  • Buffer overflow may happen at the receiver when
    the sender sends frames at a rate faster than the
    receiver

63
Stop and Wait with Noiseless Channels (contd)
Busy Client
Slow Server
Finite Box (once full, Letter is lost)
Bit Bucket
64
Stop and Wait with Noiseless Channels (contd)
  • Solution Stop-and-Wait
  • The receiver sends an acknowledgement frame
    telling the sender to transmit the next data
    frame.
  • The sender waits for the ACK, and if the ACK
    comes, it transmits the next data frame.

65
Stop and Wait with Noiseless Channels (contd)
Data
Data
66
Stop and Wait (contd)
  • Note that we assume an error-free transmission
    link and therefore ACK frames will not be lost
  • In this flow control protocol, there are two
    types of frames data frames and ACK frames. The
    ACK frames dont contain any particular
    information, since only the arrival of the ACK
    frame at the sender is important.

67
5.3 Stop and Wait for Noisy Channels
  • Assumptions
  • Transmission link may cause errors in frames,
  • Finite buffer at the receiver

ACK frames may now be lost
68
Problems introduced by a noisy line
  • Problem 1 Loss of a data or ACK frame
  • Since the transmission link is not error-free, a
    data or ACK frame may be lost, causing the sender
    to wait indefinitely for an ACK

69
Loss of an ACK frame
Data
?
70
Problems introduced by a noisy line
  • Can we solve problem 1 by introducing a timeout
    period for the sender? Yes, but...
  • Problem 2 Duplicated frames
  • If the ACK frame for a certain data frame is
    lost, the sender will retransmit the same frame
    after a time-out period, and the receiver will
    then have two copies of the same frame

71
Duplicated Data Frames
Buy 10 Pikachus!
Wheres the ACK?
Buy 10 Pikachus!
Order 20?
72
Stop and Wait for Noisy Channels (contd)
  • Solution
  • The sender uses a timer to retransmit data frames
    when an ACK has not arrived
  • The sender includes a sequence number in each
    frame to distinguish one frame from another.
    This way, the receiver knows when it has received
    duplicate frames.

73
Stop-and-Wait with Noisy channels
Wheres the ACK?
Data
Duplicate
74
Is Stop and Wait the best we can do?
  • Stop and Wait is an effective form of flow
    control, but
  • Its not very efficient.
  • 1. Only one data frame can be in transit on the
    link at a time
  • 2. When waiting for an acknowledgement, the
    sender cannot transmit any frames
  • Better solution? Sliding Window

75
Sliding Window ProtocolsDefinitions
  • Sequence Number Each frame is assigned a
    sequence number that is incremented as each frame
    is transmitted
  • Sender Window Keeps track of sequence numbers
    for frames that have been sent but not yet
    acknowledged
  • Receiver Window Keeps track of sequence numbers
    for frames the receiver is allowed to accept
  • Maximum Sender Window size The maximum number
    of frames the sender may transmit without
    receiving any acknowledgements
  • Maximum Receiver Window size The maximum number
    of frames the receiver may receive before
    returning an acknowledgement to the sender

76
Simple Sliding Window with Window Size of 1
  • A sliding window with a maximum window size of 1
    frame
  • Window for a 3-bit sequence number

77
Sliding Window example
Sender window
Receiver window
(a)
(b)
(c)
(d)
(a) Initial state, no frames transmitted (b)
Sender transmits frame 0 (c) Receiver receives
frame 0 and ACKs (d) Sender receives ACK
78
Simple Sliding Window withWindow size 1 (contd)
  • This protocol behaves identically to stop and
    wait for a noisy channel

79
Sliding Window ProtocolsGeneral Remarks
  • The sending and receiving windows do not
    necessarily have the same maximum size
  • Any frame whose sequence number falls outside the
    receiver window is discarded at the receiver
  • The sender windows size grows and shrinks as
    frames are transmitted and acknowledged
  • Unlike the sender window, the receiver window
    always remains at its maximum size

80
Sliding Window ProtocolsPiggybacking
Acknowledgements
  • Since we have full duplex transmission, we can
    piggyback an ACK onto the header of an outgoing
    data frame to make better use of the channel

When a data frame arrives at a router, instead of
immediately sending a separate ACK frame, the
router waits until it is passed the next data
frame to send. The acknowledgement is attached
to the outgoing data frame.
81
Sliding Window with Maximum Sender Window Size WS
  • With a maximum window size of 1, the sender waits
    for an ACK before sending another frame
  • With a maximum window size of WS, the sender can
    transmit up to WS frames before being blocked
  • This allows the sender to transmit several frames
    before waiting for an acknowledgement

82
Sender-Side Window with WS2
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(a) Initial window state (b) Send frame 0 (c)
Send frame 1 (d) ACK for frame 0 arrives
(e) Send frame 2 (f ) ACK for frame 1 arrives (g)
ACK for frame 2 arrives, send frame 3 (h) ACK for
frame 3 arrives
83
Pipelining
packet 5
packet 4
packet 6
Ack 0
Ack 2
Ack 1
84
Pipelining
  • Sliding window with WS gt 1 is also called
    pipelined communication

data stream
99
51
50
A
B
49
1
0
ACK stream
By allowing several frames onto the link before
receiving an acknowledgement, pipelining keeps
the link from being idle
85
5.4.3 Sliding Window with Maximum Receiver
Window Size WR
  • With a maximum window size of 1, the receiver
    must receive and process every frame in sequence
  • With a maximum window size of WR, the receiver
    can receive and process up to WR frames before
    acknowledging them
  • This is useful when frames are lost the receiver
    can still accept and buffer frames after the
    missing frame

86
Receiver-Side Window with WR2
(a)
(b)
(c)
(d)
(e)
(f)
(g)
(h)
(a) Initial window state (b) Nothing happens (c)
Frame 0 arrives, ACK frame 0 (d) Nothing happens
(e) Frame 1 arrives, ACK frame 1 (f) Frame 2
arrives, ACK frame 2 (g) Nothing happens (h)
Frame 3 arrives, ACK frame 3
87
(No Transcript)
88
What about Errors?
  • What if a data or acknowledgement frame is lost
    when using a sliding window protocol?
  • Two Solutions
  • Go Back N
  • Selective Repeat

89
5.5 Sliding Window with Go Back N
  • When the receiver notices a missing or erroneous
    frame, it simply discards all frames with greater
    sequence numbers and sends no ACK
  • The sender will eventually time out and
    retransmit all the frames in its sending window

90
Go Back N
Timeout interval
Sender
0
1
2
3
4
2
3
4
5
6
Maximum window size 8
ACK 0
ACK 1
ACK 2
ACK 3
ACK 4
ACK 5
ACK 6
Receiver
0
1
E
D
D
2
3
4
5
6
Maximum window size 8
Discarded by receiver
Frame with error
Time
91
Go Back N (contd)
  • Go Back N can recover from erroneous or missing
    frames
  • But
  • It is wasteful. If there are errors, the sender
    will spend time retransmitting frames the
    receiver has already seen

92
Sliding Window with Selective Repeat
  • The sender retransmits only the frame with errors
  • The receiver stores all the correct frames that
    arrive following the bad one. (Note that the
    receiver requires a frame buffer for each
    sequence number in its receiver window.)
  • When the receiver notices a skipped sequence
    number, it keeps acknowledging the last good
    sequence number
  • When the sender times out waiting for an
    acknowledgement, it just retransmits the one
    unacknowledged frame, not all its successors.

93
Selective Repeat
Timeout interval
Sender
0
1
2
3
4
2
5
6
Maximum window size 8
ACK 0
ACK 1
ACK 4
ACK 5
ACK 1
ACK 1
ACK 6
Receiver
0
1
E
2
5
6
3
4
Maximum window size 8
Buffered by receiver
Frame with error
Time
94
Recap
95
Layer 2 - Data Link Layer
DATA LINK LAYER
1
1
0
001100
1 0 1 0
00110
111001
101010
96
Data Link Layer Design Issues
  • A Well Defined Service Interface to the Network
    Layer.
  • How are the bits grouped into frames.
  • Handling Transmission Errors
  • Regulating the flow of Frames to prevent swamping

97
OSI Architecture
98
OSI Operations
Data
Data
Bits
Bits
99
Data Link Layer Design Issues
  • Virtual Communication (a) and Actual
    Communication (b)
  • the Data Link Layer provides services to the
    Network Layer
  • Services Provided to the Network Layer
  • Unacknowledged connectionless service
  • Acknowledged connectionless service
  • Acknowledged connection-oriented service

100
  • Unacknowledged connectionless service
  • source machine sends independent frames to the
    destination machine
  • the destination machine does not ACK
  • no connection is established
  • the data link layer does not attempt to recover
    lost frames
  • appropriate for low error rate connection
  • ok for speech data where late data is worse than
    bad data
  • any error recovery is left to higher layers
  • Acknowledged connectionless service
  • source machine sends independent frames to the
    destination machine
  • the destination machine does ACK on indivisual
    frame received
  • no connection is established
  • if ACK is not received for given time limit, the
    source machine resends
  • appropriate for unreliable connection like
    wireless systems

101
  • the ACK by the data link layer is not a
    requirement but optimization
  • the transport layer (who is responsible for
    end-to-end transport of message) can always send
    a message and wait for a ACK on the message ok
    with reliable fiber connection
  • message by message checkup has much bigger
    overhead due to the size
  • only a few frames of a message can be in error
    but still the whole message is resent
  • much more efficient to do it (ACK on frame) in
    the data link layer esp for wireless systems
  • Acknowledged connection-oriented service
  • connection is established first
  • frames sent over the established route are
    numberd
  • the data link layer guarantees the safe delivery
    and orderly delivery of each frame

102
  • The Data Link Layer in ATM
  • the ATM physical layer covers roughly the OSI
    physical layer and data link layers
  • the PMD (physical medium dependent) sublayer acts
    like the OSI physical layer
  • the TC (Transmission Convergence) sublayer acts
    like the Data Link layer
  • There are no physical layer characteristics
    specific to ATM
  • Instead, ATM cells are carried by SONET, FDDI,
    and other transmission systems
  • Well look at TC sublayer functionality

103
TCP/IP Protocol Stack vs. OSI
User Processes
Kernel
104
Data Link Layer
Interface Data Unit
Service Access Points
ICI
SDU
Service User
Layer N1
Network Layer
Interface
Service Provider
Layer N
ICI
SDU
Data Link Layer
SDU
Header
ICI Interface Control Information
N-Protocol Data Unit
105
Communication Path
Virtual Data Path
106
Breaking Bits into Frames Character Count Method
Character Count
Error Free
5
1
2
3
4
5
6
7
8
9
8
0
1
2
3
4
5
6
Frame 1 5 Characters
Frame 3 5 Characters
Frame 2 5 Characters
107
Breaking Bits into Frames Starting and Ending
Flags with Bit Stuffing
0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0
Network Layer
Stuffed Bits
108
Error Control
Start
Timers
PACKET
Stop
109
Flow Control
STOP!!!
STOP!!!
Can Happen When Sender overloads Receiver!
110
Error Correcting
  • Error Correcting Codes
  • Error Detecting Codes

111
Positive Acknowledgement with Retransmission
Events at Sender Site
Network Messages
Events at Receiver Site
Send Packet 1
Receive Packet 1 Send ACK1
Receive ACK1 Send Packet 2
Receive Packet 2 Send ACK2
Receive ACK2
112
Positive Acknowledgement with Retransmission
(Lost Packet)
Events at Sender Site
Network Messages
Events at Receiver Site
Send Packet 1 Start Timer
Packet should arrive ACK should be sent
ACK would normally arrive at this time
Timer Expires
Retransmit Packet 1 Start Timer
Receive Packet 1 Send ACK1
Receive ACK1 Cancel Timer
113
Sequence Numbers
  • Initial Sequence Numbers (ISN)
  • A ISN generator is employed which is driven by
    a 32 bit
  • clock.
  • An ISN generator will cycle every 4.55 Hrs
  • Each Connection has a Transmit and Receive
    Sequence
  • Number
  • MSL is 2 Minutes, But can be changed.

114
Sliding Window Mechanism
  • The Sliding Window solves two
  • important problems for TCP
  • Efficient Transmission
  • Flow Control

115
Sliding WindowEfficient Transmission
There are three pointers associated with every
connection
1 2 3 4 5 6 7 8 9 10 11
...
1
2
3
1. One marks left of sliding window 2. One
marks right of sliding window 3. One separates
sent from not sent
Each End of the connection maintains two
windows Transmit Receive
116
Sliding WindowFlow Control
There are two independent Flow problems 1.
Need end to end flow control between source
and Destination 2. Need to allow intermediate
systems (I.e. routers) to control a source
that sends more traffic than the machine
can tolerate
Sliding window will solve 1. The other is
congestion control
117
Sliding Windows
Events at Sender Site
Network Messages
Events at Receiver Site
Send Packet 1
Receive Packet 1 Send ACK1
Send Packet 2
Receive Packet 2 Send ACK2
Send Packet n
Receive Packet n Send ACKn
Send Packet 8
Receive ACK1
Receive Packet 8 Send ACK8
Send Packet 9
Receive ACK2
Receive ACKn
Receive ACK8
Write a Comment
User Comments (0)
About PowerShow.com