AI-assisted, automatically checked• Updated August 2026

Computer Networks MCQs

Computer Networks MCQs covering the OSI 7-layer model, TCP/IP stack, routing algorithms, DNS, and HTTP/HTTPS.

47 MCQsComputer ScienceAll Levels
Key Concept Overview & Exam Context

Review core principles of Computer Networks before answering questions. These questions simulate placement technical assessments (TCS, Infosys, Amazon), university exams (CS/IT), and technical certifications.

Target Readiness
Placements & Job Interviews
Question Format
Multiple-Choice with Explanations
Explained Solutions
Written explanations

Computer Networks MCQ Questions

Page 1 of 1 (47 total)
Q1

What is the main difference between TCP and UDP?

medium
View Answer & Explanation
Correct Answer: TCP is connection-oriented and guarantees reliable delivery, while UDP is connectionless and does not guarantee delivery
Explanation:
TCP establishes a connection through a handshake and ensures packets arrive in order and without loss, while UDP simply sends packets without such guarantees, making it faster but less reliable, which suits use cases like live video streaming.
Q2

What is the purpose of DNS in computer networking?

easy
View Answer & Explanation
Correct Answer: To translate human readable domain names into IP addresses
Explanation:
DNS acts like a phone book for the internet, allowing users to type a domain name such as example.com instead of memorizing the numeric IP address of the server hosting that website.
Q3

What is the primary function of a firewall?

easy
View Answer & Explanation
Correct Answer: To monitor and control incoming and outgoing network traffic based on predetermined security rules
Explanation:
A firewall acts as a barrier between a trusted internal network and untrusted external networks, deciding which traffic is allowed through based on rules covering ports, protocols, or IP addresses.
Q4

What does DHCP stand for and what does it do?

medium
View Answer & Explanation
Correct Answer: Dynamic Host Configuration Protocol, which automatically assigns IP addresses to devices on a network
Explanation:
Without DHCP, network administrators would need to manually configure an IP address on every device, which becomes impractical on larger networks where devices join and leave frequently.
Q5

What is the purpose of the three-way handshake in TCP?

medium
View Answer & Explanation
Correct Answer: To establish a reliable connection between a client and server before data transfer begins
Explanation:
The three-way handshake consists of a SYN, SYN-ACK, and ACK exchange between client and server, which synchronizes sequence numbers and confirms that both sides are ready to communicate before any actual data is sent.
Q6

What is the difference between a MAC address and an IP address?

medium
View Answer & Explanation
Correct Answer: A MAC address is a fixed hardware identifier for a network interface, while an IP address is a logical address that can change based on the network
Explanation:
A device's MAC address is typically assigned by the manufacturer and rarely changes, while its IP address depends on which network it connects to and can change each time it joins a different network.
Q7

What is the main purpose of Network Address Translation (NAT)?

medium
View Answer & Explanation
Correct Answer: To allow multiple devices on a private network to share a single public IP address
Explanation:
NAT translates private internal IP addresses into a single public IP address when traffic leaves the local network, which conserves the limited pool of available public IP addresses.
Q8

What is the difference between HTTP and HTTPS?

easy
View Answer & Explanation
Correct Answer: HTTPS encrypts data in transit using SSL/TLS, while standard HTTP sends data without encryption
Explanation:
Because HTTPS encrypts the data exchanged between a browser and a server, it protects sensitive information like passwords or payment details from being intercepted, which is why most modern websites use it by default.
Q9

What is the function of a router in a computer network?

easy
View Answer & Explanation
Correct Answer: To forward data packets between different networks based on their destination IP address
Explanation:
A router examines the destination address of incoming packets and determines the best path to forward them toward their destination, which is what allows devices on different networks, such as a home network and the internet, to communicate.
Q10

What is bandwidth in the context of computer networks?

medium
View Answer & Explanation
Correct Answer: The maximum rate at which data can be transferred over a network connection in a given amount of time
Explanation:
Bandwidth is usually measured in bits per second and represents the capacity of a connection, which is different from latency, which measures the delay before data starts arriving.
Q11

