CMPE 150 – Winter 2009 Lecture 6 January 22, 2009 P.E. Mantey.
CMPE 150 – Winter 2009
description
Transcript of CMPE 150 – Winter 2009
![Page 1: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/1.jpg)
CMPE 150 – Winter 2009
Lecture 17
March 5, 2009
P.E. Mantey
![Page 2: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/2.jpg)
CMPE 150 -- Introduction to Computer Networks
Instructor: Patrick Mantey [email protected] http://www.soe.ucsc.edu/~mantey/
Office: Engr. 2 Room 595J Office hours: Tues 3-5 PM, Mon 5-6 PM* TA: Anselm Kia [email protected] Web site:
http://www.soe.ucsc.edu/classes/cmpe150/Winter09/
Text: Tannenbaum: Computer Networks (4th edition – available in bookstore, etc. )
![Page 3: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/3.jpg)
Syllabus
![Page 4: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/4.jpg)
Text Readings
Today: Chapter 6, Section 6.6 (TCP Performance)
Tuesday March 10 Chapter 7.1 (DNS), 7.2-3 Chapter 7.4 (Multimedia)
![Page 5: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/5.jpg)
Internet Layering Level 5 -- Application Layer (rlogin, ftp, SMTP, POP3, IMAP, HTTP..) Level 4 -- Transport Layer(a.k.a Host-to-Host) (TCP, UDP) Level 3 -- Network Layer (a.k.a. Internet) (IP, ICMP, ARP) Level 2 -- (Data) Link Layer / MAC sub-layer (a.k.a. Network Interface or
Network Access Layer) Level 1 -- Physical Layer
![Page 6: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/6.jpg)
Transport Layer – Connection Oriented Service
Addressing / Access Points Connection Request /
Establishment Delayed Duplicate Packet Problem Timer management Connection points
Connection Release
![Page 7: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/7.jpg)
Today’s Agenda
Transport Layer TCP: Timers / RTT estimates Exponential backoff Wireless vs. wired Transactional TCP Performance
![Page 8: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/8.jpg)
![Page 9: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/9.jpg)
Port Detective
http://www.softpedia.com/get/Network-Tools/Network-Testing/Port-Detective.shtml
![Page 10: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/10.jpg)
![Page 11: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/11.jpg)
![Page 12: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/12.jpg)
==========================================================See also:http://www.chebucto.ns.ca/~rakerman/port-table.html
3389 Remote desktop (Windows XP) Reference: http://www.microsoft.com/windowsxp/using/networking/expert/northrup_03may16.mspx
![Page 13: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/13.jpg)
TCP Congestion Control
(a) A fast network feeding a low capacity receiver.(b) A slow network feeding a high-capacity receiver.
![Page 14: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/14.jpg)
Jacobson’s Algorithm 1
Determining the round-trip time:– TCP keeps RTT variable. – When segment sent, TCP measures how long it takes to
get ACK back (M).– RTT = alpha*RTT + (1-alpha)M.– alpha: smoothing factor; determines weight given to
previous estimate.– Typically, alpha=7/8.
![Page 15: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/15.jpg)
Jacobson’s Algorithm 2
Determining timeout value:– Measure RTT variation, or |RTT-M|.– Keeps smoothed value of cumulative variation
D=alpha*D+(1-alpha)|RTT-M|.– Alpha may or may not be the same as value used to
smooth RTT.– Timeout = RTT+4*D.
![Page 16: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/16.jpg)
Karn’s Algorithm
How to account for ACKs of retransmitted segments? – Count it for first or second transmission?– Karn proposed not to update RTT on any retransmitted
segment.– Instead RTT is doubled on each failure until segments
get through.
![Page 17: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/17.jpg)
TCP Congestion Control: Example
threshold
timeout
threshold
cwin
time
![Page 18: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/18.jpg)
Persistence Timer
• Prevents deadlock if an window update packet is lost and advertised window = 0.
• When persistence timer goes off, sender probes receiver; receiver replies with its current advertised window.
• If = 0, persistence timer is set again.
![Page 19: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/19.jpg)
Keepalive Timer
• Goes off when a connection is idle for a long time.• Causes one side to check whether the other side is still
alive.• If no answer, connection terminated.
![Page 20: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/20.jpg)
TCP Timer Management
(a) Probability density of ACK arrival times in the data link layer.
(b) Probability density of ACK arrival times for TCP.
![Page 21: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/21.jpg)
TCP Retransmission Timer
When segment sent, retransmission timer starts.– If segment ACKed, timer stops.– If time out, segment retransmitted and timer starts
again.
![Page 22: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/22.jpg)
How to set timer?
• Based on round-trip time: time between a segment is sent and ACK comes back.
• If timer is too short, unnecessary retransmissions.• If timer is too long, long retransmission delay.
![Page 23: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/23.jpg)
Jacobson’s Algorithm 1
Determining the round-trip time:– TCP keeps RTT variable. – When segment sent, TCP measures how long it takes to
get ACK back (M).– RTT = alpha*RTT + (1-alpha)M.– alpha: smoothing factor; determines weight given to
previous estimate.– Typically, alpha=7/8.
![Page 24: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/24.jpg)
Jacobson’s Algorithm 2
Determining timeout value:– Measure RTT variation, or |RTT-M|.– Keeps smoothed value of cumulative variation
D=alpha*D+(1-alpha)|RTT-M|.– Alpha may or may not be the same as value used to
smooth RTT.– Timeout = RTT+4*D.
![Page 25: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/25.jpg)
Karn’s Algorithm
How to account for ACKs of retransmitted segments? – Count it for first or second transmission?– Karn proposed not to update RTT on any retransmitted
segment.– Instead RTT is doubled on each failure until segments
get through.
![Page 26: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/26.jpg)
Persistence Timer
• Prevents deadlock if an window update packet is lost and advertised window = 0.
• When persistence timer goes off, sender probes receiver; receiver replies with its current advertised window.
• If = 0, persistence timer is set again.
![Page 27: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/27.jpg)
Keepalive Timer
• Goes off when a connection is idle for a long time.• Causes one side to check whether the other side is still
alive.• If no answer, connection terminated.
![Page 28: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/28.jpg)
Performance Issues
• Performance Problems in Computer Networks
• Network Performance Measurement
• System Design for Better Performance
• Fast TPDU Processing
• Protocols for Gigabit Networks
![Page 29: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/29.jpg)
![Page 30: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/30.jpg)
![Page 31: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/31.jpg)
![Page 32: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/32.jpg)
System Design for Better Performance
• Rules:• CPU speed is more important than network speed.• Reduce packet count to reduce software overhead.• Minimize context switches.• Minimize copying.• You can buy more bandwidth but not lower delay.• Avoiding congestion is better than recovering from it.• Avoid timeouts.
![Page 33: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/33.jpg)
Wireless TCP and UDP
Splitting a TCP connection into two connections.
![Page 34: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/34.jpg)
Wireless TCP 1
• According to layered system design principles, transport protocol should be independent of underlying technology.
• However, wireless networks invalidate this principle.– Ignoring properties of wireless medium can lead to
poor TCP performance.– Problem: TCP’s congestion control.
![Page 35: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/35.jpg)
Wireless TCP 2
• Problem: packet loss as congestion indicator.– When retransmission timer times out, sender slows
down.• Wireless links are lossy!
– Dealing with losses in this case should be re-sending lost segments asap.
![Page 36: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/36.jpg)
Indirect TCP (I-TCP)
• [Bakne and Badrinath, 1995].• Split TCP connection in 2: one from sender to base
station and the other from base station to receiver.– Base station serves as “repeater”: copies segments
between connections in both directions.– Connections are homogeneous; timeouts on 1st.
connection, slow down sender.– Problem: violates TCP’s e2e’ness.
– Example: ACKs to sender mean base station received segments, not necessarily receiver.
![Page 37: CMPE 150 – Winter 2009](https://reader035.fdocuments.in/reader035/viewer/2022081513/5681585f550346895dc5bc1e/html5/thumbnails/37.jpg)
Snoop TCP
• [Balakrishnan et al., 1995].• Does not break connection. • Modifications to base station’s network layer code.
– Snooping agent on base station observes and caches TCP segments sent to mobile host and ACKs coming back.
– If it doesn’t see an ACK for a segment or sees duplicate ACKs, it times out and retransmits.
– But source may time out anyway.