0% found this document useful (0 votes)
74 views56 pages

Computer Network Paid

The document provides a comprehensive overview of computer networks, including definitions, types, components, and features. It explains various network architectures such as Peer-to-Peer and Client/Server, along with different network types like LAN, WAN, and VPN. Additionally, it covers network topologies, transmission modes, and the roles of various network devices.

Uploaded by

harshdeepg12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views56 pages

Computer Network Paid

The document provides a comprehensive overview of computer networks, including definitions, types, components, and features. It explains various network architectures such as Peer-to-Peer and Client/Server, along with different network types like LAN, WAN, and VPN. Additionally, it covers network topologies, transmission modes, and the roles of various network devices.

Uploaded by

harshdeepg12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

SLASHBYTE

COMPUTER
NETWORK
Slashbyte: Your guide to mastering
IT concepts and exam strategies.

Prepared By:
SLASHBYTE

@slashbytessc
www.slashbyte.xyz
Computer Network Paid Notes
What is a Computer Network?
Computer Network is a group of computers connected with each other through wires,
optical fibres or optical links so that various devices can interact with each other through
a network.
1️⃣ Resource Sharing – Allows multiple devices to share hardware (printers, storage),
software, and internet connections efficiently.
2️⃣ Communication & Collaboration – Enables data exchange and seamless
interaction between users through emails, messaging, and video conferencing.
3️⃣ Types of Networks – Includes LAN (Local Area Network), WAN (Wide Area
Network), MAN (Metropolitan Area Network), and PAN (Personal Area Network), each
serving different scales.
4️⃣ Network Components – Consists of devices like routers, switches, hubs, and
protocols such as TCP/IP that facilitate communication.
5️⃣ Security & Reliability – Involves firewalls, encryption, and authentication
mechanisms to protect data and ensure safe, uninterrupted connectivity.
Component Function/Details Types/Features

NIC (Network Allows communication - Wireless NIC: Uses


Interface Card) between computers on a antennas and radio waves
network. (common in laptops).
[Hardware-
Installed inside Wired NIC: Uses cables for
system] data transfer.

Hub Distributes network requests - Centralized but inefficient as


to all connected devices. it broadcasts data to all
devices.

Switch Directs data from the source - Efficient as it minimizes


to the intended device without unnecessary data traffic.
broadcasting.
[Active Hub, Passive Hub,
Intelligent Hub]
Cables and Transmit communication - Twisted Pair Cable: High-
Connectors signals. speed (1Gbps+).

Coaxial Cable: Resembles TV


cables, faster but costlier.

Fibre Optic Cable: Uses light


for fastest transmission,
expensive.

Router Connects LAN to the internet - Allows multiple devices to


and links distinct networks. share one internet connection.

Modem Connects computers to the - Separate device connected


[Modulator- internet using telephone lines. via PC slot, not integrated with
Demodulator] the motherboard.

Comparison between Router, Switch,


Bridge, and Hub:

Device Function Layer Data Example


Handling

Router Routes data Layer 3 Uses IP Connects a local


between (Network) addresses network to the internet
different
networks

Switch Connects Layer 2 (Data Uses MAC Connecting devices


devices within Link) addresses like computers and
a network printers in a LAN

Bridge Connects two Layer 2 (Data Filters traffic Connecting two LANs
networks, Link) based on to reduce network
reduces MAC traffic
collisions

Hub Broadcasts Layer 1 Sends data Older networks,


