Computer Network Interview Questions & Answers: Protocols, Topologies & the OSI Model
This comprehensive guide prepares you for computer network interviews by covering a wide range of fundamental and advanced networking concepts. We explore the OSI model in detail, examining the roles and responsibilities of each layer. This resource provides detailed answers to frequently asked computer network interview questions, including those on network topologies, data transmission methods (unicast, multicast, broadcast), multiplexing techniques (TDM, FDM, WDM), and various network protocols. We also delve into error detection and correction methods (checksums, CRCs, FEC), data link layer protocols, and key design considerations for building robust and efficient networks. This guide will equip you with the knowledge to confidently answer a broad spectrum of networking questions.
Computer Network Viva Questions and Answers
What is a Computer Network?
A computer network is a collection of interconnected devices (computers, servers, etc.) that can communicate and share resources. Networks can range from small, local networks (LANs) to the vast global network known as the internet.
How Network Links Work
A network link is the physical connection between two or more network devices. This could be a wired connection (e.g., using cables like coaxial cable or fiber optic cable) or a wireless connection (e.g., Wi-Fi).
Nodes in a Network
A node is any device connected to a network, such as a computer, server, printer, or other network-enabled device.
Routers and Gateways
A router or gateway is a node connecting two or more networks. It forwards data packets between networks, examining the destination address to determine the best path for transmission.
Point-to-Point Links
A point-to-point link connects only two devices directly. This provides a dedicated connection between them.
Multiple Access
Multiple access occurs when multiple devices share a single network link. This requires mechanisms to manage access and prevent conflicts (e.g., CSMA/CD, token ring).
Benefits of Distributed Processing Systems
Distributed processing systems distribute tasks across multiple computers, offering advantages such as:
- Improved resource utilization.
- Enhanced reliability through redundancy.
- Increased processing speed.
- Better scalability.
- Improved security through data separation.
Factors Affecting Network Performance
Many factors affect network performance, including:
- Hardware limitations (processing power, network interface cards).
- Software inefficiencies.
- Number of users.
- Network topology and design.
- Transmission media.
Essential Network Standards for Efficiency and Reliability
- Reliability: The ability of the network to function consistently and recover quickly from failures. This involves metrics like Mean Time Between Failures (MTBF) and Mean Time To Repair (MTTR).
- Security: Protection against unauthorized access, viruses, and other threats. This involves firewalls, intrusion detection systems, and access controls.
- Performance: Measured by factors such as throughput, latency, and jitter. This involves efficient protocols and network design.
Factors Affecting Network Reliability
- Frequency of failures.
- Time to recover from failures.
Factors Affecting Network Security
Network security is threatened by various factors:
- Viruses and malware.
- Unauthorized access attempts.
- Denial-of-service attacks.
- Insider threats.
Network Protocols
A protocol defines the rules and conventions governing data communication. Protocols specify data formats, message sequencing, and error handling.
Essential Components of a Protocol
- Syntax: Data formats and structure.
- Semantics: Meaning of data fields and commands.
- Timing: When data should be sent and at what rate.
Key Design Issues in Computer Networks
- Providing common network services (e.g., file sharing, printing).
- Cost-effective resource sharing.
- Performance (speed, bandwidth, latency).
- Security.
- Scalability (ability to handle growth).
Latency and Bandwidth
Bandwidth refers to the amount of data that can be transmitted over a network link in a given time. Latency is the delay experienced in data transmission.
Routing in Networks
Routing involves selecting the best path for data transmission between a source and a destination node. Routers use routing protocols and routing tables to determine these paths.
Peer-to-Peer Processes
Peer-to-peer processes communicate directly with each other at a specific layer in the network, without a central server or intermediary.
Congested Switches
A congested switch occurs when the switch receives packets faster than it can forward them, leading to buffer overflow and packet loss.
Semantic Gap in Networks
The semantic gap refers to the difference between the requirements of applications and the capabilities of the underlying network technology.
Round-Trip Time (RTT)
RTT is the time it takes for a data packet to travel from the source to the destination and back again.
Unicasting, Multicasting, Broadcasting
- Unicasting: One-to-one communication.
- Multicasting: One-to-many communication (to a specific group of recipients).
- Broadcasting: One-to-all communication.
Multiplexing
Multiplexing allows multiple signals to share a single communication channel.
Types of Multiplexing
- Time-division multiplexing (TDM): Divides time slots among users.
- Frequency-division multiplexing (FDM): Divides frequency bands among users.
- Wavelength-division multiplexing (WDM): Divides wavelengths of light among users (fiber optics).
Frequency-Division Multiplexing (FDM)
FDM is an analog technique that divides a communication channel into multiple frequency bands, each used by a different signal.
Wavelength-Division Multiplexing (WDM)
WDM is similar to FDM but uses different wavelengths of light in fiber optic cables to transmit multiple signals.
Time-Division Multiplexing (TDM)
TDM is a digital multiplexing technique that allocates time slots to different users.
Synchronous TDM
In synchronous TDM, each user is assigned a fixed time slot, regardless of whether they have data to transmit.
OSI Model Layers
- Physical Layer
- Data Link Layer
- Network Layer
- Transport Layer
- Session Layer
- Presentation Layer
- Application Layer
Network-Supported Layers
The network-supported layers are the Physical, Data Link, and Network layers. These layers handle the physical transmission and routing of data.
User-Supported Layers
The user-supported layers are the Session, Presentation, and Application layers. These layers provide services directly to applications.
Transport Layer's Role
The transport layer connects the network and user layers, providing reliable end-to-end data transfer.
Session Layer
The session layer manages communication sessions between applications.
Presentation Layer
The presentation layer handles data formatting, encryption, and other transformations.
Application Layer
The application layer provides network services to applications (e.g., email, file transfer).
Hardware Components: Nodes and Links
Network hardware consists of nodes (devices) and links (connections).
Types of Network Links
- Leased lines
- Cables
- Last-mile links
- Wireless links
Transmission Media
Transmission media can be guided (cables) or unguided (wireless):
- Guided: Twisted pair, coaxial cable, fiber optic cable.
- Unguided: Terrestrial microwave, satellite communication.
Types of Network Errors
- Single-bit error: One bit is changed.
- Burst error: Two or more bits are changed.
Error Detection in Computer Networks
Error detection methods add redundancy to data to detect errors at the receiver. Common techniques include parity checks, checksums, and cyclic redundancy checks (CRCs).
Redundancy
Redundancy involves transmitting extra information to allow for error detection and correction.
Basic Networking Concepts
What is a Network?
A network is a collection of interconnected devices (computers, servers, etc.) that can communicate and share resources. Networks can range in size from a small local area network (LAN) to the vast global internet.
Network Links
Network links are the physical connections between devices, such as cables (coaxial, fiber optic) or wireless signals (Wi-Fi).
Network Nodes
A node is any device connected to a network (computer, printer, server, etc.).
Routers/Gateways
Routers or gateways connect different networks, forwarding data packets between them based on IP addresses.
Point-to-Point Links
A point-to-point link directly connects two devices, creating a dedicated connection.
Multiple Access
Multiple access occurs when multiple devices share the same physical link. This requires methods to manage access (like token ring or CSMA/CD).
Benefits of Distributed Processing
Distributing processing tasks across multiple computers offers:
- Improved reliability through redundancy.
- Increased processing power.
- Better scalability.
- Enhanced resource utilization.
- Improved security through data separation.
Factors Impacting Network Performance
Network performance is affected by hardware, software, the number of users, and the network's design and topology.
Network Design Considerations
- Reliability: Minimize downtime and ensure quick recovery from failures.
- Security: Protect against unauthorized access and threats.
- Performance: Optimize speed and efficiency (throughput, latency).
Elements Affecting Network Reliability
- Frequency of failures.
- Time needed to recover from failures.
Factors Affecting Network Security
Threats to network security include viruses, unauthorized access, denial-of-service attacks, and insider threats.
Network Protocols
Protocols define the rules for data communication. They standardize data formats, message sequencing, and error handling.
Protocol Components
- Syntax: Data format and structure.
- Semantics: Meaning of data fields.
- Timing: When and how fast data is sent.
Computer Network Design Challenges
- Providing essential services (file sharing, printing).
- Cost-effective resource sharing.
- Performance optimization.
- Security.
- Scalability.
Latency and Bandwidth
Bandwidth: The amount of data transmitted per unit of time. Latency: The delay in data transmission.
Routing
Routing is the process of selecting paths for data packets to travel from source to destination.
Peer-to-Peer Processes
In peer-to-peer communication, devices communicate directly without a central server.
Congested Switches
A congested switch occurs when it receives data faster than it can process and forward it, resulting in dropped packets.
Semantic Gap
The semantic gap is the difference between what applications need and what the network can provide.
Round-Trip Time (RTT)
RTT is the time taken for a signal to travel from source to destination and back again.
Unicasting, Multicasting, Broadcasting
- Unicasting: One-to-one communication.
- Multicasting: One-to-many (a specific group).
- Broadcasting: One-to-all communication.
Multiplexing
Multiplexing allows multiple signals to share a single channel.
Types of Multiplexing
- Time-division multiplexing (TDM)
- Frequency-division multiplexing (FDM)
- Wavelength-division multiplexing (WDM)
Frequency-Division Multiplexing (FDM)
FDM divides a channel into frequency bands for different signals (analog).
Wavelength-Division Multiplexing (WDM)
WDM is like FDM but uses different wavelengths of light in fiber optics.
Time-Division Multiplexing (TDM)
TDM divides a channel into time slots for different signals (digital).
Synchronous TDM
In synchronous TDM, fixed time slots are allocated, regardless of whether a user has data to send.
OSI Model Layers
- Physical Layer
- Data Link Layer
- Network Layer
- Transport Layer
- Session Layer
- Presentation Layer
- Application Layer
Network-Supported Layers
The physical, data link, and network layers handle physical transmission and routing.
User-Supported Layers
The session, presentation, and application layers provide services directly to applications.
Transport Layer's Role
The transport layer provides reliable end-to-end data transfer between applications.
Session Layer Responsibilities
The session layer manages and coordinates communication sessions between applications.
Presentation Layer Responsibilities
The presentation layer handles data formatting, encryption, and compression.
Application Layer Responsibilities
The application layer provides network services to applications (email, file sharing).
Hardware Components
Network hardware consists of nodes (devices) and links (connections).
Types of Network Links
- Leased lines
- Cables
- Last-mile links
- Wireless links
Transmission Media
- Guided media (twisted pair, coaxial, fiber optic).
- Unguided media (microwave, satellite).
Types of Errors
- Single-bit error
- Burst error
Error Detection Methods
Error detection methods use redundancy to identify errors. Techniques include parity checks, checksums, and cyclic redundancy checks (CRCs).
Redundancy
Redundancy adds extra information to allow error detection.
Vertical Redundancy Check (VRC)
VRC adds a parity bit to ensure an even (or odd) number of 1s in each data unit. It can detect single-bit errors.
Longitudinal Redundancy Check (LRC)
LRC adds a parity check byte to a block of data to detect errors across multiple data units.
Cyclic Redundancy Check (CRC)
CRC is a powerful error detection method using polynomial division to generate a checksum.
Checksum Method
- Divide data into sections.
- Sum the sections using 1's complement arithmetic.
- Take the 1's complement of the sum (this is the checksum).
Data Link Layer Protocols
- Asynchronous protocols
- Synchronous protocols
- Character-oriented protocols
- Bit-oriented protocols
Error Detection vs. Correction
Error detection identifies the presence of errors. Error correction attempts to fix errors.
Forward Error Correction (FEC)
FEC adds redundancy so the receiver can correct errors without retransmission.
Retransmission
Retransmission involves requesting the sender to resend data if errors are detected.
Data Words and Code Words
In block coding, data is divided into k-bit data words, and r redundant bits are added to create n-bit code words (n = k + r).
Linear Block Code
A linear block code is one where the XOR of two valid code words produces another valid code word.
Cyclic Code
A cyclic code is a type of linear block code where a cyclic shift of a code word produces another valid code word.
Encoder and Decoder
An encoder converts data into a coded format for transmission or storage. A decoder converts the coded data back to its original form.
Framing
Framing is the process of structuring data into frames for transmission across a data link.
Fixed-Size Framing
In fixed-size framing, frames are all the same size.
Character Stuffing (Byte Stuffing)
Character stuffing adds escape characters to prevent data from being misinterpreted as frame delimiters.
Bit Stuffing
Bit stuffing adds a 0 after five consecutive 1s to prevent a specific bit pattern from being mistaken for a flag.
Flow Control
Flow control mechanisms regulate the rate of data transmission to prevent overwhelming the receiver.
Error Control
Error control combines error detection and correction or retransmission.
Automatic Repeat Request (ARQ)
ARQ is a method for reliable data transmission that uses acknowledgments and retransmissions to ensure error-free data transfer.
Stop-and-Wait ARQ
In stop-and-wait ARQ, the sender transmits one frame, then waits for an acknowledgment before sending the next.
Stop-and-Wait with Retransmission
The sender keeps a copy of the sent frame and retransmits it if the acknowledgment isn't received within a timeout period.
Sequence Numbers in Reliable Transmission
Sequence numbers are added to frames to ensure they are received in the correct order.
Pipelining
Pipelining is a technique where multiple tasks are started before previous ones are completed, increasing efficiency.
Sliding Window
A sliding window is a technique used in data link layer protocols that allows for multiple frames to be transmitted without waiting for acknowledgments for each frame. It defines the range of sequence numbers the sender can transmit without waiting for acknowledgments.
Piggybacking
Piggybacking is when acknowledgments are sent within data frames to improve efficiency.
Transmission Technologies
- Point-to-point
- Broadcast
Subnet
A subnet is a logical division of a larger network.
Transmission vs. Communication
Transmission is the physical transfer of data. Communication involves successful transmission and interpretation of that data.
Data Exchange Methods
- Simplex
- Half-duplex
- Full-duplex
Service Access Point (SAP)
A SAP is an address that identifies a specific point of access within a protocol stack layer.
X.25 Protocol Suite
X.25 is a layered protocol suite for packet-switched networks.
Beaconing
Beaconing is used in some network topologies (token ring) to detect and recover from failures.
Redirector
A redirector intercepts file and print requests, translating them into network requests.
NETBEUI and NetBIOS
NETBEUI is a network protocol, and NetBIOS is a programming interface for networking.
RAID (Redundant Array of Independent Disks)
RAID is a storage technology that combines multiple disks for performance and reliability.
Passive Topology
In a passive topology, network devices only receive and do not amplify signals (e.g., a bus topology).
Cladding in Fiber Optics
Cladding is the outer layer of glass surrounding the core in a fiber optic cable.
Point-to-Point Protocol (PPP)
PPP is a data link layer protocol used to establish point-to-point connections.
Gateways vs. Routers
Gateway | Router |
---|---|
Operates at higher OSI layers; translates between different network architectures or protocols. | Operates primarily at the network layer (layer 3); forwards packets between networks based on IP addresses. |
MAC Address
A MAC (Media Access Control) address is a unique identifier assigned to a network interface controller (NIC). It's used at the data link layer (layer 2) to identify devices on a local network.
Bit Rate vs. Baud Rate
The bit rate is the number of bits transmitted per second. The baud rate is the number of signal units transmitted per second. The relationship depends on how many bits each signal unit represents.
Formula
Baud Rate = Bit Rate / Number of bits per symbol
Transmission Media
Transmission media can be categorized as guided or unguided:
- Guided Media: Transmit signals through a physical medium (twisted pair cable, coaxial cable, fiber optic cable).
- Unguided Media: Transmit signals through air or space (radio waves, microwaves, infrared, satellite communication).
IEEE 802 Standards
The IEEE 802 standards define various local area network (LAN) and metropolitan area network (MAN) protocols and technologies, enabling interoperability between devices from different manufacturers.
- 802.1: High-level management.
- 802.2: Logical Link Control (LLC).
- 802.3: Ethernet.
- 802.4: Token Bus.
- 802.5: Token Ring.
- 802.6: Metropolitan Area Network (MAN) standard.
Protocol Data Unit (PDU) at the LLC Level
A PDU (Protocol Data Unit) at the Logical Link Control (LLC) level is the data unit exchanged between devices on a local network. It contains addressing information (source and destination service access points), control information, and the data itself.
Networking Devices
- Repeaters: Operate at the physical layer; regenerate signals.
- Bridges: Connect LANs, filtering traffic based on MAC addresses.
- Routers: Forward packets between networks based on IP addresses.
- Gateways: Connect networks using different protocols or architectures.
ICMP (Internet Control Message Protocol)
ICMP is a network layer protocol used for error reporting and network diagnostics (e.g., ping). It's used by devices to send messages about network issues (e.g., unreachable host).
Data Units in TCP/IP Protocol Suite
- Application Layer: Message
- Transport Layer: Segment (TCP) or Datagram (UDP)
- Network Layer: Packet/Datagram
- Data Link Layer: Frame
- Physical Layer: Bits
ARP (Address Resolution Protocol) vs. RARP (Reverse Address Resolution Protocol)
ARP | RARP |
---|---|
Maps IP addresses to physical (MAC) addresses. | Maps MAC addresses to IP addresses. (Less common now.) |
TCP Segment and IP Datagram Header Length
The minimum TCP segment header length is 20 bytes, and the maximum is 60 bytes. The minimum IP datagram header length is 20 bytes.
Internet Address Classes
Class | Address Range |
---|---|
A | 0.0.0.0 - 127.255.255.255 |
B | 128.0.0.0 - 191.255.255.255 |
C | 192.0.0.0 - 223.255.255.255 |
D | 224.0.0.0 - 239.255.255.255 |
E | 240.0.0.0 - 247.255.255.255 |
FTP (File Transfer Protocol) vs. TFTP (Trivial File Transfer Protocol)
FTP | TFTP |
---|---|
Reliable, connection-oriented (uses TCP); provides authentication and security features. | Unreliable, connectionless (uses UDP); simpler but no security or authentication. |
Types of Networks
- Peer-to-peer: Devices share resources equally.
- Server-based: A central server manages resources.
Network Topologies
- Star topology: Devices connect to a central hub or switch.
- Bus topology: Devices connect to a single cable.
- Ring topology: Devices are connected in a closed loop.
- Mesh topology: Devices have multiple connections.
Mesh Networks
Mesh networks use multiple paths for data transmission, increasing reliability.
Broadband vs. Baseband Transmission
Broadband | Baseband |
---|---|
Multiple signals are transmitted simultaneously on different frequencies. | A single signal occupies the entire bandwidth of the cable. |
5-4-3 Rule in Ethernet
The 5-4-3 rule limits the number of segments and repeaters in an Ethernet network to prevent signal degradation and improve performance.
MAU (Multistation Access Unit)
In Token Ring networks, the MAU is a central hub that connects the network devices.
Routable vs. Non-Routable Protocols
Routable protocols (e.g., IP) can be routed across networks, while non-routable protocols cannot be routed by routers.
Importance of the OSI Model
The OSI (Open Systems Interconnection) model provides a framework for understanding and designing networks.
Logical Link Control (LLC)
LLC (Logical Link Control) is the upper sublayer of the data link layer in the OSI model. It provides services to the network layer, managing communication between network devices regardless of the physical medium being used.
Virtual Channels
A virtual channel is a logical connection between a source and a destination in a network. Multiple virtual channels can exist on the same physical link, providing a way to segment and manage data traffic.
Virtual Paths
A virtual path groups multiple virtual channels together, providing a way to bundle related traffic. This is used to improve efficiency and management of data streams.
Packet Filtering
Packet filtering is a network security technique that controls network access by examining incoming and outgoing packets. It allows or blocks packets based on rules set by a network administrator (source and destination IP addresses, ports, and protocols).
Multicast Routing
Multicast routing efficiently distributes data from a single source to multiple destinations. This is commonly used for applications like video conferencing or software updates.
Silly Window Syndrome
Silly Window Syndrome is a network performance issue that occurs in TCP when small window sizes are advertised, causing inefficient data transmission and reducing network throughput.
Trigrams and Digrams
In linguistics, a trigram is a sequence of three consecutive letters (e.g., "ing"), and a digram is a sequence of two consecutive letters (e.g., "th").
Additional Interview Resources
Here are some additional interview resources covering related technologies:
- Java 8 Multithreading Interview Questions