Chapter-1
Introduction to Computer
Networks
Defination:
• A computer network is a set of interconnected devices (computers, servers, mobile devices, IoT)
that exchange data and share resources using communication links and agreed rules (protocols).
• Networks enable distributed communication, resource sharing, centralized services, and global
connectivity.
Primary goals:
• Resource sharing (files, printers, storage, software).
• Communication & collaboration (email, conferencing, shared apps).
• Reliability & fault tolerance (redundancy, backups).
• Scalability & performance (add users, tune bandwidth).
• Cost efficiency (centralized services instead of duplicated hardware).
• Security & controlled access (authentication, authorization).
Network Hardware — Broadcast vs Point-to-Point
Broadcast links:
• Concept: single shared medium where a transmission is (potentially) received by all nodes on that
medium.
• When used: wireless Wi-Fi segments, older Ethernet coax bus segments.
• Implication: MAC-level addressing and access control protocols (CSMA/CA or CSMA/CD).
• Real-world: Wi-Fi access point’s radio channel is effectively a broadcast medium.
Point-to-point links:
• Concept: dedicated physical/logical channel between two endpoints.
• When used: leased lines, serial links, fiber runs between two routers,
many modern wired ethernet links (switch ports create virtual point-to-point links).
• Real-world: MPLS or leased fiber connecting two datacenters.
NETWORK TOPOLOGIES — star, bus, mesh, ring, tree, hybrid
Topology= physical or logical layout of hosts and links.
Topology affects performance, fault tolerance, cost, and routing.
1. Star topology
How: every node connects to a central device (switch/hub).
How It Works:
➢ A device wants to send data to another device.
➢ It sends the frame to the central switch.
➢ The switch checks the MAC address table
➢ The switch forwards the frame only to the intended port.
➢ Communication is isolated between sender and receiver.
Advantages: Disadvantages:
• Easy to Install and Manage • Single Point of Failure
• If the central switch/hub fails, the entire
• Adding or removing a node does
network segment goes down.
not disrupt the network. • Higher Initial Cost
• Troubleshooting is easier due to centralized wiring. • Requires a network switch and more
cabling
• Fault Isolation
• Limited by Central Device Capacity
• If a single node or cable fails, • Number of ports = number of possible
others continue working. nodes unless expanded.
• Cable Dependency
• Clear identification of problematic links.
• Each node needs its own dedicated cable
• High Performance (with switches) run, increasing cable length and cost.
• Dedicated link per device.
Real-Life Examples:
➢ Modern Ethernet LANs
➢ Standard design in offices, universities, labs.
➢ Each floor has an access switch connecting PCs, IP phones, printers.
➢ Wi-Fi Networks
➢ Access points connect to a central switch, forming a logical star.
➢ Home Networks
➢ Router with LAN ports acts as the central device.
2. Bus Topology:
How It Works:
• A node broadcasts the data onto the backbone.
• All nodes receive the signal.
• Only the intended receiver accepts and processes the data
.
Advantages: Disadvantages:
• Very simple physical layout. • Single cable is a single point of failure.
• Heavy traffic causes collisions and
• Low installation cost (minimal cabling).
performance drops.
• Works well for small temporary networks. • Difficult troubleshooting: any cable fault
disturbs entire network.
• Very limited scalability
3. Ring Topology:
Each device connects to exactly two neighboring devices, forming a closed loop.
How It Works:
Two methods:
[Link] Passing (IBM Token Ring)
A special “token” circulates.
A node transmits only when it captures the token.
Ensures collision-free operation.
[Link] looping
Frame travels hop-by-hop around the ring until it reaches its destination.
Advantage:
• Collision-free transmission (token-based).
• Predictable performance in high-load environments.
• Each node gets equal access; suited for deterministic networks.
Disadvantages:
• A single node or link failure can break the ring.
• Troubleshooting is difficult.
• Slower compared to modern switched Ethernet.
Real-Life Example:
• IBM Token Ring LANs.
• FDDI (Fiber Distributed Data Interface) networks used dual rings for reliability.
• Some metro fiber networks still use ring principles.
4. Mesh Topology:
A mesh topology provides multiple redundant paths between nodes.
Two types:
1. Full Mesh: every node is connected to every other node.
2. Partial Mesh: only some nodes have multiple paths.
How It Works:
• Data can travel through multiple possible paths.
• Routing protocols (OSPF, EIGRP) dynamically choose the best path.
• Provides very high fault tolerance.
Advantages: Disadvantages:
• Excellent reliability and redundancy. • Very expensive due to large number of links.
• Complex installation and management.
• Failure of any single link rarely affects communication. • Full mesh becomes impractical for large N
• Suitable for mission-critical networks. (requires N(N–1)/2 links).
Real-Life Example:
• Backbone of telecom networks.
• WAN interconnects between data centers.
• Wireless mesh networks (public Wi-Fi).
5. Tree Topology:
Tree topology is a hierarchical extension of star topology.
It resembles a parent–child branching structure.
How It Works:
• Central/root device forms the highest level.
• Downstream switches connect hosts or other switches.
• Used to build multi-layer networks (core → distribution → access).
Advantages:
Scalable hierarchy for large networks.
Logical segmentation is easier (departments, floors).
Faults in lower branches don’t affect the whole structure.
Disadvantages:
Failure in the root or upper-level device affects large sections.
More cabling and more complex than a simple star.
Requires configuration of routing or VLANs in larger deployments.
Real-Life Example:
Enterprise building networks.
University campus networks.
Data center Top-of-Rack → Aggregation → Core hierarchy.
Topology Key Feature Major Advantage Major Disadvantage Typical Use
Easy mgmt, fault
Star Central device Central device failure Modern LANs
isolation
Bus Single backbone Low cost Cable failure affects all Legacy Ethernet
Break affects whole Old Token Ring,
Ring Closed loop Collision-free
ring FDDI
Mesh Multiple paths High reliability Expensive, complex WAN, telecom
Upper-level failures
Tree Hierarchical Scalable Enterprise networks
severe
Hybrid Combination Flexible, scalable Complex Large organizations
NETWORK TYPES
LAN MAN WAN Wireless
(Local Area (Metropolitan (Wide Area networks
Network) Area Network) Network)
LAN (Local Area Network):
A LAN is a network that covers a small geographic area, such as a room, building, school, or
corporate campus.
It is usually owned, managed, and controlled by a single organization.
Typical Scope:
• A building
• A school/college campus
• A computer lab
Characteristics of LAN:
• High bandwidth (100 Mbps, 1 Gbps, 10 Gbps).
• Low latency due to short distances.
• Privately owned and managed.
• Secure because control stays inside an organization.
• Supports Ethernet, Wi-Fi, VLANs, PoE
LAN Technologies & Devices:
• Ethernet Switches – central communication devices.
• Wi-Fi Access Points – for wireless access.
• Routers – for connection to WAN/Internet.
• VLANs – segmenting networks.
Real-life Example:
• School computer lab with 30 PCs connected to a switch.
• Home network with a Wi-Fi router and 5–10 devices.
• Corporate office running:
• 1 Gbps Ethernet to employee desktops
• Enterprise Wi-Fi (e.g., Aruba/Cisco)
• VLANs for HR, Finance, and Guest Wi-Fi
MAN (Metropolitan Area Network):
A MAN spans an entire city or metropolitan region.
It connects multiple LANs using high-speed fiber infrastructure, often operated by:
• Telecom providers
• Government agencies
• ISP
Characteristics of MAN:
• Covers 10–50 km or more within a city.
• Connects schools, offices, government buildings.
• Medium to high bandwidth (100 Mbps to multi-Gbps).
• Often deployed as fiber loops/rings for redundancy.
• Typically leased or managed by telecom providers.
MAN Technologies:
Metro Ethernet
Fiber Optic Rings
DWDM (Dense Wavelength Division Multiplexing) for high capacity
FDDI rings (historical)
Real-life Examples:
Municipal CCTV network across the city.
City-wide public Wi-Fi connecting via fiber backbones.
University campuses located in different city zones linked through fiber.
Banking sector inter-branch connectivity within a metro region
WAN (Wide Area Network):
A WAN covers large geographical areas such as countries, continents, or even the entire globe.
WANs interconnect multiple MANs and LANs using:
• Long-distance fiber
• Leased lines
• Microwave links
• Satellite
• Submarine cables
Characteristics of WAN:
• Long-distance communication.
• Lower throughput compared to LAN/MAN due to distance.
• Requires routing, policy control, and traffic engineering.
• Often uses leased infrastructure from telecom carriers.
• Heterogeneous technologies combine to form one system.
WAN Technologies:
• MPLS (Multiprotocol Label Switching)
• BGP (Border Gateway Protocol) — routing the internet
• IPSec VPN, SSL VPN
• Submarine fiber cables for intercontinental links
Real-life Examples:
• The Internet – the world’s largest WAN.
Multinational corporation WAN:
• Headquarters in US
• Branches in India, UK, Singapore
• Banking networks connecting branches across countries.
Wireless Networks:
Wireless networks use radio waves instead of cables to connect devices.
These networks differ based on:
• Range
• Frequency
• Application
Main Types of Wireless Networks:
1. Wi-Fi (WLAN – Wireless LAN):
• Short-range (within home/building)
• Standards: IEEE 802.11n/ac/ax
• Device: Wi-Fi router / Access Point
• Use: laptops, mobiles, IoT devices
2. Cellular Networks (4G/5G):
• Very wide area (city → country)
• Operated by telecom companies
• High mobility support
• Used for mobile phones, IoT, data cards
3. Bluetooth (PAN – Personal Area Network):
• Very short range (~10 m)
• Device to device: headsets, speakers, smartwatches
PROTOCOLS AND STANDARDS
What Is a Protocol?
• A protocol is a well-defined set of rules, formats, and
procedures that govern how devices communicate over a network.
• Just like two humans need a common language to talk,
computers need protocols to exchange data correctly and efficiently.
Key Characteristics of a Network Protocol:
1. Syntax (Format of Data):
Defines how data is structured (fields, headers, footers).
Example: An HTTP request has a method, URL, headers, and body.
2. Semantics (Meaning of Each Part)
Meaning of each field (e.g., what does “ACK” in TCP mean?).
[Link] (When and How Fast Data Should Be Sent)
• Speed matching
• When to start/stop transmission
• Timeout rules
• Retransmission delays
4. Error Handling:
What happens when data is lost, corrupted, or arrives out of order.
5. Sequencing:
How to number packets so that they can be reassembled in the right order.
6. Real-World Analogy :
When two people speak the same language, communication works.
Similarly, computers using the same protocol (HTTP, TCP, Wi-Fi) can communicate.
Why Do We Need Protocols?
1. To ensure all devices understand each other
Example: Web browsers and web servers must agree on HTTP format.
2. To manage data transmission
Speed control
Error management
Packet ordering
3. To ensure reliable, accurate, and secure communication
4. To support communication between different devices & vendors
Types of Protocols (Layer-wise Classification):
Application Layer Protocols Data Link Layer
• HTTP (web) • Ethernet (802.3)
• Wi-Fi MAC (802.11)
• FTP (file transfer)
• SMTP (email) Physical Layer
• Radio frequency rules
• Electrical signaling rules
Transport Layer
• TCP Real-World Example:
• UDP • When you watch YouTube:
• Your browser uses HTTP/HTTPS
• Your video stream flows using TCP or QUIC
Network Layer • Your packets route using IP
• IP (routing & addressing) • Your laptop transmits over Wi-Fi (802.11)
• ICMP
Peer-to-Peer LAN (P2P LAN):
A Peer-to-Peer LAN is a network model where all computers (nodes) act as equals (peers). Each
device can both request and provide services such as file sharing, printing, or media access.
Characteristics
1. No Central Server
There is no dedicated server controlling the network.
Each computer can access resources on others directly.
[Link] Control
No centralized management for:
Users
Permissions
Backups
Security policies
[Link] Sharing
PCs share folders, printers, and media.
Users manually configure permissions.
4 Suitable For Small Networks
Usually used in homes or very small offices (2–10 computers).
Low cost because there is no server hardware.
Advantages: Disadvantages:
• Difficult to manage when network grows
• Very easy to set up
• Security is weak
• Low cost (no server required) • Data inconsistency (files stored on multiple
• No specialized administrator needed PCs)
• No centralized backup
• Direct file sharing possible
• Performance degrades when many devices share
• Each user controls their own system files
Real-World Examples
Example 1: Home Wi-Fi Network
3–4 laptops connected to home Wi-Fi.
One laptop shares movies or files with others.
No central server; all computers are peers.
Example 2: Small Shop/Startup
5 PCs sharing a printer and local files.
Staff members share folders from their own computers.
Example 3: Torrent Networks (BitTorrent)
Each user is a peer that downloads and uploads files.
No central server storing the files.
Network Software – Protocols Hierarchies:
What are Protocol Hiearchies?
- It means the networking is divided into layers, where each layer has its own job.
- Communication between two hosts is modeled as peer-to-peer interactions between corresponding
layers, with data actually carried across the physical medium via adjacent-layer interfaces.
• Each layer does only one specific type of work.
• Upper layers depend on lower layers.
• Lower layers never need to know how upper layers works.
• Lower layers never nedd to know how upper layers works.
Layers and Protocols:
Layer= a stage in communication.
Protocol = rules followed in that stage.
Common Layers-
1. Application Layer – apps like Whatsapp , Gmail
2. Transport Layer – ensures data reaches correctly
3. Network Layer – handles IP address and routing.
4. Data Link Layer – frames, MAC address, inside LAN(Ethernet)
5. Physical Layer – wires, signals, bits.
Example:
When you watch YouTube:
Application: You request the video
Transport: TCP ensures smooth streaming
Network: IP finds YouTube servers
Data Link: Wi-Fi or Ethernet sends frames
Physical: Radio waves / cable carries bits
Peers and Interfaces:
Peers:
• Peer layers are same layer on two different computer.
Ex.
• TCP on your laptop → TCP on YouTube server
• Both understand TCP rules.
Interfaces:
• Interfaces are connections between layers inside the same device.
Ex:
• Application layer asks Transport layer to “send this data”.
Network Architecture patterns:
Common architectures:
OSI reference (7 layers) — conceptual teaching model (good for explaining separation of concerns).
TCP/IP (Internet) stack — practical, widely implemented (link, internet, transport, application).
Protocol Stack Design issues: (These are problems each layer must handle so that communication works properly.)
Addressing
Every device must have an address so data knows where to go.
Types of addresses:
MAC Address → used inside LAN (hardware address)
IP Address → used for routing between networks
Port Number → used to talk to the correct application
Example:
When you open Google:
IP identifies Google's server
Port 443 points to its HTTPS service
MAC helps your Wi-Fi router deliver the frame locally
Error Control:
Ensures data is not corrupted.
How?
Detect errors (using CRC)
Resend data if errors occur (TCP does this)
Example:
If a WhatsApp message arrives corrupted, TCP automatically resends it.
Flow Control:
Prevents a fast sender from overwhelming a slow receiver.
Example:
If YouTube sends video too fast, your phone says,
“Slow down, I can’t handle this much data.”
(TCP sliding window manages this.)
Multiplexing and Demultiplexing:
Allows many applications to use the network at the same time.
Multiplexing: combining multiple outgoing applications into one connection.
Demultiplexing: delivering incoming data to the correct application.
Example:
While using the internet, you may have:
YouTube
WhatsApp
Email
…all working together using port numbers.
Routing:
Routing means finding the best path for data to travel across networks.
Example:
Your laptop → Wi-Fi router → ISP router → Google → back to you
Each router chooses the next step based on IP address.
Connection-Oriented vs Connectionless Service:
Connection-Oriented (TCP)- Transmission Control Protocol:
• Connection is built before data is sent.
• Reliable, ordered, no missing data.
Example uses: Web browsing, email, file downloads.
Real Example:
When downloading a PDF, TCP ensures the file arrives complete and correct.
Connectionless (UDP)- User Diagram Protocol:
• No connection, just sending packets.
• Faster but unreliable.
Example uses: Live video calls, online games, voice calls.
Real Example:
In a video call, small packet losses are okay, but delay is not — so UDP is used.
TCP UDP
1. Connection-oriented – Connection is made 1. Connectionless – No connection before
before sending data sending data
2. Reliable – Data is guaranteed to reach 2. Unreliable – Data may be lost
3. Slow – Because it checks and resends data 3. Fast – No checking or resending
4. Ordered delivery – Data comes in correct 4. No order guarantee – Data may come in any
order order
5. Used for files & websites – Example: 5. Used for calls & games – Example: video
downloads, emails calls, gaming
OSI Refrence Model:
What is the OSI Model?
• OSI stands for Open Systems Interconnection.
• It is a 7-layer model used to understand how data moves from one computer to another.
• It is a conceptual model (used for learning and design).
• Each layer has a specific function.
→ OSI model explains how data travels step by step from one computer to another.
LAYER 7 – APPLICATION LAYER
Function: Protocol Examples:
Provides network services to the user HTTP – Web
FTP – File transfer
This is where user interacts with the network SMTP – Email
What it does: Real-Life Example:
Opening Google Chrome and
Web browsing searching something.
Sending emails
File downloading
LAYER 6 – PRESENTATION LAYER
Function:
Formats, encrypts and compresses data
What it does:
Makes data readable
Provides security
Reduces data size
Real-Life Example:
WhatsApp encrypts your message before sending
Layer 5 – Session Layer
Main Function:
Starts, manages, and ends communication sessions
It controls when communication starts and stops
Real-Life Example:
Logging into a website and staying logged in until you log out.
Layer 4 – Transport Layer
Main Function:
Delivers data safely or quickly between two computers
Protocols Used:
TCP – Reliable
UDP – Fast
It decides whether data should be sent safely or fast
Real-Life Example:
Downloading a file → TCP
Video call → UDP
Layer 3 – Network Layer
Main Function:
Finds the correct path using IP address (Routing)
Protocol Used:
IP (Internet Protocol)
It finds where the data should go
Real-Life Example:
Your message traveling from your city to another country using routers.
Layer 2 – Data Link Layer
Main Function:
Uses MAC address
Checks for errors (CRC)
Controls data flow inside local network
Devices Used:
Switch
It makes sure data is correctly sent inside your local network
Real-Life Example:
Wi-Fi router sending data from your phone to your laptop.
Layer 1 – Physical Layer
Main Function:
Sends raw bits (0s and 1s) using cables or signals
What it includes:
Wires
Cables
Wi-Fi signals
Voltage, signals
Real-Life Example:
Internet cable or Wi-Fi waves in your home.
END