data to all (Physical) to all ports connects multiple
devices in a [uses MAC devices in a small
network network

Gateway Translates All Layers Translates Connecting different


between (Application between network types or
different to Physical) protocols different network
protocols architectures (e.g.,
connecting a local
network to a different
protocol-based
network like the
internet)

Modem Modulates and Layer 1 Converts Connecting to the


demodulates (Physical) digital data internet via telephone
data over to analog lines or cable systems
telephone lines and vice
versa

Firewall Protects Layer 3 Filters traffic Network security


networks from (Network) based on IP device used in
unauthorized addresses organizations or
access and ports homes

Repeater Amplifies or Layer 1 Amplifies Extending signal


regenerates (Physical) signals to range in large
signals extend the networks (e.g., Wi-Fi
reach repeaters)

Proxy Acts as an Layer 7 Processes Web proxies for


Server intermediary for (Application) requests on controlling and
requests behalf of monitoring internet
clients traffic

Features Of Computer network


Computer Network Architecture:
1️⃣ Peer-to-Peer (P2P) Network ✅
A Peer-to-Peer (P2P) network is a decentralized network where each computer (node) acts
as both a client and a server, sharing resources and responsibilities equally.

🔹 Key Features:
✔ No central server – all devices are independent and connected directly.

✔ Each device (peer) can request and provide services.

✔ Used in file sharing, small office setups, and home networks.

✔ Easier to set up but may lack centralized security and control.

✔ Example: Torrent file-sharing networks.

🔹 Advantages:
✔ Cost-effective, as no dedicated server is required.

✔ Easy to configure and expand.

✔ No network downtime if one device fails.


🔹 Disadvantages:
❌ Less secure, as there is no centralized control.
❌ Difficult to manage in large networks.
❌ Slower performance for high-traffic data sharing.

2️⃣ Client/Server Network ✅


A Client/Server network is a centralized network where one powerful computer (Server)
manages resources and services, while other computers (Clients) request access to those
resources.

🔹 Key Features:
✔ A dedicated server manages and controls data, applications, and security.

✔ Clients (users) request services such as file access, printing, or database queries.

✔ Used in businesses, data centers, and online services (e.g., websites, banking apps).

✔ Ensures better security, performance, and scalability.

🔹 Advantages:
✔ Centralized control enhances security and data management.

✔ High-speed performance due to efficient resource allocation.

✔ Easy to back up and recover data.

🔹 Disadvantages:
❌ More expensive to set up (requires a dedicated server).
❌ If the server fails, the entire network may be affected.
❌ Requires skilled administration and maintenance.

Comparison Table

Feature Peer-to-Peer (P2P) Network Client/Server Network


Control Decentralized Centralized

Server Role No dedicated server Dedicated server

Security Less secure More secure

Scalability Suitable for small networks Easily scalable for large networks

Cost Low-cost setup High initial investment

Performance Slower for large data transfers Faster and optimized

Types of networks:

1️⃣ Local Area Network (LAN) ✅


A Local Area Network (LAN) is a network that connects computers and devices within a
small geographic area such as a home, office, or school.

🔹 Key Features:
✔ Covers a small area (up to a few kilometers).

✔ High-speed data transfer (up to 1 Gbps or more).

✔ Uses Ethernet cables, Wi-Fi, and switches for connectivity.

✔ Secure and private network with low latency.

✔ Example: Office networks, home Wi-Fi, school labs.

🔹 Advantages:
✔ Fast data transmission.

✔ Secure and easy to maintain.

✔ Cost-effective as fewer devices are required.

🔹 Disadvantages:
❌ Limited to a small area.
❌ Maintenance may require IT expertise.
2️⃣ Metropolitan Area Network (MAN) ✅
A Metropolitan Area Network (MAN) connects multiple LANs within a city or large
campus, allowing communication between different buildings.

🔹 Key Features:
✔ Covers a larger area than LAN (up to 50 km).

✔ Connects multiple LANs in a city, town, or university campus.

✔ Uses high-speed fiber optics and wireless links.

✔ Example: Cable TV networks, city-wide Wi-Fi.

🔹 Advantages:
✔ High-speed communication between distant locations.

✔ Allows seamless connection of multiple LANs.

✔ Can be managed by a single entity (e.g., an ISP or government).

🔹 Disadvantages:
❌ More expensive than LAN.
❌ Requires professional maintenance.

3️⃣ Wide Area Network (WAN) ✅


A Wide Area Network (WAN) covers a large geographic area, such as a country or
continent.

🔹 Key Features:
✔ Covers thousands of kilometers (country or worldwide).

✔ Connects multiple LANs and MANs.

✔ Uses fiber optics, satellites, and leased telecommunication lines.

✔ Example: The Internet, banking networks, multinational corporate networks.

🔹 Advantages:
✔ Enables global connectivity.
✔ Supports large-scale communication.

✔ Essential for cloud computing and remote access.

🔹 Disadvantages:
❌ Expensive setup and maintenance.
❌ Higher security risks due to public access.
❌ Slower speeds compared to LAN and MAN.

4️⃣ Personal Area Network (PAN) ✅


A Personal Area Network (PAN) connects devices in an individual's personal space.

🔹 Key Features:
✔ Covers a few meters (typically within a room).

✔ Uses Bluetooth, NFC, USB, and Wi-Fi.

✔ Example: Wireless headphones, smartwatches, smartphone hotspot, fitness


trackers.

🔹 Advantages:
✔ Convenient for personal use.

✔ Wireless and easy to set up.

🔹 Disadvantages:
❌ Limited range and speed.
❌ Less secure if not properly configured.

5️⃣ Campus Area Network (CAN) ✅


A Campus Area Network (CAN) is a network covering a university, business campus, or
military base.

🔹 Key Features:
✔ Covers multiple buildings in a specific location (up to 10 km).
✔ Uses fiber optics, Wi-Fi, and Ethernet.

✔ Example: University campus networks, military bases, business campuses.

🔹 Advantages:
✔ Faster than MAN.

✔ Controlled access for security.

🔹 Disadvantages:
❌ Expensive to install and maintain.
❌ Limited to a specific area.

6️⃣ Virtual Private Network (VPN) ✅


A Virtual Private Network (VPN) is a secure network that encrypts data over the Internet.

🔹 Key Features:
✔ Uses encryption for secure communication.

✔ Allows remote access to private networks.

✔ Example: Secure work-from-home connections, anonymous browsing.

🔹 Advantages:
✔ Protects data privacy.

✔ Enables secure access to corporate resources.

🔹 Disadvantages:
❌ Slower speeds due to encryption.
❌ Some VPNs require paid subscriptions.

Comparison Table of Network Types ✅

Network Type Coverage Area Speed Usage Examples


LAN (Local Small (up to a few km) High (1 Offices, Office
Area Network) Gbps or Homes, Ethernet,
more) Schools Wi-Fi

MAN Medium (up to 50 km) Moderate City-wide Cable TV,


(Metropolitan to High networks Public Wi-Fi
Area Network)

WAN (Wide Large (Country/Global) Low to Internet, Internet,


Area Network) Moderate Cloud Banking
Computing Networks

PAN Very Small (few Low Personal Bluetooth,


(Personal meters) Devices NFC
Area Network)

CAN Medium High Universities, University


(Campus Area (University/Campus) Military, Wi-Fi
Network) Corporate

VPN (Virtual Secure Internet Moderate Secure Work-from-


Private Network Remote home,
Network) Access Secure
Browsing

SAN (Storage high-speed data High Data storage Data


Area transfer between and centers,
Network) storage devices and management cloud
servers. storage
networks

What is Network Topology?


Topology defines the structure of the network of how all the components are interconnected
to each other. There are two types of topology: physical and logical topology.
Types of Network Topology

Topology Description Advantages Disadvantages Calculation

Ring Each device - Data - If one device - Number of devices:


is connected travels in a fails, the whole N
to two other single network is
devices, direction, affected. - Bandwidth is
forming a reducing shared, so total
circular path traffic. - Difficult to add bandwidth =
for data. new devices. bandwidth per link ×
- Simple N.
setup.

Mesh Every device - High fault - Expensive and - Total


is connected tolerance complex to wire. links:N(N−1)/2where
to every N is the number of
other device, - Redundant - Difficult to devices.
creating a paths ensure manage with
fully reliability. many devices.
connected
network.

Bus All devices - Simple and - If the bus fails, - Bandwidth: shared
are easy to the whole by all devices.- Cable
connected to implement. network is length determines
a single down. max number of
central cable - Cost- devices.
(the bus). effective. - Performance
degrades with
more devices.

Star All devices - Easy to - Hub failure - Total cables: N


are install and causes network where N is the
connected to manage. failure. number of devices.
a central hub
or switch. - If one - More cables - Central hub/switch
device fails, required. required.
it doesn’t
affect others.

Tree A hybrid of - Scalable - More cable - Total nodes: Sum of


star and bus required. all sub-nodes.
topologies, -
combining Hierarchical, - If a backbone - Total links:
multiple star easy to fails, it can
networks. manage. affect multiple N+(N−1)
devices.

Hybrid Combines - Flexibility - Complex to - Depends on the


two or more and design and combination of
topologies to scalability. manage. topologies used.
fit specific
needs. - Can be - Expensive to
designed to implement.
suit large
networks.

Star Topology ⭐ (Most Common in Banks)


🔹 How It Works:
A central server (hub or switch) connects all branch computers, ATMs, and banking
systems.
Each device communicates through the central node.

🔹 Why Banks Use It:


✔ Reliability – If one branch/ATM fails, others remain unaffected.

✔ Security – Centralized monitoring and control of banking transactions.

✔ Scalability – Easy to add new branches, ATMs, and services.

✔ Fast Performance – High-speed transactions and real-time processing.

🔹 Example Usage in Banking:


Core Banking System (CBS) – Branches connect to a central database.
ATM Networks – ATMs communicate with central servers.
Customer Service Systems – Banking applications and teller systems.

🔹 Disadvantages:
❌ If the central server fails, the entire network goes down.
❌ Requires high bandwidth and maintenance.

Transmission modes
The way in which data is transmitted from one device to another device is known
as transmission mode.
The transmission mode is also known as the communication mode.
Each communication channel has a direction associated with it, and transmission media
provide the direction. Therefore, the transmission mode is also known as a directional
mode.
The transmission mode is defined in the physical layer.

The Transmission mode is divided into three categories:

Types of Transmission Modes ✅


Transmission modes define how data flows between devices in a network. There are three
main types: Simplex, Half-Duplex, and Full-Duplex.

1️⃣ Simplex Mode 🔹 (One-Way Communication)


Data flows in only one direction.
The sender can only transmit, and the receiver can only receive.
The receiver cannot send data back to the sender.

🔹 Example Usage:
✔ Radio Broadcasting – Radio stations send signals; listeners can’t reply.

✔ Television Broadcast – TV channels send video/audio signals; users only receive.

✔ Keyboard to Monitor – Keyboard sends input, but the monitor doesn’t send data back.

🔹 Advantages:
✔ Simple and cost-effective.

✔ Efficient for one-way data flow applications.

🔹 Disadvantages:
❌ No feedback or acknowledgment.
❌ No two-way communication.

2️⃣ Half-Duplex Mode 🔄 (Two-Way, But One at a Time)


Data flows in both directions, but one device sends at a time.
The sender must wait for the receiver to finish before replying.

🔹 Example Usage:
✔ Walkie-Talkies – One person speaks, the other listens, then switches.

✔ Traditional Ethernet Networks – Data can go in both directions but not simultaneously.

✔ Shared Communication Channels – Used in some banking systems.

🔹 Advantages:
✔ Supports two-way communication.

✔ Less bandwidth usage than full-duplex.

🔹 Disadvantages:
❌ Slower communication due to turn-taking.
❌ Collisions possible if two devices try to send data at the same time.

3️⃣ Full-Duplex Mode 🔁 (Two-Way Simultaneous


Communication)
Data flows in both directions at the same time.
No waiting required for response.

🔹 Example Usage:
✔ Telephone Calls – Both people can speak and listen at the same time.

✔ Modern Ethernet Networks (Switch-Based LANs) – Supports fast two-way data flow.

✔ Banking Transactions – Real-time processing of debit/credit transactions.

🔹 Advantages:
✔ Fastest communication with no waiting.

✔ No collisions, as both can send/receive simultaneously.

🔹 Disadvantages:
❌ Requires more bandwidth.
❌ Expensive network infrastructure needed.

Comparison Table ✅

Transmission Direction Example Speed Communication Cost


Mode Type

Simplex One-way TV, Radio Fast Only sender to Low


receiver

Half-Duplex Two-way (one Walkie- Medium Alternating Medium


at a time) Talkie, Old communication
Ethernet

Full-Duplex Two-way Telephone, Fastest Instant High


(simultaneous) Modern communication
Ethernet

OSI Model
Open System Interconnection (OSI) Model ✅
What is the OSI Model?
The OSI Model (Open Systems Interconnection Model) is a conceptual framework that
describes how data moves from one device to another in a network. It consists of seven
layers, each with specific functions to ensure smooth communication between computers.

🔹 Developed by ISO (International Organization for Standardization).


🔹 Helps standardize networking functions across different systems and technologies.
🔹 Each layer performs a distinct role and interacts with the layers above and below it.

🔹 OSI Model: 7 Layers and Functions

Layer Layer Name Function Example


No.

7 Application User interface, network services Web browsers,


Layer Email, FTP

6 Presentation Data encryption, compression, SSL/TLS, JPEG,


Layer format conversion MP3

5 Session Layer Establishing, maintaining, and NetBIOS, RPC


terminating communication sessions

4 Transport Reliable data transfer, error TCP, UDP


Layer correction, segmentation

3 Network Layer Routing, logical addressing (IP) IP, ICMP,


Routers
2 Data Link Physical addressing (MAC), error Ethernet,
Layer detection Switches

1 Physical Layer Data transmission over cables, Cables, Wi-Fi,


signals Bluetooth

1️⃣ Physical Layer (Layer 1) 📡


✔ The lowest layer of the OSI model.

✔ Responsible for the physical connection between devices.

✔ Transmits raw binary data (0s and 1s) over a medium (cables, radio waves).

✔ Defines cable types, voltages, signal modulation, and transmission rates.

🔹 Examples:
Ethernet cables (Cat5, Cat6)
Fiber optics
Wireless signals (Wi-Fi, Bluetooth)
USB, RS-232

🔹 Key Functions:
✔ Bit-by-bit data transmission.

✔ Defines hardware connections (pins, voltages).

✔ Manages signal encoding.

❌ Does NOT handle data interpretation or error correction.

2️⃣ Data Link Layer (Layer 2) 🔄


✔ Responsible for node-to-node communication.

✔ Divided into two sub-layers:

MAC (Media Access Control): Defines how devices access the network.
LLC (Logical Link Control): Handles error detection and flow control.
✔ Uses MAC addresses for device identification.
✔ Corrects errors that occur at the Physical Layer.

🔹 Examples:
Ethernet (IEEE 802.3)
Wi-Fi (IEEE 802.11)
MAC Addressing
Switches & Bridges

🔹 Key Functions:
✔ Assigns MAC addresses to devices.

✔ Detects and corrects frame errors.

✔ Controls access to the network medium.

3️⃣ Network Layer (Layer 3) 🌍


✔ Routes data between different networks using IP addressing.

✔ Uses logical addressing (IP addresses) to uniquely identify devices.

✔ Determines the best path for data packets.

✔ Works with routers to direct traffic.

🔹 Examples:
Internet Protocol (IP, IPv4, IPv6)
ICMP (Ping requests, error messages)
Routers
ARP (Address Resolution Protocol)

🔹 Key Functions:
✔ Assigns IP addresses to devices.

✔ Uses routing algorithms for data forwarding.

✔ Ensures packets reach the correct destination.

❌ Does NOT handle actual data transmission—only logical routing.

4️⃣ Transport Layer (Layer 4) 🚚


✔ Ensures reliable data transfer between systems.
✔ Handles error correction, segmentation, and reassembly.

✔ Uses port numbers to direct data to correct applications.

✔ Works with TCP (reliable) and UDP (fast, but unreliable).

🔹 Examples:
TCP (Transmission Control Protocol)
UDP (User Datagram Protocol)
Ports (e.g., HTTP = 80, HTTPS = 443, FTP = 21)

🔹 Key Functions:
✔ Ensures error-free data transfer.

✔ Segments and reassembles messages.

✔ Uses flow control to prevent data overload.

❌ Does NOT define how data is presented—only ensures delivery.

5️⃣ Session Layer (Layer 5) 🔄


✔ Manages sessions (connections) between applications.

✔ Establishes, maintains, and terminates communication sessions.

✔ Syncs data exchange between applications.

🔹 Examples:
NetBIOS (Network Basic Input Output System)
Remote Procedure Call (RPC)
SQL Database Connections

🔹 Key Functions:
✔ Initiates and manages communication sessions.

✔ Synchronizes data streams.

✔ Handles session recovery after failure.

❌ Does NOT handle physical transmission—only manages connections.


6️⃣ Presentation Layer (Layer 6) 🎭
✔ Converts data into a format readable by applications.

✔ Performs encryption, decryption, and compression.

✔ Ensures compatibility between different file formats and character sets.

🔹 Examples:

SSL/TLS (Secure encryption for HTTPS sites)


JPEG, MP3, GIF (File formats)
ASCII, Unicode (Text formats)

🔹 Key Functions:
✔ Translates data formats between devices.

✔ Encrypts and decrypts sensitive information.

✔ Compresses files for efficient transmission.

❌ Does NOT manage sessions or routing—only data formatting.

7️⃣ Application Layer (Layer 7) 🌐


✔ Provides direct user interaction with network services.

✔ Handles file transfers, email, web browsing, and messaging.

✔ Uses protocols like HTTP, FTP, and SMTP to deliver data.

🔹 Examples:
Web Browsers (Chrome, Firefox, Edge) → HTTP/HTTPS
Email Services (Gmail, Outlook) → SMTP, IMAP, POP3
File Transfers (FTP Clients)

🔹 Key Functions:
✔ Provides network services to applications.

✔ Handles file sharing, messaging, and browsing.

✔ Ensures user authentication and access control.

❌ Does NOT deal with routing or addressing—only application-related tasks.


Layer Layer Function Key Protocols/Devices
Number

Application 7 Provides network services HTTP, HTTPS, FTP, SMTP,


directly to user applications POP3, IMAP, DNS, Telnet,
(e.g., browsers, email). SNMP

Presentation 6 Translates data between SSL/TLS, JPEG, MPEG,


the application layer and ASCII, EBCDIC
the network format;
handles encryption and
compression.

Session 5 Manages sessions or NetBIOS, RPC, PPTP


connections between
applications (e.g.,
maintaining a session in a
web browser).

Transport 4 Ensures reliable TCP, UDP


transmission of data, error
checking, and flow control.

Network 3 Manages routing, IP, ICMP, ARP, RIP, OSPF,


addressing, and packet BGP
forwarding between
devices on different
networks.

Data Link 2 Provides reliable data Ethernet, PPP, Frame


transfer over the physical Relay, ATM, MAC Address,
layer; manages MAC VLAN
addresses and frames.

Physical 1 Handles the physical Cables (Ethernet, Fiber),


transmission of raw bits Hubs, Repeaters, Physical
over a medium (cables, Ports, Wireless Signals
wireless signals, etc.).

Key Points:
1. Layers 7-5: Focus on software/application-level functions.
2. Layer 4: Bridges software and network communication.
3. Layers 3-1: Deal with data transmission and networking.

Fun Trick to Remember OSI Model Layers 🚀🎯


👉 "Pyar Do Nhi To Suicide Pe Aunga" 😍💔

Letter Meaning OSI Layer Function

P - Pyar Physical 📡 Physical Transmits raw data via cables, Wi-Fi,


Layer etc.

D - Do Data Link 🔄 Data Link Uses MAC addresses, detects errors,


Layer and ensures smooth data transfer.

N - Nhi Network 🌍 Network Routes data using IP addresses,


Layer manages traffic via routers.

T - To Transport 🚚 Transport Ensures reliable delivery using


Layer TCP/UDP, error correction.

S- Session 🔄 Session Manages communication sessions


Suicide Layer (start, maintain, close).

P - Pe Presentation 🎭 Presentation Encrypts, compresses, and converts


Layer data formats.

A- Application 🌐 Application User interaction layer (Web, Email,


Aunga Layer FTP, etc.).

TCP/IP model
The TCP/IP model was developed prior to the OSI model.
The TCP/IP model is not exactly similar to the OSI model.
The TCP/IP model consists of five layers: the application layer, transport layer, network
layer, data link layer and physical layer.

Layer Layer Equivalent Functions Key


(TCP/IP) Number OSI Layers Protocols/Technologies

Application 5 Application, Handles high- HTTP, HTTPS, FTP,


Presentation, level protocols, SMTP, IMAP, POP3,
Session user interfaces, DNS, Telnet, SNMP
and data
encoding.

Transport 4 Transport Provides end- TCP, UDP


to-end
communication,
reliability, error
detection, and
flow control.

Network 3 Network Handles logical IP, ICMP, ARP, RIP,


(Internet) addressing, OSPF, BGP
routing, and
packet
forwarding
between
networks.

Data Link 2 Data Link Manages Ethernet, Wi-Fi, PPP,


physical Frame Relay, MAC
addressing Address, ARP
(MAC),
framing, and
error detection
at the link level.

Physical 1 Physical Manages the Ethernet cables, fiber


physical optics, wireless signals,
hardware and hubs, repeaters
transmission of
raw data over
the network
medium.

TCP vs UDP
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the two
main transport layer protocols used for data transmission over networks. Each has its own
strengths and is used in different applications depending on speed, reliability, and
efficiency requirements.

1️⃣ Transmission Control Protocol (TCP) 🚀


✔ TCP is a connection-oriented protocol that ensures reliable data transmission.

✔ It establishes a connection between sender and receiver before sending data.

✔ TCP ensures error checking, retransmission, and proper sequencing of data packets.

🔹 Key Features of TCP:


✔ Reliable communication – Ensures data is received correctly.
✔ Connection-oriented – A three-way handshake (SYN, SYN-ACK, ACK) is used before
data transmission.

✔ Error detection and correction – If a packet is lost, TCP retransmits it.

✔ Ordered delivery – Packets arrive in the correct sequence.

✔ Flow and congestion control – Prevents network overload.

🔹 Example Uses of TCP:


✔ Web Browsing (HTTP/HTTPS) – Ensures complete webpage loading.

✔ Email (SMTP, IMAP, POP3) – No loss of email content.

✔ File Transfer (FTP) – Ensures correct file integrity.

✔ Remote Login (SSH, Telnet) – Needs reliable data delivery.

🔹 TCP Header Format:

Field Size Description


(bits)

Source Port 16 Identifies the sender's port number.

Destination Port 16 Identifies the receiver's port number.

Sequence Number 32 Helps maintain the order of packets.

Acknowledgment 32 Confirms received packets.


Number

Flags (Control Bits) 6 Includes SYN, ACK, FIN for connection


control.

Checksum 16 Used for error detection.

2️⃣ User Datagram Protocol (UDP) ⚡


✔ UDP is a connectionless, fast, and lightweight protocol used where speed is more
important than reliability.

✔ Unlike TCP, UDP does not establish a connection before sending data.

✔ No retransmission or error correction – If a packet is lost, UDP does not resend it.
🔹 Key Features of UDP:
✔ Faster than TCP – No connection setup or acknowledgments.

✔ Connectionless communication – Data is sent without verifying if the receiver is ready.

✔ No ordering or retransmission – Data may arrive out of order or get lost.

✔ Best-effort delivery – Suitable for real-time applications.

🔹 Example Uses of UDP:


✔ Live Streaming (YouTube, Netflix, VoIP, Zoom) – Slight packet loss doesn’t affect
quality.

✔ Online Gaming – High speed is needed, slight data loss is acceptable.

✔ DNS (Domain Name System) – Quick, one-time request-response communication.

✔ IoT & Sensor Networks – Devices transmit small, real-time data packets.

🔹 UDP Header Format:

Field Size (bits) Description

Source Port 16 Identifies the sender's port number.

Destination Port 16 Identifies the receiver's port number.

Length 16 Specifies the length of the datagram.

Checksum 16 Used for error detection.

Comparison Table: TCP vs UDP ✅

Feature TCP (Transmission Control UDP (User Datagram


Protocol) Protocol)

Type of Connection-oriented Connectionless


Connection

Reliability High (acknowledgment & Low (no guarantee of


retransmission) delivery)

Speed Slower (due to error checking) Faster (no retransmissions)


Data Flow Ordered and controlled Unordered and best-effort

Error Handling Detects & corrects errors Detects but doesn’t correct
errors

Packet Loss Retransmits lost packets No retransmission, loss is


Handling ignored

Overhead High (due to additional control Low (fewer control


mechanisms) mechanisms)

Used For Web browsing, emails, file Streaming, gaming, VoIP,


transfer, remote login DNS, IoT

Examples HTTP, HTTPS, FTP, SMTP, SSH DNS, VoIP, Online Gaming,
Video Calls

When to Use TCP vs UDP? ✅


🔹 Use TCP when:
✔ Data must be delivered accurately (e.g., emails, file downloads, web pages).

✔ Connection and order of packets are important.

✔ Speed is not the top priority.

🔹 Use UDP when:


✔ Speed matters more than reliability (e.g., gaming, live streaming).

✔ Minor packet loss is acceptable.

✔ Applications need low latency (DNS, VoIP, IoT sensors).

👉 For banking, secure logins, and e-commerce → Use TCP.


👉 For gaming, live streaming, and IoT → Use UDP.
1️⃣ TCP is which type of handshaking protocol?(SBI SO 2024)
a) One-way

