1/44
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Flow control
A TCP mechanism that ensures the sender does not overwhelm the receiver.
The sender regulates the rate of data transmitted based on the receiver's ability to process and buffer the incoming data.
What does a window do ?
Advertises to the sender in every TCP segment to inform the sender of the available buffer space at the receiver.
What is the window size ?
The amount of bytes the sender can transmit before receiving a TCP ACK from the receiver.
TCP Sliding windows (2 answers)
A flow control mechanism that dynamically adjusts the amount of data a sender can transmit before needing an ACK
Helps ensure efficient and reliable data transfer by preventing congestion and packet loss.
The TCP Maximum Segment Size Concept
The largest amount of bytes that a device is willing to receive or transmit in a single TCP segment.
How many bytes in TCP Maximum Segment Size (4 answers)
Typically set to 1460 bytes for IPv4 packets
1440 bytes for IPv6 packets
Meant to optimize performance by fitting within the standard Ethernet MTU (Maximum Transmission Unit) of 1500 bytes.
Note, IPv4 and IPv6 have different header sizes which is why they can transmit different amounts.
Congestion Window (2 answers)
Manages the amount of data that can be sent into the network without receiving an ACK from the receiver to avoid network congestion (this is done algorithmically).
Determined by the sender
Receive window (2 answers)
Advertised by the receiver
How much data the receiver can handle/process - available buffer space.
What is TCP Slow Start and how does it work? (5 answers)
Used at the start of a TCP connection to avoid congestion.
Starts with congestion window (cwnd) = 1 MSS (Maximum Segment Size).
cwnd doubles every Round Trip Time (RTT) by increasing it with each ACK received.
Rate increases exponentially until the first loss is detected.
Purpose: slowly probe the network capacity without overwhelming it.
When and how does TCP switch from Slow Start to Congestion Avoidance?
When: When cwnd
reaches the slow start threshold (ssthresh
).
Why: To prevent overshooting the available network capacity.
How:
On loss event, set ssthresh = cwnd / 2
(just before the loss).
If cwnd < ssthresh
: use exponential growth (slow start).
If cwnd ≥ ssthresh
: switch to congestion avoidance (linear growth).
Why use UDP ?(4.5 answers)
No connection establishment (which can add RTT delay)
Simple: no connection state at sender, receiver
Small header size
No congestion control
UDP can blast away as fast as desired!
Can function in the face of congestion
UDP Uses (5 answers)
Streaming
Online games
DNS
SNMP (Simple network Management Protocol
HTTP/3 (Hypertext Transfer Protocol)
What are ways to make UDP more reliable
Add needed reliability at application layer
Add congestion control at application layer
Why use TCP ?(5.5 answers)
Offers reliable, in-order byte stream: no “message boundaries"
Full duplex data: bi-directional data flow in same connection
Connection-oriented: client and sender do handshake before exchanging data
Flow and Congestion control limit the size of the window, i.e. effectively limiting the send rate
To avoid overloading receiver and the network in the middle
Point-to-point: one sender, one receiver
TCP Disadvantages (3 answers)
TCP is made for Wide Area Networks, thus its size can become an issue for small networks with low resources.
TCP runs several layers so it can slow down the speed of the network.
It is not generic in nature. It cannot represent any protocol stack other than the TCP/IP suite. E.g., it cannot work with a Bluetooth connection.
TCP uses (3 answers)
Web browsing
File transfer
TCP connection process (5 steps)
Server creates welcome socket then waits for the client to connect (uses source port num and IP address to distinguish clients)
Client creates a socket then connects to server
Server creates a new socket for that specific client
Client and server now transmit data using this new socket
Repeated until sockets close
Why must the TCP timeout be set longer than the RTT?
Because RTT varies; if the timeout is too short, it causes unnecessary retransmissions. If it's too long, the response to segment loss is delayed.
What happens if the TCP timeout is set too short or too long?
Too short: premature timeouts and unnecessary retransmissions.
Too long: slow reaction to segment loss.
How is SampleRTT measured in TCP?
SampleRTT is the time measured from when a segment is sent until its ACK is received. Retransmitted segments are ignored for this calculation.
Why can't we just use the latest SampleRTT as the estimated RTT in TCP?
Because SampleRTT can vary significantly. Using only the latest value would make the timeout unstable.
How does TCP estimate RTT to smooth out variation?
TCP uses an average of several recent SampleRTT measurements to calculate a more stable EstimatedRTT.
What is TCP fast retransmit
if sender receives 3 additional ACKs for same data (“triple duplicate ACKs”), resend unACKed segment with smallest seq # It is likely that unACKed segment lost, so don’t wait for timeout
UDP connection process
Sender explicitly informs IP destination address and port# to each packet.
Receiver extracts sender IP address and port# from each received packet
In this case the server and client create sockets the client sends data through their datagram socket and the server receives and sends through that same socket.
What are the main Transport Services and Protocols?
TCP and UDP
Provide logical communication between application processes running on different hosts.
Transport protocol actions
The sender breaks application messages into segments and passes them down to network layer. (Multiplexing)
The receiver reassembles segments into messages, passes up to application layer. (Demultiplexing)
Multiplexing concept
Gathering data chunks at the source host from different sockets then encapsulating each data chunk with header info to create segments, then passing the segments to the network layer.
Demultiplexing concept
Examines the header fields in the segment to determine the receiving socket then directs the segment to that socket.
What actions does the transport layer take to send to another transport layer? (7 answers)
Sender application prepares an application message to send through the socket.
The sender Transport layer makes a header with fields (e.g. port numbers) and completes those fields, creating a segment.
This will then get sent to the Network Layer, where the network layer tries to make sure that the segment is delivered to the target host
The receiving Network layer will then send this up to their Transport layer
The receiving Transport will then check the header values and try to make sure that its correct.
The Transport will then extract the application-layer message and it will be demultiplexed by the machine.
The sender application message is then delivered to the application side on the receivers end.
UDP multiplexing and demultiplexing (2 answers)
Packets have the source port and IP address, and destination port and IP address in the header. (Multiplexing)
When the transport gets this it will check the destination port and IP address then direct it to the socket bound to that port# and IP address. (Demultiplexing)
TCP multiplexing and demultiplexing (3 answers)
TCP socket has a 4-tuple with the Source IP address, source port number, Destination IP address, and destination port number. (Multiplexing)
Receiver uses all four values to direct the segment to the appropriate socket. (Demultiplexing)
Server may support many simultaneous TCP sockets where each socket is identified by its own 4-tuple and associated with a different connecting client.
Checksum purpose
To detect packet corruption in both directions
Congestion meaning (2 answers)
Too many sources sending too much data too fast for the network to handle
Leads to long delays (queueing in router buffers) and packet loss (buffer overflow at routers)
What are some TCP Congestion Control methods ?
AIMD (Additive Increase Multiplicative Decrease)
Senders can increase sending rate until packet loss (congestion) occurs then decrease sending rate on loss event.
TCP Slow Start
What is AIMD ?(Additive Increase Multiplicative Decrease)
Additive increase: Increase sending rate by 1 maximum segment size every RTT until loss detected
Multiplicative Decrease: Cut sending rate in half at each loss.
Sawtooth behavior: probing for bandwidth.
What is the Go-Back-N Protocol ?
When the sender is allowed to transmit multiple packets (when available) without waiting for an acknowledgment, but is constrained to have no more than some maximum allowable number, N, of unacknowledged packets in the pipeline.
How does the Go-Back-N protocol handle reliable transmission? (6 answers)
Sender maintains a window of up to N unACKed packets.
Each packet is labeled with a sequence number.
ACKs are cumulative: ACK(n)
confirms receipt of all packets ≤ n
.
On receiving ACK(n)
, sender slides window to begin at n+1
.
A single timer tracks the oldest unACKed packet.
On timeout, the sender retransmits that packet and all following packets in the window.
How does the receiver behave in the Go-Back-N protocol? (5.5 answers)
Receiver sends ACK-only messages for the highest in-order packet received so far.
Keeps track of rcv_base: the first missing in-order packet.
May receive/send duplicate ACKs if out-of-order packets arrive.
On out-of-order packets, receiver can either:
Discard them (no buffering), or
Buffer them (implementation choice).
Regardless, receiver always re-ACKs the highest in-order packet.
How does the Go-Back-N receiver identify the data
The sender places a sequence number in the packet header
What are the key features of the Selective Repeat protocol ?
Receiver individually ACKs each correctly received packet
Receiver buffers out-of-order packets for in-order delivery
Sender selectively retransmits only unACKed packets
Sender maintains a timer for each unACKed packet
Sender window holds N consecutive sequence numbers
Window restricts sending to unACKed sequence numbers only
What are the 3 possible events for a selective repeat sender ?
Gets data from application if next available seq # is within window send packet
If there is a timeout for packet n resend packet n, restart timer
sender gets ACK(n)
What does the sender do when it receives data from the application in Selective Repeat?
If the next sequence number is within the sender’s window, it sends the packet.
What happens at the sender when a timeout occurs for packet n in Selective Repeat?
The sender resends packet n and restarts its timer.
How does the sender handle an incoming ACK(n) in Selective Repeat? (3 answers)
If n is within the send window [sendBase, sendBase + N - 1], mark packet n as acknowledged.
If n is the smallest unACKed packet, advance sendBase to the next unACKed sequence number.
Otherwise, ignore the ACK.
What does the receiver do with packets outside the expected range in Selective Repeat?
It ignores the packets.