Transport layer Flashcards
Where do transport protocols run?
End systems only
send side
breaks application messages into segments, pass them to network layer
receive side
reassembles segments into messages, passes to application layer
Network layer vs. Transport layer
Network - logical communication between hosts
Transport - logical communication between processes
relies on network layer services
6 functions
- connection management
- packetization and reassembly of app data
- error control
- reliability
- flow control
- congestion control
transport layer error/ flow control vs. DLL error/ flow controll
- transport layer flow control and error control is end-to-end
- DLL flow control and error control is per-hop
end-to-end flow control
- assumes unreliable delivery of frames by DLL
- works well when few errors b/t links (wastes bandwidth when there’re errors in first hop, b/c corrupted data is transmitted over following links)
- less overhead than per-hop for high quality links
TCP socket identified by: (4 things)
- source IP
- source port
- dest IP
- dest port
Web servers have different sockets for each connecting client
UDP checksum
- 1’s complement addition of segment contents
- receiver computes checksum of received value and compares with checksum field
TCP stream delivery
- data from application is treated as a stream of bytes divided into segments (data boundaries ignored)
- each byte has a sequence #, only 1st sequence # of the segment is sent
- window sizes in bytes (instead of # of frames)
PUSH flag
- forced delivery
- if your TCP module decides a segment is still too small to send (waiting for more bytes)
Urgent flag
- urgently deliver a part of the data stream regardless of its position in the stream
- encapsulate urgent data into a segment with URG = 1
Urgent pointer in TCP header lets you specify where urgent data ends
how are connections identified in TCP?
by a pair of endpoints (IP address, port) pair
ISN
- Initial sequence #
- chosen based on current time
-should be unpredictable to defend against TCP sequence prediction attacks
if SYN == 1, then
this is the initial sequence #
SYN and FIN are 1 byte in sequence # if set
half closed
After A terminates connection, but B hasn’t yet
Data can only flow from B to A now. A HAS to keep receiving data from B and returning Acks (for what sequence # it expects next)
Officially closed when B sends last outgoing segment (FIN = 1) and gets an Ack back
how does a sender perceive congestion?
a loss event (either a timeout OR 3 duplicate ACKs)
TCP AIMD
Additive increase / multiplicative decrease
Increase cwnd (congestion window size) by 1 MSS (maximum segment size) every RTT in the absence of loss events
Cut cwnd in half after loss event
fast retransmission
-when network doesn’t seem congested, but a packet is lost (b/c duplicate Acks)
-retransmits lost segment IMMEDIATELY after 3rd duplicate Ack
(doesn’t wait for timeout)
Fast recovery
after fast retransmission, cut value of cwnd (congestion window size) in half
(skip slow start phase)
Congestion avoidance
predict when congestion is about to happen and then reduce rate at which hosts send data just before packets start getting discarded
source based congestion avoidance
watch for some sign from network that some router’s queue is building up, and that congestion will happen soon
-like increase in RTT for successive packets
Random early detection congestion avoidance mechanism
router is programmed to monitor its own queue length, and notifies source to adjust its congestion window when it detects congestion is imminent
flow control
end-to-end issue
-preventing senders from over-running the capacity of receivers
(flow control also used for receivers sending window size to sender)