CompterNetworking PDF
CompterNetworking PDF
Data Communication refers to transmission of data from one devices to another devices Through
Transmission medium (it can be either wired or wireless) is called Data Communication or
exchange information efficiently and accurately across distances, whether between computers,
servers, sensors, or other devices.
1. Sender: The device that sends the data (e.g., computer, smartphone).
4. Transmission Medium: The physical path (like cables or air) through which the message
travels.
2. Half-Duplex: Data flows in both directions, but only one direction at a time (e.g., walkie-talkie).
What is a Network?
A Network is system in which two or more devices are connected and share their resources and
exchange of data . These devices connect through either wired (like Ethernet cables) or wireless (like
Wi-Fi or Bluetooth) communication channels.
Resource Sharing : Devices on a network can share printers, scanners, storage drives, and internet
connections.
Easy Communication : Networks enable emails, chats, video calls, and instant messaging between
users in real time
Data Backup and Recovery : Central servers can be configured to automatically back up files,
reducing data loss risk.
Security and Access Control : Networks allow user authentication, permissions, and firewalls to
protect data.
Remote Access : With technologies like VPNs and cloud computing, users can access the network
remotely.
Network Classification
1. By Geographical Area
a. A Personal Area Network (PAN) is the smallest type of computer network. It connects all the
devices in very smaller geographical area, usually within a range of about 10 meters (like
inside a room).
b. A Local Area Network (LAN) is a network that connects computers and devices within a small
geographical area, like a home, office, or building. It allows devices to communicate, share
resources (like files, printers), and access the internet through a common connection.
c. A Campus Area Network (CAN) is a network that connects multiple local area networks
(LANs) within a limited geographic area, like a university campus, corporate campus, or large
business complex.
d. A Metropolitan Area Network is a network that covers a larger geographic area than a LAN
or CAN, typically spanning a city or metropolitan area. Covers a city or a large campus area
(tens of kilometers)
e. A Wide Area Network is a network that covers a very large geographical area, often spanning
cities, countries, or even continents. It connects multiple smaller networks such as LANs,
CANs, or MANs.
Transmission media refers to the physical pathway or channel through which data signals travel from
the sender to the receiver in a communication system. It connects the transmitting device to the
receiving device and allows the transmission of information such as data, voice, or video.
1. Guided Media (Wired) : Data signals are transmitted through a physical conductor.
2. Unguided Media (Wireless) : Data signals are transmitted through the air or space without physical
conductors.
• Radio Waves:
Used for broadcast radio, TV, and mobile communication.
• Microwaves:
Used for satellite communication and point-to-point communication.
• Infrared:
Used for short-range communication such as remote controls.
• Satellite Communication:
Uses satellites to transmit signals over very long distances
Network architecture refers to the design and structure of a computer network. It defines how
different devices like computers, servers, routers, and switches are connected and how they
communicate with each other.
Peer-to-Peer (P2P): In a Peer-to-Peer (P2P) network, all computers (called peers) are equal. Each
device can act as both a client (requesting data) and a server (sharing data). There is no central server
controlling the network.
Advantages of P2P
Client-Server: In a Client-Server network, there is a central server that provides resources, data, or
services, and multiple clients (computers or devices) connect to this server to use those services.
Network Topology refers to the Structural arrangement or layout pattern of various elements (links,
nodes, etc.) in a computer network. It defines how different devices (computers, printers, servers) are
connected and how data flows between them.
Type of Topology
1. Bus Topology
In Bus Topology, all devices (computers, printers, etc.) are connected to a single central cable called
the bus or backbone. This cable acts as a shared communication medium that carries data signals to
all devices. a device sends data, the signal travels along the bus in both directions.
Advantages
• Simple and Easy to Install: Requires less cabling compared to other topologies.
• Good for Small Networks: Works well with a small number of devices
2. Ring Topology
In Ring Topology, each device is connected to exactly two other devices, forming a closed loop or ring.
Data travels around the ring in one direction (or sometimes both directions in a dual ring) until it
reaches its destination.
Advantages
• Orderly Network: Data passes in one direction, reducing the chance of packet collisions.
• High Performance: Suitable for networks with heavy traffic because each device waits its turn
to transmit.
• Fault Detection: Faulty devices can be easier to detect with proper monitoring.
3. Star Topology
In Star Topology, all devices (computers, printers, etc.) are connected individually to a central device
such as a switch, hub, or router. The central device acts as a communication hub through which all
data passes
Advantages
• Better performance: Data can be sent to multiple devices without collisions if a switch is
used.
4. Mesh Topology
In Mesh Topology, every device is connected directly to every other device in the network. This means
multiple paths exist between any two devices.
• Partial Mesh: Some devices are connected to multiple devices, but not all.
Advantages
• Very reliable: Failure of one device or connection does not affect network communication.
• Data can be transmitted simultaneously: Multiple devices can communicate at the same
time.
5. Tree Topology
Tree Topology is a combination of Star and Bus topologies. It consists of groups of star-configured
networks connected to a linear bus backbone cable. It resembles a tree structure with branches.
Advantages
• Fault isolation: Faults in one branch do not affect the entire network.
Hybrid Topology is a combination of two or more different types of network topologies (like star, bus,
ring, mesh) integrated into a single network. It leverages the strengths and minimizes the weaknesses
of the combined topologies.
Advantages
• Highly flexible: Can use the best topology suited for each part of the network.
• Fault tolerance: Problems in one part do not necessarily affect the whole network.
Note : -
What is IEEE?
• IEEE develops and publishes widely accepted standards for various fields including
networking, electronics, power, and telecommunications.
Its standards
IEEE 802.3 — Ethernet : It is the standard for Ethernet, the most common wired networking
technology worldwide.Defines the physical layer and data link layer specifications for wired
LANs.Specifies how devices format and transmit data over cables.
IEEE 802.11 (Wi-Fi): Wireless networking standard used in almost all wireless devices.
Networking Terms
TCP/IP stands for Transmission Control Protocol/Internet Protocol. It is a set of communication protocols
used to connect devices on the internet and most other computer networks.
• IP (Internet Protocol) is responsible for addressing and routing packets of data so they can travel
across networks and arrive at the correct destination.
• TCP (Transmission Control Protocol) ensures reliable delivery of data by establishing a
connection, checking for errors, and managing data packets in the correct order.
Telnet
• Telnet is a network protocol used to connect to a remote computer or device over the internet or
a local network.
• It allows users to access and control a remote system’s command-line interface as if they were
physically present at the machine.
• Telnet sends data in plain text, so it is not secure and has mostly been replaced by more secure
protocols like SSH.
Networking Devices
Hub
• A Hub is a basic networking device used to connect multiple computers or devices in a local area
network (LAN).
• It works by receiving data packets from one device and broadcasting them to all other
connected devices.
• Hubs operate at the physical layer (Layer 1) of the OSI model.
• They do not filter or manage any traffic — this means all devices receive all data, which can lead to
collisions and reduced network efficiency.
Switch
• A Switch is a networking device that connects multiple devices in a local area network (LAN).
• Unlike a hub, a switch receives data and forwards it only to the specific device for which the data
is intended.
• Switches operate at the data link layer (Layer 2) of the OSI model.
• They improve network efficiency by reducing data collisions and managing traffic intelligently
using MAC addresses.
Router
• A Router is a networking device that connects different networks together, such as your home
network to the internet.
• It forwards data packets between networks by determining the best path for the data to travel.
• Routers operate at the network layer (Layer 3) of the OSI model.
• They use IP addresses to route data and often provide additional features like firewall protection,
DHCP, and NAT.
• Routers are essential for directing internet traffic and enabling communication between devices on
different networks.
Bridge
• A Bridge is a networking device that connects two or more separate local area networks (LANs) to
work as a single network.
• It operates at the data link layer (Layer 2) of the OSI model.
• A bridge filters traffic by inspecting MAC addresses and only forwards data to the part of the
network where the destination device is located.
• This helps reduce network traffic and improves efficiency by preventing unnecessary data
transmission.
• Bridges are used to divide large networks into smaller segments to reduce collisions and improve
performance.
Gateway
• A Gateway is a networking device that connects two different networks that use different protocols
or architectures.
• It acts as a translator, enabling communication between networks that would otherwise be
incompatible.
• Gateways operate at multiple layers of the OSI model, depending on their function.
• For example, a gateway can connect a company’s internal network to the internet or link two
different network systems.
• Gateways are essential for enabling data flow between different network environments.
Modem
Repeater
• A Repeater is a networking device that amplifies and regenerates signals to extend the distance
over which data can travel in a network.
• It receives a weak or distorted signal, cleans and boosts it, then retransmits it at its original strength.
• Repeaters operate at the physical layer (Layer 1) of the OSI model.
• They are used in networks to overcome signal loss caused by distance or interference.
The TCP/IP model is the fundamental communication protocol suite for the internet and most modern
networks.
1. Application Layer
It provides services and interfaces for user applications to communicate over a network.
This is the layer where network-related applications like web browsers, email clients, and file transfer
programs operate.
2. Transport Layer
The Transport Layer is the second layer in the TCP/IP model (just below the Application Layer).
It is responsible for the reliable or unreliable delivery of data between devices over a network.
3. Internet Layer
The Internet Layer is the third layer in the TCP/IP model, just below the Transport Layer. It is
responsible for routing data packets between devices across multiple networks and ensuring they reach the
correct destination.
4 . Network Access Layer (also called Link Layer or Network Interface Layer)
The Network Access Layer is the lowest layer in the TCP/IP model. It is responsible for the physical
transmission of data over the network — from one device to another on the same local network.
2 . OSI Model
The OSI Model standardizes how network systems communicate and interact. It helps break down
complex networking processes into 7 manageable layers:
1. Physical Layer
The Physical Layer is the first and lowest layer of the OSI model. It is responsible for the actual
physical connection between devices, including the transmission and reception of raw bits over a
physical medium (like cables, radio waves, or fiber optics)
Main Purposes:
1. Bit Transmission
o Converts data into electrical, optical, or radio signals and transmits those raw bits over
the physical medium.
2. Defines Physical Characteristics
o Specifies cables, connectors, voltage levels, signal timing, and data rates.
3. Transmission Medium
o Supports various media like copper wires, fiber optics, wireless signals, etc.
4. Topology and Network Design
o Supports physical layout like bus, star, ring topologies.
5. Synchronization of Bits
o Ensures sender and receiver are synchronized to properly interpret bits.
• The Physical Layer is responsible for transmitting raw bits (0s and 1s) over the physical
medium (like cables or fiber).
• Ethernet defines the physical standards for cables, connectors, voltage levels, and signaling
methods.
The Data Link Layer is the second layer of the OSI model. It is responsible for node to node delivery of
data or we can say that hope to hope delivery of data . This means it ensures data is reliably
transferred between two directly connected devices (or nodes) on the same network segment.
Main Purposes:
1. Framing
o Divides the stream of bits into manageable units called frames.
2. Error Detection & Correction
o Detects errors that may occur in the Physical Layer and may request retransmission.
3. Flow Control
o Manages the rate of data transmission between sender and receiver to avoid
congestion.
4. MAC Addressing
o Uses MAC (Media Access Control) addresses to identify devices on a local network.
5. Media Access Control (MAC)
o Determines how devices share the communication channel (important in shared
networks like Ethernet).
What is Framing?
Framing is the process of dividing raw data bits from the network layer into manageable units called
frames before transmission over the physical medium.
2. Variable size: In this, there is a need to define the end of the frame as well as the beginning of the
next frame to distinguish.
2 . Bit stuffing: Bit stuffing is a technique used to prevent data from being interpreted as control
characters by inserting extra bits into the data stream.
Simple Example:
Flag: 01111110
Switching is the process of directing data packets between devices in a network. It decides the best
path for data to travel from the source to the destination.
Types of Switching:
1. Circuit Switching
o A dedicated communication path is established between sender and receiver for the
entire duration of the communication.
o Example: Traditional telephone networks.
2. Packet Switching
o Data is broken into small packets. Each packet is sent independently and may take
different routes to reach the destination.
o Example: The internet.
3. Message Switching
o Entire messages are sent to the next switch and stored until the next path is free (store-
and-forward).
o Example: Early email systems.
• Ethernet operates mainly at the Data Link Layer (Layer 2) of the OSI model.
• It defines how devices format data into frames and control access to the physical medium.
• Ethernet frames include important fields like:
o Destination MAC address
o Source MAC address
o Type/Length
o Data payload
o Frame Check Sequence (FCS) for error detection
o
What is MAC?
MAC (Media Access Control) is a way to manage how devices share a communication channel
(like a network cable or wireless frequency). It decides who talks when so data doesn’t get mixed up.
1. Aloha
2. Slotted Aloha
• Flow Control is a way to manage the speed of data transmission between a sender and a
receiver.
• It ensures the sender doesn’t send data faster than the receiver can handle.
• Prevents data loss caused by receiver’s buffer overflow.
Stop-and-Wait
Go Back N
• It’s a flow control and error control method used in data communication.
• The sender can send multiple frames (up to a window size) without waiting for ACKs for each
one.
• If an error or lost frame is detected, the sender goes back and resends that frame and all the
frames sent after it.
Selective Repeat
1. Parity Check:
o Adds a single bit (parity bit) to make the number of 1’s either even or odd.
o If parity doesn’t match on the receiver side, an error is detected.
2. Checksum:
o Adds up data chunks and sends the sum with the data.
o Receiver calculates sum again and compares to detect errors.
3. CRC (Cyclic Redundancy Check):
o Uses polynomial division to create a checksum for detecting errors with high accuracy.
3. Network Layer
The Network Layer is the part of a computer network that decides how data travels from one
computer to another, even if they are on different networks.
It gives each device an IP address, chooses the best path for the data, and helps it reach the right
destination.
Core Functions
1. Logical Addressing
o Assigns addresses (usually IP addresses) so that each device can be uniquely identified
across a network.
2. Routing
o Determines optimal path for data to travel from source to destination.
o Uses routing tables and protocols like RIP, OSPF, BGP.
3. Fragmentation and Reassembly
o Breaks down large packets into smaller fragments suitable for transmission and
reassembles them at the destination.
4. Packet Forwarding
o Forwards packets from one network to another based on destination IP address
Key Protocols
IP Protocol : The Internet Protocol (IP) is a set of rules that computers use to send data to each other
across the internet or any network. It gives every device an address (called an IP address) so the data
knows where to go.
IP Address : IP Address stands for internet Protocol is a unique identifier assigned to each device
connected to network that use ip for communication . It allows to locate and communicate with each
other on network either local or global .
Types of IP Address
• It it composed of four group of number , each ranging from 0 to 255 , separated by period(.)
• It is of 32 bits
• Can support about 4.3 billion unique addresses.
• This is much long , consisting 8 group of four hexadecimal digit sepreated by colns(:)
• It is of 128 bits
• Can support 340 undecillion addresses (that’s 340 followed by 36 zeros!)
1. Public IP Address : A Public IP address is assigned by your Internet Service Provider (ISP) and is
visible on the internet.
2. Private IP Address : A Private IP address is used inside a home or office network. It’s not visible on
the internet.
3. Static IP Address : A Static IP does not change. It is manually set or permanently assigned.
4. Dynamic IP Address : A Dynamic IP is automatically assigned by a DHCP server (like your router)
and can change over time.
Classes of IP Address
IP addresses are divided into different classes (A, B, C, D, E) based on the range of their first octet.
Each class serves different purposes in networks.
Classless addressing is a method of allocating IP addresses and routing IP packets without being
restricted by the traditional class-based system (Class A, B, C). It was introduced to improve the
efficiency of IP address allocation and to slow the exhaustion of IPv4 addresses.
Key points:
1. Flexible IP Allocation: Instead of fixed subnet masks defined by classes (like 255.0.0.0 for
Class A), CIDR allows variable-length subnet masks (VLSM). This means networks can be
divided into smaller or larger blocks depending on need.
2. Notation: CIDR uses a format like 192.168.10.0/22, where /22 indicates the number of bits
used for the network portion of the address. This allows precise control over how many IP
addresses are included in the subnet.
3. Efficient Use of IPs: By allowing subnets of any size, CIDR reduces waste of IP addresses that
happened in the classful system where networks often had too many or too few addresses.
4. Routing Simplification: CIDR enables route aggregation (supernetting), where multiple IP
ranges can be summarized into a single routing table entry, reducing the size of routing tables
and improving routing efficiency.
5. Widely Used: CIDR is now the standard for IPv4 addressing on the internet, replacing classful
addressing completely.
ARP is a protocol used to find the MAC address of a device when you already know its IP address.
RARP is a network protocol used to find the IP address of a device when its MAC (hardware) address
is already known. It is essentially the reverse of ARP.
ICMP is a network layer protocol used by network devices, like routers and hosts, to send error
messages and operational information indicating success or failure in communication. ICMP helps in
diagnosing network communication problems and reporting errors such as unreachable destinations,
packet loss, or time exceeded.
IGMP is a communication protocol used by IPv4 hosts and adjacent routers to manage membership
of multicast groups on a local network.
What is Routing?
Routing is the method used to determine how data packets travel from the source device to the
destination device across a network.
Types of Routing:
Type Description
Static Routing Manually configured routes; good for small, simple networks.
Dynamic Routing Routes are automatically updated based on network changes using protocols.
Default Routing A path used when no specific route is found in the routing table.
RIP is one of the oldest dynamic routing protocols used in computer networks to help routers
exchange routing information.
4 . Transport Layer
The Transport Layer is responsible for end-to-end communication and data transfer between host
systems. It ensures that data is delivered reliably, in order, and without errors.
Function Description
Segmentation & Breaks large data into smaller segments at sender; reassembles them
Reassembly at receiver.
End-to-End
Ensures complete data transfer from source to destination.
Communication
Error Detection &
Identifies and corrects transmission errors.
Correction
Flow Control Prevents sender from overwhelming the receiver with too much data.
Congestion Control Helps avoid network overload by adjusting the data flow rate.
Multiplexing Allows multiple applications to use the network simultaneously.
Segmentation is the process of breaking down large chunks of application data into smaller,
manageable pieces called segments before transmission over a network.
TCP is a connection-oriented protocol used at the Transport Layer of the OSI and TCP/IP models. It
provides reliable, ordered, and error-checked delivery of data between applications.
Feature Description
Connection-Oriented Establishes a connection (3-way handshake) before data transfer begins.
Reliable Delivery Guarantees that data arrives without errors and in the correct order.
Error Detection Uses checksums to detect errors in data.
Flow Control Uses window size to avoid overwhelming the receiver.
Congestion Control Prevents network congestion using algorithms like slow start.
Sequencing Each segment has a sequence number to ensure correct ordering.
Acknowledgment (ACK) Receiver confirms successful receipt of data.
UDP is a connectionless, lightweight transport layer protocol. It is designed for fast data
transmission with low overhead, but it does not guarantee delivery, order, or error correction.
Key Features of UDP:
Feature Description
Connectionless No connection setup; sends data without handshakes.
Unreliable Delivery Data may be lost or arrive out of order.
No Acknowledgment Receiver doesn’t send an ACK back to the sender.
No Flow Control Can cause data overflow if receiver can't handle the speed.
Low Overhead Faster than TCP, ideal for time-sensitive applications.
Multiplexing is the process of combining multiple data streams from different applications or
sources into a single stream to be sent over a network.
Demultiplexing is the process of separating a single incoming stream into multiple streams and
delivering each to the correct application.
5. Session Layer
The Session Layer is responsible for establishing, managing, and terminating sessions between two
communicating devices or applications. It ensures that communication is properly organized and
synchronized.
Function Description
Session
Initiates a communication session between devices.
Establishment
Session Maintenance Keeps the session active during data transfer.
Session Termination Closes the session when communication ends.
Inserts checkpoints (sync points) in data streams to resume from there in
Synchronization
case of failure.
Function Description
Dialog Control Manages which side communicates at what time (half-duplex or full-duplex).
6. Presentation Layer
The Presentation Layer is like the translator and formatter of the OSI model. Its main job is to ensure
that data sent from one system can be understood by another — regardless of differences in data
formats, encoding, or encryption.
Function Description
Translation Converts data between different formats (e.g., EBCDIC ↔ ASCII).
Secures data before transmission and decrypts it at the receiver's
Encryption/Decryption
end.
Reduces data size for faster transmission and restores it on the
Compression/Decompression
other side.
Ensures data is in a readable and usable format (e.g., JPEG, MP4,
Data Formatting
PDF).
Technology Role
SSL/TLS Encrypts/decrypts web traffic (used in HTTPS)
JPEG, MP3, MP4 Format multimedia data for transmission
GIF, PNG Image formatting
ASCII, EBCDIC Text encoding formats
MIME Used for formatting email data
7. Application layer
The Application Layer is the topmost layer of the OSI model. It directly interacts with the end-user
and provides network services to applications (like web browsers, email clients, etc.).
Function Description
User Interface Access Enables user interaction with network services (e.g., via browser or app).
Network Services Provides services such as email, file transfer, remote access, etc.
Resource Sharing Supports data exchange, printing, file sharing over a network.
Data Presentation Sends requests down the OSI stack for formatting, encryption, etc.
Term Meaning
One-to-one communication where data is sent from a
Unicast
single sender to a single receiver.
One-to-many communication where data is sent from
Multicast one sender to multiple receivers who have joined a
specific multicast group.
One-to-all communication where data is sent from
Broadcast
one sender to all devices in a network segment.
A set of hosts that are interested in receiving a
Multicast Group particular multicast transmission. Hosts explicitly
join this group.
A logical division of a network where any broadcast
Broadcast Domain
sent is received by all devices in that segment.
A unique numerical identifier assigned to each device
IP Address
on a network.
The special IP address used to send a packet to all
Broadcast Address devices in the broadcast domain (e.g.,
255.255.255.255 in IPv4).
Protocol Use Case
A special IP address (in IPv4, from 224.0.0.0 to
Multicast Address
239.255.255.255) used to identify multicast groups.
A portion of a network where devices can directly
Network Segment
communicate at the data link layer without a router.
Packet A formatted unit of data carried by a network.
The process of selecting paths in a network along
Routing
which to send network traffic.
IGMP (Internet Group Protocol used by hosts and adjacent routers to
Management Protocol) establish multicast group memberships.