Date post: | 28-Dec-2015 |
Category: |
Documents |
Upload: | jocelyn-moody |
View: | 224 times |
Download: | 0 times |
Transport Layer Advanced Features 1
Chapter 2Transport Layer Advance Features
Some of these slides are copyrighted by:
Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith RossAddison-Wesley, April 2009.
Departamento deTecnología Electrónica
Transport Layer Advanced Features 2
Chapter 2 outline
2.1 Transport-layer services
2.2 Connection-oriented transport: TCP
2.3 Principles of congestion control
2.4 TCP congestion control
2.5 Stream Control Transmission Protocol
Transport Layer Advanced Features 3
Chapter 2 outline
2.1 Transport-layer services
2.2 Connection-oriented transport: TCP
2.3 Principles of congestion control
2.4 TCP congestion control
2.5 Stream Control Transmission Protocol
Transport Layer Advanced Features 4
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
NetworkHost A Host B
Transport Layer Advanced Features 5
Internet transport-layer protocols more than one transport protocol available to apps
Internet: TCP and UDP
FTP HTTP SMTP DNS TFTP
TCP UDP
IP
Link layer (LLC y MAC)
Physical Layer
Application
Transport
Network
Transport Layer Advanced Features 6
Internet transport-layer protocols more than one
transport protocol available to apps Internet: TCP
and UDP
TCP UDP
Connection- oriented
Non-connection- oriented
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 7
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 8
Chapter 2 outline
2.1 Transport-layer services
2.2 Connection-oriented transport: TCP
2.3 Principles of congestion control
2.4 TCP congestion control
2.5 Stream Control Transmission Protocol
Transport Layer Advanced Features 9
TCP: Overview 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
overwhelm receiver
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 bufferssocketdoor
T C Psend buffer
T C Preceive buffer
socketdoor
segm ent
applicationwrites data
applicationreads data
Transport Layer Advanced Features 10
TCP segment structure
source port # dest port #
32 bits
applicationdata
(variable length)
sequence number
acknowledgement numberReceive window
Urg data pnterchecksum
FSRPAUheadlen
notused
Options (variable length)
URG: urgent data (generally not used)
ACK: ACK #valid
PSH: push data now(generally not used)
RST, SYN, FIN:connection estab(setup, teardown
commands)
# bytes rcvr willingto accept
countingby bytes of data(not segments!)
Internetchecksum
(as in UDP)
Transport Layer Advanced Features 11
TCP seq. #’s and ACKsHost A Host B
Seq=M, SYN=1
Seq=N, ACK=M+1, SYN=1
Seq=M+1, ACK=N+1
Client starts active open
Client confirms
server open
Server is in passive open, starts connection
and confirms client open
timeConnection established
Transport Layer Advanced Features 12
Chapter 2 outline
2.1 Transport-layer services
2.2 Connection-oriented transport: TCP
2.3 Principles of congestion control
2.4 TCP congestion control
2.5 Stream Control Transmission Protocol
Transport Layer Advanced Features 13
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 14
Causes/costs of congestion
Two tx: IN = Sending rate
OUT = Receiving rate
C= Router capability
Queue theory
unlimited shared output link buffers
Host Ain : original data
Host B
out
large delays when congested
maximum achievable throughput
Transport Layer Advanced Features 15
Supposition: Tx retx lost packets Now, IN is not tx -> higher rate IN’ Congestion costs:
more work (retx) unneeded retransmissions: link carries multiple copies of pkt
Causes/costs of congestion:
unlimited shared output link buffers
Host Ain : original data
Host B
out
Transport Layer Advanced Features 16
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
finite shared output link buffers
Host Ain : original data
Host B
out
'in : original data, plus retransmitted data
Transport Layer Advanced Features 17
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 18
Approaches towards congestion control
End-end congestion control:
no explicit feedback from network
congestion inferred from end-system observed loss, delay
approach taken by TCP
Network-assisted congestion control:
routers provide feedback to end systems E.g. single bit
indicating congestion
Two broad approaches towards congestion control:
Transport Layer Advanced Features 19
Chapter 2 outline
2.1 Transport-layer services
2.2 Connection-oriented transport: TCP
2.3 Principles of congestion control
2.4 TCP congestion control
2.5 Stream Control Transmission Protocol
Transport Layer Advanced Features 20
TCP Congestion Control
sender limits transmission:
LastByteSent-LastByteAcked CongWin
How does sender perceive congestion? loss event = timeout
or 3 duplicate acks TCP sender reduces
rate (CongWin) after loss event
Host A
tim
eout
Host B
time
X
resend 2nd segment
Host A
Seq=92, 8 bytes data
ACK=100
loss
tim
eout
lost ACK scenario
Host B
XSeq=92, 8 bytes data
ACK=
100
timeResending a
segment after triple duplicate ACK
Transport Layer Advanced Features 21
TCP congestion control: additive increase, multiplicative decrease (AIMD)
8 Kbytes
16 Kbytes
24 Kbytes
time
congestionwindow
Approach: increase transmission rate (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
timecong
estio
n w
indo
w s
ize
Saw toothbehavior: probing
for bandwidth
Transport Layer Advanced Features 22
TCP Congestion Control: details
Roughly,
When connection begins, CongWin = 1 MSS Example: MSS = 500 bytes & RTT
= 200 msec initial rate = 20 kbps
three phases: slow start (SS) Congestion avoidance
(CA): e.g. AIMD Fast recovery (FR)
First two are compulsory in TCP, while the last one is recommendable
rate = CongWin
RTT Bytes/sec
Transport Layer Advanced Features 23
TCP Slow Start
available bandwidth may 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
one segment
RTT
Host B
time
two segments
four segments
Transport Layer Advanced Features 24
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
3 dup ACKs indicates network capable of delivering some segments
timeout indicates a “more alarming” congestion scenario
Philosophy:
Transport Layer Advanced Features 25
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 26
Chapter 2 outline
2.1 Transport-layer services
2.2 Connection-oriented transport: TCP
2.3 Principles of congestion control
2.4 TCP congestion control
2.5 Stream Control Transmission Protocol
Transport Layer Advanced Features 27
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 28
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
I P Network
Host A Host BApp 1
SCTP Port = 100
-------------------------------- OS
App 2SCTP Port = 200
-------------------------------- OS
NI-1 NI-3NI-2 NI
IP3 = 10.1.61.11
IP2 = 160.15.82.20
IP1 = 161.10.8.221
IP = 128.33.6.12
Transport Layer Advanced Features 29
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 -)
I P Network
Host A Host BApp 1
SCTP Port = 100
-------------------------------- OS
App 2SCTP Port = 200
-------------------------------- OS
NI-1 NI-3NI-2 NI
IP3 = 10.1.61.11
IP2 = 160.15.82.20
IP1 = 161.10.8.221
IP = 128.33.6.12
Transport Layer Advanced Features 30
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