TCP and UDP Flashcards

1
Q

What does TCP assume about channel reliability?

A

TCP assumes some unreliability in channels such as errors or packet loss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why do errors like flipped bits occur in local networks?

A

Flipped bit errors are caused by transmission issues such as electromagnetic interference, signal degradation, or hardware faults.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the purpose of acknowledgements (ACKs) in TCP?

A

ACKs confirm that the receiver has correctly received the packet and notify the sender to proceed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a NAK and how does it work?

A

A NAK informs the sender that a packet had errors prompting retransmission

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens if ACKs or NAKs are corrupted?

A

The sender cannot determine if the packet was received causing retransmissions and potential duplicates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How are duplicates handled in TCP?

A

Sequence numbers help identify and discard duplicate packets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is the IP checksum weak?

A

It may not reliably detect multiple bit flips in a packet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the role of a timer in TCP retransmissions?

A

The sender waits for a reasonable time for ACK if none is received it retransmits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does TCP handle packet loss?

A

TCP uses retransmissions sequence numbers and timers to ensure delivery

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the concept of TCP’s flow control?

A

Flow control prevents senders from overwhelming receivers by managing buffer capacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does the TCP three-way handshake work?

A

It establishes connections using SYN SYN-ACK and ACK packets to confirm readiness

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the TCP connection teardown process?

A

The initiator sends a FIN to close the connection, and the responder replies with an ACK, sends its own FIN, and receives a final ACK from the initiator to complete the teardown.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the two main TCP solutions to scaling issues?

A

Window scaling and PAWS Protection Against Wrapped Sequence Numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does window scaling address TCP’s limitations?

A

It increases the receive window size to handle larger bandwidth-delay products

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is PAWS and why is it used?

A

PAWS prevents misidentification of old packets due to sequence number wraparound

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is RTTM in TCP?

A

Round Trip Time Measurement ensures accurate RTT calculation by embedding timestamps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the purpose of Slow Start in TCP?

A

It gradually ramps up data transmission to prevent congestion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How does Fast Retransmit work?

A

It retransmits lost packets immediately based on duplicate ACKs avoiding timeout delays

