Skip to content
AD-602 · Computer Networks/Quick Revision Short Notes

Computer Networks (AD-602) - Unit 4 Short Notes

How unit 4 is examined

The unit covers process-to-process delivery by UDP and TCP; the marks sit in TCP connection management, the UDP header, congestion control versus flow control, and the TCP-UDP comparison.

Transport Layer: Design Issues

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. The transport layer gives process-to-process, end-to-end delivery between applications on different hosts, hiding the network below from the application above.

Key points.

  1. Addressing: a port number identifies the application process, and IP address plus port forms a socket.
  2. Connection establishment and release must work even when the network delays or duplicates packets.
  3. Multiplexing lets many applications share one network address; demultiplexing hands each segment to the right port.
  4. Segmentation splits long messages into segments and reassembles them in order.
  5. Error control, flow control and congestion control decide whether the service is reliable (TCP) or best-effort (UDP).

UDP: Header Format

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. UDP (User Datagram Protocol) is a connectionless, unreliable transport protocol with a fixed 8-byte header of four 16-bit fields.

Diagram.

 0                16               31
+-----------------+-----------------+
|   Source port   | Destination port|
+-----------------+-----------------+
|     Length      |    Checksum     |
+-----------------+-----------------+
|          Data (application)       |
+-----------------------------------+

Key points.

  1. Source port (16 bits) identifies the sending process and is the address for a reply; it may be zero if no reply is expected.
  2. Destination port (16 bits) identifies the receiving process, for example 53 for DNS.
  3. Length (16 bits) is the size of header plus data in bytes, with a minimum of 8.
  4. Checksum (16 bits) covers header, data and a pseudo-header for error detection; it is optional in IPv4 and mandatory in IPv6.
  5. The header is a fixed 8 bytes, so overhead is tiny and processing is fast.
  6. UDP is connectionless: there is no handshake, no acknowledgement, no ordering and no retransmission.
  7. <mark>UDP suits short, delay-sensitive exchanges such as DNS, DHCP, SNMP, VoIP and video streaming.</mark>

Comparison.

Basis TCP UDP
Connection Connection-oriented, handshake first Connectionless
Reliability Reliable: ACKs, retransmission, ordered Unreliable, no ACK, may lose or reorder
Speed Slower, 20-byte or larger header, control overhead Faster, 8-byte header
Control Flow and congestion control None
Use cases HTTP, FTP, SMTP, SSH DNS, VoIP, video, gaming, DHCP

Answer frame. Open with the definition; draw the four-field header with bit positions; explain fields 1-4 in order; add the 8-byte size and connectionless nature; close with application examples. For TCP versus UDP, draw the table and add one example line for each protocol.

Asked: [7 marks] (May 2023, May 2024) Give and explain UDP header format; describe its main fields and the purpose of each. Asked: [7 marks] (Jun 2025) Compare the working of TCP and UDP in reliability, speed and use cases, with application examples.

Per-Segment Checksum

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. The checksum is a 16-bit one's complement error-detection code computed over every segment.

Key points.

  1. The sender splits the pseudo-header (source IP, destination IP, protocol, length), header and data into 16-bit words and adds them with end-around carry.
  2. The one's complement of the sum is placed in the checksum field, which is zero during computation.
  3. The receiver adds all words including the checksum; an all-ones result means no error, otherwise the segment is discarded.
  4. It detects most single-bit and burst errors but cannot fix them or catch every error.

Carrying Unicast/Multicast Real-Time Traffic

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. Real-time traffic such as voice and video needs timely rather than perfect delivery, so it runs over UDP using RTP (Real-time Transport Protocol) with RTCP for feedback.

Key points.

  1. RTP adds a sequence number and a timestamp so the receiver can reorder packets and smooth jitter.
  2. UDP is used because retransmission would arrive too late to be useful.
  3. Unicast sends one stream per receiver; multicast sends one stream to a group address, saving bandwidth.
  4. RTCP reports loss, delay and jitter so the sender can adapt its rate.

TCP: Connection Management

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. TCP is connection-oriented: it establishes a connection with a three-way handshake, transfers data, and releases it gracefully with a four-way handshake.

Diagram.

Client                     Server
  |--- SYN, seq=x ----------->|   SYN_SENT / LISTEN
  |<-- SYN+ACK, seq=y, ack=x+1|   SYN_RCVD
  |--- ACK, ack=y+1 --------->|   ESTABLISHED
  ...data...
  |--- FIN ------------------>|   FIN_WAIT_1
  |<-- ACK -------------------|   CLOSE_WAIT / FIN_WAIT_2
  |<-- FIN -------------------|   LAST_ACK
  |--- ACK ------------------>|   TIME_WAIT (2 MSL) -> CLOSED

Key points.

  1. Step 1: the client sends SYN with its initial sequence number x to request a connection.
  2. Step 2: the server replies SYN+ACK, acknowledging x+1 and announcing its own initial sequence number y.
  3. Step 3: the client sends ACK with y+1; both sides have now synchronised sequence numbers and the connection is ESTABLISHED.
  4. Window size, MSS and other parameters are negotiated in the SYN segments, and random initial numbers protect against old duplicates.
  5. A SYN or FIN consumes one sequence number; the ACK flag says the acknowledgement field is valid.
  6. Release takes four steps because each direction closes independently: FIN, ACK, FIN, ACK (half-close).
  7. The active closer waits in TIME_WAIT for twice the maximum segment lifetime so the last ACK is not lost and stray segments die.
  8. <mark>Graceful termination is needed so that all data already sent is delivered before the connection closes, unlike an abrupt RST.</mark>

Answer frame. Open with the definition; draw the handshake and release diagram with states; develop points 1-5 for establishment, then 6-7 for termination; close with the graceful-termination reason.

