Beruflich Dokumente
Kultur Dokumente
McDougall 2001
Transport Protocols
TCP and UDP
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Transport Layer
Layer 4 of the OSI model is responsible for
ensuring that packets are properly transported
through a network
IP is a best effort networking protocol and does not
guarantee delivery of a packet.
Two forms of transport for IP packets:
Connection-Oriented
Connectionless
9/2000
(TCP)
(UDP)
2
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Application
TCP
UDP
ICMP
IP
ARP
RARP
Physical
network
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Flow Control
Error Control
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Flow Control
Ensuring appropriate data rates
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Flow control
Sliding window
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S to p a n d W a it
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S lid in g W in d o w
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S e n d e r Sliding W in d o w
9/2000
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
R e c e iv e r Sliding W in d o w
9/2000
10
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S lid in g W in d o w E x a m p le
9/2000
11
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Sender
9/2000
12
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
R e c e iv e r
9/2000
13
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Window Management
9/2000
14
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Computer 2
Computer 2
Computer 1
send
ack
send
four
packets
send
ack
done
send
four
acks
send
ack
send
packet
send
ack
done
9/2000
(a)
(b)
15
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Tw = Tg * W
Tw = Throughput achieved with sliding window
Tg = Throughput achieved with stop & wait
W = widow size
9/2000
16
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Performance Comparison
Stop-and-wait
Slow
Useful only in special cases
Sliding window
Fast
Needed in high-speed network
9/2000
17
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
18
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Error Control
Ensuring Integrity of Data
9/2000
19
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Error control
Stop-and-wait ARQ
Sliding window
Go-back-n
9/2000
Slective-reject
20
10
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Stop-and-wait ARQ
(Automatic Repeat Request)
Sender keeps copy of last frame transmitted until it
receives an ACK for it
Data and ACK frames are numbered alternately 0 and 1
For an error in data frame a NAK frame is returned
If expected ACK not received within an allotted time
period, data frame is assumed lost (timeout)
9/2000
21
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S to p -an d - w a i t A R Q
9/2000
Damaged Frames
22
11
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S to p -an d - w a i t A R Q
Lost Frame
9/2000
23
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Stop-and-wait ARQ
9/2000
Lost ACK
24
12
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
25
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
Go-back-n,Damaged Frame
26
13
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S lid in g W in d o w A R Q
9/2000
Go-back-n,Lost Frame
27
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S lid in g W in d o w A R Q
9/2000
Go-back-n,Lost ACK
28
14
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S lid in g W in d o w A R Q
9/2000
29
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Lost Frames
If a frame is lost, next frame will arrive out of sequence
Receiver returns a NAK
Lost ACK
Treated similarly as go-back-n ARQ
On sender timeout, it retransmits all the frames that remain
unacknowledged
9/2000
30
15
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Congestion
9/2000
31
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Summary
Network congestion
9/2000
32
16
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
33
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Introduction
In this lecture we will study TCP, the major transport
protocol in the TCP/IP suite
We will examine
9/2000
34
17
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
35
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Addressing
9/2000
36
18
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
37
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Physical Addresses
9/2000
38
19
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Network Addresses
9/2000
39
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Port Addresses
9/2000
40
20
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
TCP vs IP
9/2000
41
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Port Numbers
9/2000
42
21
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
TCP Features
Connection oriented
Point-to-point communication
Provides reliable data delivery
Full duplex communication
Stream interface
Reliable connection startup: Three-way handshake
Graceful connection shutdown
9/2000
43
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
TCP Segment
9/2000
44
22
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
45
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
46
23
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
47
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
48
24
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
49
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
End of Options
9/2000
50
25
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
No Operation Option
9/2000
52
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
53
26
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
54
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Timestamp Option
9/2000
55
27
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
TCP Timers
9/2000
56
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
datagrams
9/2000
57
28
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Host A
appl.
TCP
IP
net iface.
Communication system
as viewed by TCP
Host B
appl.
TCP
IP
net iface.
router
IP
net iface.
net 1
net 2
9/2000
58
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Apparent Contradiction
9/2000
59
29
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Achieving Reliability
9/2000
60
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Lost
Duplicated
Delayed
Delivered out of order
Either side can crash
9/2000
61
30
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Startup/Shutdown Solution
9/2000
62
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Three-Way Handshake
(Connection Establishment)
9/2000
63
31
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Four-way Handshake
(Connection Termination)
9/2000
64
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
Lost packets
Duplicate packets
Delayed packets
Corrupted data
Transmission speed mismatches
Congestion
65
32
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Retransmission
Sender starts timer when message is transmitted
If timer expires before Ack arrives, sender retransmits message
9/2000
66
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Retransmission
Events at Host 2
Events at Host 1
send message 1
receive message 1
send ack 1
receive ack 1
send message 2
receive message 2
send ack 2
9/2000
packet lost
receive message 3
send ack 3
67
33
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
68
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
69
34
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
est 1
est 1
est 2
est 2
timeout
timeout packet lost
packet lost
9/2000
70
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Measuring RTT
Difference between time of transmission and arrival of
Ack
Sender cannot determine whether Ack is from original
transmission or retransmission
Choosing original transmission overestimates RTT
Choosing retransmission underestimates RTT
9/2000
71
35
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Karns Algorithm
Karn's algorithm specifies that sender ignores RTTs for
retransmitted segments
How will RTT get updated if internet round trip time
increases?
Karn's algorithm specifies that RTO is separated from RTT
when retransmission occurs
RTO doubles for each new message until ACK arrives
with no retransmission
9/2000
72
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Sender
Can send up to entire window before ack arrives
9/2000
73
36
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Receiver Events
Advertise window =2500
9/2000
74
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
75
37
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
76
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
77
38
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
78
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
TCP Operations
Encapsulation & Decapsulation
9/2000
79
39
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
TCP Operations
Queues in TCP
9/2000
80
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
TCP Operations
Multiplexing & Demultiplexing
9/2000
81
40
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Summary
9/2000
82
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Summary (Cont..)
Positive acknowledgment with retransmission
Sequence numbers detect missing, duplicate and out-oforder data
Three-way & four-way handshake
Sliding window flow control
Congestion control
TCP Operations
9/2000
83
41
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
84
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Intro d u c tio n
9/2000
85
42
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
T C P P r o t o c o l S u ite
9/2000
86
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
U D P C h a r a c t e r i s t ic s
Connectionless service
Unreliable
No flow-control mechanism
Limited error checking
Provides process-to-process communication
9/2000
87
43
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
U D P v s IP
9/2000
88
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
P o rt Num b e r s
9/2000
89
44
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
IP A d d r e s s e s v s P o r t N u m b e r s
9/2000
90
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
IA N A R a n g e s
9/2000
91
45
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S o m e W e ll-K n o w n P o rts
Echo
Discard
13
Daytime
53
Nameserver
67
Bootps
161
SNMP
To download bootstrap
information
Simple Network Management
Protocol
9/2000
92
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Socket Address
9/2000
93
46
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
U D P D a tag r a m F o r m a t
94
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
95
47
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Q u e u in g
9/2000
96
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
9/2000
97
48
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
Use of UDP
9/2000
98
Telecommunication Engineering Technology, Texas A&M University LAN WAN Lecture Notes - Copyright Jeff M. McDougall 2001
S u m m a ry
9/2000
99
49