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

Errors like flipped bits often result from transmission issues such as interference

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

It uses a four-step process FIN ACK LAST-ACK to close connections gracefully

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

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

UDP mappings lack state and are cleared after short inactivity making tracking difficult

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
Q

What is the difference between the transport and network layers

A

The transport layer provides logical communication between processes while the network layer provides logical communication between hosts

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

How does the transport layer enhance network layer services

A

The transport layer breaks application messages into segments on the send side and reassembles segments into messages on the receive side

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

What are the two main transport protocols in the Internet

A

TCP and UDP

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

What services does TCP provide

A

Reliable in-order delivery congestion control flow control and connection setup

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

What type of delivery does UDP provide

A

Unreliable unordered delivery with no delay or bandwidth guarantees

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

What is the main function of demultiplexing in the transport layer

A

Directing transport-layer segments to the appropriate socket using IP addresses and port numbers

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

What identifies a TCP socket

A

A 4-tuple consisting of source IP address source port number destination IP address and destination port number

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

What identifies a UDP socket

A

A 2-tuple consisting of destination IP address and destination port number

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

Why is UDP considered connectionless

A

UDP does not involve handshaking between sender and receiver and handles each segment independently

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

What mechanisms allow TCP to provide reliable data transfer

A

Pipelined segments cumulative acknowledgments and a single retransmission timer

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

What triggers TCP retransmissions

A

Timeout events and duplicate acknowledgments

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

How does TCP handle duplicates

A

TCP uses sequence numbers to identify and discard duplicate packets

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

What is a TCP cumulative acknowledgment

A

An acknowledgment that specifies the sequence number of the next expected byte

38
Q

What is the role of sequence numbers in TCP

A

Sequence numbers uniquely identify each byte of data in a TCP segment

39
Q

What is the TCP three-way handshake

A

A process involving SYN SYN-ACK and ACK messages to establish a connection

40
Q

How does TCP close a connection

A

By exchanging FIN and ACK messages between the sender and receiver

41
Q

What is the purpose of the TCP window size

A

To control the amount of unacknowledged data a sender can transmit

42
Q

What is the significance of the TCP receive window

A

It advertises the available buffer space at the receiver

43
Q

What is TCP flow control

A

A mechanism to prevent the sender from overwhelming the receiver’s buffer

44
Q

What is the purpose of slow start in TCP

A

To avoid network congestion by gradually increasing the number of packets sent

45
Q

What is the purpose of rapid retransmission in TCP

A

To retransmit lost segments quickly without waiting for a timeout

46
Q

What is the selective acknowledgment SACK option in TCP

A

An option allowing the receiver to acknowledge specific ranges of received data

47
Q

What does TCP window scaling achieve

A

It increases the maximum window size to accommodate high-bandwidth high-delay networks

48
Q

What does PAWS stand for and what does it address

A

Protection Against Wrapped Sequence numbers which helps differentiate between old and new packets with the same sequence number

49
Q

What is RTTM in TCP

A

Round Trip Time Measurement used to calculate RTT more accurately with timestamps

50
Q

What does the TCP timestamp option enable

A

Accurate RTT measurement and differentiation of packets with the same sequence number

51
Q

What are the key differences between TCP and UDP

A

TCP provides reliable in-order delivery with congestion control while UDP is connectionless unreliable and unordered

52
Q

How does a sender detect lost TCP segments

A

Through timeouts and duplicate acknowledgments

53
Q

What is the purpose of the TCP checksum

A

To detect errors in the segment during transmission

54
Q

What happens when a TCP ACK is delayed

A

The sender may retransmit data unnecessarily thinking the segment was lost

55
Q

Why is retransmission of data necessary in TCP

A

To recover from packet loss or errors during transmission

56
Q

How does the sender handle timeouts in TCP

A

It retransmits the oldest unacknowledged segment

57
Q

What is the TCP timeout interval

A

Estimated RTT plus a safety margin based on RTT variation

58
Q

What is exponential weighted moving average in TCP

A

A method to estimate RTT by averaging recent measurements with decreasing weight for older samples

59
Q

Why is window scaling important in modern networks

A

To support larger receive windows required for high-bandwidth long-delay networks