b) Two-way

✅ c) Three-way
d) Four-way
e) None of the above

Answer: TCP follows a three-way handshake (SYN → SYN-ACK → ACK) to establish a


reliable connection between sender and receiver.

2️⃣ Which of the following is the correct sequence of the TCP three-way handshake?
a) SYN → ACK → SYN-ACK

✅ b) SYN → SYN-ACK → ACK


c) ACK → SYN → SYN-ACK

d) SYN-ACK → SYN → ACK

e) None of the above

Answer: The correct sequence is SYN (Client) → SYN-ACK (Server) → ACK (Client),
ensuring both parties are ready for communication.

Here’s a simplified explanation in a table format:

OSI Layer Function Details

Application User sends the website The browser (like Chrome or Firefox)
Layer request. sends a request to
www.omegleindia.in using HTTP or
HTTPS.

Presentation Prepares the data for The data is converted into a format that
Layer sending. can be understood (like encrypting for
security).

Session Manages the A connection is set up between the


Layer communication session. user's browser and the website server.

Transport Ensures the data is sent The data is split into small chunks and
Layer correctly. sent reliably (TCP makes sure it’s
received correctly).

Network Finds the route to send It uses the website's IP address to find
Layer the data. the best path for sending the data
through networks.

Data Link Organizes the data into The data is packaged into frames and
Layer frames for transmission. sent through local networks (Wi-Fi or
Ethernet).

