3: Transport Layer Flashcards
what is the role of the transport layer?
to provide logical communication between app processes running on different hosts
transport protocols run in end systems - breaks app messages into segments, passes them down
how does role of the T layer compare to the role of the N layer?
network layer: logical communication between hosts transport layer: logical communication between processes
12 kids in Anne’s house sending letters to 12 kids in Bill’s house: • hosts = houses • processes = kids • app messages = letters in envelopes • transport protocol = Anne and Bill who demux to inhouse siblings • network-layer protocol = postal service
what is Multiplexing/demultiplexing?
multiplexing at sender: handle data from multiple sockets, add transport header (later used for demultiplexing)
demultiplexing at receiver: use header info to deliver received segments to correct socket host uses IP addresses & port numbers to direct segment to appropriate socket
extending the host-to-host delivery service provided by the network layer to a process-to-process delivery service for applications, basically
how do connection oriented and connectionless mulitplexing differ?
connectionless: socket is IDd by dest port and ip address, so two packets can go to the same process
connection: socket IDd by 4 tuple of source ip port dest ip port, and all as used to demux
what applications does UDP have? why do we have UDP?
streaming multimedia apps (loss tolerant, rate sensitive) DNS SNMP
no connection establishment (which can add delay) simple: no connection state at sender, receiver small header size no congestion control: UDP can blast away as fast as desired
describe the UDP header
64 bits, 16 bits (2bytes) each: source port dest port length checksum
describe the UDP checksum
goal is to detect bit errors e.g. flipped bits
sender treats the segment as a sequence of 16bit ints. the checksum is the addition of the segment’s contents, and puts the one’s compliment (inversion) of the number into the UDP checksum field. overflow wraps around
receiver computes the checksum and compares it to checksum field.
errors are still possible though
what is a pipelined protocol? give two forms of pipelines
pipelining: sender allows multiple, “in-flight”, yet-to-beacknowledged pkts
• range of sequence numbers must be increased
• buffering at sender and/or receiver
go-Back-N, selective
repeat
Go-back-N: • sender can have up to N unacked packets in pipeline • receiver only sends cumulative ack • doesn’t ack packet if there’ s a gap • sender has timer for oldest unacked packet • when timer expires, retransmit all unacked packets
Selective Repeat: • sender can have up to N unack’ed packets in pipeline • rcvr sends individual ack for each packet • sender maintains timer for each unacked packet • when timer expires, retransmit only that unacked packet
what features does TCP boast?
• point-to-point: • one sender, one receiver • reliable, in-order byte steam: • no “message boundaries” • pipelined: • TCP congestion and flow control set window size full duplex data: • bi-directional data flow in same connection • MSS: maximum segment size connection-oriented: • handshaking (exchange of control msgs) inits sender, receiver state before data exchange flow controlled: • sender will not overwhelm receiver
how does TCP deal with out of order segments?
It provides sequence numbers, but TCP spec doesn’t define how they are handled. This is up to the implementor.
how is TCP timeout calculated?
EstimatedRTT = (1 - a) * EstimatedRTT + a*SampleRTT
a typically is 0.125
then the timeout value is the EstimatedRTT plus safety margin. uses an exponential weighted moving average
DevRTT = (1 - B)DevRTT + B|SampleRTT-EstimatedRTT|
recall that |x| is the absolute value of x
typically B = 0.25
recall that a and B are actually alpha and beta
then
timeoutinterval = estimatedRTT + 4*devRTT
this 4 x Dev is the safety margin
does TCP use NACKs? what do?
no
it instead reACKS the previously received packet.
if the sender receives 3 ACKS for the same data, it resends the next smallest sequence number packet before its timeout occurs: fast retransmit
describe TCP flow control
receiver controls sender, so
sender won’t overflow
receiver’s buffer by
transmitting too much, too fast
the sender limits the amount of unacked “in flight” data to the receive window value: a value that the receiver “advertises” declaring how much free buffer space it has
this stops buffer overflow
what are the problems with a 2 way handshake? describe some failure scenarios
how does 3 way handshake work? how opened how closed?
if the client sends a request, and the ack for the request isnt received quickly, they may send another. then, if the ack for the 1st comes through, and then completes, the server may receive the 2nd request later and be left with a half open connection (no client)
client makes connection request
server acks request
client acks the ack
C and S both send a FINbit, and an ACK for that. doesnt matter the order
how does TCP congestion control work?
additive increase multiplicative decrease aka sawtooth probing
the sender increases transmission rate by 1 MSS (max segment size) every RTT until loss is detected
then cuts transmission rate in half after loss