CN · 13 topics
What is a computer network? What are its types?
A computer network is a group of two or more connected devices that share data, files and resources.
Common Usage
Internet & Web Access: Browsing websites, streaming video, sending emails and using cloud apps.
Resource & File Sharing: Sharing a single printer, central file storage or network drives across a home or office.
Workplace & Learning: Enabling remote work, video calls, shared databases and online classrooms.
Smart Home & IoT: Connecting smart TVs, speakers, cameras and sensors to a local network or the cloud.
Types of Computer Networks
PAN (Personal Area Network): Covers a tiny range usually within about 10 meters. Example: pairing wireless earbuds, a smartwatch or a mouse to phone or laptop via Bluetooth or a USB cable.
LAN (Local Area Network): Connects devices inside a limited geographic area like a single home, room, school or office building. It typically runs over Ethernet cables or Wi-Fi.
MAN (Metropolitan Area Network): A Metropolitan Area Network (MAN) is a computer network that connects a city or large metropolitan region typically covering around 5 to 50 km by interconnecting multiple Local Area Networks (LANs). It usually relies on high-speed links like fiber-optic cables and is used for city-wide networks, local government connections or university/municipal setups.
WAN (Wide Area Network): It is a computer network that covers a large geographical area. The public internet is the biggest WAN.
Explain network topologies with pros and cons.
Network topology is the physical or logical layout showing how devices are arranged in a computer network.
Point-to-Point Topology: Two devices connect directly over a single dedicated link.
Pros: Simple setup, low latency and strong security since no extra nodes share the link.
Cons: Poor scalability (adding more devices requires extra links/management)
Common use: Connecting two routers.
Star Topology: Every device connects to a central hub or switch.
Pros: Easy to add or remove devices, simple troubleshooting, and one bad cable or device won't drop the rest of the network.
Cons: If the central hub or switch fails, the whole network goes down.
Common use: Home networks and office LANs.
Bus Topology: All devices attach to a single shared main cable.
Pros: Cheap and quick to set up for small networks with minimal cable.
Cons: A break in the main cable takes down the entire network, traffic collisions slow things down as devices increase, and scalability is limited.
Common use: Small, simple, or legacy setups with low traffic.
Ring Topology: Devices connect in a closed loop, with each node linked to two neighbors.
Pros: Predictable data flow with no central hub needed.
Cons: A single break or failed node can disrupt the loop, and adding nodes can interrupt service.
Common use: Certain metropolitan or industrial networks.
Mesh Topology: Devices connect to multiple other devices either partial mesh (some connections) or full mesh (every node connects to every other node).
Pros: Top fault tolerance and redundancy. If one link drops, traffic reroutes along another path.
Cons: Expensive and complex.
Common use: Data centers.
Tree Topology: Tree topology (also called a star-bus topology or hierarchical topology) is a network layout where devices are arranged in a parent-child hierarchy.
Pros: Scales cleanly by adding new branches.
Cons: Higher cost and complexity; failure in the root can knock out entire branches.
Common use: Large campuses or companies split into departments and buildings.
Hybrid Topology: Combines two or more topologies (such as star + mesh or star + ring) to fit specific needs.
Pros: Flexible
Cons: Complex design and management, often carrying higher overall costs.
Common use: Large enterprise and university networks.
What is the OSI model? Explain all 7 layers and their functions.
The OSI (Open Systems Interconnection) model is a conceptual model developed by the International Organization for Standardization (ISO) that splits network communication into 7 distinct layers.
It explains how data moves from an application on one device to an application on another device.
When we send data, it starts at Layer 7 and moves down to Layer 1.
On the receiving end, the data moves up from Layer 1 to Layer 7
Layer 7 - Application Layer. This is the closest layer to the end user and provides network services directly to software applications. It handles tasks like web browsing, file transfers and email using protocols such as HTTP/HTTPS, FTP, SMTP and DNS.
Layer 6 - Presentation Layer. It acts as the data translator between the Application Layer and the Session Layer. It formats, encrypts and compresses data so different systems can understand each other securely and efficiently.
Layer 5 - Session Layer. This is responsible for opening, managing and closing communication sessions between applications on different devices.
Layer 4 - Transport Layer. This layer ensures end to end delivery of complete messages between applications. It breaks large data into segments, manages flow control and error recovery.
Layer 3 - Network Layer. This layer is responsible for logical addressing and routing data packets across different networks from source to destination.
Key Functions:
Logical addressing Assigns unique IP addresses (IPv4 or IPv6) to devices so they can be identified across separate, interconnected networks.
Routing. Determines the best physical or logical path for data to travel from the source network to the destination network.
Layer 2 - Data Link Layer. This layer manages node to node data transfer on the same local network.
Key Functions
Physical addressing (MAC addresses). Uses permanent 48-bit MAC addresses to deliver data to the exact device on a local network.
Framing. Wraps Layer 3 packets into Layer 2 frames by adding a header (with source and destination MAC addresses) and a trailer.
Error detection.
Layer 1 - Physical Layer. The Physical Layer (Layer 1) is the first and lowest layer of the OSI model, responsible for transmitting raw binary data (1s and 0s) across a communication medium.
Key Functions
Bit transmission. Converts digital frames from Layer 2 into electrical impulses, light pulses, or radio waves for travel. It converts them back into raw bits at the receiving end.
Physical topology. Determines how devices are physically arranged and wired together, such as star, mesh, bus, or ring layouts.
Transmission mode. Establishes whether signals flow one way (simplex), both ways one at a time (half-duplex), or both ways simultaneously (full-duplex).
What is the TCP/IP model? How does it differ from OSI?
The TCP/IP model (Transmission Control Protocol/Internet Protocol) is a networking model that explains how data travels from one device to another over the internet.
Four layers of the TCP/IP model
Application Layer
It handles tasks like web browsing, file transfers and email using protocols such as HTTP, HTTPS, FTP, SMTP and DNS.
Example: When you open a website, your browser uses HTTP or HTTPS.
Transport Layer
This layer ensures end to end delivery of complete messages between applications.
It breaks large data into segments, manages flow control and error recovery.
Main protocols:
TCP: Reliable communication.
UDP: Faster communication without guaranteed delivery.
Internet/ Network Layer
This layer is responsible for logical addressing and routing data packets across different networks from source to destination.
Uses IP addresses.
Example: IPv4 and IPv6.
Network Access Layer
It combines the roles of the Physical Layer (Layer 1) and Data Link Layer (Layer 2) from the OSI model
Responsible for transferring data through the physical network.
Uses MAC addressing
Examples: Ethernet and Wi-Fi.
Basis | TCP/IP Model | OSI Model |
|---|---|---|
Full form | Transmission Control Protocol / Internet Protocol | Open Systems Interconnection |
Number of layers | 4 | 7 |
Developed by | DARPA | ISO |
Nature | Practical model | Reference model |
Usage | Used in real-world networking | Mainly used for learning and understanding networking |
Session layer | Part of Application | Separate layer |
Presentation layer | Part of Application | Separate layer |
Physical & Data Link | Combined | Separate laye |
Why was a layered architecture chosen?
Layered architecture was chosen in computer networking to divide the complex process of communication into smaller, manageable parts (layers).
Instead of handling all networking tasks together, each layer performs a specific function and communicates with the layers above and below it.
What is the difference between a protocol and a standard?
Protocol: A set of rules that defines how devices communicate with each other.
Standard: An agreed upon specification or guideline that ensures devices and technologies work consistently and are compatible.
Difference between connection-oriented and connectionless services?
Connection-Oriented Service
A connection-oriented service establishes a connection between the sender and receiver before transferring data.
It generally ensures reliable and ordered delivery.
Example: TCP (Transmission Control Protocol).
How does it work?
Connection establishment – Sender and receiver establish a connection.
Data transfer – Data is transmitted between them.
Connection termination – The connection is closed after communication.
TCP uses a process called the Three-Way Handshake to establish a connection.
Step 1 - SYN (Client → Server): The client requests a connection and sends its initial sequence number.
Step 2 - SYN-ACK (Server → Client): The server acknowledges the client's request and sends its own sequence number.
Step 3 - ACK (Client → Server): The client acknowledges the server's sequence number.
Characteristics:
Reliable data transmission.
Acknowledgment of received data.
Maintains data order.
Error detection and retransmission.
SYN - Synchronize
SYN-ACK - Synchronize + Acknowledgment
Connectionless Service
A connectionless service sends data directly without establishing a connection between the sender and receiver.
Each packet is transmitted independently.
Example: UDP (User Datagram Protocol).
How does it work?
Sender prepares the data.
Data is sent directly to the destination.
Receiver receives packets independently, if they arrive.
There is no connection establishment or termination process.
Characteristics:
No connection establishment required.
Faster with less overhead.
No guaranteed delivery.
No guaranteed packet ordering.
No built-in retransmission.
Each packet is handled independently.
What is the difference between circuit switching, packet switching, and message switching?
Circuit Switching
A dedicated communication path is established between sender and receiver before communication begins.
The entire path remains reserved for the duration of communication.
Packet Switching
Data is divided into small units called packets.
Each packet is transmitted independently through the network.
Packets may take different routes to reach the destination.
The receiver reassembles the packets into the original data.
Example: Internet, email, web browsing.
Message Switching
The entire message is sent as a single unit.
No dedicated path is established.
Each intermediate node receives the complete message, stores it temporarily, and then forwards it to the next node.
This is called Store-and-Forward switching.
What is a client-server vs peer-to-peer architecture?
Client-Server Architecture
In this architecture, one or more server provide services or resources to multiple clients.
Client: Requests services or data.
Server: Receives requests, processes them, and sends responses. The server manages data, authentication and resources.
Working:
Client sends a request to the server.
Server processes the request and sends a response.
Client displays the result.
Peer-to-Peer (P2P) Architecture
In this architecture, all connected devices (peers) can communicate and share resources directly with each other.
There is no requirement for a central server.
Each peer can act as both a client and a server.
Peers share resources such as files, storage and processing power.
What are simplex, half-duplex, and full-duplex communication?
Simplex Communication
Communication happens in only one direction.
One device only sends data, and the other only receives it.
The receiver cannot send data back.
Examples: Keyboard → Computer
Half-Duplex Communication
Communication happens in both directions, but not simultaneously.
Both devices can send and receive data.
Only one device can transmit at a time.
Example: Walkie-talkie.
Full-Duplex Communication
Communication happens in both directions simultaneously.
Both devices can send and receive data at the same time.
Examples: Telephone calls
What is the difference between unicast, multicast, broadcast and anycast?
Unicast (One-to-One)
Data is sent from one sender to one specific receiver.
Each communication happens between two devices.
Multicast (One-to-Many Selected)
Data is sent from one sender to a specific group of receivers.
Only devices that have joined the multicast group receive the data.
Broadcast (One-to-All)
Data is sent from one sender to all devices within a broadcast network.
Every device in that broadcast domain receives the message.
Anycast (One-to-Nearest)
Data is sent to a group of devices sharing the same anycast IP address.
What is attenuation, noise, and distortion?
Attenuation: Attenuation means the loss of signal strength as it travels through a transmission medium. Signal strength decreases with increasing distance.
Noise: Noise is any unwanted external or internal signal that interferes with the original transmitted signal.
Distortion: Distortion means a change in the shape or form of the original signal during transmission.
What is multiplexing? (FDM, TDM, WDM)
Multiplexing is a technique in computer networks that allows multiple signals to share a single communication channel.
Instead of using separate communication channels for every device, multiplexing combines multiple signals and transmits them through one shared medium.
At the receiving end, a technique called Demultiplexing separates the combined signals and delivers them to their respective destinations.
Multiplexing involves two main devices:
MUX (Multiplexer): Combines multiple input signals into one combined signal.
DEMUX (Demultiplexer): Separates the combined signal into individual signals.
Working:
Multiple sources generate data.
MUX combines the data.
Combined data travels through a shared communication channel.
DEMUX separates the data.
Data reaches the correct destination.
Types of Multiplexing
FDM (Frequency Division Multiplexing)
The available bandwidth is divided into different frequency bands.
Each signal gets a separate frequency range.
TDM (Time Division Multiplexing)
Each signal gets a specific time slot.
Each user gets access to the channel during their assigned time slot.
WDM (Wavelength Division Multiplexing)
Multiple signals are transmitted using different wavelengths (colors) of light.
What is framing? Explain its methods (character count, byte stuffing, bit stuffing).
What is a MAC address? How is it different from an IP address?
What is error detection vs error correction?
Explain parity check, checksum, CRC, and Hamming code.
What are flow control mechanisms? Explain stop-and-wait, Go-Back-N, and Selective Repeat.
What is sliding window protocol?
What is the efficiency of stop-and-wait and sliding window?
What are multiple access protocols? (ALOHA, Slotted ALOHA, CSMA, CSMA/CD, CSMA/CA)
What is a switch? How does it learn MAC addresses?
Hub vs switch vs bridge?
What is a VLAN? Why is it used? What is trunking (802.1Q)?
4. Network Layer
What are the functions of the network layer?
What is IP addressing? IPv4 header format?
Explain IP address classes (A to E) and private vs public addresses.
What is subnetting? Subnet mask? CIDR notation?
How do you calculate the number of hosts and subnets? (Practical problems)
What is IPv6? Why is it needed? Compare IPv4 vs IPv6.
Explain the IPv6 address types and header format.
What is fragmentation? Which fields are used (MF, offset, ID)?
Explain routing vs forwarding.
Static vs dynamic routing?
Distance vector vs link state routing?
5. Transport Layer
What are the functions of the transport layer?
What is a port number? Well-known ports (HTTP, HTTPS, FTP, SSH, DNS, SMTP, etc.)?
What is a socket?
TCP vs UDP: differences and use cases.
Explain the TCP header format.
Explain the TCP 3-way handshake. Why 3 and not 2?
Explain the TCP connection termination (4-way handshake). What is TIME_WAIT?
What is a SYN flood attack?
How does TCP ensure reliability? (sequence numbers, ACK, retransmission)
Explain TCP flow control and the sliding window.
What is the receiver window (rwnd) vs congestion window (cwnd)?
Explain TCP congestion control: slow start, congestion avoidance, fast retransmit, fast recovery.
6. Application Layer
What is HTTP? Explain request and response structure.
HTTP methods (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)? Idempotent methods?
GET vs POST?
HTTP status codes (1xx to 5xx)?
What are cookies and sessions?
What is HTTPS? How does it work?
What is DNS? How does DNS resolution work?
Iterative vs recursive DNS queries?
DNS record types (A, AAAA, CNAME, MX, NS, PTR, TXT, SOA)?
What is DNS caching and TTL? What is DNS poisoning?
What happens when you type a URL in the browser and press Enter? (Very common question)
What are SMTP, POP3, and IMAP? Differences?
What is FTP? Active vs passive mode? FTP vs SFTP?
What are Telnet and SSH?
What is DHCP? What is SNMP? What is NTP?
What is a proxy server? Forward vs reverse proxy?
What is a CDN?
What is a load balancer? Types (L4 vs L7)?
What are REST, WebSocket, and long polling?
7. Network Security
What are the CIA triad and common network threats?
What is a firewall? Types (packet filter, stateful, application, NGFW)?
What is a VPN? Types and protocols (IPSec, SSL VPN, OpenVPN, WireGuard)?
What is SSL/TLS? Explain the TLS handshake.
Symmetric vs asymmetric encryption?
What is a digital signature, a certificate, and a CA?
What are hashing and MAC? What is HMAC?
What are DoS and DDoS attacks? How do you mitigate them?
What are man-in-the-middle, IP spoofing, session hijacking, sniffing, phishing?
10. Scenario and Troubleshooting Questions
You can ping an IP but not a domain name. What's wrong?
A user can't access the internet but can access the LAN. How do you troubleshoot?
Two devices on the same switch can't communicate. What do you check?
Why might a website load slowly?
How would you design a network for an office of 500 users?
How do you detect and resolve an IP conflict?
What happens if two DHCP servers are on the same network?
What happens when a switch receives a frame with an unknown destination MAC?
How does a packet travel from your laptop to a server across the internet, hop by hop?
How would you secure a small office network?
What is the difference between a public and a private IP in this scenario?
How would you troubleshoot high latency or packet loss?
Most Frequently Asked Questions
What happens when you type a URL in the browser?
Subnetting and IP addressing
How DNS works
Hub vs switch vs router
TCP congestion control
Firewall, VPN, and common attacks