Physical Sends the data as signals The data is converted into electrical
Layer through cables or signals (for wired connections) or radio
wireless networks. waves (for Wi-Fi).
1. Physical Layer:

Digital Transmission
Digital-to-digital encoding is divided into three categories:

Unipolar Encoding
Polar Encoding
Bipolar Encoding

Unipolar

In Unipolar encoding, the polarity is assigned to the 1 binary state.


In this, 1s are represented as a positive value and 0s are represented as a zero value.
In Unipolar Encoding, '1' is considered as a high voltage and '0' is considered as a zero
voltage.

Polar
Polar encoding is an encoding scheme that uses two voltage levels: one is positive, and
another is negative.

Bipolar
Bipolar encoding scheme represents three voltage levels: positive, negative, and zero.

What is Transmission media?


Transmission media is a communication channel that carries the information from the
sender to the receiver. Data is transmitted through the electromagnetic signals.
The main functionality of the transmission media is to carry the information in the form of
bits through LAN(Local Area Network)

Guided Transmission:

Type of Description Advantages Disadvantages Examples/Applications


Guided
Media

Twisted Two insulated Inexpensive, Limited Telephone lines, LANs


Pair copper wires widely bandwidth and (Cat5, Cat6 cables).
Cable twisted together available, distance,
to reduce flexible. susceptible to
electromagnetic EMI.
interference
(EMI).

