* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Document
Survey
Document related concepts
Transcript
Departamento de
Tecnología Electrónica
Some of these slides are
copyrighted by:
Chapter 2
Transport Layer
Advance Features
Computer Networking:
A Top Down Approach
5th edition.
Jim Kurose, Keith Ross
Addison-Wesley, April
2009.
Transport Layer Advanced Features
1
Chapter 2 outline
2.1 Transport-layer
services
2.2 Connectionoriented transport:
TCP
2.3 Principles of
congestion control
2.4 TCP congestion
control
2.5 Stream Control
Transmission Protocol
Transport Layer Advanced Features
2
Chapter 2 outline
2.1 Transport-layer
services
2.2 Connectionoriented transport:
TCP
2.3 Principles of
congestion control
2.4 TCP congestion
control
2.5 Stream Control
Transmission Protocol
Transport Layer Advanced Features
3
Transport services and protocols
provide logical communication between app
processes running on different hosts
transport protocols run in end systems
breaks app messages into segments, passes to
network layer
Host A
Network
Host B
Transport Layer Advanced Features
4
Internet transport-layer protocols
more than one transport protocol available to apps
Internet: TCP and UDP
FTP
HTTP
SMTP
DNS
TCP
UDP
IP
TFTP
Application
Transport
Network
Link layer (LLC y MAC)
Physical
Layer
Transport Layer Advanced Features
5
Internet transport-layer
protocols
more than one
transport
protocol available
to apps
Internet: TCP
and UDP
TCP
UDP
Connection- oriented Non-connectionoriented
Reliable
Unreliable
Segment grouping
Unfragmented
messages
Rcv orders segments User datagram
ACKs and timers
No ACKs
Flow control
No flow control
Congestion control
No congestion control
Transport Layer Advanced Features
6
Internet transport-layer
protocols
Port: identifies application
Port numbers: http://www.iana.org/assignments/port-
numbers
Application protocol
Port numbers
Transport protocol
FTP
20, 21
TCP
Telnet
23
TCP
SMTP
25
TCP
DNS
53
UDP (TCP (*))
TFTP
69
UDP
HTTP
80
TCP
POP3
110
TCP
RIP
520
UDP
Transport Layer Advanced Features
7
Chapter 2 outline
2.1 Transport-layer
services
2.2 Connectionoriented transport:
TCP
2.3 Principles of
congestion control
2.4 TCP congestion
control
2.5 Stream Control
Transmission Protocol
Transport Layer Advanced Features
8
TCP: Overview
point-to-point:
one sender, one receiver
reliable, in-order byte
stream:
no “message boundaries”
pipelined:
TCP congestion and flow
control set window size
send & receive buffers
socket
door
application
writes data
application
reads data
TCP
send buffer
TCP
receive buffer
RFCs: 793, 1122, 1323, 2018, 2581
full duplex data:
bi-directional data flow
in same connection
MSS: maximum segment
size
connection-oriented:
handshaking (exchange
of control msgs) init’s
sender, receiver state
before data exchange
flow controlled:
sender will not
socket
door
overwhelm receiver
segment
Transport Layer Advanced Features
9
TCP segment structure
32 bits
URG: urgent data
(generally not used)
ACK: ACK #
valid
PSH: push data now
(generally not used)
RST, SYN, FIN:
connection estab
(setup, teardown
commands)
Internet
checksum
(as in UDP)
source port #
dest port #
sequence number
acknowledgement number
head not
UA P R S F
len used
checksum
Receive window
Urg data pnter
Options (variable length)
counting
by bytes
of data
(not segments!)
# bytes
rcvr willing
to accept
application
data
(variable length)
Transport Layer Advanced Features
10
TCP seq. #’s and ACKs
Host A
Host B
Client starts
active open
Server is in passive open,
starts connection and
confirms client open
Client confirms
server open
Connection
established
Transport Layer Advanced Features
time
11
Chapter 2 outline
2.1 Transport-layer
services
2.2 Connectionoriented transport:
TCP
2.3 Principles of
congestion control
2.4 TCP congestion
control
2.5 Stream Control
Transmission Protocol
Transport Layer Advanced Features
12
Principles of Congestion Control
Congestion:
informally: “too many sources sending too much
data too fast for network to handle”
different from flow control!
manifestations:
lost packets (buffer overflow at routers)
long delays (queueing in router buffers)
Transport Layer Advanced Features
13
Causes/costs of congestion
Host A
Two tx:
lIN = Sending rate
lOUT = Receiving
rate
C= Router capability
Host B
lout
lin : original data
unlimited shared
output link buffers
Queue theory
large delays
when congested
maximum
achievable
throughput
Transport Layer Advanced Features
14
Causes/costs of congestion:
Supposition: Tx retx lost packets
Now, lIN is not tx -> higher rate lIN’
Congestion costs:
more work (retx)
unneeded retransmissions: link carries multiple copies of pkt
Host A
Host B
lout
lin : original data
unlimited shared
output link buffers
Transport Layer Advanced Features
15
Causes/costs of congestion
Two tx and the same dest
Supposition: congestion in the router between A and dest
Another cost of congestion:
when a packet is dropped, any upstream transmission capacity
used for that packet was wasted
Host A
lin : original data
lout
l'in : original data, plus
retransmitted data
finite shared output
link buffers
Host B
Transport Layer Advanced Features
16
Causes/costs of congestion
Congestion costs: a summary
Big delays when the incoming rate to a router is near to the
link capability.
The tx must retx the lost segments due to the router
overflow.
Unnecessary BW is used for the retx of duplicated copies of
segments (due to delays).
Upstream transmission capacity used for a packet is wasted
when it is discarded.
Transport Layer Advanced Features
17
Approaches towards congestion control
Two broad approaches towards congestion control:
Network-assisted
congestion control:
End-end congestion
control:
no explicit feedback from
network
congestion inferred from
end-system observed loss,
delay
approach taken by TCP
routers provide feedback
to end systems
E.g. single bit indicating
congestion
Transport Layer Advanced Features
18
Chapter 2 outline
2.1 Transport-layer
services
2.2 Connectionoriented transport:
TCP
2.3 Principles of
congestion control
2.4 TCP congestion
control
2.5 Stream Control
Transmission Protocol
Transport Layer Advanced Features
19
TCP Congestion Control
Host A
sender limits
Host B
Host A
Host B
transmission:
timeout
LastByteSent-LastByteAcked
CongWin
How does sender
perceive congestion?
X
loss
loss event = timeout or 3
duplicate acks
TCP sender reduces rate
(CongWin) after loss
event
timeout
X
time
lost ACK
scenario
time
Resending a segment
after triple duplicate
ACK
Transport Layer Advanced Features
20
TCP congestion control:
additive increase,
multiplicative decrease (AIMD)
Approach: increase transmission rate (window size),
Saw tooth
behavior: probing
for bandwidth
congestion window size
probing for usable bandwidth, until loss occurs
additive increase: increase CongWin by 1 MSS
every RTT until loss detected
multiplicative decrease: cut CongWin in half after
loss
congestion
window
24 Kbytes
16 Kbytes
8 Kbytes
time
time
Transport Layer Advanced Features
21
TCP Congestion Control: details
three phases:
Roughly,
rate =
CongWin
Bytes/sec
RTT
When connection begins,
CongWin = 1 MSS
Example: MSS = 500 bytes & RTT
= 200 msec
initial rate = 20 kbps
slow start (SS)
Congestion avoidance (CA):
e.g. AIMD
Fast recovery (FR)
First two are compulsory in
TCP, while the last one is
recommendable
Transport Layer Advanced Features
22
TCP Slow Start
available bandwidth may
Host B
RTT
be >> MSS/RTT
When connection begins,
increase rate
exponentially fast until
first loss event
initial rate is slow but
ramps up exponentially
fast
Host A
time
Transport Layer Advanced Features
23
Congestion avoidance
After 3 dup ACKs:
CongWin is cut in half
window then grows linearly
But after timeout event:
CongWin instead set to 1
MSS;
window then grows
exponentially
to a threshold, then grows
linearly
Philosophy:
3 dup ACKs indicates
network capable of
delivering some segments
timeout indicates a “more
alarming” congestion scenario
Transport Layer Advanced Features
24
Summary: TCP Congestion Control
When CongWin is below Threshold, sender in slow-start phase,
window grows exponentially.
When CongWin is above Threshold, sender is in congestion-avoidance
phase, window grows linearly.
When a triple duplicate ACK occurs, Threshold set to CongWin/2 and
CongWin set to Threshold.
When timeout occurs, Threshold set to CongWin/2 and CongWin is
set to 1 MSS.
Note: TCP version varies the way
congestion control is applied. For
example, TCP Tahoe always reduces
Congestion Window to its initial
value after a loss event. Meanwhile,
in TCP Reno, all the congestion
phases take place.
Transport Layer Advanced Features
25
Chapter 2 outline
2.1 Transport-layer
services
2.2 Connectionoriented transport:
TCP
2.3 Principles of
congestion control
2.4 TCP congestion
control
2.5 Stream Control
Transmission Protocol
Transport Layer Advanced Features
26
TCP and UDP limitations
TCP limitations:
TCP keeps strict order: head-of-line blocking may be
a problem (data flow blocked until recovering a lost
segment)
Byte-oriented nature of TCP: must use PSH to
ensure data goes to app
No multi-home IP hosts
Relatively vulnerable to some attacks (SYN flooding)
UDP limitations
Not reliable
No data order
No congestion control
Solution: SCTP
Transport Layer Advanced Features
27
Stream Control Transport Protocol
SCTP
Stream Control Transport Protocol, RFC 2960
Initially created by SIGTRAN group for PSTN
SCTP enhancements
Multi-homed host support: redundancy & efficient flow
Multiple flows in one association: solves head-of-line
blocking TCP problem
Host A
Host B
App 1
SCTP Port = 100
App 2
SCTP Port = 200
-------------------------------OS
NI-1
NI-2
-------------------------------OS
NI
NI-3
IP3 = 10.1.61.11
IP2 = 160.15.82.20
IP Network
IP = 128.33.6.12
IP1 = 161.10.8.221
Transport Layer Advanced Features
28
SCTP features
SCTP features
Connection oriented
Concepts
• Endpoints: SCTP endpoint is a list of addresses, same
ports
• Association multiple possible IPs
• {[160.15.82.20, 161.10.8.221, 10.1.61.11:100]}:
[128.33.6.12:200]} (two endpoints, one association – Figure -)
Host A
Host B
App 1
SCTP Port = 100
App 2
SCTP Port = 200
-------------------------------OS
NI-1
NI-2
-------------------------------OS
NI
NI-3
IP3 = 10.1.61.11
IP2 = 160.15.82.20
IP Network
IP = 128.33.6.12
IP1 = 161.10.8.221
Transport Layer Advanced Features
29
SCTP header
SCTP header
First 32 bit words SCTP common header (similar to UDP
header)
Verification tag: distinguish between associations; prevent
from attacks
Chunks: building blocks
Transport Layer Advanced Features
30
SCTP header
SCTP chunks
Blocks with a 32-bit multiple length
Different types
• Control (e.g., INIT, INIT-ACK, COOKIE-ECHO, COOKIEACK – four-way handshake -)
• Data (e.g. DATA)
Transport Layer Advanced Features
31