Asked: [7 marks] (May 2023, May 2024, Jun 2025) Explain TCP connection management; describe the three-way handshake and the purpose of each step; explain establishment and termination with three-way and four-way handshakes and why graceful termination is needed.

Reliability of Data Transfers

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. TCP gives reliable delivery: data arrives complete, in order and without duplicates.

Key points.

  1. Each byte has a sequence number, and the receiver sends cumulative acknowledgements.
  2. A retransmission timer resends unacknowledged data; three duplicate ACKs trigger fast retransmit.
  3. The checksum detects corrupt segments, which are discarded and so retransmitted.
  4. Sequence numbers let the receiver reorder segments and drop duplicates.

TCP Flow Control

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>

Definition. TCP flow control uses a sliding window: the receiver advertises its free buffer space (rwnd) in each ACK, and the sender never keeps more than rwnd bytes unacknowledged.

Key points.

  1. It is necessary because a fast sender would otherwise overflow a slow receiver's buffer, causing loss and retransmissions.
  2. Silly window syndrome occurs when tiny windows or tiny segments are sent, wasting bandwidth on headers.
  3. Solutions: Nagle's algorithm on the sender side, and Clark's solution (and delayed ACK) on the receiver side, which hides small window updates.
  4. Deadlock can arise when a zero-window update is lost; the sender's persist timer sends probes to avoid it.
  5. Limits: the 16-bit window caps at 64 KB, fixed by the window scale option, and flow control does not see network congestion.

Asked: [7 marks] (May 2024) What is TCP flow control and why is it necessary? Explain its challenges and limitations.

TCP Congestion Control

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>

Definition. Congestion control limits the sender's rate so that the network is not overloaded; the sender keeps a congestion window (cwnd) and sends min(cwnd, rwnd).

Key points.

  1. Slow start begins at cwnd = 1 MSS and doubles every round trip (exponential growth) until it reaches ssthresh.
  2. Congestion avoidance then adds 1 MSS per round trip (additive increase).
  3. On a timeout, ssthresh becomes cwnd/2 and cwnd falls to 1 MSS, restarting slow start.
  4. Fast retransmit resends a segment after three duplicate ACKs without waiting for the timeout.
  5. Fast recovery halves cwnd instead of resetting it, so AIMD (additive increase, multiplicative decrease) gives a saw-tooth.
  6. Together these give fair sharing and stable throughput, and avoid congestion collapse, at the cost of slow ramp-up.

Comparison.

Basis Flow control Congestion control
Scope Sender-receiver, end to end Whole network
Purpose Receiver not overrun Network not overloaded
Controlled by Receiver's advertised window Sender's cwnd
Mechanism Sliding window, ACK Slow start, AIMD, fast retransmit, RED

Answer frame. For the comparison, write the definitions and the four-row table with one example each. For the impact question, open with cwnd and ssthresh, describe slow start, congestion avoidance and fast retransmit in order, and close with throughput and stability.

Asked: [7 marks] (May 2023) Differentiate between congestion control and flow control. Asked: [7 marks] (Jun 2025) Discuss the impact of slow start, congestion avoidance and fast retransmit on network performance.

TCP Header Format

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. The TCP header is 20 to 60 bytes.

Key points.

  1. It holds source port and destination port (16 bits each), a 32-bit sequence number and a 32-bit acknowledgement number.
  2. Header length (4 bits), flags URG, ACK, PSH, RST, SYN, FIN, and a 16-bit window size follow.
  3. A 16-bit checksum, a 16-bit urgent pointer and up to 40 bytes of options complete it.

TCP Timer Management

<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>

Definition. TCP uses timers for retransmission, persistence, keepalive and TIME_WAIT.

Key points.

  1. The retransmission timer (RTO) is set from smoothed RTT: $RTO = SRTT + 4 \times RTTVAR$.
  2. The persistence timer probes a zero window; the keepalive timer checks idle connections.
  3. The TIME_WAIT timer waits 2 MSL before closing.

Last-minute revision

  • UDP header: 4 fields of 16 bits, 8 bytes, connectionless.
  • TCP header: 20 bytes minimum, 60 maximum; 6 flags.
  • Handshake: SYN, SYN+ACK, ACK; release: FIN, ACK, FIN, ACK.
  • TIME_WAIT lasts 2 MSL.
  • Slow start doubles cwnd per RTT; congestion avoidance adds 1 MSS per RTT.
  • Timeout: ssthresh = cwnd/2, cwnd = 1 MSS; three duplicate ACKs trigger fast retransmit.
  • Flow control uses rwnd; congestion control uses cwnd.
  • Silly window fixes: Nagle (sender), Clark (receiver).
  • Checksum is 16-bit one's complement over pseudo-header, header and data.
  • RTP over UDP carries real-time traffic.

Memory hooks

  • UDP header = "SDLC": Source, Destination, Length, Checksum.
  • Handshake = "SYN, SYN-ACK, ACK": knock, answer, confirm.
  • Flow control protects the receiver; congestion control protects the network.
  • Slow start is not slow: it doubles.

Coverage checklist

  • Transport Layer: Design Issues: covered.
  • UDP: Header Format: May 2023, May 2024 header; Jun 2025 TCP vs UDP.
  • Per-Segment Checksum: covered.
  • Carrying Unicast/Multicast Real-Time Traffic: covered.
  • TCP: Connection Management: May 2023, May 2024, Jun 2025.
  • Reliability of Data Transfers: covered.
  • TCP Flow Control: May 2024.
  • TCP Congestion Control: May 2023, Jun 2025.
  • TCP Header Format: covered.
  • TCP Timer Management: covered.
Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in