What is a computer network?
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:
What are the different types of computer networks?
Networks are typically categorized by their geographical scope:
What is the OSI Model? Explain its 7 layers.
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.
What is the difference between the OSI and TCP/IP models?
The main differences lie in their structure and an application:
What are the main differences between TCP and UDP?
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:
Feature | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) |
---|---|---|
Connection | Connection-oriented. A connection (three-way handshake) must be established before data transfer. | Connectionless. No prior connection is needed. Just send the data. |
Reliability | Highly 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'. |
Ordering | Guarantees that data packets are delivered in the same order they were sent. | No guarantee of packet order. |
Speed | Slower due to its reliability features (acknowledgments, ordering, flow control). | Faster due to its simplicity and lack of overhead. |
Header Size | Larger header (20 bytes). | Smaller header (8 bytes). |
Use Cases | Web 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. |
Explain the TCP Three-Way Handshake.
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:
SYN
(Synchronize Sequence Number) flag set to the server.SYN
and ACK
(Acknowledgment) flags set.ACK
flag set. This acknowledges the server's response.After these three steps, the connection is established, and data transfer can begin.
What is an IP address?
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:
There are two versions of IP addresses in use: IPv4 and IPv6.
What is the difference between IPv4 and IPv6?
IPv4 and IPv6 are two versions of the Internet Protocol.
Feature | IPv4 | IPv6 |
---|---|---|
Address Size | 32-bit address space. | 128-bit address space. |
Address Format | Dotted-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 Addresses | Approximately 4.3 billion addresses. | Approximately 340 undecillion (\( 2^{128} \)) addresses, which is virtually inexhaustible. |
Address Configuration | Mostly manual or via DHCP. | Supports stateless auto-configuration. |
Security | Security features (IPSec) are optional. | IPSec is built-in and mandatory. |
Packet Header | More complex header with variable length. | Simpler, fixed-length header for faster processing by routers. |
What is a subnet mask?
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
:
11000000.10101000.00000001.01100100
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
).
What is the purpose of subnetting?
Subnetting is the process of dividing a single large IP network into multiple smaller sub-networks (or subnets). This is done for several reasons: