Skip to content

Computer Networking Practice Test — 30 Problems

Computer Networking Practice Test — 30 Problems

Section titled “Computer Networking Practice Test — 30 Problems”

This practice test covers 30 problems across four major domains of computer networking: OSI Model and TCP/IP, Transport Protocols, Routing and DNS, and Network Security. Each problem tests conceptual understanding, protocol analysis, and real-world scenario reasoning. Work through all problems before checking the answer key.

  • Time limit: 75 minutes (2.5 minutes per problem)
  • Format: Multiple choice and scenario analysis — select the best answer or apply networking concepts to a scenario
  • Marking: 1 mark per problem, 30 marks total
  • Conditions: Attempt without notes.
  • After the test: Check the answer key at the bottom. Study the explanations for any problems you got wrong.
DomainProblemsMarks
OSI Model and TCP/IPP1–P88
Transport Protocols (TCP/UDP)P9–P168
Routing and DNSP17–P237
Network SecurityP24–P307
Total3030

At which OSI layer does a router operate?

#Option
ALayer 1 — Physical
BLayer 2 — Data Link
CLayer 3 — Network
DLayer 4 — Transport
ELayer 5 — Session

Correct: C (index 2)

Routers operate at Layer 3 (Network). They make forwarding decisions based on IP addresses, which are Network layer addresses. Layer 2 devices (switches) use MAC addresses. Layer 4 devices (load balancers) use port numbers.

easy — 1 mark


When a host sends an HTTP request, in which order are the protocol headers added?

#Option
ATCP → IP → Ethernet → HTTP
BHTTP → TCP → IP → Ethernet
CEthernet → IP → TCP → HTTP
DIP → TCP → HTTP → Ethernet
EHTTP → Ethernet → IP → TCP

Correct: B (index 1)

Data flows down the protocol stack. The application adds HTTP headers, the transport layer adds TCP headers, the network layer adds IP headers, and the data link layer adds Ethernet headers (and trailers). This is encapsulation — each layer wraps the data from the layer above.

easy — 1 mark


What is the Protocol Data Unit (PDU) at the Transport layer?

#Option
ABit
BFrame
CPacket
DSegment
EDatagram

Correct: D (index 3)

The PDU names by layer are: Physical = Bit, Data Link = Frame, Network = Packet, Transport = Segment (TCP) or Datagram (UDP). “Segment” is the standard term for a TCP PDU. “Datagram” is used for UDP.

easy — 1 mark


Which TCP/IP layer corresponds to OSI layers 5, 6, and 7?

#Option
ALink layer
BInternet layer
CTransport layer
DApplication layer
ESession layer

Correct: D (index 3)

The TCP/IP model consolidates OSI layers 5 (Session), 6 (Presentation), and 7 (Application) into a single Application layer. The TCP/IP model has four layers: Link, Internet, Transport, and Application. This simplification reflects how the internet actually works.

medium — 1 mark


A device receives a frame with a destination MAC address that is not in its forwarding table. What does it do?

#Option
ADrops the frame
BSends an ICMP error
CFloods the frame out all ports except the source
DBuffers the frame until the address is learned
EReturns the frame to the sender

Correct: C (index 2)

When a switch receives a frame with an unknown destination MAC, it floods the frame out all ports except the source port. This is how switches learn MAC addresses — they observe the source MAC on incoming frames and build their forwarding table.

medium — 1 mark


What is the primary purpose of ARP (Address Resolution Protocol)?

#Option
AResolve domain names to IP addresses
BResolve IP addresses to MAC addresses
CAssign IP addresses dynamically
DEncrypt network traffic
ERoute packets between networks

Correct: B (index 1)

ARP maps IP addresses (Layer 3) to MAC addresses (Layer 2). When a host wants to send a frame to another host on the same LAN, it uses ARP to discover the destination’s MAC address. DNS resolves domain names to IP addresses — a different function.

easy — 1 mark


A host has IP address 192.168.10.67 with subnet mask 255.255.255.192. How many usable host addresses are in this subnet?

#Option
A62
B64
C30
D32
E126

Correct: A (index 0)

255.255.255.192 = /26 (26 network bits). Host bits = 32 - 26 = 6. Total addresses = 2^6 = 64. Usable hosts = 64 - 2 = 62 (subtract network address and broadcast address). The subnet is 192.168.10.64/26 with host range .65 to .126.

medium — 1 mark


What is the size of an IPv6 address?

#Option
A32 bits
B64 bits
C128 bits
D256 bits
E512 bits