Coaxial A single copper Higher Bulkier, more Cable TV, broadband


Cable conductor bandwidth expensive, internet, long-distance
surrounded by than twisted difficult to install telephony.
insulation, pair, better compared to
shielding, and EMI twisted pair.
an outer plastic resistance.
cover.

Fiber Uses light Extremely Expensive, Internet backbone,


Optic signals to high fragile, requires telecommunication
Cable transmit data bandwidth, specialized networks.
through glass low signal installation.
or plastic fibers. loss,
immune to
EMI.
Unguided Transmission:
An unguided transmission transmits the electromagnetic waves without using any
physical medium. Therefore it is also known as wireless transmission.

Type of Description Advantages Disadvantages Examples/A


Unguided
Media

Radio Waves Electromagnetic Covers large Susceptible to AM/FM radio


waves used for areas, easy to interference, broadcasting
long and short- set up, limited Bluetooth.
distance penetrates bandwidth.
communication. walls.

Microwaves High-frequency High Affected by Satellite com


waves requiring bandwidth, weather, cellular netw
line-of-sight used for point- requires
transmission. to-point precise
communication. alignment.

Infrared (IR) Short-range High security, Limited range, Remote con


communication low cannot distance dev
using infrared interference. penetrate connections
light waves. obstacles.

Visible Light Uses LEDs or Secure, fast Affected by Li-Fi (Light F


lasers for data transmission. environmental indoor posit
transmission light, requires systems.
over short or line of sight.
medium
distances.

Satellite Uses satellites Global High cost, GPS, satelli


Communication to transmit coverage, high delay due to weather fore
signals over bandwidth. long distances.
long distances.

What is Multiplexing?
Multiplexing is a technique used to combine and send the multiple data streams over a
single medium. The process of combining the data streams is known as multiplexing and
hardware used for multiplexing is known as a multiplexer.

Multiplexing is achieved by using a device called Multiplexer (MUX) that combines n input
lines to generate a single output line. Multiplexing follows many-to-one, i.e., n input lines and
one output line.
Demultiplexing is achieved by using a device called Demultiplexer (DEMUX) available at the
receiving end. DEMUX separates a signal into its component signals (one input and n
outputs). Therefore, we can say that demultiplexing follows the one-to-many approach.

2. Data Link Layer


Data Link Controls

Aspect Description

Layer 4th layer from the top in IP and 2nd layer from the bottom in the
OSI model.

Main Role Transfers the datagram across an individual link by


encapsulating it into frames.

Protocols Ethernet, Token Ring, FDDI, PPP.

Key Characteristic Allows datagrams to be handled by different link layer protocols


on different links in a path.

Services Provided

Framing & Link Encapsulates network layer datagrams into link layer frames.
Access Defines the frame structure and channel access protocols.

Reliable Delivery Ensures error-free delivery using retransmissions and


acknowledgments.

Flow Control Prevents receiver buffer overflow by regulating the sender's data
transmission rate.

Error Detection Adds error detection bits to identify errors caused by signal
attenuation and noise.

Error Correction Not only detects errors but also identifies the location of errors in
the frame.

Half-Duplex & Full- - Full-Duplex: Both nodes can transmit data simultaneously.
Duplex
-

Half-Duplex: Only one node can transmit at a time.


Data Link Layer Functions
The Data Link Layer (Layer 2) of the OSI Model is responsible for node-to-node
communication and provides three key functions:

1️⃣ Line Discipline – Determines who can send and receive data.
2️⃣ Flow Control – Ensures the sender does not overwhelm the receiver.
3️⃣ Error Control – Detects and corrects errors during data transmission.

1️⃣ Line Discipline 🔄 (Who Can Talk & When?)


Line discipline coordinates communication between sender and receiver, ensuring proper
control over data exchange.

Types of Line Discipline:


🔹 Enquiry/Acknowledgment (ENQ/ACK) – The sender requests permission before
sending data.

🔹 Polling/Selecting – Used in multipoint networks where a central controller decides


which device can send data.

Method Function Example

ENQ/ACK Sender asks permission before Used in ATM transactions to check


sending data. server availability.

Polling Central controller asks devices Used in banking networks where


one by one if they want to send branches communicate with a central
data. server.

Selecting The controller selects one Used in airline ticketing systems to


device for data transfer. manage customer requests.

🔹 Real-World Example:
In ATMs, before processing a transaction, the ATM sends an ENQ (Enquiry) to the
bank’s server.
If the bank server responds with an ACK (Acknowledgment), the transaction
proceeds.
❌ Without line discipline, multiple devices may send data at the same time, causing
collisions!

2️⃣ Flow Control 🚦 (Preventing Data Overload)


Flow control ensures that the sender does not send data faster than the receiver can
process.

Two Types of Flow Control:


1️⃣ Stop-and-Wait Protocol
The sender sends one frame and waits for an acknowledgment before sending the
next.
Example: Used in SMS delivery where each message must be received before sending
the next.

2️⃣ Sliding Window Protocol


The sender can send multiple frames before receiving acknowledgment.
Example: Used in video streaming and high-speed internet connections.

Flow Control How It Works Best Use Case


Method

Stop-and-Wait Sends one packet, waits for Email transmission,


acknowledgment. SMS

Sliding Sends multiple packets before waiting for Live video


Window an acknowledgment. streaming, VoIP

🔹 Real-World Example:

In YouTube video streaming, if the internet is slow, the video buffers because the
sender (YouTube server) must adjust the flow rate to match the user's bandwidth.

❌ Without flow control, the receiver may drop packets or crash due to overload!

3️⃣ Error Control ⚠️ (Ensuring Accurate Data


Transmission)
Error control detects and corrects transmission errors to ensure data integrity.

Methods of Error Control:


🔹 Error Detection Techniques:
✔ Parity Check – Adds a parity bit to detect errors.

✔ Cyclic Redundancy Check (CRC) – Uses mathematical algorithms to detect errors.

✔ Checksum – Adds a sum of data bits to verify accuracy.

🔹 Error Correction Techniques:


✔ Automatic Repeat reQuest (ARQ) – Resends data if an error is detected.

✔ Forward Error Correction (FEC) – Adds redundant bits to automatically correct errors.

Error Control Function Example


Method

Parity Check Detects errors by checking if the Used in modems and


total number of 1s is odd/even. RAM.

CRC (Cyclic Uses polynomial division to Used in Ethernet and Wi-


Redundancy Check) detect errors. Fi.

ARQ (Automatic Resends the data if an error is Used in bank


Repeat Request) detected. transactions and file
transfers.

🔹 Real-World Example:
In online banking, when you transfer money, the system rechecks the transaction
details using CRC to prevent corruption.
If an error occurs, the transaction is retried (ARQ) to ensure accuracy.

❌ Without error control, financial transactions, and important messages may be lost
or corrupted!

Comparison of Line Discipline, Flow Control,


and Error Control
Feature Line Discipline Flow Control Error Control

Purpose Controls who Ensures sender does Ensures data is


sends/receives data. not overload receiver. received without
errors.

Example ATM sending a request YouTube buffering Online banking


before transaction. video based on verifying
internet speed. transactions.

Methods ENQ/ACK, Polling Stop-and-Wait, Parity Check, CRC,


Used Sliding Window ARQ

MCQs
1️⃣ Which function of the Data Link Layer ensures only one device sends data at a
time?

a) Flow Control

