LI Interview Questions and Answers On Networking
LI Interview Questions and Answers On Networking
Answer:
• ifconfig:
ip addr show
Answer:
• Namespaces are a feature of the Linux kernel that isolate resources such as processes,
network interfaces, and mounts.
• Network namespaces:
o Each namespace has its own interfaces, routing tables, and ARP tables.
Answer:
• Bridge: Operates at Layer 2 (Data Link Layer); connects two network segments and forwards
packets based on MAC addresses.
• Switch: Similar to a bridge but more advanced, handling multiple ports and faster
forwarding.
• Router: Operates at Layer 3 (Network Layer); routes packets between different networks
using IP addresses.
Linux supports bridging with tools like brctl and routing with tools like ip route.
Answer:
• Workflow:
1. The host sends a broadcast ARP request (who has <IP address>?).
2. The device with the requested IP responds with its MAC address.
• The ARP table stores mappings, which can be viewed or modified using:
o arp (deprecated)
Answer:
Answer:
• In Linux:
2. Each socket is linked to a protocol family (e.g., PF_INET for IPv4, PF_INET6 for IPv6).
3. Data flow between user space and kernel space occurs via system calls like
socket(), bind(), listen(), accept(), send(), and recv().
7. What are the differences between TCP and UDP? How does Linux manage them?
Answer:
o Connection-oriented
o Connectionless
• Linux manages TCP and UDP using different protocol control blocks:
Answer:
• The Linux kernel uses the routing table to determine the next hop for a packet.
o Destination IP address
o Subnet mask
o Gateway
o Interface
• The routing table can be viewed using the ip route or route command.
• Linux supports both static routing and dynamic routing through tools like Quagga or BIRD
1. What is TCP/IP and how does it work?
TCP/IP stands for Transmission Control Protocol/Internet Protocol. It is a suite of communication
protocols used to interconnect network devices on the internet. TCP handles reliable data
transmission between devices, guaranteeing data delivery and maintaining the order of packets,
while IP handles addressing and routing of data packets across networks.
9. What is the TCP window size, and how does it affect throughput?
The TCP window size specifies the amount of data that can be sent before receiving an
acknowledgment. A larger window size allows more data to be sent, increasing throughput, while a
smaller window size reduces throughput due to frequent waiting for acknowledgments.
1. Hands-on Practice: Use tools like netstat, and ip to understand their outputs.
3. Read Kernel Source Code: Familiarize yourself with key files related to networking in the
Linux kernel source (e.g., /net/ipv4/).