
This third set of Computer Networks MCQs moves up the stack to the transport layer, routing and common application protocols. It suits GATE aspirants, students preparing for university exams and anyone revising networking for placement interviews, and every numerical on TCP and routing comes with short working.
How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 18 questions.
Topics covered in this set
- TCP vs UDP and the three-way handshake
- Flow control and congestion control
- Port numbers of common protocols
- Distance vector vs link state, RIP, OSPF and BGP
- DNS, HTTP/HTTPS, SMTP, POP3 and IMAP
- DHCP and NAT
Computer networks MCQs with answers and explanations
Q1. Which statement about UDP is correct?
a) It guarantees in-order delivery of datagrams
b) It uses a three-way handshake before sending data
c) It is connectionless and provides no flow or congestion control
d) Its header is 20 bytes long
Q2. What is the correct order of segments in the TCP three-way handshake initiated by a client?
a) SYN, SYN+ACK, ACK
b) SYN, ACK, SYN+ACK
c) SYN+ACK, SYN, ACK
d) SYN, FIN, ACK
Q3. Which protocol and default port pairing is correct?
a) SMTP - port 110
b) HTTPS - port 8080
c) POP3 - port 143
d) DNS queries - port 53
Q4. In TCP flow control, how does the receiver stop a fast sender from overflowing its buffer?
a) By advertising its free buffer space in the receive window (rwnd) field
b) By sending three duplicate ACKs
c) By reducing the sender's congestion window directly
d) By dropping every alternate segment
Q5. A TCP sender receives three duplicate ACKs for the same segment. Which mechanism does this trigger?
a) Slow start from a window of 1 MSS without retransmission
b) Fast retransmit of the missing segment without waiting for the timeout
c) Connection termination using FIN
d) Doubling of the retransmission timeout
Q6. The count-to-infinity problem is a known weakness of which kind of routing algorithm?
a) Link state routing
b) Path vector routing
c) Distance vector routing
d) Static routing
Q7. In RIP, which hop count value represents an unreachable destination?
a) 15
b) 16
c) 255
d) 30
Q8. Which statement about OSPF is correct?
a) It is a distance vector protocol that uses the Bellman-Ford algorithm
b) It is used for routing between different autonomous systems
c) It sends its full routing table to neighbours every 30 seconds
d) It is a link state protocol that computes routes with Dijkstra's algorithm
Q9. Which statement correctly describes BGP?
a) It is a path vector protocol for inter-domain routing that runs over TCP port 179
b) It is a link state protocol used inside a single area
c) It runs over UDP port 520
d) It always chooses the path with the fewest router hops
Q10. Which DNS resource record maps a host name to an IPv6 address?
a) A
b) MX
c) AAAA
d) CNAME
Q11. A user wants mail to stay on the server and be organised in folders that look the same from a phone and a laptop. Which protocol fits best for reading the mail?
a) SMTP
b) POP3
c) FTP
d) IMAP
Q12. What is the correct order of messages when a client obtains an IP address using DHCP?
a) Request, Offer, Discover, Acknowledge
b) Discover, Offer, Request, Acknowledge
c) Offer, Discover, Acknowledge, Request
d) Discover, Request, Offer, Acknowledge
Q13. How does NAT with port address translation (PAT / NAT overload) let many private hosts share one public IP address?
a) It keeps a table mapping each private IP and port to a unique port on the public IP
b) It assigns each host a different public IP from a pool for every packet
c) It encrypts the private address inside the TCP payload
d) It changes only the MAC address of outgoing frames
Q14. A client picks initial sequence number 1000 and sends SYN. The server picks initial sequence number 5000 and replies with SYN+ACK. What are the sequence and acknowledgement numbers in the client's final ACK?
a) Seq = 1000, Ack = 5000
b) Seq = 1001, Ack = 5000
c) Seq = 1000, Ack = 5001
d) Seq = 1001, Ack = 5001
Q15. A TCP connection starts with cwnd = 1 MSS in transmission round 1 and ssthresh = 16 MSS. With no losses, slow start doubles cwnd each round until ssthresh, then congestion avoidance adds 1 MSS per round. What is cwnd in round 7?
a) 64 MSS
b) 32 MSS
c) 18 MSS
d) 22 MSS
Q16. In TCP Tahoe, a retransmission timeout occurs when cwnd = 20 MSS. What are the new ssthresh and cwnd?
a) ssthresh = 20 MSS, cwnd = 10 MSS
b) ssthresh = 10 MSS, cwnd = 1 MSS
c) ssthresh = 10 MSS, cwnd = 10 MSS
d) ssthresh = 1 MSS, cwnd = 1 MSS
Q17. Router A uses distance vector routing. Its link cost to neighbour B is 2 and to neighbour C is 5. B advertises a distance of 7 to destination D, and C advertises a distance of 3 to D. What does A record for D?
a) Cost 8 via C
b) Cost 9 via B
c) Cost 3 via C
d) Cost 7 via B
Q18. A web page has one base HTML file that references 10 small images on the same server. Using non-persistent HTTP with one connection at a time, and ignoring transmission time and DNS lookup, how many RTTs are needed to fetch the whole page?
a) 11 RTTs
b) 12 RTTs
c) 22 RTTs
d) 20 RTTs
Quick revision notes
- TCP header is 20-60 bytes and connection-oriented; UDP header is 8 bytes and connectionless.
- SYN and FIN each consume one sequence number; ACK number = next byte expected.
- Sender window = min(rwnd, cwnd); rwnd is for flow control, cwnd is for congestion control.
- Slow start doubles cwnd per RTT up to ssthresh; congestion avoidance adds 1 MSS per RTT (AIMD).
- Timeout: ssthresh = cwnd/2, cwnd = 1 MSS; three duplicate ACKs: fast retransmit (and fast recovery in Reno).
- RIP: distance vector, hop count, 16 = infinity; OSPF: link state, Dijkstra; BGP: path vector, TCP 179.
- Ports: FTP 20/21, SSH 22, SMTP 25, DNS 53, DHCP 67/68, HTTP 80, POP3 110, IMAP 143, HTTPS 443.
- Non-persistent HTTP costs 2 RTT per object; persistent HTTP reuses one connection.
Frequently asked questions
When should an application use UDP instead of TCP?
UDP suits applications that value low delay over perfect reliability, such as live video, voice calls, online games and DNS queries. These applications either tolerate some loss or handle recovery themselves, so TCP's handshake and retransmission delays are not worth paying.
What is the difference between flow control and congestion control in TCP?
Flow control protects the receiver: the receiver advertises how much buffer space it has, and the sender stays within it. Congestion control protects the network: the sender estimates available capacity with its congestion window and cuts it back when losses suggest the network is overloaded.
Why are both link state and distance vector routing still used?
Distance vector protocols like RIP are simple and need little memory, which suits small networks. Link state protocols like OSPF converge faster and avoid count-to-infinity, so they are preferred in larger enterprise networks, while BGP handles policy-based routing between autonomous systems.
Comments
Post a Comment