Quiz · Medium
OSI layers, TCP vs UDP, the three-way handshake, DNS, DHCP, ARP, NAT, common ports, IPv4 vs IPv6 and subnet math. Good for networking courses and CompTIA Network+ prep.
In the OSI model shown, at which layer does TCP operate?
Layer 3, Network
Layer 7, Application
Layer 4, Transport
Layer 2, Data Link
TCP and UDP are transport protocols: they handle end-to-end delivery between applications using port numbers. IP, which routes packets between networks, is at layer 3.
At which OSI layer does a router forward packets using IP addresses?
Layer 2, Data Link
Layer 3, Network
Layer 4, Transport
Layer 1, Physical
Routers read IP addresses and choose paths between networks (layer 3). Switches forward frames within a local network using MAC addresses (layer 2).
Which protocol is usually preferred for live video calls and online games?
TCP, because it guarantees every packet arrives in order
ICMP, because it is the fastest
FTP, because it handles streaming
UDP, because it has low overhead and does not wait to resend lost packets
In real-time media, a late packet is useless, so retransmitting it (as TCP does) only adds delay. UDP lets the app skip lost data and keep going. TCP suits web pages, email and file transfers, where every byte matters.
What is the order of the TCP three-way handshake?
ACK → SYN → SYN-ACK
SYN → ACK → FIN
HELLO → ACK → READY
SYN → SYN-ACK → ACK
The client sends SYN, the server replies SYN-ACK, and the client confirms with ACK. Both sides have now agreed on starting sequence numbers. FIN is used to close a connection.
What does DNS do?
Assigns IP addresses to devices on a network
Encrypts web traffic
Translates domain names like example.com into IP addresses
Maps IP addresses to MAC addresses
DNS is the internet's phone book and normally uses port 53. Assigning addresses is DHCP's job, and mapping IP to MAC is ARP's.
Which port does HTTPS use by default?
80
22
25
443
HTTPS uses 443. HTTP uses 80, SSH 22 and SMTP 25. Common ports come up often in IT certification exams.
How long are IPv4 and IPv6 addresses?
IPv4 is 64 bits; IPv6 is 128 bits
IPv4 is 32 bits; IPv6 is 128 bits
IPv4 is 32 bits; IPv6 is 64 bits
Both are 48 bits
IPv4 gives about 4.3 billion () addresses, which ran out. IPv6 gives . 48 bits is the length of a MAC address.
How many usable host addresses are in a /24 subnet such as 192.168.1.0/24?
256
255
254
24
A /24 leaves 8 host bits: addresses. Subtract 2, the network address (.0) and the broadcast address (.255), to get 254 usable hosts.
How many usable host addresses are in a /26 subnet?
64
30
126
62
32 − 26 = 6 host bits, so addresses, minus 2 for network and broadcast = 62. A /27 gives 30, and a /25 gives 126.
Which of these is a private IPv4 address?
192.168.1.10
8.8.8.8
172.32.0.5
11.0.0.1
The private ranges are 10.0.0.0/8, 172.16.0.0/12 (172.16–172.31) and 192.168.0.0/16. 172.32.0.5 is just outside the 172 range, a common trick. 8.8.8.8 is Google's public DNS.
A laptop joins Wi-Fi and automatically receives an IP address, subnet mask, gateway and DNS server. Which protocol did that?
DNS
DHCP
ARP
NAT
DHCP hands out network settings through the DORA exchange: Discover, Offer, Request, Acknowledge. DNS only resolves names.
A host knows the IP address of another device on its local network but needs its MAC address to send a frame. Which protocol does it use?
DNS
DHCP
ARP
ICMP
ARP broadcasts "who has this IP?" and the owner replies with its MAC address, which is then cached. DNS maps names to IPs, not IPs to MACs.
What does NAT on a home router do?
Translates many private internal addresses to one public IP address
Assigns domain names to devices
Encrypts all outgoing traffic
Blocks all incoming traffic
NAT rewrites the source address (and port) of outgoing packets and tracks the mappings so replies get back to the right device. It is a big reason IPv4 has lasted this long.
A browser gets HTTP status code 404. What does it mean?
The server had an internal error
The resource moved permanently
The server could not find the requested resource
The request succeeded
4xx codes are client errors, and 404 is Not Found. 500 is an internal server error, 301 is Moved Permanently, and 200 is OK.
What is a default gateway?
The DNS server a host uses first
The switch port a host is plugged into
The MAC address of the host's network card
The router address a host sends traffic to when the destination is outside its local subnet
Hosts deliver local traffic directly. Anything for another network goes to the default gateway, usually the router, which forwards it on. A wrong gateway means local access works but the internet does not.