- Duties → ports and sockets → mux/demux → connectionless vs. connection-oriented → TCP (sequence numbers, handshake, ACKs, windows) → UDP and when to use it.
- 9.1 services · 9.2 protocols · UDP · TCP.
- Transport sits between application and network and gives PROCESS-to-process delivery over a logical connection.
- The two transport layers act as if directly connected; the routers in between never look at the transport header.
- Two transport protocols in the course: UDP and TCP.
- Seven duties: process-to-process, addressing, encapsulation, mux/demux, connection control, reliability (flow + error), congestion control.
🎯 How this can come up · 1 question
Which is NOT a transport-layer duty in the slides?
Correct: Routing.
- Process = a running application program that uses transport services.
- Network layer = host to host. Transport layer = process to process.
🎯 How this can come up · 1 question
Host-to-host delivery is the job of the ___ layer; process-to-process delivery is the job of the ___ layer.
Correct: Network; transport.
- Network layer gets the packet to the right COMPUTER; transport gets it to the right PROCESS on that computer.
- Port = 16 bits (0–65,535). Well-known 0–1023 (IANA) → servers. Clients pick a random higher (ephemeral) port.
🎯 How this can come up · 3 questions
Port numbers are:
Correct: 16 bits, 0–65,535.
The well-known port of HTTP is:
Correct: 80.
A client normally uses a well-known port as its source port.
False. Well-known ports go to servers; clients use ephemeral ports.
- FTP, TELNET, SMTP, HTTP need reliability → TCP only. SNMP → UDP only. DNS uses both (mostly UDP).
🎯 How this can come up · 2 questions
Which application uses port 25?
Correct: SMTP.
Which port does DNS use?
Correct: 53.
- Request: source 52,000 → destination 13. Reply: the ports swap.
- A connection needs four things: local IP, local port, remote IP, remote port.
- Socket = the interface between application and transport. Socket address = IP + port.
🎯 How this can come up · 1 question
A socket address is the combination of:
Correct: IP address and port number.
- IP selects the HOST, port selects the PROCESS.
🎯 How this can come up · 1 question
At the receiving host, which field selects the application process?
Correct: Destination port number.
- Two tabs to the same site = same destination port 80, different source ports.
- A connection is identified by BOTH socket addresses. Same port 49888 is fine because the source IPs differ.
🎯 How this can come up · 1 question
Two laptops, 192.168.1.101 and 172.16.5.5, both open a connection from port 49888 to a web server on port 80. How does the server tell them apart?
Each connection is identified by the full pair of socket addresses (source IP, source port, destination IP, destination port). The source IPs differ, so the two connections are different even though the ports are the same.
- Sender: add the transport header (with the ports). Receiver: strip it and hand the data to the process.
- Source transport: MULTIPLEXES many processes onto one network layer (many → one).
- Destination transport: DEMULTIPLEXES to the right process using the port (one → many).
🎯 How this can come up · 1 question
Demultiplexing at the transport layer happens at the:
Correct: Destination, using port numbers.
- Congestion = load > network capacity. Congestion control keeps the load below capacity.
🎯 How this can come up · 1 question
Keeping the load on the network below its capacity is:
Correct: Congestion control.
- Connectionless/connection-oriented means something different at the transport layer than at the network layer.
- UDP (connectionless): segments independent, no flow/error/congestion control.
- TCP (connection-oriented): set up first, both sides agree, in-order delivery, flow + error + congestion control, then close.
🎯 How this can come up · 2 questions
Compare connectionless (UDP) and connection-oriented (TCP) transport services.
Connectionless (UDP): each segment is independent, no connection setup, no flow, error or congestion control. Connection-oriented (TCP): a logical connection is set up with both sides agreeing before data is sent, segments are delivered in order, flow, error and congestion control are applied, and the connection is closed afterwards.
UDP provides flow and congestion control.
False.
- Connectionless: delivered out of order and nobody fixes it.
- Connection-oriented: open → data (out-of-order segments held and reordered) → teardown.
- Flow control: don’t overflow the receiver’s buffer.
- Error control: the whole message arrives without error, loss, duplication, in order.
- Same figure as slide 5.
- TCP: connection-oriented, reliable (sequence numbers, error + flow + congestion control). Header 20 bytes, up to 60.
🎯 How this can come up · 1 question
The default TCP header size is:
Correct: 20 bytes.
- Ports (16 + 16), sequence (32), ACK number (32), HLEN, flags, window (16), checksum, urgent pointer, options.
- SYN = synchronize (open). ACK = acknowledgment valid. FIN = finish (close). RST = reset. PSH = push. URG = urgent.
🎯 How this can come up · 2 questions
Which TCP flag is used to open a connection?
Correct: SYN.
Which flag terminates a connection?
Correct: FIN.
- Sender and receiver run at different speeds → buffers on both sides; TCP groups bytes into segments.
- TCP numbers BYTES, not segments. The first number is random (ISN).
- Next segment’s sequence number = previous sequence number + bytes it carried.
🎯 How this can come up · 2 questions
A segment has sequence number 2,001 and carries 500 bytes. The next segment’s sequence number is:
Correct: 2,501.
TCP sequence numbers count segments.
False. They count bytes.
- Add 1,000 each time.
🎯 How this can come up · 1 question
A 6,000-byte file starts at byte 1,001 and is sent in 3 equal segments. The third segment’s sequence number is:
1,001 → 3,001 → 5,001.
- TCP opens with a three-way handshake and closes the session afterwards.
- 1) Client → SYN with a random initial sequence number.
- 2) Server → SYN + ACK: acknowledges, gives its own ISN and its receive window.
- 3) Client → ACK, with its receive window.
🎯 How this can come up · 2 questions
The second segment of the three-way handshake has which flags set?
Correct: SYN and ACK.
The client sends SYN with seq 8000. The server’s SYN+ACK carries ack =
SYN consumes one sequence number.
- ACK number = next byte expected = last byte received + 1. ACKs are cumulative (all bytes up to X - 1).
- A timer per segment: no ACK in time → retransmit.
🎯 How this can come up · 2 questions
A receiver got bytes up to 4,500. It sends ACK number:
Correct: 4,501.
An ACK number of X means bytes up to X - 1 were received.
True.
- Explained on the next slide. ACKs piggyback on data segments.
- 8001–9000, 9001–10000 → server ACKs 10001 and sends 15001–17000 → client ACKs 17001.
🎯 How this can come up · 1 question
Client sends seq 8001 (1000 bytes) and seq 9001 (1000 bytes). The server replies with 2000 bytes starting at 15001. Give the server’s ACK number and the client’s final ACK number.
The server acknowledges 10001 (it has bytes up to 10000). Its data covers 15001–17000, so the client acknowledges 17001.
- Termination: FIN → ACK, then (when the other side is done) FIN → ACK. Half-close in between.
🎯 How this can come up · 1 question
After host 1 sends FIN and gets ACK, host 1 can:
Correct: Only acknowledge, not send data.
- Window = how much the sender may send before it must wait for an ACK.
- TCP grows and shrinks the window for flow control. Each side has a send window and a receive window.
🎯 How this can come up · 1 question
TCP flow control is done with:
Correct: Sliding windows.
- My SEND window = the other side’s RECEIVE window.
🎯 How this can come up · 1 question
The server advertises a receive window of 5,000 bytes. The client’s send window is:
Correct: 5,000 bytes.
- TCP for anything that must arrive complete: web (HTTP), email (SMTP), Telnet, file transfer (FTP).
🎯 How this can come up · 1 question
Which application needs TCP?
Correct: File transfer with FTP.
- UDP: connectionless, no handshake, unreliable (segments can be lost, reordered, duplicated, corrupted).
- Optional checksum over the whole segment; on error it just DISCARDS.
- Benefits: simple, small header, no setup delay.
🎯 How this can come up · 2 questions
When UDP detects an error with its checksum, it asks the sender to retransmit.
False. It simply discards the segment.
The UDP checksum is:
Correct: Optional and covers the entire segment.
- UDP for apps that tolerate a little loss and need speed: multimedia, internet telephony, video conferencing, DNS, audio, some routing protocols.
- One short request + one short reply (DNS) → UDP is perfect: nothing to reorder.
🎯 How this can come up · 1 question
Why does DNS use UDP?
Correct: Short request and reply that each fit in one datagram.
- Long messages (SMTP with attachments) split over many datagrams can arrive out of order → UDP is a bad fit.
- Big file download: completeness matters more than delay → TCP.
🎯 How this can come up · 1 question
You are downloading a very large text file. TCP or UDP? Why?
TCP. No part of the file may be missing or corrupted, and the delay between parts doesn’t matter because the file is opened only when complete. UDP gives no reliability or ordering.
- Real-time (Skype): resending late frames is worse than skipping them → UDP.
🎯 How this can come up · 1 question
A video call app must choose between TCP and UDP. Which, and why?
UDP. Audio and video are sent as a stream of small frames; waiting for a retransmission would break the timing and freeze the call. With UDP a lost or corrupted frame is just skipped, and the brief gap is barely noticed.
- UDP header = 8 bytes: source port, destination port, length, checksum. (TCP’s is 20.)
🎯 How this can come up · 1 question
The UDP header length is:
Correct: 8 bytes.
No slides match this filter.





