60
Q

What is the silly window syndrome in TCP

A

Inefficient use of TCP frames when the receiver’s buffer is almost full

61
Q

What are the two solutions for silly window syndrome

A

The receiver avoids advertising small window sizes and the sender uses Nagles algorithm to avoid sending small packets

62
Q

What is Nagles algorithm

A

A TCP mechanism to reduce the number of small packets sent by combining them until acknowledgment is received

63
Q

How does TCP ensure in-order delivery

A

By using sequence numbers and buffering out-of-order packets until they can be delivered sequentially

64
Q

What are the three main TCP algorithms for congestion control

A

Slow Start Fast Retransmission and Rapid Recovery

65
Q

What are the phases of the TCP congestion control algorithm

A

Slow Start Congestion Avoidance Fast Retransmission and Recovery

66
Q

How does TCP respond to duplicate ACKs

A

It assumes a packet loss and retransmits the missing segment immediately

67
Q

What is the minimum number of packets for a TCP connection with no data transfer

A

Seven packets SYN SYN-ACK ACK FIN ACK FIN ACK

68
Q

What happens during the TCP connection teardown

A

Each side exchanges FIN and ACK messages to close the connection gracefully

69
Q

What is the TCP state diagram used for

A

To describe the various states during TCP connection setup data transfer and teardown

70
Q

What are TCP options and when are they used

A

Optional fields in the header to enable features like SACK window scaling and timestamping

71
Q

What is the purpose of the urgent pointer in TCP

A

It indicates urgent data but it is rarely used today

72
Q

What does the PSH bit in TCP indicate

A

It requests the receiver to push data to the application immediately

73
Q

What does the term bulk transfer mean in TCP

A

Transferring large amounts of data controlled by the receive window and acknowledgment mechanism

74
Q

Why does TCP use cumulative acknowledgments

A

To reduce overhead by acknowledging all received data up to a specific point

75
Q

What happens if a segment is lost during a TCP bulk transfer

A

The sender retransmits all unacknowledged data starting from the lost segment

76
Q

What is the role of the TCP receive buffer

A

To temporarily store incoming data before it is delivered to the application

77
Q

How does TCP handle out-of-order segments

A

The receiver buffers them until missing segments are received or discards them depending on implementation

78
Q

Why is RTT estimation important in TCP

A

To set an appropriate timeout interval for retransmissions

79
Q

What does TCP use to handle varying RTT

A

Exponential weighted moving average and deviation-based safety margins

80
Q

How does TCP prevent buffer overflow at the receiver

A

By limiting the sender’s unacknowledged data to the advertised receive window size

81
Q

What is the impact of delayed ACKs on TCP performance

A

They reduce the number of packets sent but can delay retransmissions in case of loss

82
Q

How does TCP achieve full duplex communication

A

By maintaining separate sequence and acknowledgment numbers for each direction of data flow

83
Q

What is the maximum segment size MSS in TCP

A

The largest amount of data a TCP segment can carry typically negotiated during connection setup

84
Q

What happens during the TCP three-way handshake

A

The client sends a SYN the server responds with SYN-ACK and the client acknowledges with ACK

85
Q

What triggers TCPs slow start mechanism

A

Connection initialization or retransmission after a timeout

86
Q

How does TCP avoid congestion during the slow start phase

A

By increasing the congestion window size gradually until packet loss occurs

87
Q

What is fast recovery in TCP

A

A mechanism to avoid slow start after segment loss using duplicate ACKs to infer missing segments

88
Q

What is the effect of packet loss on TCP throughput

A

It reduces throughput due to retransmissions and congestion control adjustments

89
Q

Why is TCP not suitable for real-time applications

A

TCPs reliability mechanisms introduce latency making it unsuitable for time-sensitive data

90
Q

How does TCP handle simultaneous connection initiation

A

Both sides send SYN packets simultaneously and establish the connection after exchanging SYN-ACKs

91
Q

What is the purpose of the FIN bit in TCP

A

To indicate the sender has finished transmitting data and wants to close the connection

92
Q

What is the role of the TCP acknowledgment number

A

To indicate the next byte the receiver expects to receive from the sender