(Fast Retransmit works when the receiver notices a missing packet and keeps asking for it by sending the same “ACK” repeatedly. If the sender gets three duplicate ACKs in a row, it assumes the packet is lost and resends it right away without waiting for a timeout. This speeds up recovery from lost packets.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the problem with early HTTP protocols like HTTP/1.0?

A

They lacked pipelining leading to inefficiencies such as multiple connections per object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the purpose of NAT?

A

To conserve public IP addresses by translating private addresses for external communication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is outbound NAT?

A

It maps multiple internal source IPs to fewer external IPs using port numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is inbound NAT?

A

It allows external traffic to access services on a private network using ports

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the challenge of using NAT for UDP?

A

NAT (Network Address Translation) for UDP is challenging because UDP is stateless, meaning it doesn’t establish a connection like TCP. NAT relies on active connections to maintain mappings, but since UDP doesn’t create a persistent connection, its mappings are cleared after brief periods of inactivity, making it hard to track and manage UDP traffic consistently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is a key advantage of IPv6 over NAT?

A

IPv6 assigns unique public IPs to devices simplifying logging and investigation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the difference between the transport and network layers
The transport layer provides logical communication between processes while the network layer provides logical communication between hosts
26
How does the transport layer enhance network layer services
The transport layer breaks application messages into segments on the send side and reassembles segments into messages on the receive side
27
What are the two main transport protocols in the Internet
TCP and UDP
28
What services does TCP provide
Reliable in-order delivery congestion control flow control and connection setup
29
What type of delivery does UDP provide
Unreliable unordered delivery with no delay or bandwidth guarantees
30
What is the main function of demultiplexing in the transport layer
Directing transport-layer segments to the appropriate socket using IP addresses and port numbers
31
What identifies a TCP socket
A 4-tuple consisting of source IP address source port number destination IP address and destination port number
32
What identifies a UDP socket
A 2-tuple consisting of destination IP address and destination port number
33
Why is UDP considered connectionless
UDP does not involve handshaking between sender and receiver and handles each segment independently
34
What mechanisms allow TCP to provide reliable data transfer
Pipelined segments cumulative acknowledgments and a single retransmission timer
35
What triggers TCP retransmissions
Timeout events and duplicate acknowledgments
36
How does TCP handle duplicates
TCP uses sequence numbers to identify and discard duplicate packets
37
What is a TCP cumulative acknowledgment
An acknowledgment that specifies the sequence number of the next expected byte
38
What is the role of sequence numbers in TCP
Sequence numbers uniquely identify each byte of data in a TCP segment
39
What is the TCP three-way handshake
A process involving SYN SYN-ACK and ACK messages to establish a connection
40
How does TCP close a connection
By exchanging FIN and ACK messages between the sender and receiver
41
What is the purpose of the TCP window size
To control the amount of unacknowledged data a sender can transmit
42
What is the significance of the TCP receive window
It advertises the available buffer space at the receiver
43
What is TCP flow control
A mechanism to prevent the sender from overwhelming the receiver’s buffer
44
What is the purpose of slow start in TCP
To avoid network congestion by gradually increasing the number of packets sent
45
What is the purpose of rapid retransmission in TCP
To retransmit lost segments quickly without waiting for a timeout
46
What is the selective acknowledgment SACK option in TCP
An option allowing the receiver to acknowledge specific ranges of received data
47
What does TCP window scaling achieve
It increases the maximum window size to accommodate high-bandwidth high-delay networks
48
What does PAWS stand for and what does it address
Protection Against Wrapped Sequence numbers which helps differentiate between old and new packets with the same sequence number
49
What is RTTM in TCP
Round Trip Time Measurement used to calculate RTT more accurately with timestamps
50
What does the TCP timestamp option enable
Accurate RTT measurement and differentiation of packets with the same sequence number
51
What are the key differences between TCP and UDP
TCP provides reliable in-order delivery with congestion control while UDP is connectionless unreliable and unordered
52
How does a sender detect lost TCP segments
Through timeouts and duplicate acknowledgments
53
What is the purpose of the TCP checksum
To detect errors in the segment during transmission
54
What happens when a TCP ACK is delayed
The sender may retransmit data unnecessarily thinking the segment was lost
55
Why is retransmission of data necessary in TCP
To recover from packet loss or errors during transmission
56
How does the sender handle timeouts in TCP
It retransmits the oldest unacknowledged segment
57
What is the TCP timeout interval
Estimated RTT plus a safety margin based on RTT variation
58
What is exponential weighted moving average in TCP
A method to estimate RTT by averaging recent measurements with decreasing weight for older samples
59
Why is window scaling important in modern networks
To support larger receive windows required for high-bandwidth long-delay networks
60
What is the silly window syndrome in TCP
Inefficient use of TCP frames when the receiver’s buffer is almost full
61
What are the two solutions for silly window syndrome
The receiver avoids advertising small window sizes and the sender uses Nagles algorithm to avoid sending small packets
62
What is Nagles algorithm
A TCP mechanism to reduce the number of small packets sent by combining them until acknowledgment is received
63
How does TCP ensure in-order delivery
By using sequence numbers and buffering out-of-order packets until they can be delivered sequentially
64
What are the three main TCP algorithms for congestion control
Slow Start Fast Retransmission and Rapid Recovery
65
What are the phases of the TCP congestion control algorithm
Slow Start Congestion Avoidance Fast Retransmission and Recovery
66
How does TCP respond to duplicate ACKs
It assumes a packet loss and retransmits the missing segment immediately
67
What is the minimum number of packets for a TCP connection with no data transfer
Seven packets SYN SYN-ACK ACK FIN ACK FIN ACK
68
What happens during the TCP connection teardown
Each side exchanges FIN and ACK messages to close the connection gracefully
69
What is the TCP state diagram used for
To describe the various states during TCP connection setup data transfer and teardown
70
What are TCP options and when are they used
Optional fields in the header to enable features like SACK window scaling and timestamping
71
What is the purpose of the urgent pointer in TCP
It indicates urgent data but it is rarely used today
72
What does the PSH bit in TCP indicate
It requests the receiver to push data to the application immediately
73
What does the term bulk transfer mean in TCP
Transferring large amounts of data controlled by the receive window and acknowledgment mechanism
74
Why does TCP use cumulative acknowledgments
To reduce overhead by acknowledging all received data up to a specific point
75
What happens if a segment is lost during a TCP bulk transfer
The sender retransmits all unacknowledged data starting from the lost segment
76
What is the role of the TCP receive buffer
To temporarily store incoming data before it is delivered to the application
77
How does TCP handle out-of-order segments
The receiver buffers them until missing segments are received or discards them depending on implementation
78
Why is RTT estimation important in TCP
To set an appropriate timeout interval for retransmissions
79
What does TCP use to handle varying RTT
Exponential weighted moving average and deviation-based safety margins
80
How does TCP prevent buffer overflow at the receiver
By limiting the sender’s unacknowledged data to the advertised receive window size
81
What is the impact of delayed ACKs on TCP performance
They reduce the number of packets sent but can delay retransmissions in case of loss
82
How does TCP achieve full duplex communication
By maintaining separate sequence and acknowledgment numbers for each direction of data flow
83
What is the maximum segment size MSS in TCP
The largest amount of data a TCP segment can carry typically negotiated during connection setup
84
What happens during the TCP three-way handshake
The client sends a SYN the server responds with SYN-ACK and the client acknowledges with ACK
85
What triggers TCPs slow start mechanism
Connection initialization or retransmission after a timeout
86
How does TCP avoid congestion during the slow start phase
By increasing the congestion window size gradually until packet loss occurs
87
What is fast recovery in TCP
A mechanism to avoid slow start after segment loss using duplicate ACKs to infer missing segments
88
What is the effect of packet loss on TCP throughput
It reduces throughput due to retransmissions and congestion control adjustments
89
Why is TCP not suitable for real-time applications
TCPs reliability mechanisms introduce latency making it unsuitable for time-sensitive data
90
How does TCP handle simultaneous connection initiation
Both sides send SYN packets simultaneously and establish the connection after exchanging SYN-ACKs
91
What is the purpose of the FIN bit in TCP
To indicate the sender has finished transmitting data and wants to close the connection
92
What is the role of the TCP acknowledgment number
To indicate the next byte the receiver expects to receive from the sender