transport layer Flashcards
goal of the transport layer
provide logical communication between application processes running on different hosts
what happens on sender side
breaks app messages into segments and passes to network layer
what happens on receiver side
reassembles segmnets into messages and passes to app layer
explain multiplexing at sender
handle data from multiple sockets and add transport header
explain what is meant by demultiplexing at receiver
use header to deliver received segments to correct socket
how does demultiplexing work?
- host receives IP datagram - each has src ip and dest ip address, each contains trans layer segments, each segment contains dest port no
- host uses IP address and port no to direct segment to appropriate socket
Explain how connectionless demultiplexing happens
- socket created at local port
- when host receives UDP segment: checks dest port, directs udp segment to socket with same port n #
- IP datagrams with same dest port # directed to same sockets
Explain how connection-orientated demux happens
TCP socket identified by-tuple: src ip & port, dest ip and & port
- receiver uses all 4 values to direct to correct socket
server hose may support many simultaneous TCP sockets
TCP allows full duplex data - what does this mean
Bi-directional data flow in same connection and MSS (max segment size)
what are sequence numbers
byte stream number of first byte in segments data
what are acknowledgements
seq# of next byte expected from other side - cumulative ack
will 2 way handshake always work?
variable delays retransmitted messages message loss message reordering cant see other side
how can a two-way handshake fail?
1.) retransmitted connection request is delayed, client disconnects because it ack for inital message, server receives retransmitted connection request - establishes another connection with the client (who is disconnected)
Explain a three-way hand shake
c - choose initializing seq number x - send tcp syn messahe to establish connection (synbit = 1, seq = x)
s - choose initializing seq # = y, send synAck to client
- synbit = 1, seq = y, ackBit = 1, Ack# = x+1
c - send ack for synack to server (may also contain data)
- Ackbit = 1, Ack# = y+1
Explain how closing a tcp connection happens
c - close client socket (can no longer send but can still receive) - FinBit = 1, seq = x
s - can still send data to client - Ack = 1, Ack# = x+1 - client waits for server to close
s - Finbit - 1 seq = y – can now no longer send data but can still receive
c - acknowledges server close - Ackbit = 1, ack# = y+1
how do we disambiguate the rtt for tcp
use time stamps and echo
What to consider when setting the TCP timeout value?
Longer than RTT
if too short - premature timeout - unecessary retransmissions
too long - slow reaction to segment loss
Estimated RTT formula
(1-a)estimatedRTT + asampleRTT
a is usually 0.125
what is the timeout interval
estimatedRTT + safety margin … large variation in RTT = larger safety margin
Timeout interval calculation
Deviation = (1-b)average of previous devs + b|samplertt-estimatedrtt|, typically b = 0.25
Timeout interval = EstimatedRTT + 4*DevRTT
Define flow control
receiver controls sender so that sender doesn’t overflow receiver’s buffer by transmitting too much too fast
Explain how flow control works
receiver advertises free buffer space by including a receiver window (rwnd) value in tcp header of receiver-sender segments
sender limits amount of unacked data to receivers rwnd value
guarantees that buffer will not overflow
what is congestion
too many sources sending too much data too fast for network to handle
manifestations of congestion
lost packets - buffer overflow at routers
long delays - queuing in router buffers
What are two broad approaches to congestion control?
end-to-end congestion control
network assisted congestion control
Explain network assisted cong control
routers provide feedback to end systems
single bit indicating congestion
explicit rate for sender to send at
Explain end-to-end cong control
no explicit feedback from network
congestion inferred from end-system observed loss/delay
approach taken by tcp
What does TCP use for cong control?
additive increase multiplicative decrease
explain additive increase and multiplicative decrease
sender increases transmission rate (window size) probing for usable bandwith until loss occurs
- add increase - increase sending window by 1 mss every RTT until loss
- mult decrease - decrease sending window (cwnd) by half everyloss
TCP sending rate formula
rate = cwnd/rtt bytes per second (sent and not acked cannot exceed cwnd)