b) Error Control

✅ c) Line Discipline
d) Network Control

e) None of the above

2️⃣ Which protocol is used to prevent the sender from overwhelming the receiver?
a) Stop-and-Wait

b) Parity Check

c) Polling

d) Selecting

✅ e) Sliding Window
3️⃣ Which error control technique allows automatic error correction without
retransmission?

a) ARQ

b) Stop-and-Wait
✅ c) Forward Error Correction (FEC)
d) CRC

e) None of the above

4️⃣ What is the main function of the Data Link Layer?


a) Routing data packets

✅ b) Ensuring reliable transmission between nodes


c) Encrypting data

d) Establishing user sessions

Error Detection
When data is transmitted from one device to another device, the system does not guarantee
whether the data received by the device is identical to the data transmitted by another
device. An Error is a situation when the message received at the receiver end is not identical
to the message transmitted.

Types Of Errors
Errors can be classified into two categories:

Single-Bit Error

Burst Error

Error Detecting Techniques:


The most popular Error Detecting Techniques are:

Single parity check


Two-dimensional parity check
Checksum
Cyclic redundancy check

Error Detecting Techniques

Technique Description Advantages Disadvantages


Single Parity Adds a single parity bit Simple and easy Can only detect odd
Check to data to make the to implement. numbers of bit
total number of 1s errors.
either even or odd.

Two- Extends single parity Detects and Limited to detecting


Dimensional by applying parity corrects some single-bit errors in
Parity Check checks to rows and errors. blocks.
columns of a data
block.

Checksum Adds all data Effective for Cannot detect some


segments, and the detecting errors complex error
sum (checksum) is in data blocks. patterns.
transmitted with the
data.

Cyclic Uses polynomial Highly reliable Complex


Redundancy division to generate a for detecting computation
Check (CRC) checksum (remainder) burst errors. compared to other
for error detection. methods.

Error Correction
Error Correction codes are used to detect and correct the errors when data is transmitted
from the sender to the receiver.

Error Correction can be handled in two ways:

Backward error correction: Once the error is discovered, the receiver requests the
sender to retransmit the entire data unit.
Forward error correction: In this case, the receiver uses the error-correcting code
which automatically corrects the errors.
7 Layers functions(IMPORTANT)

3. Network Layer

Aspect Description

Layer Third layer of the OSI model. Handles requests from the transport
layer and forwards them to the data link layer.

Main Role Moves packets from the sending host to the receiving host.

Functions - Routing: Determines the best path from source to destination.

Logical Addressing: Translates logical addresses into physical


addresses.

-
Internetworking: Provides logical connections between different
networks.

Fragmentation: Breaks packets into smaller units for transmission


through different networks.

Forwarding & - Uses forwarding tables to determine the output link interface.
Routing
- Routing algorithms (centralized or decentralized) update
forwarding tables.

Example A packet with header value 0111 is indexed in the forwarding


table to determine the outgoing link (e.g., interface 2).

Services - Guaranteed Delivery: Ensures packet reaches the destination.


Provided
-

Bounded Delay: Guarantees packet delivery within a specified


delay.

In-Order Delivery: Ensures packets arrive in sequence.

Security: Encrypts and decrypts payloads to ensure data integrity


and source authentication.

Network Addressing

Aspect Details

Network Logical, software-based addressing; hosts have one interface,


Addressing routers have multiple interfaces with unique IP addresses.

IP Address 32 bits in "dot-decimal" notation (e.g., 193.32.216.9).


Format
Each IP has

Network ID (first 3 bytes) and Host ID (last byte).

Classes of IP

Class A - NET ID: 8 bits


-

HOST ID: 24 bits

Range: 0.0.0.0 to 127.255.255.255

Networks: 128

Hosts: 16,777,214

Class B - NET ID: 16 bits

HOST ID: 16 bits

Range: 128.0.0.0 to 191.255.255.255

Networks: 16,384

Hosts: 65,534

Class C - NET ID: 24 bits

HOST ID: 8 bits

Range: 192.0.0.0 to 223.255.255.255

Networks: 2,097,152

-
Hosts: 254

Class D Reserved for multicast; Range: 224.0.0.0 to 239.255.255.255.

Class E Reserved for research; Range: 240.0.0.0 to 255.255.255.255.

Rules for Host - Must be unique within the network.


ID
- Cannot use all 0s (represents network ID) or all 1s (reserved for
multicast).

Rules for - Hosts in the same local network share a Network ID.
Network ID
- Cannot start with 127 (reserved for loopback).

- Cannot use all 0s or 1s.

Reserved IP Purpose Description


Range

10.0.0.0/8 Private Reserved for private networks (Class A).


Network

172.16.0.0/12 Private Reserved for private networks (Class B).


Network

192.168.0.0/16 Private Reserved for private networks (Class C). Most


Network commonly used range.

127.0.0.0/8 Loopback Used for local communication on a device.


Address

169.254.0.0/16 Link-local Assigned automatically when no DHCP server


Address is available.

224.0.0.0/4 Multicast Reserved for multicast traffic.


Address

255.255.255.255 Broadcast Used to send data to all devices in a network.


Address

Classful addressing:

Class Range Default Network Host Number Number of


of Subnet Mask Bits Bits of Hosts per
First Networks Network
Octet
A 1- 255.0.0.0 (/8) 8 24 2⁷ = 128 2²⁴ - 2 =
126 16,777,214

B 128 - 255.255.0.0 16 16 2¹⁴ = 2¹⁶ - 2 =


191 (/16) 16,384 65,534

C 192 - 255.255.255.0 24 8 2²¹ = 2⁸ - 2 =


223 (/24) 2,097,152 254

D 224 - Not Applicable Reserved Reserved Reserved Reserved


239

E 240 - Not Applicable Reserved Reserved Reserved Reserved


255

Routing:

Aspect Details

Routing Process of selecting paths for data transfer. Performed by routers


operating at the Network Layer (OSI) or Internet Layer (TCP/IP).

Routing - Hop Count: Number of routers a packet crosses.


Metrics
-

Delay: Time taken to process and transmit data.

Bandwidth: Link capacity.

Load: Resource utilization.

Reliability: Stability of network links.

