CSCE 515: Computer Network Programming - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

CSCE 515: Computer Network Programming

Description:

Problems similar to those in midterm exam ... TCP SACK Permitted and SACK Option ... some segment is lost, can use SACK option to acknowledge received bytes to avoid ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 20
Provided by: huan75
Learn more at: http://www.cse.sc.edu
Category:

less

Transcript and Presenter's Notes

Title: CSCE 515: Computer Network Programming


1
CSCE 515Computer Network Programming
  • Chin-Tser Huang
  • huangct_at_cse.sc.edu
  • University of South Carolina

2
Midterm Exam Grade
  • Before adjustment
  • Graduate Avg 11.56, Highest 18
  • Undergrad Avg 9.5, Highest 14
  • After adjustment
  • Graduate 2 to everyone
  • Undergrad 4 to everyone

3
Final Exam Guide
  • Problems similar to those in midterm exam
  • Might have one more programming problem that asks
    you to debug a piece of code
  • In each section, the one who makes most progress
    in final exam compared to midterm exam grade will
    get 3 bonus points!

4
Bulk Data Flow
  • With bulk of data to send, it is desired that
    sender is allowed to transmit multiple packets
    before it stops and waits for acknowledgment
  • Use sliding window protocol to control data flow

5
Sliding Window Protocol
  • Receiver advertises a window to notify sender how
    much data it can send
  • Window closes as left edge moves to right
  • When data is sent and acknowledged
  • Window opens as right edge moves to right
  • When receiving process reads acknowledged data
    and freeing up space in TCP receive buffer
  • Window shrinks as right edge moves to left
    (discouraged)

6
Sliding Window
offered window
(advertised by receiver)
usable window
1
2
3
4
5
6
7
8
9
10
11

cant send until
sent, not ACKed
window moves
sent and
acknowledged
can send ASAP
7
TCP Options
  • A variable-length list of optional information
    for TCP segments
  • Some options defined in TCP include
  • End of option list
  • No operation
  • Maximum segment size
  • Window scale factor
  • Timestamp
  • Selective acknowledgment

8
TCP SACK Permitted and SACK Option
  • When establishing a connection, either end can
    use SACK permitted option to let the other end
    know that it can accept SACK option
  • When some segment is lost, can use SACK option to
    acknowledge received bytes to avoid redundant
    retransmission

9
TCP PUSH Flag
  • Sender uses PUSH flag to notify receiver to pass
    all data it has to the receiving process
  • Some cases where PUSH is set
  • Send buffer is emptied by sending this segment
  • This segment is final data segment

10
Urgent Mode
  • One end notifies the other end that some urgent
    data is in data stream
  • What action to take is up to receiver
  • Two fields in TCP header needs to be set
  • URG flag set to 1
  • Urgent pointer set to a positive offset that is
    added to ISN to get seq of last byte of urgent
    data

11
TCP Timeout and Retransmission
  • TCP handles lost data segments and
    acknowledgments by setting a timeout when it
    sends data
  • If data isnt acknowledged when timeout expires,
    TCP retransmits data
  • Two implementation issues to consider
  • How to determine timeout interval
  • How frequently to retransmit data

12
Round-Trip Time Measurement
  • RTT changes over time due to route changes and
    network traffic changes
  • TCP should track RTT changes and modify its
    timeout accordingly
  • R ? ?R(1-?)M, where ?0.9
  • RTO R?, where ?2

13
Improved RTT Measurement
  • Previous approach cant keep up with wide
    fluctuations in RTT and may cause unnecessary
    retransmissions
  • Err M-A
  • A ? AgErr, where g0.125
  • D ? Dh(Err-D), where h0.25
  • RTO A4D

14
Karns Algorithm
  • When receiving an ACK after retransmission, TCP
    cant tell this ACK is for original transmission
    or for retransmission
  • Hence cant update RTT estimators using received
    ACK when a timeout and retransmission occur

15
TCP Congestion Control
  • Assume packet loss is largely due to congestion
  • Two indications of packet loss timeout and
    receipt of duplicate ACKs
  • When congestion occurs, slow down transmission
    rate, and gradually come back if congestion is
    relieved
  • Use two algorithms
  • Slow start
  • Congestion avoidance

16
Slow Start
  • The rate at which new packets should be injected
    into network is the rate at which acknowledgments
    are returned
  • Use a congestion window (cwnd) in senders TCP
  • Initialized to one segment when new connection is
    established
  • Increased by one segment each time an ACK is
    received until packet loss occurs exponential
    increase
  • Congestion window is flow control by sender while
    advertised window is flow control by receiver

17
Congestion Avoidance
  • Use a slow start threshold (ssthresh)
  • When receiving 3 dup ACKs, cwnd is cut in half,
    and window grows linearly
  • 3 dup ACKs indicates network capable of
    delivering some segments
  • When timeout occurs, cwnd instead set to 1 MSS,
    and window first grows exponentially until reach
    ssthresh, then grows linearly
  • Timeout before 3 dup ACKs implies severe
    congestion

18
Congestion Control Algorithm
  • When cwnd is below ssthresh, sender in slow-start
    phase, window grows exponentially
  • When cwnd is above ssthresh, sender is in
    congestion-avoidance phase, window grows linearly
  • When a triple duplicate ACK occurs, ssthresh set
    to cwnd/2 and cwnd set to ssthresh
  • When timeout occurs, ssthresh set to cwnd/2 and
    cwnd is set to 1 MSS

19
Next Class
  • TCP persist and keepalive timers
  • Other TCP options
  • Read TI Ch. 22, 23, 24
Write a Comment
User Comments (0)
About PowerShow.com