1.
OSI Model (Open Systems Interconnection Model)
The OSI model is a conceptual framework used to understand and standardize the functions of a
telecommunication or computing system without regard to its underlying internal technology. It's not a
protocol itself, but a model for how protocols work together.
The model is divided into 7 layers, with each layer performing a specific function and communicating
only with the layers directly above and below it.
Protocols &
Layer Name Function Data Unit
Devices
Provides a user interface and network services for HTTP, FTP, SMTP,
7 Application Data
applications. DNS
Handles data formatting, encryption, decryption,
SSL, TLS, JPEG,
6 Presentation and compression. Ensures data is readable by the Data
MPEG
receiving application.
Establishes, manages, and terminates connections
5 Session Data NetBIOS, RPC
(sessions) between applications.
Provides end-to-end communication services.
4 Transport Handles segmentation, reassembly, flow control, Segments TCP, UDP
and error correction.
Handles logical addressing (IP addresses) and
3 Network Packets IP, ICMP, Routers
routing of data packets across different networks.
Provides reliable data transfer between adjacent
Ethernet, PPP,
2 Data Link network nodes. Handles physical addressing Frames
Switches, Bridges
(MAC addresses) and error detection.
Transmits raw binary data (bits) over a physical Coaxial cable, Fiber
1 Physical medium (e.g., cable, fiber, Wi-Fi). Deals with Bits optic, Hubs,
voltage levels, timings, and physical connections. Repeaters
Export to Sheets
Key Takeaway: The OSI model is a valuable tool for troubleshooting and for understanding the high-
level architecture of network communication. Data travels down the stack at the sender (with each layer
adding a header) and up the stack at the receiver (with each layer stripping off its header).
2. TCP/IP Model
The TCP/IP model is a practical, widely adopted model that forms the foundation of the internet. It is a
more condensed version of the OSI model, with a few key differences.
The most common version of the TCP/IP model has 4 layers:
OSI
Layer Name Function Protocols & Devices
Equivalent
4 Application Combines the functions of the OSI Layers 5, 6, HTTP, FTP, SMTP,
Application, Presentation, and Session layers. 7 DNS
OSI
Layer Name Function Protocols & Devices
Equivalent
Provides services to the user.
Provides end-to-end communication services.
3 Transport Handles segmentation, reassembly, flow Layer 4 TCP, UDP
control, and error correction.
Handles logical addressing (IP addresses) and
2 Internet routing of data packets across different Layer 3 IP, ICMP, Routers
networks.
Combines the functions of the OSI Data Link
Ethernet, WiFi, ARP,
Network and Physical layers. Deals with physical
1 Layers 1, 2 MAC addresses,
Access addressing and data transmission over the
Switches, Hubs
local network.
Export to Sheets
Comparison with OSI Model:
Layer Consolidation: The TCP/IP model is less granular, with fewer layers. The OSI model's
Presentation and Session layers are merged into the Application layer of TCP/IP. The Data Link
and Physical layers are merged into the Network Access layer.
Focus: The OSI model is a theoretical reference model. The TCP/IP model is a practical
implementation model based on the protocols that actually run the internet.
Protocol Independence: The OSI model was designed to be protocol-independent. The TCP/IP
model is largely centered around its core protocols: TCP and IP.
3. Networking Devices
Networking devices operate at specific layers of the OSI model and perform distinct functions.
Device OSI Layer Function Example Scenario
Connects multiple devices in a local area Connecting 4 computers in a
network (LAN). It sends incoming data to small network. The data sent
Hub 1 (Physical)
all connected devices, regardless of the from PC1 is received by PC2,
intended recipient. PC3, and PC4.
Regenerates a signal that has been
Boosting a WiFi signal to reach
Repeater 1 (Physical) weakened by distance. Extends the range
a distant room.
of a physical network medium.
Connects devices and forwards data only to
A switch receives data for PC3
the intended recipient based on their
2 (Data from PC1 and forwards it only to
Switch unique MAC addresses. It learns which
Link) PC3, not to other devices on the
devices are on which ports, making it more
network.
efficient and secure than a hub.
Bridge 2 (Data Similar to a switch, but typically has only Connecting two separate office
Link) two ports. It connects two LAN segments building LANs to filter traffic.
Device OSI Layer Function Example Scenario
and filters traffic between them based on
MAC addresses.
Connects multiple networks (e.g., your
Your home router connects all
home network to the internet). It forwards
your devices to your ISP's
Router 3 (Network) data packets based on IP addresses and
network, which in turn connects
finds the optimal path (route) for the data
you to the wider internet.
to travel.
An email gateway might
A general term for a device or software
translate between two different
7 that connects two networks that use
Gateway email protocols to allow
(Application) different protocols. It can translate
communication between
protocols at any layer of the OSI model.
systems.
Export to Sheets
4. Protocols (HTTP, FTP, DNS)
These are application layer protocols that define how applications communicate.
HTTP (HyperText Transfer Protocol)
Purpose: The foundation of the World Wide Web. It's a protocol for fetching resources
(like HTML documents) from a server. It is stateless, meaning each request is
independent of previous requests.
Transport Layer: TCP (typically on port 80 or 443 for HTTPS). TCP's reliability is
crucial for ensuring a full web page loads correctly.
How it Works: A client (web browser) sends a request (e.g., GET /index.html
HTTP/1.1) to a server. The server processes the request and sends a response, which
includes a status code (e.g., 200 OK) and the requested data.
FTP (File Transfer Protocol)
Purpose: A standard protocol for transferring files between a client and a server. It
requires separate control and data connections.
Transport Layer: TCP (port 21 for control, and a dynamic port for data). TCP's
connection-oriented nature and error checking are vital for reliable file transfers.
How it Works: A client establishes a control connection with the server (port 21) to
send commands (e.g., LIST, GET). When a file transfer command is issued, a separate
data connection is opened to transfer the actual file content.
DNS (Domain Name System)
Purpose: Translates human-readable domain names (e.g., www.google.com) into
computer-friendly IP addresses (e.g., 142.250.191.132). It's often called the
"phonebook of the internet."
Transport Layer: UDP (User Datagram Protocol) on port 53. UDP is used because
DNS queries are very fast and small. The speed is more important than a guaranteed
delivery, and if a query is lost, the client can simply re-send it. For larger transfers (like
zone transfers), it uses TCP.
How it Works: When you type a domain name into your browser, your computer sends
a DNS query to a DNS server. The DNS server recursively resolves the name by asking
other servers until it finds the correct IP address and sends it back to your computer.
5. Network Security
Network security is about protecting the confidentiality, integrity, and availability of computer
networks and data. It's a vast field, but we can break it down by its core goals.
Confidentiality (Keeping data secret):
Goal: Ensure that data is not read by unauthorized parties.
Threats: Eavesdropping, snooping, Man-in-the-Middle attacks.
Solutions:
Encryption: The process of converting data into an unreadable format (cipher-
text). SSL/TLS (Secure Sockets Layer/Transport Layer Security) encrypts data
between a web browser and a server.
Firewalls: Act as a barrier between a trusted internal network and an untrusted
external network (like the internet). They filter traffic based on a set of security
rules.
Integrity (Ensuring data is not tampered with):
Goal: Ensure that data remains unchanged during transmission or storage.
Threats: Data tampering, unauthorized modification.
Solutions:
Hashing: A cryptographic function that generates a fixed-size string (hash) from
any input data. Any change to the data will result in a completely different hash,
revealing tampering.
Digital Signatures: Uses public key cryptography to verify the authenticity and
integrity of a message. The sender signs the data with their private key, and the
receiver verifies it with the sender's public key.
Availability (Ensuring services are accessible):
Goal: Ensure that network services and data are available to authorized users when
needed.
Threats: DDoS (Distributed Denial of Service) attacks, system failures, power
outages.
Solutions:
Firewalls & IDS (Intrusion Detection Systems): Can block malicious traffic
that aims to overwhelm a server.
Redundancy: Having backup servers and network paths to ensure services
remain available if one part of the system fails.
DDoS Mitigation Services: Specialized services that absorb and filter attack
traffic before it reaches the target network.
Common Threats:
Malware: Malicious software like viruses, worms, and ransomware.
Phishing: Deceptive attempts to trick users into revealing sensitive information.
Spoofing: Faking the identity of a legitimate sender to gain access or credibility.
An IP (Internet Protocol) address is a fundamental concept in computer networks. It's a unique
numerical label assigned to each device (e.g., computer, printer, server, smartphone) connected to a
computer network. Its two primary functions are:
1. Identification: To uniquely identify a device on a network.
2. Location: To provide a location for the device, enabling data to be routed to it.
Think of an IP address like a street address for your computer. Your computer has an address that
allows other devices to send information to it.
IP addresses are categorized in several ways, and understanding these categories is crucial for a
comprehensive knowledge of networking.
1. Types by Version: IPv4 vs. IPv6
This is the most common and important distinction between IP address types.
IPv4 (Internet Protocol version 4)
Structure: A 32-bit address, typically written in dotted-decimal notation. It consists of four
numbers, each ranging from 0 to 255, separated by periods.
Example: 192.168.1.1
Address Space: It allows for approximately 4.3 billion unique addresses (232).
Problem: With the explosive growth of the internet and the proliferation of devices (laptops,
smartphones, IoT devices), the world has essentially run out of available IPv4 addresses. This
problem is known as IPv4 address exhaustion.
Mitigation: Technologies like NAT (Network Address Translation) were developed to
conserve addresses, but they are a temporary solution.
IPv6 (Internet Protocol version 6)
Structure: A 128-bit address, written in hexadecimal notation. It consists of eight groups of
four hexadecimal digits, separated by colons.
Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334 (often shortened by
omitting leading zeros and consecutive zero fields: 2001:db8:85a3::8a2e:370:7334)
Address Space: It allows for a virtually unlimited number of addresses, specifically 340
undecillion (2128) addresses, which solves the address exhaustion problem for the foreseeable
future.
Purpose: IPv6 was developed as the successor to IPv4 to not only solve the address shortage
but also to provide other improvements, such as simplified headers, better security features
(IPsec is built-in), and more efficient routing.
2. Types by Scope/Usage
These categories apply mainly to IPv4 addresses but the concepts extend to IPv6 as well.
Public IP Address
Definition: A globally unique IP address that is assigned to your network by your Internet
Service Provider (ISP). It is routable on the public internet.
Purpose: It identifies your entire network to the internet. When you visit a website, your public
IP address is what the website's server sees, allowing it to send information back to your
network.
Analogy: The public mailing address of your building.
Private IP Address
Definition: A non-globally routable IP address used within a private, local network (LAN) like
your home, school, or office.
Purpose: It allows devices within your local network to communicate with each other. A router
is responsible for assigning these private IP addresses to devices and using NAT to translate the
private addresses to the single public IP address when communicating with the internet.
Analogy: The apartment number within your building.
Reserved Ranges: The Internet Assigned Numbers Authority (IANA) has reserved specific
address blocks for private use, so they can be reused by every private network without conflict.
The most common ranges are:
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
Static IP Address
Definition: An IP address that is permanently assigned to a device and does not change. It is
manually configured.
Purpose: Used for devices that need a consistent, reliable address so they can be easily found
on a network. Common use cases include:
Web servers, mail servers, and DNS servers.
Printers or other network-attached devices.
Dynamic IP Address
Definition: An IP address that is temporarily assigned to a device from a pool of available
addresses. It can change periodically.
Purpose: This is the most common type for consumer devices like laptops and smartphones. It
is assigned automatically by a DHCP (Dynamic Host Configuration Protocol) server when a
device connects to a network.
Advantage: It simplifies network administration and helps conserve the limited number of IPv4
addresses.
3. Types by Communication Mode
These categories refer to how data is sent and received.
Unicast
Definition: A one-to-one communication method. A data packet is sent from a single source to
a single destination.
Example: A web browser requesting a page from a web server. This is the most common form
of communication on the internet.
Broadcast
Definition: A one-to-all communication method. A data packet is sent from a single source to
all devices on a local network segment.
Example: A DHCP server broadcasting an IP address to all devices on the network.
Multicast
Definition: A one-to-many communication method. A data packet is sent from a single source
to a specific group of devices that are part of a multicast group.
Example: Live video streaming or online gaming, where multiple users need to receive the
same data stream without the server having to send a separate packet to each one individually.
Layer 1: Physical Layer
Function: Transmits raw bit streams over a physical medium. It deals with electrical,
mechanical, and timing specifications. This layer is about the hardware itself.
Protocols & Technologies:
Ethernet (cabling, connectors): Defines the physical cabling (e.g., Cat 5e, Cat 6), the
electrical signals, and the physical connectors (RJ45) used for wired local area networks.
Wi-Fi (IEEE 802.11): A family of standards that defines how devices communicate
wirelessly using radio waves. It specifies the physical characteristics of wireless
transmission.
DSL (Digital Subscriber Line): Technology for transmitting digital data over telephone
lines.
USB (Universal Serial Bus): A protocol that defines the physical and electrical
specifications for connecting and communicating with devices over a short distance.
Layer 2: Data Link Layer
Function: Provides reliable data transfer between two directly connected network nodes. It
handles physical addressing (MAC addresses) and error detection.
Protocols:
Ethernet (IEEE 802.3): While its physical aspects are Layer 1, the Ethernet protocol
also defines the frame format and the Media Access Control (MAC) addresses used to
identify devices on a local network.
PPP (Point-to-Point Protocol): A protocol used to establish a direct connection
between two nodes, often used for dial-up or broadband connections to an ISP.
ARP (Address Resolution Protocol): A crucial protocol that maps a logical IP address
to a physical MAC address on a local network.
Spanning Tree Protocol (STP): Used in switches to prevent network loops by logically
disabling redundant paths.
Layer 3: Network Layer
Function: Responsible for logical addressing (IP addresses) and routing data packets across
different, interconnected networks.
Protocols:
IP (Internet Protocol): The most fundamental protocol of the Internet. It defines the
addressing scheme (IPv4 and IPv6) and the format of packets (datagrams) that carry data
from a source to a destination.
ICMP (Internet Control Message Protocol): Used to send error messages and
operational information. The ping and traceroute commands rely on ICMP.
Routing Protocols: These are used by routers to discover and maintain the best paths
for data to travel. Examples include:
OSPF (Open Shortest Path First): A common interior gateway protocol used to
route data within a single autonomous system.
BGP (Border Gateway Protocol): The "protocol of the Internet," used to route
data between different autonomous systems (large networks like those of ISPs).
Layer 4: Transport Layer
Function: Provides end-to-end communication services for applications. It handles
segmentation, reassembly, and ensures the reliability and flow control of data between hosts.
Protocols:
TCP (Transmission Control Protocol): A connection-oriented and reliable protocol.
It establishes a connection before sending data, guarantees delivery, and provides flow
control and error checking. Used for applications where data integrity is critical (e.g.,
file transfer, web Browse).
UDP (User Datagram Protocol): A connectionless and unreliable protocol. It sends
data without establishing a connection or guaranteeing delivery. It's faster and more
efficient than TCP, making it ideal for applications where speed is more important than
reliability (e.g., live video streaming, online gaming, DNS queries).
SCTP (Stream Control Transmission Protocol): A more modern, reliable protocol
that offers multiple streams of data within a single connection.
Layer 5: Session Layer
Function: Establishes, manages, and terminates connections (sessions) between applications. It
provides services like dialogue control (who sends, who receives, and when) and
synchronization.
Protocols:
RPC (Remote Procedure Call): Allows a program to cause a procedure to execute on
another computer on the network.
ADSP (AppleTalk Data Stream Protocol): A legacy protocol for managing sessions
between Apple devices.
NetBIOS: Provides a set of session-level services for applications on a local area
network.
Layer 6: Presentation Layer
Function: Handles data formatting, encryption, and compression. It ensures that data sent from
one application is understandable by the receiving application, regardless of the underlying
format or system.
Protocols & Standards:
SSL / TLS (Secure Sockets Layer / Transport Layer Security): While often
associated with the transport layer, these protocols technically operate across the
presentation and session layers. They encrypt data for secure communication, as seen
with HTTPS.
JPEG, GIF, TIFF: Standards for image compression and formatting.
MIME (Multipurpose Internet Mail Extensions): Defines how to format non-text
data (like images, audio, and video) for transfer over email.
Layer 7: Application Layer
Function: The topmost layer that provides an interface for the user and network services for
applications. Protocols at this layer are what you interact with directly.
Protocols:
HTTP / HTTPS (HyperText Transfer Protocol / Secure): The foundation of the
World Wide Web, used for retrieving web pages and other resources.
FTP (File Transfer Protocol): Used for transferring files between a client and a server.
SMTP (Simple Mail Transfer Protocol): Used for sending email.
POP3 / IMAP (Post Office Protocol / Internet Message Access Protocol): Used for
retrieving email from a server.
DNS (Domain Name System): Translates human-readable domain names into IP
addresses.
DHCP (Dynamic Host Configuration Protocol): Automatically assigns IP addresses
to devices on a network.
Telnet / SSH (Secure Shell): Protocols for remote login and command execution on
another computer.
An IPv4 address is a 32-bit number, typically written as four decimal numbers (octets) separated by
dots. In the classful system, the first few bits of an address's first octet determined its class. This, in
turn, dictated how the rest of the 32 bits were divided between the Network ID (identifying the specific
network) and the Host ID (identifying the specific device on that network).
Class A Addresses
First Bit: Always 0.
First Octet Range: 1 to 126. (The address 0.0.0.0 is reserved, and 127.0.0.0 is
reserved for loopback addresses).
Network & Host Bits: The first 8 bits are for the Network ID, and the remaining 24 bits are
for the Host ID.
Default Subnet Mask: 255.0.0.0
Scale: Designed for very large networks.
Number of Networks: 27=128 (but effectively 126 usable)
Number of Hosts per Network: 224−2=16,777,214 (subtracting 2 for the network
address and the broadcast address).
Use Case: Large organizations or governments that needed to support millions of hosts on a single
network.
Class B Addresses
First Bits: Always 10.
First Octet Range: 128 to 191.
Network & Host Bits: The first 16 bits are for the Network ID, and the remaining 16 bits are
for the Host ID.
Default Subnet Mask: 255.255.0.0
Scale: Designed for medium to large networks.
Number of Networks: 214=16,384
Number of Hosts per Network: 216−2=65,534
Use Case: Large universities and medium to large corporations.
Class C Addresses
First Bits: Always 110.
First Octet Range: 192 to 223.
Network & Host Bits: The first 24 bits are for the Network ID, and the remaining 8 bits are
for the Host ID.
Default Subnet Mask: 255.255.255.0
Scale: Designed for small networks.
Number of Networks: 221=2,097,152
Number of Hosts per Network: 28−2=254
Use Case: Small businesses and home networks. This is the most common class seen in local network
private address ranges (e.g., 192.168.1.0).
Class D Addresses (Multicast)
First Bits: Always 1110.
First Octet Range: 224 to 239.
Purpose: These addresses are not used for unicast communication (one-to-one). Instead, they
are reserved for multicasting, which is a one-to-many communication method where data is
sent from a single source to a specific group of recipients.
Example: 224.0.0.1 is the address for all hosts on a local network.
Class E Addresses (Experimental)
First Bits: Always 11110.
First Octet Range: 240 to 255.
Purpose: These addresses are reserved for experimental and future use and are not used for any
public or private addressing.
Summary Table
First Octet Network Host Hosts/
Class First Bits Networks Default Subnet Mask
Range Bits Bits Network
A 0 1 - 126 8 24 126 16,777,214 255.0.0.0
B 10 128 - 191 16 16 16,384 65,534 255.255.0.0
C 110 192 - 223 24 8 2,097,152 254 255.255.255.0
D 1110 224 - 239 N/A N/A N/A N/A N/A
E 11110 240 - 255 N/A N/A N/A N/A N/A