Types of Static Routing: Manually defined routes.


Routing
Default Routing: Sends all packets to a specific next-hop device.

Dynamic Routing: Routes adjust automatically based on network


conditions.
Static Advantages:- No CPU overhead
Routing
- No bandwidth usage

- Secure (manual control).

Disadvantages:

- Manual configuration for large networks.

- Requires topology knowledge.

Default Sends all packets to a single hop device. Useful for networks with a
Routing single exit point. Specific routes override default routes.

Dynamic Advantages:
Routing
- Auto-adjusts to changes

- Easier configuration.

Disadvantages:

- CPU and bandwidth intensive

- Less secure.

Network Layer Protocols

Protocol Full Form Purpose Key Features

ARP Address Associates an IP - Resolves IP to MAC


Resolution address with a MAC address.
Protocol address.
- Uses ARP cache for
efficiency.

- ARP queries broadcasted


over the network.

- Supports dynamic and


static entries.

RARP Reverse Obtains IP address - Works opposite to ARP.


Address from a server using the
Resolution host's MAC address. - RARP servers respond with
Protocol the IP address.
- Similar message format to
ARP.

ICMP Internet Control Reports network layer - Used for diagnostics (e.g.,
Message errors and control ping).
Protocol messages.
- Reports errors like
destination unreachable,
source quench, etc.

- Includes error reporting but


not error correction.

- Encapsulated in IP
datagram.

IGMP Internet Group Supports multicasting - Identifies multicast group


Management for group members.- Types of
Protocol communication. messages: Membership
Query, Membership Report,
Leave Report.

- Includes feedback
suppression for optimization.

4. Transport Layer:

Transport Layer Description

Layer Position 4th layer in the OSI model.

Main Role Provides communication services directly to application


processes on different hosts.

Protocols TCP (Reliable) and UDP (Unreliable).

Key Services End-to-end delivery, addressing, reliable delivery, flow control,


and multiplexing.

End-to-End Delivery Ensures the entire message is delivered to the destination.

Addressing Uses Transport Service Access Points (TSAP) for correct


application delivery.

Reliable Delivery Includes error, sequence, loss, and duplication control


mechanisms.

Flow Control Prevents sender from overwhelming the receiver (often via
sliding window protocol).
Multiplexing Enables multiple connections on the same network (upward)
or splits a connection (downward).

User Address Identifies applications by port numbers.


Specification

Transport Layer Protocols:

Basis for TCP UDP


Comparison

Definition Establishes a virtual circuit Transmits data directly


before data transmission. without verifying receiver
readiness.

Connection Type Connection-Oriented Connectionless

Speed Slow High

Reliability Reliable protocol (ensures Unreliable protocol (does not


data delivery, retransmits lost guarantee delivery or
packets). retransmit lost packets).

Header Size 20 bytes 8 bytes

Acknowledgement Waits for acknowledgements Does not acknowledge, nor


and retransmits lost data. retransmit lost data.

5. Application Layer:

Application Layer Description

Layer Position Closest layer to the end user in the OSI model.

Main Role Facilitates direct interaction between end users and software
applications.

Key Functions - Identifying communication partners

- Determining resource availability

- Synchronizing communication

Services of - Network Virtual Terminal: Emulates terminal access to


Application Layer remote hosts.

-
File Transfer, Access, and Management (FTAM): Allows
file retrieval and management on remote computers.

Addressing: Uses DNS for client-server communication


addressing.

Mail Services: Provides email forwarding and storage.

Directory Services: Offers global access to information


about various objects and services.

Authentication: Authenticates messages between sender


and receiver.

Application Defines how applications are structured over end systems


Architecture (not fixed like network architecture).

Types of Application - Client-Server Architecture: Clients send requests to


Architecture servers that respond (e.g., web applications).

P2P (Peer-to-Peer) Architecture: Peers communicate


directly without a dedicated server (e.g., file sharing, internet
telephony).

Characteristics of - Clients do not directly communicate with each other.


Client-Server
- The server has a fixed IP address and is always available.

Disadvantages of - Can become overwhelmed with requests as it relies on a


Client-Server single server.

Features of P2P - Self Scalability: Each peer adds service capacity as it


Architecture connects.

Cost-effective: Requires minimal server infrastructure.

Client and Server In P2P, a file transfer occurs between processes in different
Processes peers. A peer can act as both client and server.
Application Protocol:

Application Protocol Description Common Use

HTTP (Hypertext A protocol for transferring hypertext Web browsing


Transfer Protocol) requests and information on the (HTTP/HTTPS)
World Wide Web.

FTP (File Transfer A standard network protocol used to File transfers between
Protocol) transfer files from one host to servers and clients
another over a TCP-based network.

SMTP (Simple Mail Protocol for sending email Sending emails


Transfer Protocol) messages between servers.

POP3 (Post Office A protocol used by email clients to Email retrieval


Protocol version 3) retrieve emails from a server.

IMAP (Internet A protocol for accessing email Email retrieval with


Message Access messages on a mail server, advanced
Protocol) allowing for more flexibility than management
POP3.

DNS (Domain Name Resolves domain names to IP Website navigation


System) addresses, enabling access to (converting domain to
websites via human-readable IP)
names.

TELNET A protocol used for remote Remote server login


communication and managing and command
devices over the internet. execution

SSH (Secure Shell) A protocol for securely accessing Secure remote login
and managing remote servers over and file transfers
a network.

DHCP (Dynamic Host A protocol used to automatically IP address allocation


Configuration assign IP addresses to devices on a
Protocol) network.

SNMP (Simple Used for monitoring and managing Network device


Network devices on a network. management
Management
Protocol)

UDP, TCP, Sockets and Ports:


1. UDP (User Datagram Protocol) vs. TCP (Transmission
Control Protocol)
Feature UDP (User Datagram Protocol) TCP (Transmission Control
Protocol)

Connection No connection setup (it's faster) Establishes a connection first (it's


slower)

Reliability Unreliable (data can be lost) Reliable (guarantees data


delivery)

Speed Faster, lower overhead Slower, more overhead due to


reliability checks

Error No error checking or correction Checks for errors and retransmits


Checking data if needed

Flow Control No control over flow (data might Manages flow (slows down if too
be sent too fast) much data is sent)

Use Cases Video streaming, online games, Web browsing, emails, file
DNS (where speed is more transfers (where reliability
important) matters)

Example DNS, VoIP, video calls HTTP (web), FTP (file transfer),
SMTP (email)

2. Sockets
What is a socket?
A socket is like a "door" through which data enters or exits your computer when you're
communicating over a network. Each socket is connected to a specific application, like a
web browser (HTTP) or a file transfer tool (FTP).
How do sockets work?
When you want to send data over the network (for example, loading a webpage), your
computer uses a socket to send and receive that data. Each socket needs a port
number to know which specific application it’s talking to.

3. Ports
What is a port?
A port is a number that helps identify specific services or applications on a computer. For
example, when you open a website, your browser connects to port 80 (HTTP) or port
443 (HTTPS) on a server.
Port Range:
Ports are numbered from 0 to 65535, and different numbers are used for different
services:
Port 80: Used by web browsers for HTTP (websites).
Port 443: Used by web browsers for HTTPS (secure websites).
Port 21: Used for FTP (file transfer).
Port 53: Used for DNS (domain name system).

Simple Example:
When you visit a website, your browser uses a socket connected to port 80 to send a
request to a web server.
The web server listens on port 80, gets the request, and sends the data (the website)
back through that port.

IPv4 vs IPv6:

Feature IPv4 IPv6

Address 32 bits 128 bits


Length

Address Decimal notation Hexadecimal notation (e.g.,


Format (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334)
192.168.1.1)

