Unit I: Introduction to Computer Networks
1.1 What is a Computer Network?
Computer Network: A computer network is a
sophisticated system of interconnected devices (computers, servers,
routers, switches, printers, mobile devices, IoT sensors, etc.) that
can communicate with each other and share resources through various
transmission media. It serves as the backbone of modern digital
communication, enabling seamless data transmission, resource sharing,
and collaborative computing across multiple devices and locations.
Detailed Explanation:
A computer network functions as a digital ecosystem where multiple
computing devices work together to achieve common goals. These
networks can range from simple home networks connecting a few
devices to complex enterprise networks spanning multiple continents.
The fundamental purpose is to enable devices to exchange
information, share resources, and provide services to users
regardless of their physical location.
Key Characteristics:
-
Interconnection: Multiple devices connected
through various transmission media including copper wires, fiber
optic cables, wireless radio waves, and satellite links. This
interconnection creates a web of communication pathways that allow
data to flow between any two points in the network.
-
Resource Sharing: Hardware (printers, storage
devices, processing power), software (applications, databases,
services), and data (files, documents, multimedia content) can be
shared among network users, reducing costs and improving
efficiency through centralized management and distributed access.
-
Communication: Enables real-time exchange of
information between devices through standardized protocols,
supporting various forms of communication including text, voice,
video, and data transfer with different quality of service
requirements.
-
Scalability: Networks can be expanded to
accommodate more devices, users, and services without significant
redesign, allowing organizations to grow their infrastructure
incrementally as needs evolve.
-
Reliability: Redundancy and fault tolerance
mechanisms ensure continuous operation even when individual
components fail, including backup systems, alternative routing
paths, and automatic failover capabilities.
-
Security: Protection mechanisms for data and
network resources including authentication, authorization,
encryption, firewalls, and intrusion detection systems to
safeguard against unauthorized access and cyber threats.
Network Benefits:
-
Cost Efficiency: Shared resources reduce
individual device costs and maintenance expenses
-
Improved Communication: Instant messaging, email,
video conferencing, and collaborative tools
-
Centralized Management: Simplified
administration, updates, and security policies
-
Data Backup: Centralized storage and automated
backup systems
-
Remote Access: Ability to access network
resources from anywhere
-
High Availability: Redundant systems ensure
continuous service availability
1.2 Network Types and Classifications
Based on Geographic Coverage:
Personal Area Network (PAN): A Personal Area Network
is a specialized network that connects devices within a very small
geographic area, typically within a person's immediate workspace,
personal space, or body area. PANs are designed for personal use and
typically cover a range of about 10 meters, creating a personal
digital ecosystem around an individual.
Detailed Explanation:
A PAN represents the most intimate level of networking, where
devices are connected to serve a single individual's needs. These
networks are characterized by their close proximity to the user and
their focus on personal productivity, entertainment, and health
monitoring. PANs can be either wired or wireless, with wireless PANs
(WPANs) being more common due to their convenience and mobility.
The concept of PANs emerged with the proliferation of personal
electronic devices and the need for seamless communication between
them. Modern PANs often include smart devices that can communicate
autonomously, creating an intelligent personal environment that
adapts to user preferences and needs.
Characteristics:
-
Range: Up to 10 meters, with most practical
applications working within 1-5 meters. This limited range ensures
privacy and reduces interference with other networks while
maintaining sufficient coverage for personal use scenarios.
-
Devices: Smartphones, laptops, tablets, wearable
devices (smartwatches, fitness trackers), wireless headphones,
smart glasses, medical devices, gaming controllers, and IoT
sensors. These devices form a personal digital ecosystem.
-
Technology: Bluetooth (most common), Infrared
(IR), USB, ZigBee, Near Field Communication (NFC), and proprietary
wireless protocols. Each technology offers different trade-offs
between power consumption, data rate, and range.
-
Use Cases: File sharing between devices, device
synchronization (contacts, calendars, photos), wireless audio
streaming, health monitoring, smart home control, mobile payments,
and device tethering for internet access.
-
Advantages: Low power consumption (especially
important for battery-powered devices), simple setup and
configuration, cost-effective implementation, high security due to
limited range, and automatic device discovery and pairing.
-
Limitations: Limited range restricts mobility,
relatively low data transfer rates compared to larger networks,
potential interference in crowded environments, and dependency on
device compatibility and protocol support.
PAN Applications:
-
Health Monitoring: Connecting medical devices,
fitness trackers, and health sensors
-
Entertainment: Wireless audio systems, gaming
peripherals, and media streaming
-
Productivity: Device synchronization, file
transfer, and peripheral connectivity
-
Smart Home: Personal device control of home
automation systems
-
Mobile Computing: Internet tethering and device
interconnection
Local Area Network (LAN): A Local Area Network is a
computer network that connects devices within a limited geographic
area such as a home, office building, campus, or small group of
buildings. LANs are typically owned, controlled, and managed by a
single organization and provide high-speed data transmission with low
latency, making them ideal for resource sharing and collaborative
computing environments.
Detailed Explanation:
LANs represent the foundation of modern networking, providing the
infrastructure for most organizational computing needs. These
networks are characterized by their high performance, reliability,
and centralized management capabilities. LANs can support both wired
and wireless connections, with modern implementations often
combining both technologies to provide maximum flexibility and
coverage.
The design of LANs focuses on optimizing performance for local
communication while providing seamless connectivity to external
networks through gateways and routers. LANs are the building blocks
of larger network architectures and serve as the primary means of
connecting end-user devices to organizational resources and
services.
Characteristics:
-
Range: Up to 1-2 kilometers, with typical
implementations covering areas from a single room to multiple
buildings within a campus. This limited geographic scope allows
for high-speed connections and centralized management.
-
Speed: 10 Mbps to 10 Gbps, with modern LANs
typically operating at 100 Mbps to 1 Gbps. High-speed fiber
connections can reach 10 Gbps or higher for backbone connections
and high-performance computing applications.
-
Topology: Star (most common), Bus, Ring, Mesh,
Tree, and hybrid topologies. The choice of topology depends on
factors such as cost, performance requirements, fault tolerance
needs, and management preferences.
-
Technology: Ethernet (wired), Wi-Fi (wireless),
Power over Ethernet (PoE), and various networking protocols.
Ethernet remains the dominant wired technology, while Wi-Fi
provides wireless connectivity for mobile devices.
-
Use Cases: Office networks for business
operations, home networks for personal computing, campus networks
for educational institutions, industrial networks for
manufacturing, and data center networks for server connectivity.
-
Advantages: High speed and low latency for
real-time applications, centralized management and security
control, cost-effective resource sharing, reliable connectivity,
and support for both wired and wireless devices.
-
Limitations: Limited geographic coverage
restricts mobility, requires physical infrastructure for wired
connections, potential security vulnerabilities if not properly
configured, and dependency on centralized equipment.
LAN Components:
-
Network Interface Cards (NICs): Hardware
components that connect devices to the network
-
Switches and Hubs: Central connectivity devices
that manage data flow
-
Routers: Devices that connect LANs to other
networks
-
Access Points: Wireless connectivity devices for
Wi-Fi networks
-
Cabling: Physical transmission media (copper,
fiber optic)
-
Network Software: Operating systems, protocols,
and management tools
LAN Applications:
-
File Sharing: Centralized storage and
collaborative document access
-
Printing: Shared printer access and print job
management
-
Email and Communication: Internal messaging and
collaboration tools
-
Database Access: Shared database systems and
applications
-
Internet Access: Gateway to external networks and
services
-
Backup and Recovery: Centralized backup systems
and disaster recovery
Metropolitan Area Network (MAN): A Metropolitan Area
Network is a computer network that covers a larger geographic area
than a Local Area Network (LAN) but smaller than a Wide Area Network
(WAN), typically spanning a city, metropolitan area, or large campus.
MANs are designed to interconnect multiple LANs within a metropolitan
region, providing high-speed connectivity for organizations,
government agencies, and service providers operating across a city.
Detailed Explanation:
MANs serve as the middle tier in the network hierarchy, bridging the
gap between local networks and wide area networks. They are
particularly important for organizations with multiple locations
within a city, such as universities, hospitals, government agencies,
and large corporations. MANs provide the infrastructure for
city-wide services, including internet access, telephony, cable
television, and emergency services.
The design of MANs focuses on providing high bandwidth, reliability,
and scalability while maintaining reasonable costs. Modern MANs
often use fiber optic technology to achieve high speeds and support
multiple services over a single infrastructure. They are typically
owned and operated by telecommunications companies, municipalities,
or large organizations.
Characteristics:
-
Range: 5-50 kilometers, covering metropolitan
areas, cities, or large campuses. This range allows for city-wide
connectivity while maintaining high performance and manageable
complexity.
-
Speed: 100 Mbps to 10 Gbps, with modern MANs
typically operating at 1 Gbps to 10 Gbps. High-speed connections
support bandwidth-intensive applications and multiple simultaneous
users.
-
Technology: Fiber optic cables (primary),
microwave links, wireless broadband, and hybrid technologies.
Fiber optics provide the backbone for most MANs due to their high
bandwidth and reliability.
-
Use Cases: City-wide networks for government
services, ISP backbone networks for internet connectivity,
university campus networks, hospital networks, and corporate
networks with multiple locations.
-
Advantages: High bandwidth supports multiple
services and users, connects multiple LANs efficiently, provides
redundancy and fault tolerance, supports both data and voice
services, and enables centralized management of distributed
resources.
-
Limitations: Higher cost than LANs due to
infrastructure requirements, complex management and maintenance,
dependency on service providers, potential regulatory
restrictions, and vulnerability to natural disasters affecting the
metropolitan area.
MAN Technologies:
-
Fiber Optic Networks: High-speed backbone using
light signals through glass fibers
-
Microwave Links: Wireless point-to-point
connections for areas where fiber is impractical
-
Wireless MAN (WiMAX): Broadband wireless access
for metropolitan areas
-
Ethernet MAN: Extended Ethernet technology for
metropolitan connectivity
-
SONET/SDH: Synchronous optical networking for
high-speed data transmission
MAN Applications:
-
Government Services: City-wide administrative
networks and emergency services
-
Education: University campus networks and school
district connectivity
-
Healthcare: Hospital networks and medical
information systems
-
Business: Corporate networks with multiple office
locations
-
Entertainment: Cable television and streaming
services
-
Transportation: Traffic management and public
transportation systems
MAN Architecture:
-
Core Network: High-speed backbone connecting
major nodes
-
Distribution Network: Intermediate connections to
smaller areas
-
Access Network: Final connections to end users
and LANs
-
Management Systems: Network monitoring, security,
and service management
Wide Area Network (WAN): A Wide Area Network is a
computer network that spans large geographic areas, often covering
multiple cities, states, countries, or even continents. WANs connect
multiple Local Area Networks (LANs) and Metropolitan Area Networks
(MANs) across vast distances, enabling global communication and
resource sharing. These networks form the backbone of the Internet and
are essential for international business, telecommunications, and
global connectivity.
Detailed Explanation:
WANs represent the largest scale of computer networking, providing
the infrastructure for global communication and commerce. They are
characterized by their extensive geographic coverage, complex
routing systems, and the ability to connect diverse networks
operated by different organizations. WANs are the foundation of the
modern Internet and enable worldwide access to information,
services, and resources.
The architecture of WANs is highly complex, involving multiple
layers of networking equipment, diverse transmission media,
sophisticated routing protocols, and extensive redundancy systems.
WANs must handle varying network conditions, different regulatory
environments, and the challenges of long-distance communication
while maintaining reliability and performance.
Characteristics:
-
Range: Unlimited (global coverage), spanning from
regional networks covering multiple cities to international
networks connecting continents. WANs can extend across oceans and
connect remote locations worldwide.
-
Speed: 56 Kbps to 100 Gbps, with typical speeds
ranging from 1 Mbps to 10 Gbps depending on the technology and
service level. High-speed backbone connections can reach 100 Gbps
or higher for major network trunks.
-
Technology: Fiber optic cables (primary
backbone), satellite communications, microwave links, undersea
cables, and wireless technologies. Multiple technologies are often
combined to provide comprehensive coverage and redundancy.
-
Use Cases: Internet backbone infrastructure,
corporate networks with global offices, telecommunications
networks, cloud computing services, international banking systems,
and global e-commerce platforms.
-
Advantages: Global connectivity enables worldwide
communication and commerce, connects distant locations
efficiently, provides access to remote resources and services,
supports international collaboration, and enables centralized
management of distributed operations.
-
Limitations: High cost due to infrastructure and
maintenance requirements, lower speed compared to local networks
due to distance and routing complexity, dependency on multiple
service providers, potential regulatory and political
restrictions, and vulnerability to natural disasters and
geopolitical events.
WAN Technologies:
-
Fiber Optic Networks: High-speed backbone using
light signals through glass fibers
-
Satellite Communications: Wireless connections
via orbiting satellites
-
Undersea Cables: Submarine fiber optic cables
connecting continents
-
Microwave Links: Terrestrial wireless
point-to-point connections
-
Mobile Networks: Cellular and mobile broadband
technologies
-
Leased Lines: Dedicated connections between
locations
WAN Applications:
-
Internet Access: Global connectivity to the World
Wide Web
-
Corporate Networks: Multi-location business
connectivity
-
Cloud Services: Access to distributed computing
resources
-
Telecommunications: Voice, video, and data
services
-
Financial Services: International banking and
trading systems
-
E-commerce: Global online commerce platforms
-
Content Delivery: Streaming media and content
distribution
WAN Architecture:
-
Core Network: High-speed backbone connecting
major regions
-
Regional Networks: Intermediate connections
between areas
-
Access Networks: Final connections to end users
-
Peering Points: Interconnection points between
networks
-
Data Centers: Centralized computing and storage
facilities
WAN Challenges:
-
Latency: Signal propagation delays over long
distances
-
Bandwidth: Limited capacity compared to local
networks
-
Reliability: Multiple points of failure across
vast distances
-
Security: Vulnerabilities in complex, multi-owner
networks
-
Cost: High infrastructure and maintenance
expenses
-
Regulation: Different legal and regulatory
environments
Based on Topology:
| Topology |
Description |
Advantages |
Disadvantages |
| Bus |
All devices connected to a single cable |
Simple, cost-effective |
Single point of failure, limited scalability |
| Star |
All devices connected to a central hub |
Easy management, fault isolation |
Central point of failure, more cabling |
| Ring |
Devices connected in a circular arrangement |
Equal access, good performance |
Single point of failure, complex troubleshooting |
| Mesh |
Every device connected to every other device |
High reliability, multiple paths |
High cost, complex cabling |
| Tree |
Hierarchical structure with root and branches |
Scalable, organized structure |
Root dependency, complex management |
1.3 Network Architecture Models
OSI Reference Model (7-Layer Model)
Open Systems Interconnection (OSI) Model: The Open
Systems Interconnection (OSI) Model is a conceptual framework
developed by the International Organization for Standardization (ISO)
to describe and standardize network interactions in seven distinct
layers. Each layer has specific functions, protocols, and
responsibilities, and provides services to the layer above it while
receiving services from the layer below it. This layered approach
enables modular design, easier troubleshooting, and interoperability
between different network technologies and vendors.
Detailed Explanation:
The OSI Model serves as a reference model for understanding how data
flows through a network from one application to another. It provides
a systematic approach to network design and troubleshooting by
breaking down complex network operations into manageable,
well-defined layers. Each layer focuses on specific aspects of
network communication, allowing developers and network engineers to
work on individual layers without affecting others.
The model follows the principle of encapsulation, where each layer
adds its own header (and sometimes trailer) to the data received
from the layer above. This process continues down the stack until
the data reaches the physical layer for transmission. At the
receiving end, the process is reversed as each layer removes its
header and passes the data up to the next layer.
Layer Functions:
-
Physical Layer (Layer 1): Transmits raw bits
over physical medium, including electrical signals, light
pulses, or radio waves. Handles physical connections, cable
specifications, voltage levels, timing, and data rates.
Examples: Ethernet cables, fiber optics, wireless signals.
-
Data Link Layer (Layer 2): Provides error-free
transmission between nodes on the same network segment. Handles
framing, error detection and correction, flow control, and media
access control. Examples: Ethernet, Wi-Fi, PPP, ATM.
-
Network Layer (Layer 3): Routes packets across
different networks using logical addressing. Handles packet
forwarding, routing decisions, network addressing, and
fragmentation. Examples: IP, ICMP, OSPF, BGP.
-
Transport Layer (Layer 4): Ensures end-to-end
data delivery between applications. Handles segmentation,
reassembly, flow control, error recovery, and connection
management. Examples: TCP, UDP, SCTP.
-
Session Layer (Layer 5): Manages communication
sessions between applications. Handles session establishment,
maintenance, synchronization, and termination. Examples:
NetBIOS, RPC, SQL.
-
Presentation Layer (Layer 6): Handles data
format, encoding, compression, and encryption. Ensures data is
presented in a format that the application layer can understand.
Examples: SSL/TLS, JPEG, MPEG, ASCII.
-
Application Layer (Layer 7): Provides network
services directly to end-user applications. Handles user
interface, application protocols, and service access. Examples:
HTTP, FTP, SMTP, DNS, SSH.
OSI Model Benefits:
-
Modularity: Each layer can be developed and
modified independently
-
Interoperability: Different vendors can implement
compatible layers
-
Troubleshooting: Problems can be isolated to
specific layers
-
Standards: Provides a framework for network
protocol development
-
Education: Helps understand network concepts
systematically
Data Flow in OSI Model:
Data Flow Process:
Application Layer (7) β Data
Presentation Layer (6) β Data + Header6
Session Layer (5) β Data + Header6 + Header5
Transport Layer (4) β Data + Header6 + Header5 + Header4
Network Layer (3) β Data + Header6 + Header5 + Header4 + Header3
Data Link Layer (2) β Data + Header6 + Header5 + Header4 + Header3 + Header2 + Trailer2
Physical Layer (1) β Bits transmitted over medium
At receiving end, process is reversed:
Physical Layer (1) β Receives bits
Data Link Layer (2) β Removes Header2 + Trailer2
Network Layer (3) β Removes Header3
Transport Layer (4) β Removes Header4
Session Layer (5) β Removes Header5
Presentation Layer (6) β Removes Header6
Application Layer (7) β Receives original data
OSI vs TCP/IP Model:
| OSI Model |
TCP/IP Model |
Description |
| Application (7) |
Application |
User applications and services |
| Presentation (6) |
Application |
Data formatting and encryption |
| Session (5) |
Application |
Session management |
| Transport (4) |
Transport |
End-to-end communication |
| Network (3) |
Internet |
Routing and addressing |
| Data Link (2) |
Network Access |
Local network communication |
| Physical (1) |
Network Access |
Physical transmission |
TCP/IP Model (4-Layer Model)
Transmission Control Protocol/Internet Protocol (TCP/IP)
Model:
A practical networking model that forms the basis for the Internet. It
consists of four layers that correspond to the OSI model but are more
focused on practical implementation.
Layer Functions:
-
Network Access Layer: Corresponds to OSI
Physical and Data Link layers
-
Internet Layer: Corresponds to OSI Network
layer, handles IP addressing and routing
-
Transport Layer: Corresponds to OSI Transport
layer, provides TCP and UDP protocols
-
Application Layer: Corresponds to OSI Session,
Presentation, and Application layers
1.4 Network Components and Devices
End Devices
End Devices: Devices that are the source or
destination of network communications. These devices generate,
process, and consume network data.
Types of End Devices:
-
Computers: Desktop computers, laptops,
workstations
-
Mobile Devices: Smartphones, tablets, IoT devices
-
Servers: Web servers, file servers, database
servers
-
Network Printers: Printers with network
connectivity
-
Network Cameras: IP cameras and surveillance
systems
Network Infrastructure Devices
Network Infrastructure Devices: Devices that
facilitate network connectivity, data transmission, and network
management. These devices form the backbone of network infrastructure.
Types of Infrastructure Devices:
-
Hubs: Basic devices that connect multiple devices
in a network
-
Switches: Intelligent devices that forward data
based on MAC addresses
-
Routers: Devices that route data between
different networks
-
Bridges: Devices that connect two network
segments
-
Gateways: Devices that connect networks with
different protocols
-
Modems: Devices that modulate/demodulate signals
for transmission
Unit II: Physical Layer & Data Link Layer
2.1 Physical Layer Fundamentals
Transmission Media
Transmission Media: The physical path through which
data is transmitted from one device to another in a network. The
choice of transmission media affects the network's performance,
reliability, and cost.
Types of Transmission Media:
-
Guided Media: Physical cables that guide the
signal along a specific path
-
Unguided Media: Wireless transmission through air
or space
Guided Media
Twisted Pair Cable: A type of cable in which two
conductors are twisted together to reduce electromagnetic
interference. It is the most common type of cable used in computer
networks.
Characteristics:
-
Types: Unshielded Twisted Pair (UTP) and Shielded
Twisted Pair (STP)
-
Categories: Cat3, Cat5, Cat5e, Cat6, Cat6a, Cat7,
Cat8
-
Speed: 10 Mbps to 40 Gbps depending on category
-
Distance: Up to 100 meters for most applications
-
Advantages: Low cost, easy installation, flexible
-
Disadvantages: Susceptible to interference,
limited bandwidth
Coaxial Cable: A type of cable with a central
conductor surrounded by an insulating layer, a metallic shield, and an
outer insulating layer. It provides better shielding than twisted pair
cables.
Characteristics:
- Types: RG-6, RG-8, RG-11, RG-58
- Speed: Up to 10 Gbps
- Distance: Up to 500 meters
-
Advantages: Better shielding, higher bandwidth,
longer distance
-
Disadvantages: Higher cost, less flexible,
difficult installation
Fiber Optic Cable: A type of cable that uses light
signals to transmit data through glass or plastic fibers. It provides
the highest bandwidth and longest transmission distances.
Characteristics:
-
Types: Single-mode fiber (SMF) and Multi-mode
fiber (MMF)
- Speed: Up to 100 Tbps
- Distance: Up to 100 kilometers
-
Advantages: Highest bandwidth, longest distance,
immune to interference
-
Disadvantages: High cost, complex installation,
fragile
Unguided Media
Radio Waves: Electromagnetic waves with frequencies
between 3 kHz and 300 GHz. They are used for wireless communication
over various distances.
Characteristics:
-
Frequency Bands: AM, FM, Wi-Fi, Bluetooth,
Cellular
-
Range: Short to long distance depending on
frequency
-
Advantages: No physical connection, wide coverage
-
Disadvantages: Susceptible to interference,
security concerns
Microwave: High-frequency radio waves (1-300 GHz)
used for point-to-point communication. They are commonly used for
satellite communication and long-distance links.
Characteristics:
- Frequency: 1-300 GHz
- Range: Line of sight, up to 50 km
- Advantages: High bandwidth, long distance
-
Disadvantages: Line of sight required, affected
by weather
Infrared: Electromagnetic waves with frequencies just
below visible light. They are used for short-range wireless
communication.
Characteristics:
- Frequency: 300 GHz - 400 THz
- Range: Up to 10 meters
-
Advantages: Secure, no interference with radio
waves
-
Disadvantages: Line of sight required, short
range
2.2 Data Link Layer Protocols
Ethernet
Ethernet: A family of computer networking
technologies commonly used in local area networks (LANs). It defines
the physical and data link layer specifications for wired network
connections.
Ethernet Standards:
| Standard |
Speed |
Media |
Distance |
| 10BASE-T |
10 Mbps |
UTP Cat3 |
100m |
| 100BASE-TX |
100 Mbps |
UTP Cat5 |
100m |
| 1000BASE-T |
1 Gbps |
UTP Cat5e |
100m |
| 10GBASE-T |
10 Gbps |
UTP Cat6a |
100m |
Wi-Fi Security Protocols
Wi-Fi Security: Methods and protocols used to secure
wireless networks from unauthorized access and data interception.
Security Standards:
-
WEP (Wired Equivalent Privacy): First security
standard (1997), now considered insecure
-
WPA (Wi-Fi Protected Access): Interim security
standard (2003)
-
WPA2 (Wi-Fi Protected Access 2): Current
standard using AES encryption
-
WPA3 (Wi-Fi Protected Access 3): Latest
standard with enhanced security
Network Layer Protocols
Network Layer: The third layer of the OSI model
responsible for logical addressing, routing, and packet forwarding
across different networks.
Key Functions:
-
Logical Addressing: Assigning IP addresses to
devices
-
Routing: Determining the best path for data
packets
-
Packet Forwarding: Moving packets between
networks
-
Fragmentation: Breaking large packets into
smaller ones
Internet Protocol (IP)
Internet Protocol (IP): A connectionless protocol
that provides logical addressing and routing for data packets across
networks. IP is the primary protocol of the Internet and enables
communication between devices on different networks.
IP Characteristics:
-
Connectionless: No prior connection establishment
required
-
Best-effort delivery: No guarantee of packet
delivery
-
Unreliable: No acknowledgment or retransmission
-
Fragmentation: Can break large packets into
smaller ones
IPv4 Address Structure
IPv4 Address Format: XXX.XXX.XXX.XXX
Example: 192.168.1.100
Address Classes:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Class β First Bits β Range β Default β Network β
β β β β Subnet β Hosts β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β A β 0xxx β 1.0.0.0 - β 255.0.0.0 β 16,777,214 β
β β β 126.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β B β 10xx β 128.0.0.0 - β 255.255.0.0 β 65,534 β
β β β 191.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β C β 110x β 192.0.0.0 - β255.255.255.0 β 254 β
β β β 223.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β D β 1110 β 224.0.0.0 - β N/A β Multicast β
β β β 239.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β E β 1111 β 240.0.0.0 - β N/A β Reserved β
β β β 255.255.255.255 β β β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
IPv6 Address Structure
IPv6 (Internet Protocol Version 6): The most recent
version of the Internet Protocol, designed to replace IPv4 and address
its limitations, particularly the exhaustion of IPv4 addresses.
IPv6 Features:
-
128-bit addresses: Provides 340 undecillion
unique addresses
-
Built-in security: IPsec support is mandatory
-
Auto-configuration: Stateless address
autoconfiguration
-
Better header format: Simplified and more
efficient
- Quality of Service: Better support for QoS
IPv6 Address Format: XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Shortened form: 2001:db8:85a3::8a2e:370:7334
Address Types:
- Global Unicast: 2000::/3 (public addresses)
- Unique Local: fc00::/7 (private addresses)
- Link Local: fe80::/10 (local network only)
- Multicast: ff00::/8 (group communication)
Routing Protocols
Routing Protocol: A protocol that enables routers to
exchange routing information and build routing tables to determine the
best path for forwarding packets across networks.
Types of Routing Protocols:
-
Distance Vector Protocols: RIP, EIGRP - share
entire routing table with neighbors
-
Link State Protocols: OSPF, IS-IS - share link
state information with all routers
-
Path Vector Protocols: BGP - share path
information between autonomous systems
RIP (Routing Information Protocol)
RIP (Routing Information Protocol): A distance-vector
routing protocol that uses hop count as its routing metric. RIP is one
of the oldest routing protocols and is suitable for small networks.
RIP Characteristics:
-
Maximum hop count: 15 hops (16 = unreachable)
- Update interval: 30 seconds
- Metric: Hop count
- Administrative distance: 120
- Convergence time: Slow (up to 180 seconds)
RIP Configuration Example (Cisco):
Router(config)# router rip
Router(config-router)# version 2
Router(config-router)# network 192.168.1.0
Router(config-router)# network 10.0.0.0
Router(config-router)# no auto-summary
RIP Packet Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Command β Version β Reserved β Address β Metric β
β (1 byte) β (1 byte) β (2 bytes) β Family (2) β (4 bytes) β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Commands:
- 1: Request
- 2: Response
OSPF (Open Shortest Path First)
OSPF (Open Shortest Path First): A link-state routing
protocol that uses Dijkstra's shortest path algorithm to calculate the
best route to each destination. OSPF is widely used in enterprise
networks.
OSPF Features:
- Fast convergence: Typically 10-30 seconds
- Hierarchical design: Areas and backbone
-
Multiple metrics: Bandwidth, delay, reliability,
cost
-
Authentication: Supports MD5 authentication
-
VLSM support: Variable Length Subnet Masking
Transport Layer Protocols
Transport Layer: The fourth layer of the OSI model
responsible for end-to-end communication, error detection, flow
control, and ensuring reliable data delivery between applications.
Key Functions:
-
End-to-end delivery: Ensures data reaches the
correct application
-
Error detection and recovery: Detects and
corrects transmission errors
-
Flow control: Prevents overwhelming the receiver
-
Segmentation and reassembly: Breaks data into
manageable pieces
TCP (Transmission Control Protocol)
TCP (Transmission Control Protocol): A
connection-oriented, reliable transport protocol that provides
ordered, error-checked delivery of data between applications running
on hosts communicating via an IP network.
TCP Characteristics:
-
Connection-oriented: Establishes connection
before data transfer
-
Reliable: Guarantees delivery with
acknowledgments
-
Ordered delivery: Maintains sequence of data
- Flow control: Prevents buffer overflow
-
Error detection: Checksum for error detection
TCP Three-Way Handshake
TCP Connection Establishment (Three-Way Handshake):
Client Server
β β
ββββ SYN (seq=x) βββββββββΆβ
β β
ββββ SYN+ACK (seq=y, ack=x+1) ββ
β β
ββββ ACK (ack=y+1) βββββββΆβ
β β
Connection Established!
TCP Header Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Source β Destination β Sequence β Acknowledgmentβ Flags β
β Port (16) β Port (16) β Number (32) β Number (32) β (6 bits) β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
β Window β Checksum β Urgent β Options β Data β
β Size (16) β (16) β Pointer β (variable)β (variable)β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Flags:
- SYN: Synchronize sequence numbers
- ACK: Acknowledgment field significant
- FIN: Finish connection
- RST: Reset connection
- PSH: Push data immediately
- URG: Urgent pointer field significant
UDP (User Datagram Protocol)
UDP (User Datagram Protocol): A connectionless,
unreliable transport protocol that provides minimal overhead and fast
transmission for applications that can tolerate packet loss and don't
require guaranteed delivery.
UDP Characteristics:
-
Connectionless: No connection establishment
required
-
Unreliable: No acknowledgment or retransmission
- Fast: Minimal overhead and processing
-
No flow control: Sender can overwhelm receiver
-
No ordering: Packets may arrive out of order
UDP Header Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Source β Destination β Length β Checksum β
β Port (16) β Port (16) β (16) β (16) β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
UDP vs TCP Comparison:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Feature β TCP β UDP β Use Case β Example β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Connection β Oriented β Connectionlessβ Reliable β HTTP β
β Reliability β Yes β No β Transfer β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Ordering β Yes β No β Real-time β DNS β
β Flow Controlβ Yes β No β Streaming β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Overhead β High β Low β Gaming β VoIP β
β Speed β Slow β Fast β β β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Application Layer Protocols
Application Layer: The seventh and highest layer of
the OSI model that provides network services directly to end-user
applications and defines how applications communicate over the
network.
Common Application Protocols:
-
HTTP/HTTPS: Web browsing and secure web
communication
-
FTP/SFTP: File transfer and secure file
transfer
-
SMTP/POP3/IMAP: Email sending and receiving
- DNS: Domain name resolution
- DHCP: Dynamic IP address assignment
- SSH: Secure remote access
HTTP (Hypertext Transfer Protocol)
HTTP (Hypertext Transfer Protocol): An
application-layer protocol for distributed, collaborative, hypermedia
information systems. HTTP is the foundation of data communication for
the World Wide Web.
HTTP Methods:
- GET: Retrieve data from server
- POST: Submit data to server
- PUT: Update existing resource
- DELETE: Remove resource
- PATCH: Partial update of resource
HTTP Request Example:
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html,application/xhtml+xml
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate
Connection: keep-alive
HTTP Response Example:
HTTP/1.1 200 OK
Date: Mon, 23 May 2023 22:38:34 GMT
Server: Apache/2.4.1 (Unix)
Last-Modified: Wed, 08 Jan 2023 23:11:55 GMT
Content-Length: 138
Content-Type: text/html
Connection: close
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>
HTTP Status Codes:
- 1xx: Informational (100 Continue)
- 2xx: Success (200 OK, 201 Created)
- 3xx: Redirection (301 Moved, 304 Not Modified)
- 4xx: Client Error (404 Not Found, 403 Forbidden)
- 5xx: Server Error (500 Internal Server Error)
DNS (Domain Name System)
DNS (Domain Name System): A hierarchical, distributed
database that translates human-readable domain names into IP
addresses, enabling users to access websites using memorable names
instead of numerical addresses.
DNS Resolution Process:
- Local Cache: Check local DNS cache first
-
Recursive Resolver: Query ISP's DNS server
- Root Servers: Query root DNS servers
-
TLD Servers: Query top-level domain servers
-
Authoritative Servers: Query domain's
authoritative servers
- Response: Return IP address to client
DNS Record Types:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Record Type β Purpose β Example β TTL β Priority β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β A β IPv4 Addressβ 192.168.1.1 β 3600 β N/A β
β AAAA β IPv6 Addressβ ::1 β 3600 β N/A β
β CNAME β Alias β www.example β 3600 β N/A β
β MX β Mail Server β mail.exampleβ 3600 β 10 β
β NS β Name Server β ns1.example β 86400 β N/A β
β TXT β Text Record β SPF record β 3600 β N/A β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
DNS Query Example:
nslookup www.google.com
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: www.google.com
Address: 142.250.190.36
Network Security
Network Security: The practice of protecting computer
networks from unauthorized access, misuse, modification, or denial of
service attacks through various security measures and protocols.
Common Security Threats:
-
Malware: Viruses, worms, trojans, ransomware
-
Phishing: Deceptive emails to steal credentials
-
DDoS Attacks: Distributed Denial of Service
-
Man-in-the-Middle: Intercepting communication
- SQL Injection: Database attacks
-
Cross-Site Scripting (XSS): Web application
attacks
Firewall
Firewall: A network security device that monitors and
controls incoming and outgoing network traffic based on predetermined
security rules, acting as a barrier between trusted and untrusted
networks.
Firewall Types:
-
Packet Filtering: Examines packet headers
-
Stateful Inspection: Tracks connection state
-
Application Layer: Deep packet inspection
-
Next-Generation: Advanced threat protection
Firewall Rule Example (iptables):
# Allow HTTP traffic
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
# Allow HTTPS traffic
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Allow SSH from specific IP
iptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j ACCEPT
# Block all other incoming traffic
iptables -A INPUT -j DROP
# Allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Firewall Rule Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Action β Protocol β Source IP β Dest Port β Comment β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β ACCEPT β TCP β ANY β 80 β HTTP β
β ACCEPT β TCP β ANY β 443 β HTTPS β
β ACCEPT β TCP β 192.168.1.0 β 22 β SSH β
β DROP β ANY β ANY β ANY β Default β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
VPN (Virtual Private Network)
VPN (Virtual Private Network): A technology that
creates a secure, encrypted connection over a public network, allowing
users to access private networks remotely while maintaining privacy
and security.
VPN Benefits:
- Security: Encrypted data transmission
- Privacy: Anonymous browsing
-
Remote Access: Secure access to corporate
networks
-
Bypass Restrictions: Access geo-blocked content
- Cost Effective: Cheaper than leased lines
Network Troubleshooting
Network Troubleshooting: The systematic process of
identifying, diagnosing, and resolving network problems to restore
normal network operation and performance.
Troubleshooting Steps:
-
Identify the Problem: Gather information about
the issue
-
Establish a Theory: Formulate possible causes
- Test the Theory: Verify the hypothesis
- Create an Action Plan: Plan the solution
- Implement the Solution: Apply the fix
-
Verify Functionality: Test the resolution
- Document the Solution: Record the fix
Common Network Commands:
# Check IP configuration
ipconfig (Windows) / ifconfig (Linux)
ip addr show (Linux)
# Test connectivity
ping google.com
ping 8.8.8.8
# Trace route
tracert google.com (Windows)
traceroute google.com (Linux)
# Check DNS resolution
nslookup google.com
dig google.com
# Check network interfaces
netstat -i
ip link show
# Check routing table
route print (Windows)
ip route show (Linux)
# Test port connectivity
telnet google.com 80
nc -zv google.com 80
# Check active connections
netstat -an
ss -tuln
Network Performance Monitoring
Network Performance Monitoring: The continuous
monitoring and analysis of network performance metrics to ensure
optimal network operation, identify bottlenecks, and plan capacity.
Key Performance Metrics:
- Bandwidth: Data transfer capacity
- Latency: Time for data to travel
- Packet Loss: Percentage of lost packets
- Jitter: Variation in packet arrival time
- Throughput: Actual data transfer rate
-
Error Rate: Percentage of corrupted packets
Quality of Service (QoS)
Quality of Service (QoS): A set of technologies and
mechanisms that manage network resources to ensure reliable delivery
of applications with specific performance requirements.
QoS Mechanisms:
-
Classification: Identify and mark traffic
- Marking: Set priority levels
- Queuing: Prioritize traffic processing
- Scheduling: Determine transmission order
- Policing: Limit traffic rates
- Shaping: Smooth traffic flow
QoS Configuration Example (Cisco):
# Define traffic classes
class-map match-all VOICE
match dscp ef
class-map match-all VIDEO
match dscp af41
# Define policy
policy-map QOS-POLICY
class VOICE
priority 100
class VIDEO
bandwidth 2000
class class-default
fair-queue
# Apply policy to interface
interface FastEthernet0/0
service-policy output QOS-POLICY
QoS Priority Levels:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Priority β Service β Example β DSCP β CoS β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Critical β Voice β VoIP β EF β 5 β
β High β Video β Streaming β AF41 β 4 β
β Medium β Data β Email β AF21 β 2 β
β Low β Bulk β Backup β BE β 0 β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Emerging Network Technologies
Emerging Network Technologies: New and evolving
networking technologies that are shaping the future of computer
networks and communication systems.
Key Technologies:
-
5G Networks: Fifth-generation mobile networks
-
Software-Defined Networking (SDN): Centralized
network control
-
Network Function Virtualization (NFV):
Virtualized network services
-
Internet of Things (IoT): Connected devices and
sensors
-
Edge Computing: Distributed computing at network
edge
-
Blockchain Networks: Decentralized network
architectures
Practice Problems
Problem 1: Subnetting
Given the IP address 192.168.1.0/24, create 4 subnets with equal
number of hosts.
Solution:
- Original network: 192.168.1.0/24 (256 addresses)
- Subnet mask: 255.255.255.0
- 4 subnets require 2 additional bits (2Β² = 4)
- New subnet mask: 255.255.255.192 (/26)
-
Subnets: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26,
192.168.1.192/26
- Each subnet has 62 usable host addresses
Problem 2: Routing
Configure OSPF routing between three routers with the following
networks:
- Router A: 192.168.1.0/24, 10.0.0.0/8
- Router B: 192.168.1.0/24, 172.16.0.0/16
- Router C: 10.0.0.0/8, 172.16.0.0/16
Solution:
Router A Configuration:
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 10.0.0.0 0.255.255.255 area 0
Router B Configuration:
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 172.16.0.0 0.0.255.255 area 0
Router C Configuration:
router ospf 1
network 10.0.0.0 0.255.255.255 area 0
network 172.16.0.0 0.0.255.255 area 0
Problem 3: Network Security
Design a firewall rule set for a web server with the following
requirements:
- Allow HTTP (port 80) and HTTPS (port 443) from anywhere
- Allow SSH (port 22) only from 192.168.1.0/24
- Block all other incoming traffic
- Allow all outgoing traffic
Solution:
# Clear existing rules
iptables -F
iptables -X
# Set default policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# Allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow HTTP and HTTPS
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Allow SSH from specific network
iptables -A INPUT -p tcp --dport 22 -s 192.168.1.0/24 -j ACCEPT
# Allow loopback traffic
iptables -A INPUT -i lo -j ACCEPT
Ethernet Frame Structure
Ethernet Frame Format:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Preamble β SFD (Start) β Destination β Source β Length/ β Data β
β (7 bytes) β (1 byte) β MAC (6) β MAC (6) β Type (2) β (46-1500) β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
β
βΌ
βββββββββββββββ
β FCS β
β (4 bytes) β
βββββββββββββββ
Field Descriptions:
- Preamble: 7 bytes of alternating 1s and 0s for synchronization
- SFD (Start Frame Delimiter): 1 byte (10101011) marking frame start
- Destination MAC: 6-byte destination address
- Source MAC: 6-byte source address
- Length/Type: 2 bytes indicating data length or protocol type
- Data: Variable length payload (46-1500 bytes)
- FCS (Frame Check Sequence): 4-byte CRC for error detection
MAC Address
Media Access Control (MAC) Address: A unique 48-bit
identifier assigned to network interface controllers (NICs) for use as
a network address in communications within a network segment.
MAC Address Format:
Example: 00:1B:44:11:3A:B7
-
First 6 digits (24 bits): Organizationally
Unique Identifier (OUI)
-
Last 6 digits (24 bits): Network Interface
Controller specific
- Format: XX:XX:XX:XX:XX:XX (hexadecimal)
CSMA/CD Protocol
Carrier Sense Multiple Access with Collision Detection
(CSMA/CD):
A media access control method used in Ethernet networks to handle
collisions when multiple devices try to transmit simultaneously.
CSMA/CD Algorithm:
-
Carrier Sense: Listen to the medium before
transmitting
-
Multiple Access: Multiple devices can access
the medium
-
Collision Detection: Detect if collision occurs
during transmission
-
Collision Resolution: Wait for random time and
retransmit
Wireless LAN (Wi-Fi)
Wireless Local Area Network (WLAN): A wireless
computer network that links two or more devices using wireless
communication to form a local area network within a limited area.
Wi-Fi Standards:
| Standard |
Frequency |
Speed |
Range |
Year |
| 802.11a |
5 GHz |
54 Mbps |
35m |
1999 |
| 802.11b |
2.4 GHz |
11 Mbps |
38m |
1999 |
| 802.11g |
2.4 GHz |
54 Mbps |
38m |
2003 |
| 802.11n |
2.4/5 GHz |
600 Mbps |
70m |
2009 |
| 802.11ac |
5 GHz |
6.9 Gbps |
35m |
2013 |
| 802.11ax (Wi-Fi 6) |
2.4/5 GHz |
9.6 Gbps |
70m |
2019 |
Wi-Fi Security Protocols
Wi-Fi Security: Methods and protocols used to secure
wireless networks from unauthorized access and data interception.
Security Standards:
-
WEP (Wired Equivalent Privacy): First security
standard (1997), now considered insecure
-
WPA (Wi-Fi Protected Access): Interim security
standard (2003)
-
WPA2 (Wi-Fi Protected Access 2): Current
standard using AES encryption
-
WPA3 (Wi-Fi Protected Access 3): Latest
standard with enhanced security
Unit III: Network Layer & Transport Layer
3.1 Network Layer Protocols
Internet Protocol (IP)
Internet Protocol (IP): A connectionless protocol
that provides logical addressing and routing for data packets across
networks. IP is the primary protocol of the Internet and enables
communication between devices on different networks.
IP Characteristics:
-
Connectionless: No prior connection establishment
required
-
Best-effort delivery: No guarantee of packet
delivery
-
Unreliable: No acknowledgment or retransmission
-
Fragmentation: Can break large packets into
smaller ones
IPv4 Address Structure
IPv4 Address Format: XXX.XXX.XXX.XXX
Example: 192.168.1.100
Address Classes:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Class β First Bits β Range β Default β Network β
β β β β Subnet β Hosts β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β A β 0xxx β 1.0.0.0 - β 255.0.0.0 β 16,777,214 β
β β β 126.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β B β 10xx β 128.0.0.0 - β 255.255.0.0 β 65,534 β
β β β 191.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β C β 110x β 192.0.0.0 - β255.255.255.0 β 254 β
β β β 223.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β D β 1110 β 224.0.0.0 - β N/A β Multicast β
β β β 239.255.255.255 β β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β E β 1111 β 240.0.0.0 - β N/A β Reserved β
β β β 255.255.255.255 β β β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
IPv6 Address Structure
IPv6 (Internet Protocol Version 6): The most recent
version of the Internet Protocol, designed to replace IPv4 and address
its limitations, particularly the exhaustion of IPv4 addresses.
IPv6 Features:
-
128-bit addresses: Provides 340 undecillion
unique addresses
-
Built-in security: IPsec support is mandatory
-
Auto-configuration: Stateless address
autoconfiguration
-
Better header format: Simplified and more
efficient
- Quality of Service: Better support for QoS
IPv6 Address Format: XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Shortened form: 2001:db8:85a3::8a2e:370:7334
Address Types:
- Global Unicast: 2000::/3 (public addresses)
- Unique Local: fc00::/7 (private addresses)
- Link Local: fe80::/10 (local network only)
- Multicast: ff00::/8 (group communication)
Routing Protocols
Routing Protocol: A protocol that enables routers to
exchange routing information and build routing tables to determine the
best path for forwarding packets across networks.
Types of Routing Protocols:
-
Distance Vector Protocols: RIP, EIGRP - share
entire routing table with neighbors
-
Link State Protocols: OSPF, IS-IS - share link
state information with all routers
-
Path Vector Protocols: BGP - share path
information between autonomous systems
RIP (Routing Information Protocol)
RIP (Routing Information Protocol): A distance-vector
routing protocol that uses hop count as its routing metric. RIP is one
of the oldest routing protocols and is suitable for small networks.
RIP Characteristics:
-
Maximum hop count: 15 hops (16 = unreachable)
- Update interval: 30 seconds
- Metric: Hop count
- Administrative distance: 120
- Convergence time: Slow (up to 180 seconds)
RIP Configuration Example (Cisco):
Router(config)# router rip
Router(config-router)# version 2
Router(config-router)# network 192.168.1.0
Router(config-router)# network 10.0.0.0
Router(config-router)# no auto-summary
RIP Packet Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Command β Version β Reserved β Address β Metric β
β (1 byte) β (1 byte) β (2 bytes) β Family (2) β (4 bytes) β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Commands:
- 1: Request
- 2: Response
OSPF (Open Shortest Path First)
OSPF (Open Shortest Path First): A link-state routing
protocol that uses Dijkstra's shortest path algorithm to calculate the
best route to each destination. OSPF is widely used in enterprise
networks.
OSPF Features:
- Fast convergence: Typically 10-30 seconds
- Hierarchical design: Areas and backbone
-
Multiple metrics: Bandwidth, delay, reliability,
cost
-
Authentication: Supports MD5 authentication
-
VLSM support: Variable Length Subnet Masking
3.2 Transport Layer Protocols
TCP (Transmission Control Protocol)
TCP (Transmission Control Protocol): A
connection-oriented, reliable transport protocol that provides
ordered, error-checked delivery of data between applications running
on hosts communicating via an IP network.
TCP Characteristics:
-
Connection-oriented: Establishes connection
before data transfer
-
Reliable: Guarantees delivery with
acknowledgments
-
Ordered delivery: Maintains sequence of data
- Flow control: Prevents buffer overflow
-
Error detection: Checksum for error detection
TCP Three-Way Handshake
TCP Connection Establishment (Three-Way Handshake):
Client Server
β β
ββββ SYN (seq=x) βββββββββΆβ
β β
ββββ SYN+ACK (seq=y, ack=x+1) ββ
β β
ββββ ACK (ack=y+1) βββββββΆβ
β β
Connection Established!
TCP Header Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Source β Destination β Sequence β Acknowledgmentβ Flags β
β Port (16) β Port (16) β Number (32) β Number (32) β (6 bits) β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
β Window β Checksum β Urgent β Options β Data β
β Size (16) β (16) β Pointer β (variable)β (variable)β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Flags:
- SYN: Synchronize sequence numbers
- ACK: Acknowledgment field significant
- FIN: Finish connection
- RST: Reset connection
- PSH: Push data immediately
- URG: Urgent pointer field significant
UDP (User Datagram Protocol)
UDP (User Datagram Protocol): A connectionless,
unreliable transport protocol that provides minimal overhead and fast
transmission for applications that can tolerate packet loss and don't
require guaranteed delivery.
UDP Characteristics:
-
Connectionless: No connection establishment
required
-
Unreliable: No acknowledgment or retransmission
- Fast: Minimal overhead and processing
-
No flow control: Sender can overwhelm receiver
-
No ordering: Packets may arrive out of order
UDP Header Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Source β Destination β Length β Checksum β
β Port (16) β Port (16) β (16) β (16) β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
UDP vs TCP Comparison:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Feature β TCP β UDP β Use Case β Example β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Connection β Oriented β Connectionlessβ Reliable β HTTP β
β Reliability β Yes β No β Transfer β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Ordering β Yes β No β Real-time β DNS β
β Flow Controlβ Yes β No β Streaming β β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Overhead β High β Low β Gaming β VoIP β
β Speed β Slow β Fast β β β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
Unit IV: Application Layer & Network Security
4.1 Application Layer Protocols
HTTP (Hypertext Transfer Protocol)
HTTP (Hypertext Transfer Protocol): An
application-layer protocol for distributed, collaborative, hypermedia
information systems. HTTP is the foundation of data communication for
the World Wide Web.
HTTP Methods:
- GET: Retrieve data from server
- POST: Submit data to server
- PUT: Update existing resource
- DELETE: Remove resource
- PATCH: Partial update of resource
HTTP Request Example:
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html,application/xhtml+xml
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate
Connection: keep-alive
HTTP Response Example:
HTTP/1.1 200 OK
Date: Mon, 23 May 2023 22:38:34 GMT
Server: Apache/2.4.1 (Unix)
Last-Modified: Wed, 08 Jan 2023 23:11:55 GMT
Content-Length: 138
Content-Type: text/html
Connection: close
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>
HTTP Status Codes:
- 1xx: Informational (100 Continue)
- 2xx: Success (200 OK, 201 Created)
- 3xx: Redirection (301 Moved, 304 Not Modified)
- 4xx: Client Error (404 Not Found, 403 Forbidden)
- 5xx: Server Error (500 Internal Server Error)
DNS (Domain Name System)
DNS (Domain Name System): A hierarchical, distributed
database that translates human-readable domain names into IP
addresses, enabling users to access websites using memorable names
instead of numerical addresses.
DNS Resolution Process:
- Local Cache: Check local DNS cache first
-
Recursive Resolver: Query ISP's DNS server
- Root Servers: Query root DNS servers
-
TLD Servers: Query top-level domain servers
-
Authoritative Servers: Query domain's
authoritative servers
- Response: Return IP address to client
DNS Record Types:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Record Type β Purpose β Example β TTL β Priority β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β A β IPv4 Addressβ 192.168.1.1 β 3600 β N/A β
β AAAA β IPv6 Addressβ ::1 β 3600 β N/A β
β CNAME β Alias β www.example β 3600 β N/A β
β MX β Mail Server β mail.exampleβ 3600 β 10 β
β NS β Name Server β ns1.example β 86400 β N/A β
β TXT β Text Record β SPF record β 3600 β N/A β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
DNS Query Example:
nslookup www.google.com
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: www.google.com
Address: 142.250.190.36
4.2 Network Security
Common Security Threats
Network Security: The practice of protecting computer
networks from unauthorized access, misuse, modification, or denial of
service attacks through various security measures and protocols.
Common Security Threats:
-
Malware: Viruses, worms, trojans, ransomware
-
Phishing: Deceptive emails to steal credentials
-
DDoS Attacks: Distributed Denial of Service
-
Man-in-the-Middle: Intercepting communication
- SQL Injection: Database attacks
-
Cross-Site Scripting (XSS): Web application
attacks
Firewall
Firewall: A network security device that monitors and
controls incoming and outgoing network traffic based on predetermined
security rules, acting as a barrier between trusted and untrusted
networks.
Firewall Types:
-
Packet Filtering: Examines packet headers
-
Stateful Inspection: Tracks connection state
-
Application Layer: Deep packet inspection
-
Next-Generation: Advanced threat protection
Firewall Rule Example (iptables):
# Allow HTTP traffic
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
# Allow HTTPS traffic
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
# Allow SSH from specific IP
iptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j ACCEPT
# Block all other incoming traffic
iptables -A INPUT -j DROP
# Allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Firewall Rule Structure:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Action β Protocol β Source IP β Dest Port β Comment β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β ACCEPT β TCP β ANY β 80 β HTTP β
β ACCEPT β TCP β ANY β 443 β HTTPS β
β ACCEPT β TCP β 192.168.1.0 β 22 β SSH β
β DROP β ANY β ANY β ANY β Default β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
VPN (Virtual Private Network)
VPN (Virtual Private Network): A technology that
creates a secure, encrypted connection over a public network, allowing
users to access private networks remotely while maintaining privacy
and security.
VPN Benefits:
- Security: Encrypted data transmission
- Privacy: Anonymous browsing
-
Remote Access: Secure access to corporate
networks
-
Bypass Restrictions: Access geo-blocked content
- Cost Effective: Cheaper than leased lines
Unit V: Advanced Networking & Emerging Technologies
5.1 Network Troubleshooting
Troubleshooting Methodology
Network Troubleshooting: The systematic process of
identifying, diagnosing, and resolving network problems to restore
normal network operation and performance.
Troubleshooting Steps:
-
Identify the Problem: Gather information about
the issue
-
Establish a Theory: Formulate possible causes
- Test the Theory: Verify the hypothesis
- Create an Action Plan: Plan the solution
- Implement the Solution: Apply the fix
-
Verify Functionality: Test the resolution
- Document the Solution: Record the fix
Common Network Commands:
# Check IP configuration
ipconfig (Windows) / ifconfig (Linux)
ip addr show (Linux)
# Test connectivity
ping google.com
ping 8.8.8.8
# Trace route
tracert google.com (Windows)
traceroute google.com (Linux)
# Check DNS resolution
nslookup google.com
dig google.com
# Check network interfaces
netstat -i
ip link show
# Check routing table
route print (Windows)
ip route show (Linux)
# Test port connectivity
telnet google.com 80
nc -zv google.com 80
# Check active connections
netstat -an
ss -tuln
5.2 Network Performance Monitoring
Performance Metrics
Network Performance Monitoring: The continuous
monitoring and analysis of network performance metrics to ensure
optimal network operation, identify bottlenecks, and plan capacity.
Key Performance Metrics:
- Bandwidth: Data transfer capacity
- Latency: Time for data to travel
- Packet Loss: Percentage of lost packets
- Jitter: Variation in packet arrival time
- Throughput: Actual data transfer rate
-
Error Rate: Percentage of corrupted packets
Quality of Service (QoS)
Quality of Service (QoS): A set of technologies and
mechanisms that manage network resources to ensure reliable delivery
of applications with specific performance requirements.
QoS Mechanisms:
-
Classification: Identify and mark traffic
- Marking: Set priority levels
- Queuing: Prioritize traffic processing
- Scheduling: Determine transmission order
- Policing: Limit traffic rates
- Shaping: Smooth traffic flow
QoS Configuration Example (Cisco):
# Define traffic classes
class-map match-all VOICE
match dscp ef
class-map match-all VIDEO
match dscp af41
# Define policy
policy-map QOS-POLICY
class VOICE
priority 100
class VIDEO
bandwidth 2000
class class-default
fair-queue
# Apply policy to interface
interface FastEthernet0/0
service-policy output QOS-POLICY
QoS Priority Levels:
βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ
β Priority β Service β Example β DSCP β CoS β
βββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββΌββββββββββββββ€
β Critical β Voice β VoIP β EF β 5 β
β High β Video β Streaming β AF41 β 4 β
β Medium β Data β Email β AF21 β 2 β
β Low β Bulk β Backup β BE β 0 β
βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββ
5.3 Emerging Network Technologies
5G Networks
5G Networks: Fifth-generation mobile networks that
provide significantly higher data rates, lower latency, and greater
capacity compared to previous generations.
5G Features:
- High Speed: Up to 10 Gbps download speeds
- Low Latency: 1-10 milliseconds
-
High Capacity: Support for massive IoT
deployments
-
Network Slicing: Virtual networks for different
services
- Edge Computing: Processing closer to users
Software-Defined Networking (SDN)
Software-Defined Networking (SDN): A network
architecture approach that separates the control plane from the data
plane, enabling centralized network management and programmability.
SDN Benefits:
-
Centralized Control: Simplified network
management
- Programmability: Custom network policies
- Flexibility: Dynamic network configuration
- Cost Reduction: Lower operational costs
-
Innovation: Faster deployment of new services
Internet of Things (IoT)
Internet of Things (IoT): A network of interconnected
devices, sensors, and systems that can collect, exchange, and process
data to provide intelligent services and automation.
IoT Applications:
- Smart Homes: Home automation and security
-
Industrial IoT: Manufacturing and process control
-
Healthcare: Medical monitoring and telemedicine
-
Transportation: Connected vehicles and traffic
management
-
Agriculture: Precision farming and crop
monitoring