What is the purpose of a subnet mask in IP networking?

hard
View Answer & Explanation
Correct Answer: To divide an IP address into a network portion and a host portion
Explanation:
A subnet mask determines which part of an IP address identifies the network a device belongs to and which part identifies the specific device, which is essential for routing traffic correctly within and between networks.
Q12

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

hard
View Answer & Explanation
Correct Answer: To map an IP address to its corresponding MAC address on a local network
Explanation:
When a device needs to send data to another device on the same local network, it uses ARP to discover the MAC address associated with the destination's IP address, since data link layer communication requires a MAC address.
Q13

What is the primary difference between a hub and a switch?

medium
View Answer & Explanation
Correct Answer: A hub broadcasts incoming data to all connected devices, while a switch sends data only to the intended recipient device
Explanation:
Because a switch learns which device is connected to which port using MAC addresses, it can forward traffic directly to the correct destination, reducing unnecessary network traffic compared to a hub, which simply repeats data to every port.
Q14

What is latency in networking terms?

medium
View Answer & Explanation
Correct Answer: The time delay between sending a data packet and it arriving at its destination
Explanation:
Latency is often measured in milliseconds and is affected by factors such as physical distance, network congestion, and the number of devices the data passes through, and it is especially noticeable in real time applications like video calls or online gaming.
Q15

What is the purpose of the Transport layer in the OSI model?

hard
View Answer & Explanation
Correct Answer: To manage end-to-end communication and ensure reliable data transfer between devices
Explanation:
The Transport layer, where protocols like TCP and UDP operate, is responsible for breaking data into segments, managing flow control, and in the case of TCP, ensuring that data arrives reliably and in the correct order.
Q16

What does the term 'packet switching' refer to in networking?

hard
View Answer & Explanation
Correct Answer: Breaking data into small packets that are transmitted independently and reassembled at the destination
Explanation:
Packet switching allows different packets belonging to the same message to potentially take different paths through the network, which improves efficiency and resilience compared to older circuit switching methods that reserve a dedicated path for the entire duration of a communication.
Q17

What is the function of the Application layer in the OSI model?

medium
View Answer & Explanation
Correct Answer: It provides the interface through which end user applications interact with network services, such as web browsers using HTTP
Explanation:
The Application layer is the topmost layer in the OSI model and is where protocols like HTTP, FTP, and SMTP operate, directly supporting the software that end users actually interact with.
Q18

What is a VPN primarily used for?

medium
View Answer & Explanation
Correct Answer: To create a secure, encrypted connection over a public network, often to protect privacy or access restricted resources
Explanation:
A VPN routes a device's traffic through an encrypted tunnel to a remote server, which can hide the user's actual IP address and protect data from being intercepted on untrusted networks such as public Wi-Fi.
Q19

What is the purpose of a checksum in network data transmission?

medium
View Answer & Explanation
Correct Answer: To detect errors that may have occurred during data transmission by comparing calculated values
Explanation:
A checksum is calculated from the data before it is sent and again after it is received, and if the two values do not match, it indicates the data was corrupted somewhere during transmission.
Q20

How many layers does the OSI model have?

easy
View Answer & Explanation
Correct Answer: Seven
Explanation:
The OSI model consists of seven layers, from Physical at the bottom through Data Link, Network, Transport, Session, Presentation, and Application at the top, each responsible for a different aspect of network communication.
Q21

What is the purpose of the Domain Name System (DNS) cache?

medium
View Answer & Explanation
Correct Answer: It temporarily stores previously resolved domain name lookups to speed up future requests
Explanation:
Without a cache, every visit to a website would require a fresh trip to a DNS server, so caching recently resolved addresses saves time on repeat lookups.
Q22

What is the main difference between IPv4 and IPv6 addresses?

medium
View Answer & Explanation
Correct Answer: IPv4 uses 32-bit addresses while IPv6 uses 128-bit addresses, allowing for a vastly larger address space
Explanation:
IPv6 was developed largely because the pool of available IPv4 addresses was running out as the number of internet connected devices grew rapidly.
Q23

