Chapter 3/Lecture 3 Transport Layer Flashcards
What’s UDP?
Simple protocol for transport of datagrams. No connection establishment, flow control or other frills. Best effort service, as UDP segments may be lost or delivered out of order. Used for streaming of media, DNS and other. Reliability must be implemented in application layer.
Describe the UDP headers.
“source port #”(16) “destination port #”(16)
“length”(16) “checksum”(16)
payload
How is the checksum computed, and what are some alternatives?
Originally, it was computed with xor-ing two and two bytes on server side, then placing the 1’s complement of the sum in checksum field. Reciever does the same, including the checksum, and should arrive at all 1’s. Can also do bit addition instead of xor.
Alternatives(more modern methods) are CRC(Cyclic Redundancy check) and FCS(Frame Check Sequence on Ethernet).
What’s a simple form of flow control?
Stop-and-wait. Send one packet, keep it in a buffer, and keep it until ack is recieved, or timeout is reached. When ack is received, pop sender window, send new packet and place new packet in sender window.
What’s the point of timeout? Who handles the timeout, and why?
Timeout handles lost and delayed packets, since these cases means that both sender and receiver will wait, which again will cause a deadlock if both is waiting. The sender must handle timeout, because receiver doesn’t know when new packets will arrive, and the sender knows approximately when an ack is due.
What’s the difference between data packet and ack packet loss? Does sequence number solve any other problems?
On both, sender needs to send the data packet again. On data packet loss, receiver doesn’t notice any difference, while ack packet loss leads to the necessity of sequence number in a packet. The sequence number means that the receiver can decide if it’s a duplicate packet of the last one received(on an ack loss), or a new packet. Receiver also discards duplicate packets, but must still send acks to stop the sender from re-transmitting over and over.
Thus, sequence number solves the problem of ack loss, but also packet delay.
How is corrupted bits handled?
Repeat ack for previous packet. Ex: Send packet #3 Recv ack #3 Send packet #4 Recv ack #3 Send packet #4 Recv ack #4
What are pipelined protocols?
They are protocols that improves utilization over the stop-and-go protocol. Mainly two protocols, Go-Back-N(GBN) and Selective Repeat(SR).
GBN: Sender sends N packets before waiting for an ack. The ack sent is cumulative for the packets received since last ack. Timeout is kept for oldest unacked packet, and if time runs out, all packets are sent.
SR: Receiver sends ack for each packet, and timeout is kept for each packet. Sliding window doesn’t slide until earliest packet is acked.
How is flow control fixed?
Receiver advertises free buffer space by including rwnd value in TCP header. Sender must respect this.
How is congestion control fixed? What is slow start? What’s the difference between TCP Reno and TCP Tahoe?
Varying congestion window(cwnd). Additive increase(add 1 MSS(Maximum segment size) every RTT) until loss detected, then multiplicative decrease(cut cwnd in half).
Slow start means that the connection starts with a small cwnd, then increase it exponentially until loss is encountered.
TCP Tahoe goes back to slow start when loss is encountered, and linearly increases when treshold is met, while TCP Reno halfs cwnd then increases it linearly. Treshold is set to half of cwnd when loss was encountered.