Top

Computer Networking

1.

What is a computer network?

Ans:

A computer network is a collection of interconnected computing devices (known as nodes) that can exchange data and share resources with each other. These devices use a system of rules, called protocols, to transmit information over physical or wireless technologies.

The primary purposes of a network include:

  • Resource Sharing: Sharing hardware like printers, scanners, and storage devices.
  • Information Sharing: Accessing files, databases, and other information from remote computers.
  • Communication: Enabling communication through email, video conferencing, instant messaging, etc.
  • Centralized Management: Simplifying the administration and maintenance of software and hardware.

2.

What are the different types of computer networks?

Ans:

Networks are typically categorized by their geographical scope:

  • LAN (Local Area Network): A network that covers a small geographical area, such as a home, office, or a single building. Ethernet and Wi-Fi are the most common LAN technologies.
  • WAN (Wide Area Network): A network that spans a large geographical area, such as a city, country, or even the entire globe. The Internet is the largest WAN. WANs connect multiple LANs together.
  • MAN (Metropolitan Area Network): A network that covers a larger area than a LAN but smaller than a WAN, typically a city or a large campus.
  • PAN (Personal Area Network): A network for interconnecting devices centered on an individual's workspace. Bluetooth is a common example.

3.

What is the OSI Model? Explain its 7 layers.

Ans:

The OSI (Open Systems Interconnection) Model is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven abstract layers. It's a way to visualize how data is sent from a sender to a receiver in a network.

  1. Layer 7 - Application Layer: The layer closest to the end-user. It provides network services directly to user applications. Examples: HTTP, FTP, DNS, SMTP.
  2. Layer 6 - Presentation Layer: Translates, encrypts, and compresses data. It ensures that data sent by the application layer of one system can be read by the application layer of another system.
  3. Layer 5 - Session Layer: Establishes, manages, and terminates connections (sessions) between applications. It handles authentication and authorization.
  4. Layer 4 - Transport Layer: Provides reliable or unreliable data transfer between end systems. It handles segmentation, flow control, and error control. Examples: TCP and UDP.
  5. Layer 3 - Network Layer: Responsible for logical addressing (IP addresses) and routing. It determines the best path to move data from source to destination across the network.
  6. Layer 2 - Data Link Layer: Provides node-to-node data transfer and handles physical addressing (MAC addresses). It is divided into two sublayers: LLC (Logical Link Control) and MAC (Media Access Control).
  7. Layer 1 - Physical Layer: Responsible for the physical connection between devices. It transmits raw bit streams over a physical medium (e.g., cables, fiber optics, radio waves).

4.

What is the difference between the OSI and TCP/IP models?

Ans:

The main differences lie in their structure and an application:

  • Layers: The OSI model has 7 layers, while the TCP/IP model has 4 layers.
  • Development: OSI is a generic, protocol-independent standard that was developed as a reference model. TCP/IP is a suite of protocols that was developed first and then modeled.
  • Application: The TCP/IP model is the practical model used for the Internet, whereas the OSI model is primarily used for teaching and as a reference guide for troubleshooting.
  • Layer Mapping: The Application, Presentation, and Session layers of the OSI model are combined into the Application Layer in the TCP/IP model. The OSI's Data Link and Physical layers are combined into the Network Access Layer in TCP/IP.

5.

What are the main differences between TCP and UDP?

Ans:

TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the two primary protocols at the Transport Layer. Their differences are fundamental to network communication.

Summary Table:

FeatureTCP (Transmission Control Protocol)UDP (User Datagram Protocol)
ConnectionConnection-oriented. A connection (three-way handshake) must be established before data transfer.Connectionless. No prior connection is needed. Just send the data.
ReliabilityHighly reliable. Guarantees delivery of data, with error checking and retransmission of lost packets.Unreliable. No guarantee of delivery, no error checking or retransmission. Also called 'fire and forget'.
OrderingGuarantees that data packets are delivered in the same order they were sent.No guarantee of packet order.
SpeedSlower due to its reliability features (acknowledgments, ordering, flow control).Faster due to its simplicity and lack of overhead.
Header SizeLarger header (20 bytes).Smaller header (8 bytes).
Use CasesWeb Browse (HTTP), email (SMTP), file transfer (FTP). Applications where data integrity is critical.Video streaming, online gaming, DNS, VoIP. Applications where speed is critical and a lost packet is acceptable.

6.

Explain the TCP Three-Way Handshake.

Ans:

The TCP three-way handshake is the process used to establish a reliable connection between a client and a server before any data is transferred. It ensures both sides are ready to communicate.

The three steps are:

  1. Step 1: SYN
    The client wants to establish a connection, so it sends a segment with the SYN (Synchronize Sequence Number) flag set to the server.
  2. Step 2: SYN-ACK
    The server receives the SYN packet. If it's able to establish a connection, it responds with a segment that has both the SYN and ACK (Acknowledgment) flags set.
  3. Step 3: ACK
    The client receives the SYN-ACK packet from the server and responds with a final segment that has the ACK flag set. This acknowledges the server's response.

After these three steps, the connection is established, and data transfer can begin.

7.

What is an IP address?

Ans:

An IP (Internet Protocol) address is a unique numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves two main functions:

  • Host or network interface identification: It uniquely identifies a device on the network.
  • Location addressing: It specifies the location of the device in the network, allowing data to be routed to it.

There are two versions of IP addresses in use: IPv4 and IPv6.

8.

What is the difference between IPv4 and IPv6?

Ans:

IPv4 and IPv6 are two versions of the Internet Protocol.

FeatureIPv4IPv6
Address Size32-bit address space.128-bit address space.
Address FormatDotted-decimal notation (e.g., 192.168.1.1).Hexadecimal notation, separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
Number of AddressesApproximately 4.3 billion addresses.Approximately 340 undecillion (\( 2^{128} \)) addresses, which is virtually inexhaustible.
Address ConfigurationMostly manual or via DHCP.Supports stateless auto-configuration.
SecuritySecurity features (IPSec) are optional.IPSec is built-in and mandatory.
Packet HeaderMore complex header with variable length.Simpler, fixed-length header for faster processing by routers.

9.

What is a subnet mask?

Ans:

A subnet mask is a 32-bit number that separates an IP address into its two main components: the network address and the host address.

The subnet mask 'masks' the network part of the IP address, leaving the host part. It does this by using a series of `1`s for the network portion and a series of `0`s for the host portion.

For example, for the IP address 192.168.1.100 with a subnet mask of 255.255.255.0:

  • IP Address: 11000000.10101000.00000001.01100100
  • Subnet Mask: 11111111.11111111.11111111.00000000

By performing a bitwise AND operation between the IP address and the subnet mask, a device can determine the network address (192.168.1.0).

10.

What is the purpose of subnetting?

Ans:

Subnetting is the process of dividing a single large IP network into multiple smaller sub-networks (or subnets). This is done for several reasons:

  • Improved Performance: It reduces the volume of network traffic (broadcasts) within each subnet, leading to less congestion and better performance.
  • Enhanced Security: It allows network administrators to isolate different subnets from each other using firewalls, improving security. For example, the accounting department's network can be isolated from the marketing department's network.
  • Simplified Management: It's easier to manage and troubleshoot smaller networks than one large one.
  • Conservation of IP Addresses: It allows for a more efficient allocation of a limited block of IP addresses.

Loading…
Tags: Computer Networking Interview Questions and Answers || Computer Networking Sort Questions and Answers || Computer Networking Detailed Questions and Answers || Computer Networking Tutorial