Computer Network Complete Notes - 48659967 - 2024 - 12 - 21 - 10 - 04
Computer Network Complete Notes - 48659967 - 2024 - 12 - 21 - 10 - 04
Computer Network
A computer network is a collection of interconnected devices (such as computers, servers, and peripherals) that
communicate and share resources (e.g., data, applications, and hardware) using wired or wireless communication
channels.
Networks range from small (LAN) to global (Internet), supporting collaboration and connectivity.
Advantages:
High speed and low latency.
Cost-effective as it uses inexpensive equipment like switches and routers.
Easy to maintain and troubleshoot.
Disadvantages:
Limited range.
Security risks if not properly managed.
Advantages:
Cost-effective for connecting multiple LANs within a city.
Provides robust disaster recovery capabilities due to redundant paths.
Advantages:
Covers vast distances.
Supports large-scale communication and data sharing.
Enables connectivity across diverse locations.
Disadvantages:
High cost of setup and maintenance.
Lower reliability and higher latency compared to LANs.
Advantages:
Convenient and easy to set up.
Low cost due to limited range and simple devices.
Promotes mobility and portability.
Disadvantages:
Limited range and speed.
Potential security risks from unauthorized access.
Internet
The Internet is a global network of interconnected devices and networks that communicate using standardized protocols
(TCP/IP).
It allows users to access and share information, communicate, and utilize services
globally.
Global Connectivity: Connects billions of devices worldwide.
Scalability: Accommodates new devices and technologies seamlessly.
Interoperability: Supports diverse hardware, software, and networks using standardized
protocols.
Decentralization: No single entity controls the entire Internet.
Accessibility: Available to users via ISPs (Internet Service Providers) and public access
points.
1. Intranet
An intranet is a private network accessible only to authorized users within an organization.
It is designed to facilitate internal communication, collaboration, and resource sharing.
Restricted access; only employees or members of the organization can use it.
Secure, as it operates within the organization's internal firewall.
Often includes tools like internal email, shared file storage, employee directories, and company portals.
2. Extranet
An extranet is an extension of an intranet that allows external stakeholders (e.g., clients, vendors, partners) limited access
to specific organizational resources.
Combines internal and external communication.
Access is granted to specific users outside the organization via secure authentication.
Often used for collaboration with third parties, sharing project data, or providing services.
Advantages:
Simple and inexpensive to implement.
Requires less cable compared to other topologies.
Disadvantages:
Limited scalability; performance degrades as devices increase.
Single point of failure: Backbone failure disrupts the entire network.
If the network traffic is heavy, it increases collisions in the network. To avoid this, various protocols are used in the
MAC layer known as Pure Aloha, Slotted Aloha, CSMA/CD, etc.
2. Star Topology
All devices are connected to a central device, such as a hub or switch through a cable.
Data passes through the central device.
Each device requires a separate connection to the central hub.
The hub serves as the central node, and it can be either:
Passive: Non-intelligent, primarily broadcasting signals.
Active: Intelligent, with built-in repeaters for signal amplification.
Connections typically use coaxial cables or RJ-45 Ethernet cables, and protocols like
CSMA/CD (Carrier Sense Multiple Access with Collision Detection) are commonly
employed.
Advantages:
Requires only N cables to connect N devices, simplifying installation.
Each device connects to the hub using one port, minimizing complexity.
A failure in one link affects only that link, not the entire network.
New devices can be added to the network without disrupting existing connections.
All data passes through the hub, enabling easier monitoring and control.
Disadvantages:
If the hub fails, the entire network becomes inoperable.
Network performance is heavily reliant on the hub's capacity and efficiency.
All data passes through the hub, which can cause congestion during high traffic.
3. Ring Topology
In a Ring Topology, each device is connected to exactly two neighboring devices, forming a
circular network.
Data Flow typically unidirectional but can be made bidirectional using Dual Ring Topology
(two connections per node).
Data passes through multiple nodes before reaching its destination, So repeaters used to
prevent data loss in large networks
Uses a token-passing protocol to avoid data collision.
A token (a special data frame) circulates in the network, granting permission to transmit data.
Token Ring Protocol is commonly used for managing data transmission.
4. Mesh Topology
Every device is connected to every other device, either fully or partially.
The nodes are connected to each other completely via a dedicated link during which information travels from nodes to
nodes.
If a mesh network has N nodes, then there are N(N-1)/2 links.
Full Mesh: Every node is directly connected to every other node.
Partial Mesh: Some nodes are connected to all others, while others are only
connected to a few.
Advantages:
Network remains functional even if one device fails.
No traffic issues due to dedicated point-to-point links.
Offers high privacy, security, and reliable data transmission.
Adding devices does not disrupt the network.
Disadvantages
High cost compared to other topologies.
Complex installation and configuration.
High power consumption as all nodes remain active.
Increased maintenance and utility costs.
5. Tree Topology
A hierarchical topology where devices are connected in the shape of a tree.
It combines characteristics of star and bus topologies.
Central nodes act as roots, and branches connect other nodes.
Data flows through parent-child relationships.
Advantages:
Scalable and suitable for hierarchical organizations as the leaf nodes can add one or
more nodes.
Fault isolation is easier.
Disadvantages:
Requires a lot of cable.
A fault in the backbone can disrupt communication.
Due to the presence of a large number of nodes, the network performance of tree topology becomes a bit slow.
6. Hybrid Topology
Combines two or more different topologies into a single network.
We can mix star, bus, ring, etc., depending on requirements.
Advantages:
Highly flexible and scalable.
Optimized for specific use cases.
Disadvantages:
Complex to design and maintain.
Expensive
Subscribe Infeepedia youtube channel for computer science competitive exams
Download Infeepedia app and call or wapp on 8004391758
Computer Network Infeepedia By: Infee Tripathi
Transmission Modes
1. Simplex Mode
Data flows in only one direction. There is no provision for reverse communication.
Unidirectional communication: Information flows from the sender to the receiver only.
No feedback: The sender does not receive any acknowledgment or data from the receiver.
Low complexity: Since no reverse communication is needed, hardware and protocols are simpler.
Example:
Television broadcasting
Keyboard to computer
Advantages:
Simple and cost-effective.
Efficient for applications where only one-way
communication is needed.
Disadvantages:
Lack of interaction or feedback.
Not suitable for two-way communication systems.
2. Half-Duplex Mode
Data flows in both directions, but only one direction at a time. Communication is alternated between sender and
receiver.
Bidirectional communication: Devices can send and receive data but not simultaneously.
Control mechanism: Requires coordination to determine
which device can send or receive at any given time.
Moderate complexity: More complex than simplex due
to the need for direction control.
Example:
Walkie-talkies: A person can speak (send) or listen
(receive) at a time, but not both simultaneously.
Shared ethernet networks: In traditional shared Ethernet, data flows in one direction at a time.
Advantages:
Allows two-way communication.
More cost-effective than full-duplex systems.
Disadvantages:
Slower communication as devices take turns.
Inefficient for systems requiring simultaneous data flow.
Transmission Media
Transmission media refer to the physical pathways or channels used for transmitting data from one device to another.
It plays a critical role in determining the speed, reliability, and efficiency of data communication.
Data Transmission:
Supports analog and digital transmission.
Commonly used for telephone lines and network cables.
Advantages
Cost-Effective: Cheaper than other guided media like coaxial and fiber optic cables.
Flexible and Easy to Install: Lightweight and simple to handle.
Widely Available: Easily found and used in most network setups.
Disadvantages
Limited Bandwidth: Cannot support very high data rates.
Short Distance: Suitable for short-range communication only.
Prone to Interference: Susceptible to electromagnetic interference (more in UTP).
b) Coaxial Cable
A coaxial cable (coax cable) is a high-frequency transmission cable
with low signal loss.
It has a single solid copper core surrounded by insulation, a
metallic shield, and an outer cover.
This design prevents electromagnetic interference and helps
transmit radio frequency (RF) signals as transverse
electromagnetic waves.
It is commonly used in cable TV, broadband, and CCTV systems.
The coaxial cable transmits information in two modes:
a) Baseband mode
b) Broadband mode.
There are two types coaxial cables based on Impedance: 75 Ohm Coaxial
Cable and 50 Ohm coaxial Cable
Advantages:
Extremely high bandwidth, immune to electromagnetic interference, supports
long-distance communication.
Disadvantages:
Expensive, complex installation, and maintenance.
a) Radio Wave
Radio waves are electromagnetic waves with wavelengths ranging from 1 mm to 100 km
(frequencies between 3 kHz to 300 GHz).
They are omnidirectional, meaning they travel in all directions from the source.
Generated by radio transmitters and received by radio receivers, both use antennas to transmit
and capture signals.
Radio waves are used in mobile communication, AM/FM radio, and television broadcasting.
b) Microwaves
Microwaves are high-frequency radio waves (300 MHz to 300 GHz) used for line-of-sight communication, where sending
and receiving antennas must be properly aligned.
They have small wavelengths, allowing signals to focus into narrow beams, ideal for point-to-point communication.
Microwaves cannot penetrate walls and are unidirectional, making them useful for unicast communication (one-to-one).
Applications:
Satellite communication
Radar and navigation
Wireless LANs and cellular networks
Remote sensing
Network Devices
Network devices are hardware components that connect and manage communication between different devices in a
network.
They facilitate data transfer, ensure security, and manage network traffic.
1. Hub
A basic device that connects multiple devices in a network and broadcasts data to
all connected devices.
It works on Physical Layer.
It does not filter data and Broadcasts incoming data to all connected devices.
Data collisions occur frequently as all devices share the same communication
channel.
2. Switch
A device that connects multiple devices and forwards data based
on MAC addresses.
It works on Data Link Layer.
Filters and forwards data to the intended recipient.
Reduces network collisions.
Applications: Used in LANs for efficient communication.
4. Modem
A device that converts digital signals to analog for transmission over telephone
lines and vice versa.
It operates at the Physical Layer.
It facilitates internet access over traditional lines.
It supports DSL, cable, and fiber connections.
Applications: Home and office internet connectivity.
6. Gateway
A device that connects two different networks using different protocols.
Gateways are also called protocol converters and can operate at any network layer.
It take data from one system, interpret it, and transfer it to another system.
Acts as an entry/exit point for networks.
Applications: Connecting corporate networks to the internet.
7. Bridge
A device that connects two or more LANs, forwarding data based on MAC addresses.
It operates on Data Link Layer.
Filters and forwards traffic between LAN segments.
Reduces traffic and improves performance.
Applications: Dividing large networks into smaller segments.
8. Repeater
A repeater operates at the physical layer and amplifies or regenerates weak signals to
extend their transmission range.
It copies the signal bit by bit and restores it to its original strength,
allowing it to travel further.
A repeater is a 2-port device used to strengthen signals in a
network.Applications: Extending LANs or WANs over large distances.
It cannot filter data.
There are three primary types of switching techniques used in telecommunication systems:
1. Circuit Switching
Circuit switching is a method of communication in which a dedicated communication path (or circuit) is established
between two nodes (sender and receiver) for the duration of the transmission.
Once the circuit is established, the entire bandwidth
of the path is reserved for the communication session
until it is terminated.
It is used in real-time communication applications like
voice calls, where a dedicated path is necessary.
Advantages:
Dedicated Path: Provides a constant, predictable, and stable connection.
Low Latency: Because the path is dedicated, there is minimal delay during communication.
No Interference: The reserved path ensures no data interference from other users.
Disadvantages:
Inefficient Resource Usage: The dedicated path remains idle if no data is being transmitted, which leads to inefficient
use of network resources.
Scalability Issues: For large networks, circuit switching can become inefficient as each communication requires
dedicated resources.
2. Packet Switching
Packet switching is a method of communication in which data is divided into smaller chunks called packets, which are
transmitted separately over the network.
Each packet may take a different route to reach the destination, where they are reassembled into the original data.
Example: Internet: When you send an email or load a web page, the data is split into packets that travel through
various network routers. Once they reach the destination, they are
reassembled to present the content.
There are three main types of packet switching:
1. Datagram Switching
2. Virtual Circuit Switching
3. Hybrid Switching
Datagram Switching: Datagram Switching is the simplest form of packet switching, where each packet is treated
independently and can take different routes to reach the destination.
Virtual Circuit Switching: establishes a logical connection between the sender and receiver before transmitting data. Once
the virtual circuit is set up, all packets follow the same predefined path.
Example: Telephone Networks (VoIP)
Advantages:
Efficient Resource Usage: Network resources are shared among multiple users, allowing more flexible use of bandwidth.
Fault Tolerance: If one path is congested or down, packets can be rerouted dynamically, ensuring better reliability.
Scalability: Easier to scale because the network can handle multiple communications simultaneously without reserving
dedicated paths.
Disadvantages:
Delay and Jitter: As packets may take different routes, delays can occur, and packets may arrive out of order, causing
jitter (variability in delay).
Overhead: Additional overhead for managing packets (such as addressing and sequencing) can reduce the efficiency of
the system.
OSI Model
The OSI (Open Systems Interconnection) Model is a conceptual or reference model that explains how different computer
systems communicate over a network.
OSI Model was developed by the International Organization for
Standardization (ISO) in 1984.
The OSI model creates a standard set of rules for all networking
systems to follow.
It helps different devices and technologies work together.
Error Handling Distributed across multiple layers. Managed primarily in the Transport Layer.
Real-World Usage Ideal for network design and troubleshooting. Backbone of the internet (e.g., web browsing,
email).
2. Communication Channel:
It defines how devices can be connected physically, for examples
include twisted-pair cables, fiber optics, and coaxial cables for wired
communication and Wi-Fi, Bluetooth for wireless communication.
2. Interference (Noise): External factors like electromagnetic interference (EMI) can distort signals. Shielded cables like
STP (Shielded Twisted Pair) are used to mitigate this.
At Receiver Side: Data link layer receives bits from physical layer and convert these bits to frames and transmit these
frames to network layer.
4. Flow Control:
Sometimes, one node has higher speed and
capacity than other nodes. Then sending speed
may be higher than receiver node. So, flow control
comes into the picture.
Thus, data link layer control the flow of data node
to node.
But the Transport layer deals with source to
destination flow control.
It uses the Stop and wait and Sliding window
protocols to control the flow of data.
5. Error Control:
The Data Link Layer uses error control to ensure
accurate data frame transmission between sender
and receiver.
It detects errors or losses during transmission and retransmits corrupted or missing frames.
While not mandatory, error control optimizes data accuracy and reliability in communication.
Errors can occur during data transmission due to noise, signal attenuation, interference, or hardware malfunctions.
These mechanisms identify errors and attempt to correct them when possible, ensuring data integrity.
Types of Errors
1. Single-Bit Error:
A single bit in the data unit is altered (e.g., 10110101 becomes 10110111).
Example: A 0 becomes 1, or vice versa, due to electrical interference.
2. Burst Error:
Two or more bits in the data unit are altered.
Example: 10110101 becomes 11100101 due to a prolonged noise burst.
3. Packet Loss:
Entire frames may get lost during transmission.
Example: A frame sent over a congested network might never reach the destination.
Error Detection
2. Checksum: Treats data as a sequence of integers. Calculates the sum of all integers and transmits it with the data.
At the receiver, the sum is recalculated and compared with the received checksum.
This method uses a Checksum Generator on the sender side and a Checksum Checker on the receiver side.
Example: Data: 1001 1101 1010 Checksum: 110110
Transmitted: 1001 1101 1010 110110
Limitation: A checksum primarily detects single-bit errors and some multiple-bit errors, but it cannot guarantee detection
of all multiple-bit errors i.e. less effective for detecting burst errors.
6. Access Control:
Access control in data link layer manages how devices share and access a communication medium in networks.
It ensures efficient, fair, and collision-free communication, especially in shared or broadcast environments like Ethernet,
Wi-Fi, or cellular networks.
Types of CSMA
a) CSMA/CD (Collision Detection)
It is used in wired Ethernet.
Device monitors the medium after it sends a frame to see if the transmission was successful or to detect collisions
during transmission.
If a collision is detected, they stop transmitting and retry after a random backoff time.
Example: Traditional Ethernet.
b) Polling:
A central controller polls each device to check if it has data to send.
Ensures orderly and collision-free transmission.
Example: Printer queues in a shared network.
c) Token Passing:
A token (special frame) circulates in the network, granting the right to transmit.
Only the device holding the token can send data.
Example: Token Ring networks.
3. Channelization Protocols
Divide the medium into separate channels to allow simultaneous transmission by multiple devices.
It allows the total usable bandwidth in a shared channel to be shared across multiple stations based on their time,
distance and codes. It can access all the stations at the same time to send the data frames to the channel.
c. Routing:
Determines the optimal path for data to travel from source to
destination.
Uses routing algorithms and routing tables to make decisions.
f. Congestion Control
When too many devices send data to the same router simultaneously, even with fragmentation, the router's buffer can
become full. This can lead to network overload. Managing this overload to ensure smooth data flow is called congestion
control. Controlling traffic is called congestion control and it is an important responsibility of the Network Layer.
4. Transport Layer
The Transport Layer is responsible for end-to-end communication between devices in a network.
End-to-end delivery is also called port-to-port or Process-to-process delivery.
It ensures that data is delivered reliably, efficiently, and in the correct order, regardless of the underlying network
infrastructure.
Functions of Transport Layer
1. End-to-end Delivery:
The transport layer is responsible for Port-to-Port Delivery.
Transport Layer requires a Port number to correctly deliver the
segments of data to the correct process amongst the multiple
processes running on a particular host.
A port number is a 16-bit address used to identify any client-server
program uniquely.
3. Reliable Delivery:
The transport layer provides reliability by retransmitting the lost and damaged packets. The reliable delivery has four
aspects:
a. Error Control: It used the checksum algorithm for error deduction. The basic purpose of reliability is Error Control. In
this way, the packet has arrived correctly.
b. Sequence Control: Reliability also involves the factor of sequence control. It means sending and receiving orders must
be the same so that various segments of a transmission can be correctly reassembled.
c. Loss Control: The reliability of the transport layer ensures that all the fragments arrive at the destination successfully
without losing some of them.
If some segment is missing, then its sequence number identifies it while reassembling.
d. Duplication Control: The transport layer also ensures that no duplicate data arrive at the destination.
If some segment is duplicated, then its sequence number identifies it while reassembling. In this way, a duplicate
segment is discarded.
4. Flow Control:
If the receiver is overloaded due to the transmission of too much data by the sender, then the receiver discards some
packets and requests for the retransmission of discarded packets. These phenomena cause a reduction in the system
performance.
Transport layer regulates the data flow between sender and receiver to prevent overwhelming the receiver.
The transport layer uses the “sliding window protocol” to handle the flow control.
5. Connection Establishment and Termination: It sets up, maintains, and terminates connections between applications.
Example: Before sending data, a connection is established (e.g., using a three-way handshake in TCP).
6. Multiplexing and Demultiplexing: It allows multiple applications to share the same network connection by assigning
unique port numbers.
Example: A computer can browse the web (port 80) and send emails (port 25) simultaneously using different port
numbers.
5. Session Layer
The Session Layer manages and controls the dialog between two devices in a network.
It establishes, maintains, and terminates communication sessions, ensuring that the data exchange is properly
synchronized and organized.
2. Session Maintenance:
Keeps the session alive during communication.
Monitors the connection to detect interruptions and ensures continuity.
Example: During a video conference, the Session Layer maintains the
session even if there are minor network fluctuations.
3. Session Termination:
Closes the session once the communication is complete.
Frees up resources and ensures a clean disconnection.
Example: When a user logs out of an email client, the session is terminated.
4. Synchronization:
Adds checkpoints (synchronization points) to the data stream to resume communication from a specific point in case of
failure.
Example: In a file transfer, if the connection drops, the transfer can resume from the last checkpoint instead of starting
over.
5. Dialog Control:
Manages the flow of data between devices, ensuring proper sequencing and avoiding conflicts.
Supports half-duplex (one-way communication at a time) or full-duplex (simultaneous two-way communication).
Example: In a chat application, the Session Layer ensures that messages are sent and received in the correct order.
3. NetBIOS:
Provides session management for applications on a local network.
4. SQL Sessions:
Database management systems use sessions to handle queries and transactions.
Example: A session is established when a user connects to a database to run SQL commands.
6. Presentation Layer
The Presentation Layer is responsible for ensuring that data sent by the application layer of one system is readable by the
application layer of another system.
It acts as a translator and performs data formatting, encryption, and compression.
4. Data Formatting:
Ensures data is in a structured format that the receiving application can understand.
Example: Converting text into a standard format like XML or JSON for transmission.
5. Character Encoding:
Handles character set conversions to ensure text data is displayed correctly across different systems.
Example: Converting Unicode to UTF-8.
7. Application Layer
The Application Layer is the topmost layer of the OSI model, directly interacting with the end user.
It provides network services to applications, enabling communication between software applications on different devices.
2. Application Services:
Facilitates communication between software applications.
Example: Sending an email using an email client like Outlook or Gmail.
3. Data Communication:
Ensures data is properly structured and ready for transmission.
Example: Formatting HTTP requests for web browsing.
6. Error Handling:
Detects and manages errors in application-level communication.
Example: Displaying an error message when an email fails to send.
IP address
An IP address (Internet Protocol address) is a unique identifier assigned to each device connected to a network, such as
the internet.
It allows devices to communicate with each other by specifying the source and
destination of data packets.
It is also called logical address.
Types of IP Addresses
1. IPv4 (Internet Protocol Version 4):
Format: A 32-bit address, typically written as four decimal numbers (8 bit each)
separated by dots (e.g., 192.168.1.1).
Address Space: Approximately 4.3 billion unique addresses.
Parts of IPv4
IPv4 addresses have three parts:
1. Network Part: Identifies the network and is the same for all devices in that network.’
2. Host Part: Uniquely identifies each device within the network.
3. Subnet Number (Optional): Used to divide large networks into smaller sections (subnets).
Classful addressing
Classful addressing divides the IPv4 address space into five classes (A, B, C, D, and E), each designed for specific purposes.
The classes are distinguished by the first few bits of the IP address and
determine the size of the network and host portions.
The class of IP address is used to determine the bits used for network ID
and host ID and the number of total networks and hosts possible in that
particular class.
Class A
Range: First octet 0 to 127.
Binary Representation: First bit is always 0.
Address Range: 0.0.0.0 to 127.255.255.255.
Note: 127.x.x.x is reserved for loopback testing, so usable range is 1.0.0.0 to 126.255.255.255.
Default Subnet Mask: 255.0.0.0.
Network/Host: 8 bits for the network, 24 bits for the host.
Number of Networks: 27−2=126 (excluding reserved).
Number of Hosts per Network: 224−2=16,777,214 (excluding network and
broadcast addresses).
Class B
Range: First octet 128 to 191.
Binary Representation: First two bits are always 10.
Address Range: 128.0.0.0 to 191.255.255.255.
Subnet Mask: 255.255.0.0.
Network/Host: 16 bits for the network, 16 bits for the host.
Number of Networks: 214=16,384.
Number of Hosts per Network: 216−2=65,534(excluding network and broadcast addresses)
Use Case: Medium-sized networks like universities or large businesses.
Example: 172.16.0.1.
Class C
Range: First octet 192 to 223.
Binary Representation: First three bits are always 110.
Address Range: 192.0.0.0 to 223.255.255.255.
Subnet Mask: 255.255.255.0.
Network/Host: 24 bits for the network, 8 bits for the host.
Number of Networks: 221=2,097,152.
Number of Hosts per Network: 28−2=254 (excluding network and broadcast addresses)
Use Case: Small networks like small businesses or home networks.
Example: 192.168.1.1.
Class D
Range: First octet 224 to 239.
Binary Representation: First four bits are always 1110.
Address Range: 224.0.0.0 to 239.255.255.255.
Subnet Mask: Not applicable.
Purpose: Reserved for multicast traffic (sending data to multiple
devices).
Use Case: Applications like video streaming and conferencing.
Example: 224.0.0.1.
Class E
Range: First octet 240 to 255.
Binary Representation: First four bits are always 1111.
Address Range: 240.0.0.0 to 255.255.255.255.
Subnet Mask: Not applicable.
Purpose: Reserved for research and experimental use.
Use Case: Not used in general networking.
Example: 250.1.2.3.
3. Loopback Address:
Used by a device to refer to itself for testing and troubleshooting purposes.
Used for testing and debugging within the same host.
Range: 127.0.0.0 to 127.255.255.255 (commonly 127.0.0.1)
8. Multicast Address
Used to send data to multiple devices simultaneously within a group.
Range: 224.0.0.0 to 239.255.255.255 (Class D).
Streaming media, video conferencing, and routing protocols (e.g., OSPF, RIP).
Solution
CIDR (Classless Inter-Domain Routing) allows flexible allocation of IP addresses by removing fixed class boundaries.
IPv6 was introduced to provide a larger address space and address these limitations.
Classless Addressing
Classless Inter-Domain Routing (CIDR) was introduced in 1993 to replace classful addressing.
CIDR is a method for efficiently assigning IP addresses and routing data. Unlike classful addressing, which uses fixed
classes (A, B, C), CIDR allows for flexible subnetting with variable-length subnet masks (VLSM).
This means networks can be divided into smaller, more suitable subnets based on actual needs, rather than being limited
by rigid class boundaries.
CIDR Notation
CIDR notation combines the IP address with a subnet mask, written as IP_address/Prefix_Length. The prefix length
specifies the number of bits used for the network portion of the address.
Example: 192.168.10.0/24 means the first 24 bits are used for the network portion, leaving 8 bits for the host portion.
This represents a network with 256 IP addresses (192.168.10.0 to 192.168.10.255).
Efficient Use of Address Space:
CIDR allows IP address blocks to be assigned in more precise sizes, reducing wastage of IP addresses. It enables more
efficient use of the available address space.
Example: A network that needs only 500 addresses can be assigned a block like 192.168.10.0/23, which provides 512
addresses (from 192.168.10.0 to 192.168.11.255), instead of wasting a larger block like 192.168.0.0/22 (which provides
1,024 addresses).
Subnetting
Subnetting is the process of dividing a larger network into smaller, more manageable sub-networks, called subnets.
This is done to improve network performance, security, and organization. Subnetting allows an organization to use its IP
address space more efficiently, create smaller broadcast
domains, and manage traffic better.
2. Subnet Mask:
A subnet mask is used to define the size of the network and the host portion
of an IP address. It is a 32-bit number that "masks" the network portion of the
address and allows the router to differentiate between the network and host
portions.
Example: A common subnet mask for a small network is 255.255.255.0 (or /24
in CIDR notation), where the first 24 bits represent the network, and the
remaining 8 bits are for hosts.
Steps in Subnetting:
1. Determine the Network Requirements:
How many subnets are needed?
How many hosts are needed in each subnet?
Based on these requirements, you can calculate the subnet mask and the
number of subnets.
Working of VLSM
1. Start with a Network Address:
You begin with a network address and a subnet mask (e.g., 192.168.1.0/24). The /24 means that the first 24 bits are for
the network portion, and the remaining 8 bits are for hosts.
IPV6
In July 1999, the Internet Assigned Numbers Authority (IANA) assigned IPv6 address blocks to the Regional Internet
Registries (RIRs).
Ratification: IPv6 was ratified as an internet standard in July 2017.
IPv6 uses 128-bit addresses, which theoretically allows for 3.4 x 1038
unique IP addresses.
IPv6 Address Format:
An IPv6 address is written as 8 groups of 4 hexadecimal digits, separated by
colons.
For example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Hexadecimal Notation:
Each group of 4 digits represents 16 bits (or 2 bytes). Since there are 8 groups, the total length of the IPv6 address is 128
bits.
Example1: AF02::2
AF02:0:0:0:0:0:0:2 – The address after removing the abbreviated double-colon
AF02:0000:0000:0000:0000:0000:0000:0002 – The address after adding leading zeros
So the full address of the abbreviated address AF02::2 is
AF02:0000:0000:0000:0000:0000:0000:0002.
Example2: A0EC:0342:0000:0000:0000:C2E0:0000:FDE0
Omitting leading zero :
A0EC:342:0:0:0:C2E0:0:FDE0
Use double colon for consecutive zeros:
A0EC:342::C2E0:0:FDE0
3. Improved Security:
IPv6 was designed with security in mind. It includes mandatory support for IPsec (Internet Protocol Security), which
ensures encrypted communication between devices, helping prevent eavesdropping and data tampering.
4. Autoconfiguration:
IPv6 devices can automatically configure their own IP address using stateless address autoconfiguration (SLAAC). This
allows devices to join a network and communicate without needing a DHCP server.
7. Dual Stack:
Dual Stack allows devices and networks to run both IPv4 and IPv6 simultaneously. A device configured with dual stack can
use IPv4 or IPv6 depending on the communication requirements. Devices prefer IPv6 when available but fall back to IPv4
if needed.
8. Tunneling:
Tunneling allows IPv6 packets to be sent over an existing IPv4 network by encapsulating IPv6 packets inside IPv4 packets.
The IPv6 packet is wrapped with an IPv4 header. At the destination, the IPv4 header is removed, and the IPv6 packet is
processed.
Types of IPV6
IPv6 addresses are categorized into three main types based on their functionality and usage.
1. Unicast Address
2. Multicast Address
3. Anycast Address
1. Unicast Address
Used for one-to-one communication, where data is sent to a single, specific device.
Unique Local (ULA): Private addresses used within an organization (not routable on the internet).
Prefix: fc00::/7
Example: fd00::1
2. Multicast Address
Used for one-to-many communication, where data is sent to multiple devices in a group.
Prefix: ff00::/8
Multicast addresses have different scopes that define their reach:
Link-Local: ff02::1 (all nodes on the local link)
Site-Local: ff05::1 (nodes within a site)
Global: ff0e:: (globally routable multicast group)
Example:
ff02::1 is used to send data to all devices on the local link.
3. Anycast Address
Used for one-to-nearest communication, where data is sent to the nearest device (in terms of routing distance) among
multiple devices with the same address.
Commonly used for load balancing and services like DNS.
Example: A DNS query sent to an Anycast address will reach the
nearest DNS server.
6. Hop Limit (8 bits): Similar to the TTL (Time to Live) field in IPv4. Specifies the maximum number of hops (routers) the
packet can travel before being discarded. Each router decreases the hop limit by 1. When it reaches 0, the packet is
dropped.
7. Source Address (128 bits): Specifies the IPv6 address of the sender. Example: 2001:db8::1.
8. Destination Address (128 bits): Specifies the IPv6 address of the intended recipient.
Example: 2001:db8::2.
comparison between IPv4 and IPv6
Feature IPv4 IPv6
Address Size 32-bit address 128-bit address
Address Format Numeric, written in decimal, separated Alphanumeric, written in hexadecimal, separated by
by dots (e.g., 192.168.1.1) colons (e.g., 2001:0db8::1)
Address Space 4.3 billion (2³² addresses) Vast, approximately 340 undecillion (2¹²⁸ addresses)
Header Size Variable (20-60 bytes) Fixed (40 bytes)
Header Fields 12 fields 8 fields (simplified for efficiency)
Fragmentation Performed by sender and routers Performed only by the sender
Checksum Present in the header Removed to simplify processing
Routing Efficiency Less efficient due to complex headers More efficient with simplified headers
Security Optional (IPSec is not mandatory) Built-in security with mandatory IPSec
Address Manual (Static) or DHCP Automatic using Stateless Address Autoconfiguration
Configuration (SLAAC) or DHCPv6
Broadcast Supports broadcast communication No broadcast; uses multicast instead
Multicast Support Supported Supported and improved
Quality of Service Limited support via Type of Service (ToS) Improved with Traffic Class and Flow Label fields
(QoS)
NAT (Network Widely used due to address exhaustion Not required (sufficient addresses)
Address Translation)
Mobility Limited Improved mobility and routing
Subscribe Infeepedia youtube channel for computer science competitive exams
Download Infeepedia app and call or wapp on 8004391758
Computer Network Infeepedia By: Infee Tripathi
Packet Size 576 bytes (minimum) 1280 bytes (minimum)
Compatibility Works with IPv4-only devices Backward compatible using transition mechanisms
(e.g., Dual Stack, Tunneling)
Example Address 192.168.1.1 2001:0db8:85a3::8a2e:0370:7334
Usage Still widely used Gradually being adopted globally
Routing Concepts
Routing is the process of selecting the best path for data packets to travel from the source to the destination across a
network.
It involves routing algorithms and routing protocols that determine the most efficient path.
2. Routing Algorithms
Routing algorithms are used to determine the best path for data to travel. The two main types of routing algorithms are:
1. Distance Vector Routing Algorithm:
Distance Vector Routing calculates the best path based on the distance (hop count) to the destination. Each router
shares its routing table with its directly connected neighbors.
2. Link State Routing Algorithm:
Link State Routing calculates the best path based on the state (cost, bandwidth, delay) of the links in the network.
Routers have a complete view of the network topology.
3. Routing Protocols
Routing protocols are rules that routers use to communicate and share routing information. The three main routing
protocols are:
1. RIP (Routing Information Protocol):
It is a Distance Vector Routing Protocol.
In a small network, RIP calculates the shortest path based on hop count. If a path has fewer hops, it is preferred.
2. OSPF (Open Shortest Path First)
It is a Link State Routing Protocol.
If there are two paths to a destination:
Path 1: 100 Mbps (cost = 1) & Path 2: 10 Mbps (cost = 10)
OSPF selects Path 1 as it has a lower cost.
3. BGP (Border Gateway Protocol)
Path Vector Routing Protocol (used for inter-domain routing).
Used to connect different autonomous systems (AS) on the Internet.
When traffic needs to move between two ISPs, BGP determines the best path based on attributes like shortest AS path
or preferred policy.
Types of Ports:
1. Well-Known Ports (0–1023): Reserved for standard protocols (e.g., HTTP - Port 80, FTP - Port 21).
2. Registered Ports (1024–49151): Assigned for user-defined applications.
3. Dynamic/Private Ports (49152–65535): Used temporarily by client applications.
Example:
Port 80 is used for HTTP communication.
Port 443 is used for HTTPS communication.
2. Socket
A socket is a combination of an IP address and a port number.
It is a software structure that acts as an interface for sending and receiving data.
Sockets enable communication between applications running on the same or different devices.
Example: Suppose a client application with IP 192.168.1.2 communicates with a server on IP 192.168.1.10 using port 80.
Client Socket: 192.168.1.2:45678 (random port assigned)
Server Socket: 192.168.1.10:80
The combination of IP and port ensures data reaches the correct application.
3. Bandwidth:
Bandwidth is the maximum amount of data that can be transmitted over a communication channel in a given amount of
time.
It is measured in Hertz (Hz) for analog signals and bits per second (bps) for digital signals.
Example: A network with a bandwidth of 10 Mbps can transmit a maximum of 10 megabits of data per second.
4. Data Rate:
Data rate refers to the speed at which data is transmitted over a network. It is measured in bits per second (bps).
Data rate depends on the bandwidth and the quality of the communication channel.
Example: If a file size is 1 MB (8 megabits), and the data rate is 8 Mbps, it will take 1 second to transfer the file.
6. Attenuation:
Attenuation is the gradual loss of signal strength as it travels over a distance.
It occurs due to the resistance of the medium.
Solution: Use amplifiers or repeaters to boost the signal strength.
Example: A signal sent over a 100-meter cable may lose power and become weak by the time it reaches the other end.
7. Distortion:
Distortion occurs when the signal changes its shape or form as it travels through the medium.
It happens because different frequencies of a signal travel at different speeds.
Use equalizers to correct the signal.
Example: In a digital signal, if the original square wave gets rounded or delayed, it causes distortion.
8. Bit Rate
Bit rate is the number of bits transmitted per second in a communication channel.
It is measured in bits per second (bps).
Bit rate depends on the data rate and the encoding technique used.
Example: A data rate of 1000 bits per second (bps) means 1000 bits are transmitted in one second.
9. Baud Rate
Baud rate is the number of signal changes (symbols) per second in a communication channel.
Each signal change (symbol) can represent one or more bits, depending on the encoding scheme.
Relationship Between Bit Rate and Baud Rate:
Bit Rate = Baud Rate × Number of Bits per Symbol
Example: If a system transmits 1000 symbols per second and each symbol represents 2 bits, then:
Bit Rate = 1000 × 2 = 2000 bps
Here, the baud rate is 1000 baud and the bit rate is 2000 bps.
b. Traceroute
Traceroute is used to determine the path packets take from the source to the destination device.
Example: traceroute google.com
This shows the route taken to reach google.com.
c. Netstat
Netstat (Network Statistics) displays active network connections, listening ports, and network statistics.
Example: netstat -an
Displays all active connections and listening ports.
Subscribe Infeepedia youtube channel for computer science competitive exams
Download Infeepedia app and call or wapp on 8004391758
Computer Network Infeepedia By: Infee Tripathi
Network Security Concept
Types of Threats in Network Security
1. Malware (Malicious Software): Malware is a collective term for malicious software designed to harm, exploit, or disable
devices, networks, or data. Below are the key types of malware:
a. Virus:
A self-replicating program that attaches itself to legitimate files or software and spreads when the file is opened.
Infects the host system and can corrupt files, steal data, or crash the system.
Example: ILOVEYOU Virus (2000), Code Red(2001), Creeper, Bomber, Byte Bandit
b. Worm:
A standalone malware that spreads across networks without user intervention.
Exploits vulnerabilities in software or systems to replicate itself.
Example: Morris Worm (1988), Stuxnet, Nimda, Sasser.
c. Trojan Horse
Disguised as legitimate software but contains malicious code.
Users unknowingly install it, allowing attackers to gain control of the system.
Example: A fake antivirus program that claims to clean your system but actually steals your data.
d. Ransomware
Encrypts files on a device and demands payment (usually in cryptocurrency) for decryption.
Blocks access to data until the ransom is paid.
Example: WannaCry (2017): Targeted organizations worldwide, encrypting files and demanding Bitcoin payments.
e. Spyware
Secretly monitors user activity and collects sensitive information without consent.
Tracks keystrokes, browser history, and other personal data.
Example: Spyware in free software that collects user data for advertisers.
f. Adware
Displays unwanted advertisements and may redirect users to malicious websites.
Often bundled with free software and tracks user behavior for targeted ads.
Example: Pop-up ads that appear while browsing, redirecting to suspicious sites.
g. Rootkit
A set of tools that allow attackers to gain administrator-level control of a system.
Hides its presence and enables attackers to control the system remotely.
Example: Rootkits used to disable antivirus software and open backdoors for further attacks.
h. Keylogger
Records keystrokes to capture sensitive information like passwords or credit card numbers.
Runs silently in the background, logging every key pressed.
Example: Keyloggers installed on public computers to steal login credentials.
i. Botnets
A network of infected devices controlled by an attacker to perform coordinated attacks.
Used for spamming, DDoS attacks, or mining cryptocurrency.
Example: The Mirai Botnet (2016): Infected IoT devices to launch a massive DDoS attack.
1. Email Phishing
Fake emails designed to look like they come from trusted sources (e.g., banks, government).
Users click on malicious links or attachments, leading to data theft.
Example: An email claiming to be from your bank asking you to verify your account by entering credentials on a fake
website.
2. Spear Phishing
A targeted phishing attack aimed at specific individuals or organizations.
Uses personal information (e.g., names, job titles) to appear more convincing.
Example: An email pretending to be from your manager asking for sensitive company data.
3. Whaling
A phishing attack targeting high-profile individuals like CEOs or government officials.
Focuses on obtaining sensitive business or financial information.
Example: A fake email from a "legal department" asking a CEO to approve a wire transfer.
b. Protocol Attacks
Exploit vulnerabilities in network protocols to disrupt services.
Example: SYN Flood Attack: Exploits the TCP handshake process to overwhelm a server.
Types of VPNs
1. Remote Access VPN: Allows employees to securely access their company's internal network from remote locations.
Example: A remote worker accesses company files while traveling.
2. Site-to-Site VPN: Connects entire networks (e.g., between branch offices).
Example: A company connects its headquarters and branch offices securely.
3. Client-Based VPN: Requires users to install software on their devices.
Example: Using the NordVPN app on a laptop to browse securely.
4. Cloud VPN: Provides secure access to cloud-based resources.
Example: Accessing Google Cloud resources securely through a VPN.
Advantages of VPNs
Data Security: Prevents hackers from intercepting sensitive data.
Privacy: Protects user identity and browsing activity.
Bypassing Geo-Restrictions: Access blocked content in certain regions.
Introduction to Cryptography
Cryptography is the practice of securing communication and data by transforming information into a format that is
unreadable to unauthorized users. It ensures confidentiality, integrity, and authenticity of data.
Cryptography is widely used in securing sensitive information such as passwords, financial transactions, and
communication over the internet.
Encryption
Encryption is the process of converting plain text into unreadable ciphertext to protect data from unauthorized access. It
requires a decryption key to convert ciphertext back into plain text.
How It Works
1. The sender encrypts the message using the recipient’s public key.
2. Only the recipient can decrypt the message using their private key.
3. This eliminates the need for securely sharing a single key.
Key Features
Secure Key Distribution: No need to share private keys; only public keys are exchanged.
Slower: Computationally more intensive than symmetric encryption.
Best For: Securing small amounts of data, authentication, and digital signatures.