Correct: C (index 2)

IPv6 addresses are 128 bits, written as eight groups of four hexadecimal digits separated by colons. This provides approximately 3.4 × 10^38 unique addresses — enough for every device on Earth. IPv4 addresses are only 32 bits (approximately 4.3 billion).

easy — 1 mark


Transport Protocols — TCP/UDP (P9–P16)

Section titled “Transport Protocols — TCP/UDP (P9–P16)”

What is the correct sequence of the TCP three-way handshake?

#Option
ASYN → SYN-ACK → ACK
BACK → SYN-ACK → SYN
CSYN → ACK → SYN-ACK
DFIN → FIN-ACK → ACK
ESYN → RST → ACK

Correct: A (index 0)

The TCP three-way handshake: (1) Client sends SYN (synchronise), (2) Server responds with SYN-ACK (synchronise-acknowledge), (3) Client sends ACK (acknowledge). After this, the connection is established and data can flow bidirectionally.

easy — 1 mark


Which application is best suited for UDP rather than TCP?

#Option
AWeb browsing (HTTP)
BEmail (SMTP)
CFile transfer (FTP)
DLive video streaming
EDatabase queries

Correct: D (index 3)

UDP is ideal for real-time applications where speed matters more than perfect reliability. Live video streaming can tolerate dropped packets — a brief glitch is acceptable, but retransmission delays would cause buffering. TCP is better for HTTP, SMTP, FTP, and databases where every byte must arrive correctly.

easy — 1 mark


What mechanism does TCP use for flow control?

#Option
AToken bucket
BSliding window
CLeaky bucket
DRound robin
EExponential backoff

Correct: B (index 1)

TCP uses a sliding window mechanism for flow control. The receiver advertises a window size indicating how much data it can buffer. The sender limits its outstanding (unacknowledged) data to this window. This prevents the sender from overwhelming the receiver’s buffer.

medium — 1 mark


In TCP congestion control, what happens during “slow start”?

#Option
AThe sender transmits at minimum speed indefinitely
BThe congestion window doubles each RTT until a threshold is reached
CThe sender reduces speed by half after each loss
DThe sender waits for explicit permission from the receiver
EThe sender transmits one segment per second

Correct: B (index 1)

Slow start begins with a congestion window (cwnd) of 1 MSS. The sender doubles cwnd each round-trip time (exponential growth). When cwnd reaches the slow start threshold (ssthresh), it transitions to congestion avoidance (linear growth). Despite the name, slow start is actually fast — it ramps up quickly.

medium — 1 mark


Why does TCP enter the TIME_WAIT state after closing a connection?

#Option
ATo wait for the application to acknowledge the close
BTo ensure the last ACK is received and to prevent old segments from affecting new connections
CTo retransmit any lost data
DTo wait for DNS resolution
ETo conserve resources

Correct: B (index 1)

TIME_WAIT persists for 2× Maximum Segment Lifetime (typically 60 seconds). It ensures: (1) the last ACK is received by the remote (if lost, it retransmits), and (2) old segments from the connection are drained from the network before a new connection uses the same port pair.

medium — 1 mark


Which statement about UDP is correct?

#Option
AUDP establishes a connection before sending data
BUDP provides ordered delivery
CUDP is connectionless and does not guarantee delivery, ordering, or retransmission
DUDP includes flow control
EUDP is slower than TCP due to error checking

Correct: C (index 2)

UDP is connectionless — no handshake, no connection state. It sends datagrams best-effort with no guarantee of delivery, ordering, or error recovery. It has no flow control or congestion control. This makes it fast and lightweight — ideal for DNS, DHCP, VoIP, and gaming.

easy — 1 mark


What triggers TCP retransmission?

#Option
AThe receiver sends a RST packet
BThe sender’s retransmission timer expires without receiving an ACK
CThe congestion window reaches zero
DThe TTL field in the IP header reaches zero
EThe sender receives a duplicate ACK

Correct: B (index 1)

TCP starts a retransmission timer when it sends a segment. If an ACK is not received before the timer expires, the segment is retransmitted. Fast retransmit is triggered by three duplicate ACKs (without waiting for the timer). Both mechanisms ensure reliability.

medium — 1 mark


Which port number is used by HTTPS?

#Option
A80
B443
C22
D25
E53

Correct: B (index 1)

HTTPS uses port 443. HTTP uses port 80. SSH uses port 22. SMTP uses port 25. DNS uses port 53. Port numbers are part of the Transport layer addressing, combined with IP addresses to identify specific communication endpoints (sockets).

easy — 1 mark


What is the purpose of a default gateway?

#Option
ATo assign IP addresses to hosts
BTo route packets destined for addresses outside the local network
CTo resolve domain names
DTo encrypt traffic between hosts
ETo filter incoming traffic

Correct: B (index 1)

The default gateway is the router that hosts use to communicate with devices on other networks. When a host wants to send a packet to an IP address outside its local subnet, it forwards the packet to the default gateway, which routes it toward the destination.

easy — 1 mark


When is static routing most appropriate?

#Option
AIn large enterprise networks with hundreds of routers
BIn networks where paths change frequently
CIn small, simple networks with a single path to the destination
DIn networks requiring automatic failover
EIn internet backbone infrastructure

Correct: C (index 2)

Static routing is appropriate for small, stable networks with predictable traffic patterns. It is simple to configure and has no overhead. Dynamic routing (OSPF, BGP, RIP) is necessary for large networks where paths change and automatic convergence is required.

medium — 1 mark


Which attribute does BGP use as the primary path selection criterion?

#Option
AHop count
BHighest bandwidth
CAS-path length
DLowest latency
ERound-trip time

Correct: C (index 2)

BGP primarily selects paths based on AS-path length — shorter paths are preferred. BGP is a path-vector protocol that makes policy-based decisions, not performance-based ones. Other attributes (local preference, weight, origin) are used as tiebreakers. BGP is the protocol that connects autonomous systems on the internet.

medium — 1 mark


In order, what are the correct steps of a DNS lookup?

#Option
ARoot → TLD → Authoritative → Recursive resolver → Client
BClient → Recursive resolver → Root → TLD → Authoritative
CClient → Authoritative → Root → TLD → Recursive resolver
DRecursive resolver → Client → Root → TLD → Authoritative
ERoot → Client → TLD → Recursive resolver → Authoritative

Correct: B (index 1)

DNS resolution: (1) Client queries recursive resolver, (2) Resolver queries root server, (3) Root directs to TLD server (.com, .org), (4) TLD directs to authoritative server, (5) Authoritative server returns the IP address. The resolver caches the result and returns it to the client.

medium — 1 mark


Which DNS record type maps a domain to an IPv6 address?

#Option
AA
BAAAA
CCNAME
DMX
ETXT

Correct: B (index 1)

A = IPv4 address, AAAA (quad-A) = IPv6 address, CNAME = canonical name alias, MX = mail exchange server, TXT = arbitrary text data. AAAA records were named to continue the “A” convention while indicating the address is four times longer (128 bits vs 32 bits).

easy — 1 mark


What does NAT accomplish?

#Option
AEncrypts all outgoing traffic
BTranslates private IP addresses to public IP addresses for internet access
CAssigns IP addresses dynamically to hosts
DRoutes packets between different autonomous systems
ECompresses packets for faster transmission

Correct: B (index 1)

NAT maps private IP addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to public IP addresses. This allows many devices on a private network to share a single public IP address, conserving IPv4 addresses. NAT also provides a layer of security by hiding internal addresses.

easy — 1 mark


What type of routing protocol is OSPF?

#Option
ADistance-vector
BPath-vector
CLink-state
DHybrid
EStatic

Correct: C (index 2)

OSPF (Open Shortest Path First) is a link-state routing protocol. Each router builds a complete topology map of the network and computes shortest paths using Dijkstra’s algorithm. Distance-vector protocols (RIP) share routing tables with neighbours. BGP is path-vector.

medium — 1 mark


What does the TLS handshake accomplish?

#Option
AAssigns IP addresses to clients
BEstablishes a secure channel with encryption, authentication, and integrity
CRoutes packets through secure tunnels
DCompresses data for faster transmission
EAuthenticates users via passwords

Correct: B (index 1)

The TLS handshake: (1) negotiates cipher suites, (2) authenticates the server via certificate, (3) exchanges keys for symmetric encryption, (4) establishes session keys. After the handshake, all application data is encrypted, authenticated, and integrity-verified.

easy — 1 mark


P25 — Symmetric vs Asymmetric Encryption

Section titled “P25 — Symmetric vs Asymmetric Encryption”

Why does TLS use both symmetric and asymmetric encryption?

#Option
ASymmetric is more secure than asymmetric
BAsymmetric is used for key exchange; symmetric is used for bulk data encryption
CThey serve the same purpose
DAsymmetric is faster for data encryption
ESymmetric cannot be used over networks

Correct: B (index 1)

Asymmetric encryption (RSA, ECDH) is slow but solves the key distribution problem — it is used during the handshake to exchange a shared secret. Symmetric encryption (AES, ChaCha20) is fast and used for encrypting application data. TLS combines both for efficiency and security.

medium — 1 mark


How does a browser verify a website’s certificate?

#Option
AIt checks the website’s public key directly
BIt verifies the certificate chain back to a trusted root CA in its trust store
CIt contacts the website to confirm the certificate is valid
DIt checks the certificate’s expiration date only
EIt uses DNS to verify the certificate

Correct: B (index 1)

Certificate verification: (1) The server presents its certificate, (2) The browser checks it is signed by an intermediate CA, (3) The intermediate CA is signed by a root CA, (4) The root CA is in the browser’s trust store. If any link fails, the browser shows a warning.

medium — 1 mark


Which firewall type inspects the actual content of network packets beyond headers?

#Option
APacket-filtering firewall
BStateful firewall
CApplication-layer (proxy) firewall
DNAT firewall
ECloud-based firewall

Correct: C (index 2)

Packet-filtering firewalls inspect IP/TCP/UDP headers. Stateful firewalls track connection state. Application-layer firewalls (proxies) inspect the payload content — they can block specific HTTP requests, filter malware, and enforce application-level policies. Next-generation firewalls combine all three.

medium — 1 mark


Which VPN protocol operates at the network layer?

#Option
ASSL/TLS VPN
BWireGuard
CIPsec
DPPTP
ESSH tunnel

Correct: C (index 2)

IPsec operates at Layer 3 (Network). It provides encryption, authentication, and integrity for IP packets. WireGuard operates at Layer 3 as well but is a modern, simpler protocol. SSL/TLS VPNs operate at the transport/application layer. PPTP is a legacy protocol with known vulnerabilities.

medium — 1 mark


What is a distributed denial-of-service (DDoS) attack?

#Option
AA single computer flooding a target with traffic
BMultiple compromised systems flooding a target with traffic to overwhelm it
CIntercepting communication between two parties
DInjecting malicious code into a web application
EStealing credentials through phishing

Correct: B (index 1)

A DDoS attack uses a botnet (many compromised systems) to flood a target with traffic, exhausting its bandwidth, CPU, or memory. The distributed nature makes it harder to block than a single-source DoS attack. Mitigation requires traffic filtering, rate limiting, and DDoS protection services.

easy — 1 mark


What is the key difference between an IDS and an IPS?

#Option
AIDS blocks attacks; IPS only detects them
BIDS detects and alerts; IPS detects and actively blocks or prevents attacks
CThey are identical
DIDS operates at Layer 2; IPS operates at Layer 7
EIPS is passive; IDS is active

Correct: B (index 1)

An Intrusion Detection System (IDS) monitors traffic and alerts on suspicious activity — it is passive. An Intrusion Prevention System (IPS) sits inline with traffic and can drop malicious packets, reset connections, or block source IPs — it is active. IDS provides visibility; IPS provides enforcement.

medium — 1 mark


Click to reveal the answer key
QuestionAnswerQuestionAnswerQuestionAnswer
P1CP11BP21B
P2BP12BP22B
P3DP13BP23C
P4DP14CP24B
P5CP15BP25B
P6BP16BP26B
P7AP17BP27C
P8CP18CP28C
P9AP19CP29B
P10DP20BP30B

DifficultyCount
Easy11
Medium18
Hard1

  • OSI Model and TCP/IP — Layer functions, protocol mapping, and encapsulation
  • TCP and UDP — Connection management, flow control, and congestion control
  • DNS — Resolution process, record types, and caching
  • HTTP and HTTPS — Request/response, methods, and status codes
  • TLS — Encryption, certificates, and the handshake
  • Network Security — Firewalls, IDS/IPS, and VPNs
  • Computer Science — Algorithms and protocols that underpin networking

  1. Visualise the protocol stack. When tracing a packet, think about what happens at each layer — from physical transmission to application processing.
  2. Know the numbers. Common port numbers (80, 443, 22, 53, 25), address ranges, and header fields are worth memorising.
  3. Understand the “why”. Protocols exist because of specific problems — understanding the problem makes the protocol design intuitive.
  4. Practise subnetting by hand. Mental subnet calculations build intuition that tools alone cannot provide.
  5. Retake after one week. Networking has many interacting concepts — spaced repetition is essential.

Last updated: 24 July 2026

Written by Wyatt. For questions or feedback, visit wyattau.com.