Transport Layer 3 by grapieroo6


									Transport Layer 3

                2: Transport Layer 3   1
   TCP Flow Control
        flow control                         receiver: explicitly
         sender won’t overrun                   informs sender of
         receiver’s buffers by                  (dynamically changing)
        transmitting too much,                  amount of free buffer
                too fast                        space
                                                  RcvWindow field in
RcvBuffer = size or TCP Receive Buffer              TCP segment
RcvWindow = amount of spare room in Buffer   sender: keeps the amount
                                                of transmitted,
                                                unACKed data less than
                                                most recently received

             receiver buffering
                                                    2: Transport Layer 3   2
TCP Round Trip Time and Timeout
Q: how to set TCP           Q: how to estimate RTT?
  timeout value?             SampleRTT: measured time from
 longer than RTT             segment transmission until ACK
     note: RTT will vary
                                ignore retransmissions,
 too short: premature
                                 cumulatively ACKed segments
                             SampleRTT will vary, want
    unnecessary
                              estimated RTT “smoother”
                                use several recent
 too long: slow reaction
                                 measurements, not just
  to segment loss
                                 current SampleRTT

                                           2: Transport Layer 3   3
TCP Round Trip Time and Timeout
EstimatedRTT = (1-x)*EstimatedRTT + x*SampleRTT
      Exponential weighted moving average
      influence of given sample decreases exponentially fast
      typical value of x: 0.1

Setting the timeout
 EstimtedRTT plus “safety margin”
 large variation in EstimatedRTT -> larger safety margin

       Timeout = EstimatedRTT + 4*Deviation
    Deviation = (1-x)*Deviation +

                                             2: Transport Layer 3   4
TCP Connection Management

Recall: TCP sender, receiver      Three way handshake:
  establish “connection”          Step 1: client end system sends TCP
                                     SYN control segment to server
  before exchanging data
                                       specifies initial seq #
  segments                              (client_isn)
 initialize TCP variables:
                                  Step 2: server end system receives
    seq. #s                         SYN, replies with SYNACK control
    buffers, flow control
                                          ACKs received SYN
      info (e.g. RcvWindow)
                                       allocates buffers
 client: connection initiator         specifies server-> receiver
    Socket clientSocket = new             initial seq. # (server_isn)
     Socket("hostname","port      Step 3: client allocates buffers and
                                     variables upon receiving SYNACK
    number");                            SYN=0
   server: contacted by client          Seq = client_isn + 1
                                         Ack = server_isn +1
    Socket connectionSocket =
                                                     2: Transport Layer 3   5
TCP Connection Management (cont.)

Closing a connection:                         client           server

client closes socket:

Step 1: client end system                                                close
  sends TCP FIN control
  segment to server

Step 2: server receives
  FIN, replies with ACK.         timed wait
  Closes connection, sends
  FIN.                       closed

                                                       2: Transport Layer 3      6
TCP Connection Management (cont.)

Step 3: client receives FIN,                    client           server
  replies with ACK.             closing
      Enters “timed wait” -
       will respond with ACK
       to received FINs
Step 4: server, receives
  ACK. Connection closed.

                                   timed wait
Note: with small
  modification, can handly
  simultaneous FINs.

                                                         2: Transport Layer 3        7
TCP Connection Management (cont)

                              TCP server

TCP client

                        2: Transport Layer 3   8
Principles of Congestion Control

 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)
 a top-10 problem!

                                       2: Transport Layer 3   9
 Causes/costs of congestion: scenario 1
 two senders, two
 one router,
  infinite buffers
 no retransmission

                              large delays
                               when congested
                              maximum
                              2: Transport Layer 3   10
 Causes/costs of congestion: scenario 2

 one router,   finite buffers
 sender retransmission of lost packet

                                         2: Transport Layer 3   11

To top