Computer Network Interview Questions
Network Models and Protocols
Hierarchical Structure of Network Models
Computer networks typically adopt a four-layer model (OSI model) or a three-layer model (TCP/IP model). The OSI model comprises the Physical Layer, Data Link Layer, Network Layer, Transport Layer, and Application Layer. The TCP/IP model is divided into the Network Interface Layer, Internet Layer (often referred to as the Network Layer), Transport Layer, and Application Layer. Each layer has distinct functions:
- Physical Layer: Transmits bit streams; responsible for hardware such as cables and interfaces.
- Data Link Layer: Handles flow control and error detection, e.g., HDLC protocol.
- Network Layer: Manages routing, e.g., IP protocol.
- Transport Layer: Facilitates end-to-end communication, e.g., TCP/UDP.
- Application Layer: Provides services to user applications, e.g., HTTP, FTP.
Hierarchy of the TCP/IP Protocol Stack
The TCP/IP protocol stack consists of four layers:
- Network Interface Layer: Handles physical transmission, such as Ethernet and Wi-Fi.
- Internet Layer (Network Layer): Manages IP address allocation and routing (IPv4/IPv6).
- Transport Layer: Manages port-based communication; TCP ensures reliable transmission, while UDP provides fast transmission.
- Application Layer: Delivers services to applications, such as HTTP (Hypertext Transfer Protocol).
Fundamentals of Network Communication
Network Addressing and Subnetting
An IP address consists of a network portion and a host portion. IPv4 addresses are 32 bits long and are categorized into Class A, B, and C networks. Subnetting involves dividing the network bits and host bits to create smaller subnets. For example:
192.168.1.0/24: Network address is192.168.1.0; host address range is192.168.1.1to192.168.1.254.- A subnet mask of
255.255.255.0indicates a subnet size capable of hosting 256 hosts.
Network Security and Encryption
Common Security Protocols and Encryption Techniques
- SSL/TLS: Encrypts transmitted data to secure HTTPS connections.
- Firewalls: Filter traffic based on rules, such as
iptables. - AES Encryption: A symmetric encryption algorithm used for data protection.
- RSA Encryption: An asymmetric encryption method used for digital signatures.
Routing Algorithms and Network Topology
Routing Selection Algorithms
- Dijkstra Algorithm: Used for dynamic routing to calculate the shortest path (e.g., in OSPF).
- BFS Algorithm: Breadth-first search, suitable for networks without weighted edges.
- RIP Protocol: RIP v2 uses hop count as the routing metric.
Network Performance and Optimization
Network Latency and Bandwidth
- Latency: The time taken to transmit data, influenced by transmission distance and link quality.
- Bandwidth: The amount of data transmitted per unit of time, limited by network device performance.
Network Troubleshooting
Common Diagnostic Methods
- Ping Test: Checks network connectivity.
- Tracert: Traces the path that packets take.
- Netstat: Displays active network connections and routing table information.
- Telnet: Tests whether a specific port is open.
Network Protocols and Standards
Common Protocols and Standards
- HTTP: Hypertext Transfer Protocol, used for web browsing.
- FTP: File Transfer Protocol, used for file transfer.
- DNS: Domain Name System protocol, converts domain names to IP addresses.
- IPv6: The next-generation Internet protocol supporting 128-bit addresses.
Network Devices and Interfaces
Functions of Network Devices
- Switch: Forwards data based on MAC addresses; supports VLANs (Virtual LANs).
- Router: Forwards data based on IP addresses; maintains routing tables.
- Firewall: Filters traffic based on rules or policies.
Network Performance Metrics
Common Performance Metrics
- Bandwidth: Amount of data transmitted per unit of time (Mbps).
- Latency: Time taken to transmit data (ms).
- Jitter: The variation in latency (ms).
- Throughput: Amount of data successfully transmitted per unit of time (Mbps).
Network Topology and Architecture
Types of Network Topology
- Star Topology: All devices connect to a central node.
- Ring Topology: Data packets circulate continuously around the ring.
- Tree Topology: Hierarchical structure, such as Ethernet topology.
Network Protocols and Standards (Part 2)
Common Protocols and Standards
- TCP/IP: Core protocols of the Internet.
- HTTP/2: An improved version of HTTP supporting multiplexing.
- WebSocket: A full-duplex communication protocol used for real-time applications.
Network Security and Protection
Network Security Threats
- DDoS Attack: Distributed Denial of Service attack.
- ARP Spoofing: Forging ARP responses to hijack IP addresses.
- Man-in-the-Middle Attack: Intercepting and altering communication between two parties to steal data.
Network Performance Optimization
Network Optimization Strategies
- Load Balancing: Distributes traffic across multiple servers.
- QoS (Quality of Service): Ensures critical traffic is prioritized for transmission.
- Caching Technology: Reduces repeated requests to improve efficiency.
Network Devices and Interfaces (Part 2)
Functions of Network Devices
- Switch: Forwards data based on MAC addresses; supports VLANs.
- Router: Forwards data based on IP addresses; maintains routing tables.
- Firewall: Filters traffic based on rules or policies.
Network Performance Metrics (Part 2)
Common Performance Metrics
- Bandwidth: Amount of data transmitted per unit of time (Mbps).
- Latency: Time taken to transmit data (ms).
- Jitter: The variation in latency (ms).
- Throughput: Amount of data successfully transmitted per unit of time (Mbps).
Network Protocols and Standards (Part 3)
Common Protocols and Standards
- TCP/IP: Core protocols of the Internet.
- HTTP/2: An improved version of HTTP supporting multiplexing.
- WebSocket: A full-duplex communication protocol used for real-time applications.
Network Security and Protection (Part 3)
Network Security Threats
- DDoS Attack: Distributed Denial of Service attack.
- ARP Spoofing: Forging ARP responses to hijack IP addresses.
- Man-in-the-Middle Attack: Intercepting and altering communication between two parties to steal data.
Network Performance Optimization (Part 3)
Network Optimization Strategies
- Load Balancing: Distributes traffic across multiple servers.
- QoS (Quality of Service): Ensures critical traffic is prioritized for transmission.
- Caching Technology: Reduces repeated requests to improve efficiency.