What is the function of the Session layer in the OSI model?

hard
View Answer & Explanation
Correct Answer: It manages and controls the connections, or sessions, between two communicating devices
Explanation:
The Session layer is responsible for establishing, maintaining, and eventually closing a communication session, including handling things like reconnections if a session drops.
Q24

What is a MAC flooding attack in networking?

hard
View Answer & Explanation
Correct Answer: An attack that overwhelms a switch's MAC address table, forcing it to broadcast traffic to all ports like a hub
Explanation:
Once the table is full, the switch can no longer track which port belongs to which device, so it starts sending traffic everywhere, which an attacker can exploit to intercept data.
Q25

What is the purpose of the Transmission Control Protocol (TCP) sliding window?

hard
View Answer & Explanation
Correct Answer: It controls how much data can be sent before requiring an acknowledgment, helping manage flow control
Explanation:
The sliding window size can grow or shrink dynamically based on network conditions, allowing TCP to send more data at once when the connection is fast and reliable.
Q26

What is the difference between a public IP address and a private IP address?

medium
View Answer & Explanation
Correct Answer: A public IP address is reachable directly from the internet, while a private IP address is only used within a local network
Explanation:
Devices on a home network typically get a private IP address from a router, and NAT translates that private address to the router's single public IP address when reaching the internet.
Q27

What is the purpose of the Simple Mail Transfer Protocol (SMTP)?

medium
View Answer & Explanation
Correct Answer: It is used for sending email messages from a client to a server or between mail servers
Explanation:
While SMTP handles outgoing mail, protocols like IMAP or POP3 are typically used on the receiving end to retrieve messages from a mail server.
Q28

What does the term 'jitter' mean in the context of network performance?

medium
View Answer & Explanation
Correct Answer: The variation in delay experienced by packets as they travel across a network
Explanation:
High jitter can be especially noticeable in real time applications like video calls, causing choppy audio or video even if the overall bandwidth seems sufficient.
Q29

What is the purpose of a proxy server?

medium
View Answer & Explanation
Correct Answer: It acts as an intermediary between a client and other servers, often for caching, filtering, or anonymity
Explanation:
Requests from a client first go to the proxy, which then forwards them to the destination server, which can help with things like content filtering or hiding the client's original IP address.
Q30

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

hard
View Answer & Explanation
Correct Answer: It stores recently resolved mappings between IP addresses and MAC addresses to avoid repeating the resolution process
Explanation:
Without the cache, a device would need to broadcast an ARP request every single time it wanted to communicate with another device on the same local network.
Q31

What is the difference between unicast, multicast, and broadcast communication?

medium
View Answer & Explanation
Correct Answer: Unicast sends data to a single recipient, multicast sends to a specific group, and broadcast sends to every device on the network
Explanation:
A video call between two people is typically unicast, a live stream to subscribed viewers can use multicast, and something like an ARP request is a common example of broadcast.
Q32

What is the purpose of the Network layer in the OSI model?

medium
View Answer & Explanation
Correct Answer: It handles logical addressing and routing of data packets between different networks
Explanation:
This is the layer where IP addresses and routing decisions come into play, determining the best path for a packet to travel from source to destination across multiple networks.
Q33

What is the purpose of a Content Delivery Network (CDN)?

medium
View Answer & Explanation
Correct Answer: It distributes copies of content across multiple servers in different locations to reduce latency for users
Explanation:
By serving content from a server geographically closer to the user, a CDN can significantly reduce load times compared to fetching everything from a single distant origin server.
Q34

What is the purpose of port numbers in networking?

easy
View Answer & Explanation
Correct Answer: They identify specific applications or services running on a device so data can be delivered to the correct process
Explanation:
For example, web traffic commonly uses port 80 or 443, while email might use port 25, allowing multiple services to run on the same device without conflicting.
Q35

What is the purpose of the Simple Network Management Protocol (SNMP)?

