information network i tcp 2/2

28
Copyright(C)2012 Youki Kadobayashi. All rights reserved. 1 Information Network I TCP 2/2 Youki Kadobayashi NAIST

Upload: others

Post on 02-May-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 1

Information Network I TCP 2/2

Youki Kadobayashi NAIST

Page 2: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved.

Transport protocol challenges

n  With a number of unknown parameters: ¨ Number of active communications ¨ Bottleneck bandwidth ¨ Error rate

n  how can we accommodate as much communications as possible, without collapsing network itself?

2

1 1

n k

Key ideas: probing, estimation, self-policing, macro-level stability

Page 3: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 3

Flow control and congestion control: Competition and Arbitration of Network Resource

n  Flow control ¨ Absorb difference of transmission rate ¨ Recovery from sequence error ¨ Recovery from duplication, packets drop and

bit error n  Congestion control

¨ Sharing the bandwidth while suppressing the congestion

¨ Fair sharing of bandwidth

Page 4: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 4

Flow Control

n  Stop-and-Wait n  Go Back n

n  Various methods exist ¨ Bandwidth advertisement from the network ¨ Bandwidth estimation at individual hosts

¨ ARQ (Adaptive Repeat reQuest)

Page 5: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 5

Stop-and-Wait

0 1 2 3

ACK 0 ACK 1 ACK 2 ACK 3

Node A

Node B

Page 6: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 6

Go Back n

0 1 2 3

Node A

Node B

Page 7: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 7

Characteristics of TCP Flow Control

n  End to end ¨ No global assignment of resource ¨ Estimate available bandwidth at individual hosts ¨ Routers do not explicitly allocate resource

n  Implicit signaling through packet drops

n  Scalable ¨ Host-based autonomous method has better

scalability, because it doesn’t need state management inside network.

n  Autonomous à Less state management à Scalable

Page 8: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 8

Questions?

Page 9: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 9

TCP: key characteristics

n  Very simple algorithm ¨ Macroscopic self-stabilization

n  TCP doesn't assume the presence of greedy nodes. ¨ Elimination of global control system ¨ Reject the idea of intermediate policing system

n  Modest performance across almost all data-links ¨ As opposed to optimal performance in specific

condition

n  Stepwise improvements over 30 years

Page 10: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 10

Flow Control on TCP

n  Control available bandwidth ¨ Sliding window

n  Using sequence number, not packet number ¨ Window size

n  Control transmission interval of packets ¨ ACK clocking

n  Miscellaneous ¨ Error detection with TCP checksum ¨ Packet drop detection with duplicate ACK, timeout

Page 11: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 11

ACK clocking

n  Demonstration by nam

n  ACK clocking n  Duplicate ACK

Page 12: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 12

Sliding window

Packets in flight

Sent but unacknowledged Sent and acknowledged

User data arrives

Sender

Receiver

Nara Institute of Science and Technology

Nara Insti

10

16

Window size Sequence number

Page 13: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 13

Questions?

Page 14: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 14

Congestion Control on TCP

n  Fair-share model: fair distribution of bandwidth End to end

n  Increase and decrease of window size ¨ additive increase ¨ multiplicative decrease

¨  AIMD is known to be self-stabilizing (R. Jain, et al., “Analysis of the increase and decrease algorithms for congestion avoidance in computer networks”, 1989)

n  Switch increasing strategy of window size n  Detect congestion through packet drops

Page 15: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 15

Fair-share

n  Demo by nam

Page 16: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 16

Increasing Window size

n  TCP switches increasing strategy of congestion window (cwnd) by slow start threshold (ssthresh)

(Outline of the algorithm) n  On receiving an ACK:

if (cwnd < ssthresh) { /* slow start: exponential increase */ cwnd += 1; } else { /* congestion avoidance: additive increase */ cwnd += 1 / cwnd; }

Page 17: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 17

Increasing Window size

n  Slow start ¨ exponential increase

n  Congestion avoidance ¨ additive increase

n  Effectiveness: see V. Jacobson, “Congestion Avoidance and Control”, SIGCOMM’88.

Source: TCP/IP Illustrated, Vol.1

Page 18: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 18

Decreasing Window size

(Outline of algorithm ) n  On detecting packet drop:

ssthresh = cwnd / 2; if (timeout) { cwnd = 1; }

Source: TCP/IP Illustrated, Vol.1

Page 19: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 19

Questions?

Page 20: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 20

Packet drop

n  Detection with 2 methods: ¨ Duplicate ACK ¨ Retransmission Time Out (RTO)

n  How do I judge the time out? → RTO ~ RTT Estimator

Page 21: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 21

RTO Calculation

n  Err = M – A A <- A + gErr D <- D + h(|Err| - D) RTO = A + 4D

¨ A: smoothed RTT ¨ D: smoothed mean deviation ¨ g: gain for the average (1/8) ¨ h: gain for the deviation (1/4)

Source: TCP/IP Illustrated, Vol.1

Page 22: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved.

RTO calculation

22

Source: A Quick Tour Around TCP, http://web.eecs.utk.edu/~dunigan/tcptour/

Page 23: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 23

Loss sensitivity

n  Demo by nam

n  Timeout n  Congestion avoidance

Page 24: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 24

More topics on TCP

n  Fast retransmit n  Fast recovery (RFC3782) n  Selective Acknowledgment (SACK) (RFC3517) n  TCP Friendly Rate Control (TFRC) (RFC3448) n  Explicit Congestion Notification (ECN) (RFC3168)

n  Interaction with RED n  TCP extensions for wireless links n  ...

Page 25: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 25

TCP enhancements

n  Improvements of algorithm: ¨ Reno ¨ NewReno ¨ SACK ¨  ...

n  2 types of TCP extensions exist: n  Optimal performance in specific condition

¨ → many academic papers, but you don’t need to pay attention to these papers

n  Improved performance in various conditions ¨ → standardization in IETF

n  Vendor-specific tweaks may result in degradation

Page 26: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 26

Questions?

Page 27: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved. 27

Conclusion

n  Flow Control ¨ Stop-and-Wait ¨ Go back n

n  Flown Control on TCP ¨ Sliding window

n  Congestion Control on TCP ¨ Slow start ¨ Congestion avoidance

Page 28: Information Network I TCP 2/2

Copyright(C)2012 Youki Kadobayashi. All rights reserved.

Assignment

n  With the provided VM image, pick a sluggish website and analyze its root cause with tcpdump or wireshark.

n  Due: 5/23 17:00 JST n  Post to: A3F Internet Engineering Lab