Number of Approximately Approximately 340 undecillion addresses (3.4


Addresses 4.3 billion x 10^38)
addresses

Address Manual or DHCP Auto-configuration (stateless address


Configuration autoconfiguration)

Header Smaller, simpler More complex header (40 bytes), but more
Complexity header (20 bytes efficient
without options)

Fragmentation Done by both Done only by the sender


sender and
routers

Security IPsec is optional IPsec is natively integrated

Broadcasting Supports No broadcasting; uses multicast instead


broadcasting

NAT (Network Commonly used No need for NAT due to large address space
Address to overcome
Translation) address
exhaustion

Subnetting Uses subnet Uses CIDR (Classless Inter-Domain Routing)


masks (e.g., with prefix length
255.255.255.0)
Routing Requires routing More efficient routing due to hierarchical
protocols to addressing with aggregation
manage different
network sizes

Fragmentation Routers and Only the source host can fragment packets
Control hosts can
fragment packets

Network Security Protections


Network security involves the measures taken to protect the integrity, confidentiality, and
availability of data and resources on a network. The following are key types of network
security protections:

1. Firewall:
A firewall is a network security device that monitors and controls incoming and outgoing
network traffic based on predetermined security rules. It establishes a barrier between
trusted internal networks and untrusted external networks, such as the internet.

Functions of a Firewall:
Filters traffic based on rules.
Blocks unauthorized access while allowing legitimate communication.
Can be used to prevent attacks and limit certain services or content.
Types of Firewalls:
Packet Filtering Firewall: The simplest type of firewall, it checks each packet
passing through the firewall based on rules (IP addresses, ports, protocols) and
either allows or blocks it.
Stateful Inspection Firewall: Tracks the state of active connections and makes
decisions based on both rules and the context of the traffic.
Proxy Firewall: Acts as an intermediary between the internal network and external
network, masking the true IP addresses of devices.
Next-Generation Firewall (NGFW): Incorporates advanced features like deep
packet inspection (DPI), intrusion prevention systems (IPS), and application
awareness to provide more comprehensive protection.

2. Access Control:
Access control involves mechanisms that restrict access to resources based on identity,
roles, or policies. It ensures that only authorized users and devices can access network
resources and services.

Types of Access Control:


Discretionary Access Control (DAC): Users have the ability to control access to
their own resources.
Mandatory Access Control (MAC): Access is determined by security policies set
by an administrator, not the owner.
Role-Based Access Control (RBAC): Access permissions are granted based on a
user’s role within an organization (e.g., admin, user, guest).
Attribute-Based Access Control (ABAC): Access is granted based on attributes of
the user, environment, and resource.
Access Control Models:
Physical Access Control: Restricts physical access to devices, buildings, or other
areas.
Logical Access Control: Restricts access to network resources and data.

3. Remote Access VPN (Virtual Private Network):


A remote access VPN allows users to securely connect to a private network (such as a
corporate network) over the internet. It encrypts the connection and routes the traffic through
a VPN server, creating a secure tunnel between the user’s device and the network.

Functions of a Remote Access VPN:


Encrypts internet traffic, ensuring data privacy.
Provides secure access to corporate resources from remote locations.
Masks the user’s IP address to prevent tracking and protect anonymity.
Types of Remote Access VPN:
SSL VPN: Uses Secure Socket Layer (SSL) encryption to allow access via a web
browser.
IPSec VPN: Uses Internet Protocol Security (IPSec) to encrypt the data and is
commonly used for site-to-site VPNs.
PPTP (Point-to-Point Tunneling Protocol): An older VPN technology that is less
secure.
L2TP (Layer 2 Tunneling Protocol): Combines with IPSec for stronger encryption.

Subnets and Supernets:

Aspect Subnets Supernets

Definition Dividing a larger network into Aggregating multiple smaller


smaller, manageable segments networks into a larger network
(subnetworks). (supernetwork).

Purpose Improve network performance, Simplify routing by reducing the


security, and management number of entries in routing tables.
efficiency.
Address Focuses on defining smaller Combines the address ranges of
Range ranges within a larger address various smaller networks into one
space. block.

Routing Increases the number of routes Decreases the number of routes


Impact in routing tables as more by aggregating several networks
segments are created. into one.

Broadcast Each subnet has its own Supernetting does not create
Domain broadcast domain, limiting additional broadcast domains;
broadcast traffic. combines existing ones.

Example A company could subnet its An ISP might supernet multiple


Scenario network into departments (e.g., client networks to simplify routing.
HR, Sales).

Classless Inter-Domain Routing (CIDR):


Classless Inter-Domain Routing (CIDR) is a method used to allocate IP addresses and
manage routing

more efficiently than the traditional classful addressing system. CIDR allows for variable-
length subnet

masking (VLSM), which enables more flexible and efficient use of IP address space.

Key Features

Address Representation: CIDR notation represents IP addresses with a suffix


indicating the

prefix length (e.g., 192.168.1.0/24), where /24 indicates that the first 24 bits are the network
part.

Aggregation: CIDR allows multiple IP addresses to be grouped into a single routing


table entry,

reducing the size of routing tables and improving routing efficiency.

Subnetting: It facilitates more efficient subnetting, enabling networks to be split into


smaller

subnets based on the number of hosts required

Feature Description
Address Uses a notation format (e.g., 192.168.1.0/24 ) to indicate
Representation the network prefix length.

Variable Length Allows subnets of different sizes to optimize IP address


Subnet Mask allocation based on actual needs.

Route Aggregation Enables multiple IP addresses to be represented as a single


routing entry, reducing table size.

Efficient Routing Streamlines the routing process by minimizing the number of


entries in routing tables.

Address Space Helps manage the limited IPv4 address space more
Conservation effectively to avoid wastage.

Simplified Facilitates easier IP address management and allocation in


Management larger networks.

Adoption in IPv6 Also applicable in IPv6, leveraging CIDR's principles for vast
address space management.

Ports:

Port Number Protocol Usage

20 TCP FTP (File Transfer - Data)

21 TCP FTP (File Transfer - Control)

22 TCP SSH (Secure Shell)

23 TCP Telnet (Unsecure Remote Login)

25 TCP SMTP (Simple Mail Transfer Protocol)

53 TCP/UDP DNS (Domain Name System)

67 UDP DHCP (Client to Server)

68 UDP DHCP (Server to Client)

69 UDP TFTP (Trivial File Transfer Protocol)

80 TCP HTTP (Hypertext Transfer Protocol)

110 TCP POP3 (Post Office Protocol v3)

119 TCP NNTP (Network News Transfer Protocol)

123 UDP NTP (Network Time Protocol)

135 TCP/UDP RPC (Remote Procedure Call)

137-139 TCP/UDP NetBIOS (Name, Datagram, and Session Service)


143 TCP IMAP (Internet Message Access Protocol)

161-162 UDP SNMP (Simple Network Management Protocol)

389 TCP/UDP LDAP (Lightweight Directory Access Protocol)

443 TCP HTTPS (Secure HTTP)

445 TCP SMB (Server Message Block)

465 TCP SMTPS (Secure SMTP)

514 UDP Syslog

546-547 UDP DHCPv6

587 TCP SMTP (Email Submission)

636 TCP LDAPS (Secure LDAP)

993 TCP IMAPS (Secure IMAP)

995 TCP POP3S (Secure POP3)

1433 TCP Microsoft SQL Server

1521 TCP Oracle Database

3306 TCP MySQL Database

3389 TCP RDP (Remote Desktop Protocol)

5060-5061 TCP/UDP SIP (VoIP Signaling)

8080 TCP HTTP Alternate (Proxy)

You might also like