hard
View Answer & Explanation
Correct Answer: It is used to monitor and manage network devices such as routers and switches
Explanation:
Network administrators use SNMP to collect performance data and configuration information from devices across a network, often feeding into monitoring dashboards.
Q36

What does the term 'full duplex' mean in the context of network communication?

medium
View Answer & Explanation
Correct Answer: Data can be transmitted and received at the same time in both directions
Explanation:
Full duplex is like a phone call where both people can talk and listen simultaneously, compared to half duplex, which is more like a walkie talkie where only one side can transmit at a time.
Q37

What is the purpose of a wildcard mask in networking configurations?

hard
View Answer & Explanation
Correct Answer: It specifies which bits of an IP address should be checked or ignored, often used in routing and access control
Explanation:
Wildcard masks work somewhat like an inverted subnet mask and are commonly used in access control lists to match a range of addresses efficiently.
Q38

What is the function of the Data Link layer in the OSI model?

medium
View Answer & Explanation
Correct Answer: It handles the reliable transfer of data frames between two directly connected nodes, including error detection
Explanation:
This layer is also where MAC addresses come into play, identifying devices on the same local network segment and organizing bits into structured frames.
Q39

What is the main advantage of using fiber optic cables over traditional copper cables for networking?

medium
View Answer & Explanation
Correct Answer: Fiber optic cables generally support higher bandwidth and longer transmission distances with less signal loss
Explanation:
Because fiber optic cables transmit data as light rather than electrical signals, they are also less susceptible to electromagnetic interference compared to copper cables.
Q40

What is the purpose of Quality of Service (QoS) settings on a network?

hard
View Answer & Explanation
Correct Answer: They prioritize certain types of network traffic to ensure important data, such as video calls, gets better performance
Explanation:
QoS can be configured to give real time traffic like voice calls priority over less time sensitive traffic like file downloads, reducing lag during important activities.
Q41

What is the purpose of the File Transfer Protocol (FTP)?

easy
View Answer & Explanation
Correct Answer: It is used to transfer files between a client and a server over a network
Explanation:
FTP has largely been supplemented by more secure alternatives like SFTP or FTPS, since the original protocol transmits credentials and data without encryption by default.
Q42

What is meant by the term 'network topology'?

easy
View Answer & Explanation
Correct Answer: The physical or logical arrangement of devices and connections in a network
Explanation:
Common topologies include star, bus, ring, and mesh, each with its own trade-offs in terms of cost, reliability, and ease of troubleshooting.
Q43

What is the purpose of the Internet Control Message Protocol (ICMP)?

medium
View Answer & Explanation
Correct Answer: It is used to send error messages and operational information, such as with the ping command
Explanation:
ICMP does not carry regular application data but instead helps devices communicate about network problems, such as an unreachable destination, which is exactly what the ping utility relies on.
Q44

What is the difference between a static IP address and a dynamic IP address?

easy
View Answer & Explanation
Correct Answer: A static IP address stays the same over time, while a dynamic IP address can change and is often assigned automatically by DHCP
Explanation:
Servers often use static IP addresses so they can be reliably reached at the same address, while everyday devices on a home network commonly receive a dynamic address that can change over time.
Q45

What is the purpose of a Virtual Local Area Network (VLAN)?

hard
View Answer & Explanation
Correct Answer: It logically divides a single physical network into multiple separate broadcast domains
Explanation:
VLANs let administrators group devices by function or department, such as keeping finance and guest traffic separate, even if they are plugged into the same physical switch.
Q46

Which layer of the OSI 7-layer model is responsible for end-to-end reliable data delivery and flow control?

easy
View Answer & Explanation
Correct Answer: Transport Layer
Explanation:
The Transport Layer (Layer 4) handles end-to-end communication, segmentation, flow control, and error recovery (e.g., TCP).
Q47

Which layer of the OSI 7-layer model is responsible for end-to-end reliable data delivery and flow control?

easy
View Answer & Explanation
Correct Answer: Transport Layer
Explanation:
The Transport Layer (Layer 4) handles end-to-end communication, segmentation, flow control, and error recovery (e.g., TCP).