MOD 3 - Transport Layer Flashcards
What is window size, what is the formula?
Window size = #bytes a receiver is willing to accept
R = link size/bandwidth
RTT = round trip time, 2 way propagation
segment size = bits per segment
Window size = (R x RTT) / segment size
Avg Window size = ¾ (Window size)
What is the transport layer responsible for? What is the network layer responsible for?
Transport layer = logical communication between
processes (of applications) / process-process data transfer
Network layer = logical communication between hosts / routing of datagrams from source to dest
EXAMPLE
▪ hosts = houses
▪ processes = kids
▪ app messages = letters in
envelopes
▪ transport protocol = Ann and Bill
who deliver to post office the
letters of in-house siblings
▪ network-layer protocol = postal
service
What are the 2 transport layer protocols and their descriptions? Header size?
TCP
- Establishes connection/ 3 way handshake before exchanging data
- reliable data transfer, flow control, congestion control, in-order delivery
- header = 20 bytes
UDP
- connectionless, no handshaking
- unreliable, unordered delivery, no flow control or congestion control
- better for shorter/faster services (ex: DNS, streaming)
- header = 8 bytes
How are TCP and UDP sockets identified?
TCP socket :
- source IP
- source port
- dest IP
- dest port
(need source info for handshake!)
UDP socket :
- dest IP
- dest port
(only need dest info since no handshake)
Describe a TCP and UDP header.
UDP Header
- length = 8 bytes
- contains:
- source & dest port
- length
- checksum
TCP Header
- length = 20 bytes
- contains:
- source & dest port
- Sequence number
- ACK number
- data offset, reserved, control flags,…
- rwnd
- checksum
- options
what is a checksum and how do you calculate it? how does it detect errors
goal = to detect errors (flipped bits) in transmitted segment
process:
sender = adds segment content (sum then 1’s complement) and puts val in checksum field
receiver = computes checksum of received segment. If computed checksum = checksum field, NO errors, else, YES errors.
checksum can detect 1 bit errors, but not 2 bit errors.
How do we recover from errors detect with the checksum?
Receiver sends a NAK to the sender, which explicitly tells sender
that packet had errors.
rdt1-3 (didn’t really cover this)
Describe the TCP 3 way handshake.
1) CLIENT, choose initial sequence number x, send TCP SYN msg
2) SERVER, choose initial sequence number y, send TCP SYNACK msg (acking SYN)
3) CLIENT, receive SYNACK(x) indicating server is live. send ACK for SYNACK.
4) SERVER, receive ACK(y) indicating client is live
How do you close a TCP connection?
- client & server each close their side of connection by setting flag FIN bit = 1
- client & server respond to FIN with ACK,
what is congestion? how does TCP keep track of this?
-“too many sources sending too much
data too fast for network to handle”
-different from flow control
-AIMD (additive increase multiplicative decrease), sender keeps an additional variable cwnd (congestion window size)
- (AI) increase cwnd by 1 MSS every RTT until loss detected
- (MD) cut cwnd in half after loss (3 dupe acks)
What is TCP slow start?
- used for TCP congestion control
- increase cwnd rate exponentially until first loss event
/ gradually increase the amount of data sent across a network until it determines an appropriate amount that the network can handle without causing congestion
When do we switch from slow start to CA (congestion avoidance)?
- when cwnd gets to
a threshold value
ssthresh - on loss event, ssthresh is set
to 1/2 of cwnd just before loss
event
What indicates that the network is congested?
Timeout
Explain TCP Reno and TCP Tahoe
TCP RENO
* dup ACKs indicate network
capable of delivering some
segments
* cwnd is cut in half window then
grows linearly
TCP Tahoe
▪ always sets cwnd to 1 (timeout
or 3 duplicate acks)
What is window size and its formula?
max amount of unACKed data that can be sent in a TCP connection before receiving an ACK back.
R=link size / bandwidth
RTT=roundtrip time
Window size = (R x RTT) / segment size
Avg Window size = ¾ (Window size)