Network Protocols: Design and Analysis - PowerPoint PPT Presentation

About This Presentation
Title:

Network Protocols: Design and Analysis

Description:

time-wait. flow control. congestion control practice and theory. loss recovery. security ... window is the minimum of the two. Polly Huang, NTU EE. 16. Flow ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 31
Provided by: poll169
Category:

less

Transcript and Presenter's Notes

Title: Network Protocols: Design and Analysis


1
Network Protocols Design and Analysis
  • Polly Huang
  • EE NTU
  • http//cc.ee.ntu.edu.tw/phuang
  • phuang_at_cc.ee.ntu.edu.tw

2
TCP Overview
3
What does TCP Provide?
  • Connection establishment
  • Connectionless communication
  • Congestion avoidance
  • Differentiated services
  • Duplicate packet detection
  • Flow control
  • loss recovery
  • message or record boundaries
  • ordered data delivery to the application
  • out-of-order data delivery to the application
  • quality-of-service
  • urgent data indication

4
Where and Why is TCP Used?
  • where anywhere reliable communication is needed
  • file transfer/ftp, http, p2p e-mail smpt remote
    login/telnet db transfer/dns some real audio
  • why?
  • connection orientedcan be easier to manage (ex.
    firewall config)
  • has the right features (congestion ctl, etc.)
  • widely deployed gt interoperability, understood,
    exhaustively studied, pretty good implementations
  • doing your own protocol is a lot of work

5
TCP in a Nutshell
  • abstraction
  • reliable
  • ordered
  • point-to-point
  • byte-stream
  • mechanisms
  • window-based flow control
  • sequence numbers/ordering, 3-way handshake
  • reliability (ACK, retx policies)
  • congestion control
  • RTT estimation

6
TCP Header
Source port
Destination port
Sequence number
Flags
SYN FIN RESET PUSH URG ACK
Acknowledgement
Advertised window
Hdr len
Flags
0
Checksum
Urgent pointer
Options (variable)
Data
7
Agenda
  • connection setup and teardown
  • initial sequence number selection
  • passive/active open
  • time-wait
  • flow control
  • congestion control practice and theory
  • loss recovery
  • security
  • performance

8
Three-Way Handshake
  • why?
  • passes buffer sizes
  • connection startup
  • set up initial seq number
  • options
  • is someone there?

9
Connection Setup States
passive vs. active (and both active!)
(error recovery is not on this figure)
10
Initial Sequence Number Selection
  • Why not just start at 0?
  • want to avoid accidental replay of old packets
    (tcp connection src dest ip address port)
  • Approach
  • randomly chosen
  • OR semi-sequentally

11
Tear-down Packet Exchange
Sender
Receiver
FIN
FIN-ACK
Data write
Data ack
FIN
FIN-ACK
12
Connection Tear-down
13
Connection Tear-down
  • either side can close
  • or one side can close and the other stay open
  • one side must maintain state (TIME_WAIT) for 2
    minutes, why?
  • suppress old packets

14
Agenda
  • connection setup and teardown
  • flow control
  • setting window sizes
  • Nagles algorithm
  • silly window syndrome
  • protection against wrap-around
  • congestion control practice and theory
  • loss recovery
  • security
  • performance

15
Flow Control
  • Window sizes are passed in every packet
  • beware implementations often have separate TCP
    and socket buffers
  • effective window is the minimum of the two

16
Flow Control
  • Why?
  • avoid overrunning receiver
  • Solutions
  • TCP have a sliding window w/how much data can be
    outstanding
  • (OR could have a rate)

17
Window Flow Control Sender
effective window
advertised window (from receiver)
Sent but not acked
Not yet sent
Sequence numbers
send buffer
last byte sent
last byte ACKed
18
Window Flow Control Receiver
Receive buffer (possible window)
ACKed but not delivered to user
recvd but not ACKed
Sequence numbers
missing data
advertised window
19
Window Advancement Issues
  • What if window is full?
  • sender sends full window, but ACK is lost
  • sender sends 1-byte probes (solicits new ACK)
  • Silly window syndrome (RFC-813)
  • receiver dribbles out small window advances
  • Silly Window Avoidance delay ACKing (receiver)
    or sending small segments (sender)
  • Sender who dribbles out data (like telnet)
  • Nagles algorithm (RFC-896) send 1st partial
    packet, but not more until its ACKed or you have
    a full packet

20
Problem Rapid Wrap-Around
  • Wraparound time vs. Link speed
  • 1.5Mbps 6.4 hours
  • 10Mbps 57 minutes
  • 45Mbps 13 minutes
  • 100Mbps 6 minutes
  • 622Mbps 55 seconds
  • 1.2Gbps 28 seconds
  • Protection Against Wrapped Sequences (PAWS
    extension) Use timestamp to distinguish sequence
    number wraparound

21
Agenda
  • connection setup and teardown
  • flow control
  • congestion control theory
  • what and why
  • how
  • congestion control practice
  • loss recovery
  • security
  • performance

22
Congestion Collapse
  • If both sources send full speed, the router is
    completely overwhelmed
  • congestion collapse senders lose data from
    congestion and they resend, causing more
    congestion (can be self-reinforcing)
  • has been observed many times

23
Congestion Control vs. Flow Control
  • What does flow control do?
  • avoids overrunning the receiver
  • What does congestion control do?
  • avoid overrunning router buffers avoid
    saturating the network
  • What mechanism do they use?
  • both use windows (flow control) wnd, (congestion
    control) cwnd actual window used is the MIN of
    wnd and cwnd

24
Congestion Control Goals
  • control network buffer usage
  • avoid congestion collapse
  • want to fairly allocate network resources
  • make good use of network bandwidth power

25
Power and Load
knee
  • throughput and delay change due to load
  • want to optimize power

(From Ramakrishnan90a)
26
Fairness
  • Also want fairness
  • should treat all users equally
  • but its not so easy
  • what is a user? host, flow, person?
  • if n flows through a link, each should get n-1
    of the bandwidth
  • RJs fairness index (Sxi)2/n(Sxi2)
  • but what if flows have different needs?
    different RTTs?

27
Congestion Control Design
  • Avoidance or control? (RJ)
  • avoidance keeps system at knee of curve
  • requires some congestion signal
  • control responds to loss after the fact
  • TCP
  • Which is TCP?
  • congestion control (according to RJs
    definition)
  • How does TCP do it?
  • slow start, congestion avoidance, exponential
    backoff

28
How to Adjust Window?
  • When to increase/decrease?
  • A control theory problem
  • observe network
  • reduce window if congested
  • increase window if not congested
  • Constraints
  • efficency
  • fairness
  • stability (too much oscillation is bad)
  • out-of-date info
  • RTT is fundamental limit to how quickly you can
    react

29
Linear Control
  • Xi(t 1) ai(t,f) bi(t,f) Xi(t)
  • Formulation allows for the feedback signal
  • to change additively ai(t)
  • to change multiplicatively bi(t)
  • can consider feedback
  • What does TCP do and why?
  • AIMD additive increase, multiplicative decrease
  • Types of feedback in Internet?
  • packet loss or ECN (explicit congestion
    notification) or in RJ binary feedback DECBit

30
Agenda
  • connection setup and teardown
  • flow control
  • congestion control theory
  • congestion control practice (in TCP)
  • loss recovery
  • security
  • performance
  • gt next sets of slides
Write a Comment
User Comments (0)
About PowerShow.com