Computer Network
Computer Network
What is a Computer Network? A computer network is a system that connects computers and
devices to share resources and communicate. This can include sharing files, printers, and
internet access.
Network Topologies
1. Bus Topology:
All devices share a single communication line (the bus). It's simple but can be slow if
many devices are connected.
2. Star Topology:
All devices connect to a central hub or switch. This setup is easy to manage and
troubleshoot, but if the hub fails, the whole network goes down.
3. Ring Topology:
Devices are connected in a circular fashion. Data travels in one direction. If one device
fails, it can disrupt the entire network.
4. Mesh Topology:
Every device connects to multiple other devices. This provides high reliability, as data
can take multiple paths, but it's complex and costly to set up.
5. Hybrid Topology:
A combination of different topologies, tailored to meet specific needs.
Layered Architecture
1. Physical Layer:
The hardware that transmits raw data (cables, switches).
2. Data Link Layer:
Ensures error-free transmission between directly connected devices. It handles framing
and addressing.
3. Network Layer:
Manages data routing and forwarding. It uses IP addresses to send data across
networks.
4. Transport Layer:
Provides reliable data transfer, ensuring data arrives in order and without errors (e.g.,
TCP).
5. Session Layer:
Manages sessions or connections between applications.
6. Presentation Layer:
Translates data formats for the application layer. It handles encryption and data
compression.
7. Application Layer:
The top layer where users interact with the network (e.g., web browsers, email clients).
What It Does:
The physical layer is the first layer in the OSI model and is responsible for the physical
connection between devices. It deals with the transmission of raw bits over a communication
channel.
Key Functions:
1. Transmission Media:
Defines the physical medium used for communication (cables, fiber optics, wireless
signals).
2. Bit Representation:
Converts digital data into electrical, optical, or radio signals.
3. Data Rate Control:
Determines the speed at which data is transmitted (measured in bits per second).
4. Physical Topology:
Defines how devices are physically arranged and connected.
5. Synchronization:
Ensures that the sender and receiver are synchronized in timing for accurate data
transmission.
What It Does:
The data link layer is the second layer in the OSI model. It provides reliable communication
between directly connected devices.
Key Functions:
1. Framing:
Groups raw bits from the physical layer into frames for easier handling.
2. Error Detection and Correction:
Identifies and corrects errors that may occur during data transmission using techniques
like checksums and CRC (Cyclic Redundancy Check).
3. Flow Control:
Manages data transmission speed between sender and receiver to prevent
overwhelming the receiver.
4. Addressing:
Uses MAC (Media Access Control) addresses to identify devices on the same local
network.
5. Medium Access Control (MAC):
Regulates how multiple devices share the same communication medium (e.g.,
CSMA/CD for Ethernet).
Multiprocess Techniques
Key Techniques:
1. Multiprogramming:
Allows multiple programs to run at the same time on a single processor by rapidly
switching between them.
2. Multithreading:
Enables a single program to perform multiple threads (smaller tasks) concurrently,
making better use of CPU resources.
3. Distributed Processing:
Spreads tasks across multiple machines or servers, allowing for greater scalability and
fault tolerance.
4. Parallel Processing:
Breaks down a task into smaller parts that can be processed simultaneously by different
processors, significantly speeding up computation.
Circuit Switching
What It Is:
Circuit switching is a method of communication where a dedicated connection is established
for the entire duration of a call or data session.
Key Features:
• Dedicated Path: A fixed path is reserved between the sender and receiver.
• Consistent Quality: Offers consistent quality and speed since the entire circuit is dedicated.
• Inefficient Use: Resources are used even when no data is being transmitted (e.g., during
silence in a call).
Example:
Traditional telephone networks use circuit switching.
Packet Switching
What It Is:
Packet switching breaks data into small packets that are sent independently over the network.
Key Features:
• Flexible Routing: Packets can take different paths to reach the destination, making the network
more efficient.
• Efficient Use: Bandwidth is used more efficiently since multiple packets from different sources
can share the same network resources.
• Variable Quality: Delivery time and quality can vary, as packets may arrive out of order.
Example:
The Internet primarily uses packet switching.
LAN Technologies
1. Ethernet:
The most common wired LAN technology, using cables to connect devices.
2. Wi-Fi:
A popular wireless LAN technology that allows devices to connect without cables.
3. Token Ring:
An older technology where devices take turns sending data in a ring formation.
Wireless Networks
Key Features:
MAC Addressing
1. Format:
A MAC address is usually represented as six groups of two hexadecimal digits,
separated by colons or hyphens (e.g., 00:1A:2B:3C:4D:5E).
2. Uniqueness:
Each MAC address is intended to be unique to the device, allowing it to be
distinguished from others on the same network.
3. Layer 2 Addressing:
MAC addresses operate at the Data Link Layer (Layer 2) of the OSI model, enabling
devices to communicate directly within the same local area network (LAN).
4. Manufacturer-Specific:
The first half of a MAC address identifies the manufacturer (Organizationally Unique
Identifier, or OUI), while the second half is unique to the device.
1. Device Identification:
MAC addresses allow devices to identify and communicate with each other on a
network.
2. Data Frame Delivery:
When data is sent over a LAN, it includes the MAC addresses of the sender and
receiver to ensure it reaches the correct destination.
3. Network Management:
Network administrators can use MAC addresses for monitoring and managing devices
on the network.
Networking Devices
1. Router:
o Connects multiple networks (like a home network to the Internet).
o Routes data packets between networks based on IP addresses.
2. Switch:
o Connects multiple devices within the same local area network (LAN).
o Uses MAC addresses to forward data to the correct device.
3. Hub:
o A basic device that connects multiple Ethernet devices.
o Sends incoming data packets to all ports, not specific devices (less efficient than
switches).
4. Access Point (AP):
o Extends a wired network by adding wireless capability.
o Allows wireless devices to connect to a wired network.
5. Modem:
o Modulates and demodulates signals for Internet access.
o Connects your local network to your Internet Service Provider (ISP).
6. Firewall:
o Monitors and controls incoming and outgoing network traffic.
o Provides security by blocking unauthorized access.
1. IP (Internet Protocol):
o Responsible for addressing and routing packets of data.
o Includes two main versions: IPv4 (most common) and IPv6 (newer, with more
addresses).
2. ICMP (Internet Control Message Protocol):
o Used for error messages and network diagnostics (e.g., ping command).
o Helps in troubleshooting network issues.
3. ARP (Address Resolution Protocol):
o Resolves IP addresses to MAC addresses.
o Allows devices on a local network to discover each other's hardware addresses.
4. RARP (Reverse Address Resolution Protocol):
o Used to find an IP address based on a known MAC address.
o Less common today, replaced by DHCP.
IPv4 and IPv6
IP Addressing
What Is IP Addressing?
IP addressing gives each device a unique identifier on a network.
Key Concepts:
Subnetting
What Is Subnetting?
Subnetting is the practice of dividing a larger network into smaller, manageable sub-networks
(subnets). This helps organize networks and improves performance and security.
1. Network Segmentation:
o Splits a network into smaller parts to reduce congestion and enhance security.
2. Efficient IP Address Use:
o Allows better management of IP addresses, minimizing waste and making it easier to
allocate addresses.
3. Improved Performance:
o Reduces broadcast traffic since devices only communicate within their subnet.
4. Example:
o A network with the address 192.168.1.0/24 can be divided into smaller subnets like
192.168.1.0/26 and 192.168.1.64/26.
CIDR (Classless Inter-Domain Routing)
What Is CIDR?
CIDR is a method for allocating IP addresses and routing Internet Protocol packets more
efficiently than the traditional class-based system.
1. Flexible Addressing:
o Allows for variable-length subnet masking (VLSM), enabling more efficient use of IP
addresses.
2. Simplified Routing:
o Reduces the size of routing tables by aggregating multiple IP addresses into a single
entry (supernetting).
3. Notation:
o CIDR notation uses a slash followed by the number of bits in the subnet mask (e.g.,
192.168.1.0/24 means the first 24 bits are the network part).
4. Example:
o The CIDR range 10.0.0.0/8 covers all IP addresses from 10.0.0.0 to 10.255.255.255.
Routing Protocols
Routing protocols are rules that help routers communicate and determine the best paths for
sending data packets across networks.
Key Features:
Transport layer protocols are responsible for delivering data between devices over a
network, ensuring reliable communication and proper data flow.
Ports:
• What They Are: Virtual endpoints for communication on a device, identified by a number (0-
65535).
• Common Port Numbers:
o HTTP: Port 80
o HTTPS: Port 443
o FTP: Port 21
o SMTP: Port 25
Sockets:
• What They Are: A combination of an IP address and a port number, uniquely identifying a
connection between two devices.
• Example: An application using port 80 on IP address 192.168.1.1 would have the socket
192.168.1.1:80.
Connection Establishment
What It Is:
The process of setting up a connection between two devices before data transmission begins.
1. Three-Way Handshake:
o SYN: The client sends a synchronization (SYN) request to the server to initiate a
connection.
o SYN-ACK: The server responds with a synchronization-acknowledgment (SYN-ACK)
to confirm receipt of the request.
o ACK: The client sends an acknowledgment (ACK) back to the server to complete the
connection.
Flow and Congestion Control
Flow control and congestion control are techniques used to manage the data
transmission rate in a network, ensuring efficient communication and preventing
network overload.
Flow Control
What It Is:
Flow control manages the rate of data transmission between sender and receiver, ensuring that
the sender does not overwhelm the receiver with too much data at once.
Key Features:
1. Buffer Management:
Uses buffers to temporarily store data at the receiver, allowing it to process incoming
data at its own pace.
2. Techniques:
o Stop-and-Wait: The sender transmits one packet and waits for an acknowledgment
before sending the next.
o Sliding Window: Allows multiple packets to be sent before needing an
acknowledgment, increasing efficiency.
Congestion Control
What It Is:
Congestion control prevents network congestion by managing the amount of data being sent
into the network.
Key Features:
1. Network Monitoring:
Monitors network traffic and adjusts the data transmission rate based on current
conditions.
2. Techniques:
o TCP Congestion Control: Uses algorithms like AIMD (Additive
Increase/Multiplicative Decrease) to adjust the flow of data.
o Explicit Congestion Notification (ECN): Routers signal congestion to senders,
allowing them to reduce their transmission rate.
DIAGRAM
Application layer protocols are rules that define how applications communicate over a
network. They operate at the highest layer of the OSI model.
1. 5G Technology:
o Overview: Faster mobile networks with lower latency.
o Impact: Supports more devices and new applications like smart cities.
2. Internet of Things (IoT):
o Overview: More devices connected to the Internet.
o Impact: Increases data flow and connectivity needs.
3. Software-Defined Networking (SDN):
o Overview: Centralized control of network management.
o Impact: Increases flexibility and easier updates.
4. Network Function Virtualization (NFV):
o Overview: Virtualizes network services instead of using hardware.
o Impact: Reduces costs and speeds up service deployment.
5. Edge Computing:
o Overview: Processes data closer to where it’s generated.
o Impact: Reduces delay and bandwidth usage.
6. Artificial Intelligence (AI):
o Overview: Uses AI for network management and security.
o Impact: Automates monitoring and improves security.
7. Zero Trust Security:
o Overview: Verifies every user trying to access the network.
o Impact: Enhances security by reducing access risks.
8. Wi-Fi 6:
o Overview: The latest Wi-Fi standard for improved speed and capacity.
o Impact: Better performance in crowded areas.
9. Quantum Networking:
o Overview: Uses quantum technology for secure communication.
o Impact: Promises ultra-secure data transmission.
10. Blockchain in Networking:
o Overview: Uses blockchain for secure data sharing.
o Impact: Provides a decentralized and secure communication method.
PAST PAPERS
What Is ARP?
ARP (Address Resolution Protocol) is used to find the MAC address associated with an IP
address on a local network. It helps devices communicate by converting IP addresses into
MAC addresses.
1. ARP Request:
o When a device wants to communicate with another device but only knows its IP
address, it sends out an ARP request. This request is broadcast to all devices on the
local network.
o Example: "Who has IP address 192.168.1.2? Tell me your MAC address."
2. ARP Reply:
o The device with the matching IP address responds with an ARP reply, providing its
MAC address.
o Example: "I am 192.168.1.2, and my MAC address is 00:1A:2B:3C:4D:5E."
3. Caching:
o The requesting device stores the MAC address in its ARP cache for future use,
reducing the need to send ARP requests again.
ARP Diagram
Answers are
The three-way handshake is a process used to establish a reliable connection between two TCP
hosts. It involves the exchange of three TCP segments:
1. SYN Segment:
o Sent by the initiating host (Computer A) to the responding host (Computer B).
o Contains the SYN flag set to 1, an initial sequence number (ISN), and a maximum
segment size (MSS).
o Indicates the desire to establish a connection.
2. SYN-ACK Segment:
o Sent by Computer B in response to the SYN segment.
o Contains the SYN and ACK flags set to 1, an ISN, and the acknowledgment number
(ACK) of the received SYN segment.
o Indicates that Computer B has received the SYN segment and is willing to establish a
connection.
3. ACK Segment:
o Sent by Computer A in response to the SYN-ACK segment.
o Contains the ACK flag set to 1 and the acknowledgment number of the received SYN-
ACK segment.
o Confirms that Computer A has received the SYN-ACK segment and is ready to
establish the connection.
Example:
Breakdown:
Therefore:
Answers are
Given:
Calculations:
1. Number of networks:
o The subnet mask has 6 bits for the network portion.
o 2^6 = 64 networks
2. Number of hosts per network:
o The subnet mask has 2 bits for the host portion.
o 2^2 - 2 = 2 hosts per network (subtract 2 for the network and broadcast addresses)
3. Usable address range for the first two networks:
o Network 1: 172.16.0.0 - 172.16.0.3
o Network 2: 172.16.0.4 - 172.16.0.7
4. Broadcast addresses for the first two networks:
o Network 1: 172.16.0.3
o Network 2: 172.16.0.7
The OSI (Open Systems Interconnection) model has seven layers, each with specific functions.
Here’s a quick overview:
1. Attenuation:
o Definition: The reduction in signal strength as it travels over a distance.
o Impact: Causes weaker signals, making it harder for the receiver to detect the data.
2. Distortion:
o Definition: Changes in the shape of the signal, often due to different frequencies
traveling at different speeds.
o Impact: Can lead to misinterpretation of the data, causing errors.
3. Noise:
o Definition: Unwanted electrical signals that interfere with the transmission of the main
signal.
o Types:
▪ Thermal Noise: Generated by the random motion of electrons.
▪ Interference: From other devices or signals (e.g., crosstalk).
o Impact: Reduces signal clarity and can introduce errors.
4. Jitter:
o Definition: Variability in signal timing, often seen in digital transmissions.
o Impact: Can cause packets to arrive out of order, leading to issues in real-time
applications (like video calls).
5. Latency:
o Definition: The delay before a transfer of data begins following an instruction.
o Impact: Affects the speed of communication, especially in interactive applications.
IP Header
Overview:
The IP header contains information required for routing the packet across networks. It’s part of
the Internet Protocol (IP).
Key Fields:
TCP Header
Overview:
The TCP header contains information necessary for establishing a reliable connection and
ensuring accurate data delivery.
Key Fields:
Classful Addressing: