Computer Networks
Application Layer — Study Notes
Q1. Explain the Operation of the Application Layer
What is the Application Layer?
The Application Layer is the TOP layer (Layer 7) of the OSI model. It is the layer that users
directly interact with.
Simple Analogy: Think of it like a waiter in a restaurant. You (user) tell the waiter what you
want, and the waiter communicates with the kitchen (network) to get it done.
How it Supports End-User Applications
1. Provides Network Services to Applications
It gives applications like browsers, email clients, and file managers the ability to use the
network.
Example: When you open Chrome and type [Link], the application layer uses HTTP to
send your request to Google's server.
2. Data Translation & Formatting
It makes sure data is in the correct format that both sender and receiver can understand.
Example: Your email is written in Bengali, but the application layer formats it properly so it
can travel across the internet and display correctly.
3. User Authentication
It checks who you are before giving access to a service.
Example: When you log in to Gmail, the application layer checks your username and
password before allowing access.
4. File Transfer Support
It allows users to send and receive files over a network.
Example: When you download a file from a website, the application layer uses FTP or HTTP
to transfer that file to your computer.
5. Email Services
It handles sending and receiving emails through proper protocols.
Example: When you send an email, the application layer uses SMTP to deliver it to the
receiver's mail server.
6. Directory Services
It helps find the correct address of a website or server.
Example: When you type [Link], the application layer uses DNS to find Facebook's
actual IP address.
Application Layer — Simple Flow Diagram
┌─────────────────────────────────┐
│ END USER │
│ (Browser, Email App, FTP App) │
└──────────────┬──────────────────┘
│ interacts with
┌──────────────▼──────────────────┐
│ APPLICATION LAYER │
│ HTTP | FTP | SMTP | DNS | SSH │
└──────────────┬──────────────────┘
│ sends data down to
┌──────────────▼──────────────────┐
│ Lower Layers (Transport, │
│ Network, Data Link, Physical) │
└─────────────────────────────────┘
Key Functions Summary Table
Function What it Does Example
Network Services Gives apps access to network Browser uses HTTP
Data Formatting Makes data readable for both Email format
sides
Authentication Verifies user identity Gmail login
File Transfer Sends/receives files Download via FTP
Email Support Handles sending & receiving SMTP for sending
emails
Directory Service Finds IP from domain name DNS lookup
Q2. How TCP/IP Application Layer Protocols Operate
What is TCP/IP Application Layer?
In the TCP/IP model, the Application Layer is the TOP layer. It combines the OSI model's
top 3 layers into one. It contains many protocols — each protocol has rules for a specific
type of communication.
1. HTTP — HyperText Transfer Protocol
Used for: Browsing websites
Port: 80 (HTTP) / 443 (HTTPS — secure)
How it works:
Step 1: You type [Link] in browser
Step 2: Browser sends HTTP REQUEST to Google's server
Step 3: Google's server sends back HTTP RESPONSE (webpage)
Step 4: Browser displays the webpage to you
• Works on request-response model
• Stateless — server does not remember previous requests
• HTTPS is the secure version (data is encrypted)
Example: Every time you open a webpage, HTTP is working behind the scenes.
2. FTP — File Transfer Protocol
Used for: Transferring files between computers
Port: 21 (Control) / 20 (Data)
How it works:
Step 1: User connects to FTP server (login with username/password)
Step 2: User can upload or download files
Step 3: FTP uses TWO connections:
Port 21 = Control connection (commands)
Port 20 = Data connection (actual file transfer)
Step 4: File transfer completes, connection closes
• Supports upload and download
• Has authentication (username + password)
• Not very secure — SFTP is the secure version
Example: A web developer uploads website files to a hosting server using FTP.
3. SMTP — Simple Mail Transfer Protocol
Used for: SENDING emails
Port: 25 or 587
How it works:
Step 1: You write an email and click Send
Step 2: Email client sends it to your SMTP server
Step 3: SMTP server finds receiver's mail server using DNS
Step 4: Email is delivered to receiver's mail server
Step 5: Receiver uses POP3 or IMAP to read the email
• Only handles SENDING emails (not reading)
• Works together with POP3 / IMAP for receiving
Example: When you send an email from Gmail, SMTP carries it from Gmail's server to the
receiver's server.
4. POP3 & IMAP — Email Receiving Protocols
Used for: RECEIVING / Reading emails
Feature POP3 IMAP
Port 110 143
Downloads email? Yes, downloads & deletes from No, keeps on server
server
Multi-device support No Yes
Best for Single device Multiple devices (phone + laptop)
Example: If you check Gmail on your phone AND laptop at the same time, Gmail uses IMAP
so both devices see the same emails.
5. DNS — Domain Name System
Used for: Converting website names to IP addresses
Port: 53
How it works:
Step 1: You type [Link]
Step 2: Your computer asks DNS: 'What is the IP of [Link]?'
Step 3: DNS server replies: 'IP = [Link]'
Step 4: Your computer connects to that IP
Step 5: YouTube loads!
• Like a phone book for the internet
• Without DNS, you would need to remember IP addresses for every website
Example: DNS converts [Link] → [Link]
6. DHCP — Dynamic Host Configuration Protocol
Used for: Automatically giving IP addresses to devices
Port: 67 (server) / 68 (client)
How it works:
Step 1: Your phone connects to WiFi
Step 2: Phone says: 'I need an IP address!' (DHCP Discover)
Step 3: Router replies: 'Here, take [Link]' (DHCP Offer)
Step 4: Phone accepts the IP (DHCP Request)
Step 5: Server confirms (DHCP Acknowledge)
Example: Every time you connect to a new WiFi, DHCP automatically gives your device an
IP address.
7. SSH — Secure Shell
Used for: Securely connecting to another computer remotely
Port: 22
How it works:
Step 1: User opens terminal and types: ssh username@[Link]
Step 2: SSH starts connection on port 22
Step 3: SSH creates a secure encrypted tunnel
Step 4: User enters password and logs in
Step 5: User can now control the remote computer via commands
• All data is encrypted — very secure
• Replaced older insecure Telnet protocol
Example: A developer uses SSH to log into their web server hosted on AWS and run
commands remotely.
All Protocols — Quick Summary Table
Protocol Purpose Port
HTTP / HTTPS Web browsing 80 / 443
FTP File transfer 20, 21
SMTP Send emails 25, 587
POP3 Receive emails (download) 110
IMAP Receive emails (server-based) 143
DNS Domain name → IP address 53
DHCP Auto assign IP address 67, 68
SSH Secure remote access 22
Q3. How Application Protocols Interact with End-User
Applications
Simple Idea First
Think of it like ordering food:
You (User) → Waiter (Protocol) → Kitchen (Network/Server)
• You do not go to the kitchen yourself
• The waiter (protocol) knows exactly how to talk to the kitchen
• You just see the final result (food / data)
Same way — you use an app (browser, email), the protocol does all the background work,
and you see the result.
General Flow — How it Works
┌──────────────┐ ┌─────────────────────┐
│ END USER │ │ SERVER │
│ (App/Browser│ │ (Web/Mail/FTP...) │
└──────┬───────┘ └──────────┬───────────┘
│ │
① User opens application │
② App calls protocol │
③ Protocol sends REQUEST ─────────►
④ Server processes
⑥ App shows result │
◄──────────── ⑤ Protocol receives RESPONSE
1. Web Browser ↔ HTTP Protocol
Application: Google Chrome, Firefox, Edge
Step-by-step interaction:
Step 1: User types '[Link]' in browser
Step 2: Browser calls HTTP protocol
Step 3: HTTP sends a GET request to Google's server
GET /[Link] HTTP/1.1
Host: [Link]
Step 4: Google's server prepares the webpage
Step 5: Server sends back HTTP response
HTTP/1.1 200 OK
Content: <html>...</html>
Step 6: Browser displays the webpage to user
Simple Flow:
[You type URL]
↓
[Browser asks DNS: 'What is IP of [Link]?']
↓
[DNS replies: 'IP = [Link]']
↓
[HTTP sends request to that IP]
↓
[Server sends back webpage]
↓
[You see Google homepage] ✅
Real Example: Every time you open YouTube, your browser and HTTP work together
silently in the background.
2. Email App ↔ SMTP + IMAP/POP3
Application: Gmail, Outlook, Yahoo Mail
Sending Email (SMTP):
Step 1: You write an email and click SEND
Step 2: Email app calls SMTP protocol
Step 3: SMTP connects to mail server (port 587)
Step 4: SMTP server finds receiver's server using DNS
Step 5: Email delivered to receiver's mail server ✅
Receiving Email (IMAP):
Step 1: You open your inbox
Step 2: Email app calls IMAP protocol
Step 3: IMAP connects to mail server (port 143)
Step 4: Server sends list of emails to your app
Step 5: You see all your emails in inbox ✅
Complete Email Flow:
[You] --SMTP--> [Your Mail Server] --SMTP--> [Receiver's Mail Server]
|
[Receiver] <--IMAP/POP3-- [Receiver's Mail Server] ✅
Real Example: When you send an email from Gmail to Yahoo, SMTP carries it from Gmail's
server to Yahoo's server. Then the receiver uses IMAP to read it.
3. File Manager App ↔ FTP Protocol
Application: FileZilla, WinSCP, any FTP client
Step 1: User opens FTP application (like FileZilla)
Step 2: User enters Server IP, Username, Password, Port 21
Step 3: FTP creates CONTROL CONNECTION (port 21)
→ Used for sending commands (list, delete, rename)
Step 4: User clicks download/upload:
FTP creates DATA CONNECTION (port 20)
→ Actual file transfer happens here
Step 5: File transfer completes, connection closes
Two Connection Model:
┌─────────────┐ Port 21 (Commands) ┌─────────────┐
│ FTP Client │◄──────────────────────► │ FTP Server │
│ (FileZilla) │ Port 20 (File Data) │ │
│ │◄──────────────────────► │ │
└─────────────┘ └─────────────┘
Real Example: A web developer uploads their website files to a hosting server using
FileZilla.
4. Any App ↔ DNS Protocol (Behind the Scenes)
Application: Every internet app uses DNS!
Step 1: User types any domain name ([Link], [Link])
Step 2: App calls DNS protocol automatically
Step 3: DNS sends query: 'What is the IP of [Link]?'
Step 4: DNS server replies: '[Link]'
Step 5: App uses this IP to connect to the server
Step 6: Website loads! ✅
DNS Query Flow:
[Your App]
↓ asks
[Local DNS Cache] → If found, use it (fast!) ✅
↓ if not found
[ISP DNS Server] → If found, use it ✅
↓ if not found
[Root DNS Server] → Finds the right DNS server
↓
[Domain DNS Server] → Gives final IP address ✅
Real Example: Without DNS, you would need to type [Link] instead of
[Link] — DNS makes internet human-friendly!
5. Remote Access App ↔ SSH Protocol
Application: Terminal, PuTTY, VS Code Remote
Step 1: Developer opens terminal
Types: ssh username@[Link]
Step 2: SSH protocol starts connection on port 22
Step 3: SSH does a HANDSHAKE:
→ Server sends its public key
→ Client verifies the server
→ Secure encrypted tunnel is created
Step 4: User enters password
Step 5: User is now inside the remote computer
All data travels through encrypted tunnel 🔒
SSH Secure Tunnel:
┌──────────────┐ Encrypted Tunnel (Port 22) ┌──────────────┐
│ Developer │◄──────────────────────────── ►│Remote Server │
│ (Terminal) │ All commands encrypted 🔒 │ (AWS/Linux) │
└──────────────┘ └──────────────┘
Real Example: A developer sitting in Chittagong can control a server in the USA using SSH
— safely and securely.
Full Comparison Table
Application Protocol Port What it Does
Web Browser HTTP / HTTPS 80 / 443 Opens websites
Email (Send) SMTP 25, 587 Sends emails
Email (Receive) IMAP / POP3 143 / 110 Reads emails
File Transfer FTP / SFTP 20, 21 Upload/download files
Any Internet App DNS 53 Converts name → IP
Auto IP Setup DHCP 67, 68 Gives IP to device
Remote Access SSH 22 Secure remote control
Key Points to Remember
• User never directly talks to the network
• Application Protocol acts as the middleman
• Each app uses a specific protocol for a specific job
• Protocols use specific port numbers
• All this happens automatically in the background
• User just sees the final result (webpage, email, file)
Public and Private IP Addresses — Easy Study Notes
Q1. What is a Public and Private IP Address?
IP address is a number that identifies a device on a network.
IP Address মানে হন া প্রতিটা device এর একটা unique েম্বর — যেটা তিন়ে network এ যেই
device যক যেো ো়ে। IP address িুই ধরনের:
Private IP Address:
A Private IP Address is used for communication inside a local network (LAN) only.
• Used by devices like computers, phones, and printers inside a home or office
• Assigned by a router or DHCP server
• Cannot be accessed from the internet — only works inside the local network
• Example: [Link]
Real Example: Your home WiFi gives your phone a private IP like [Link]. Your laptop
gets [Link]. They can talk to each other, but the internet cannot see these addresses
directly.
Public IP Address:
A Public IP Address is used for communication outside a local network — over the
internet.
• It is globally routable — any device on the internet can reach it
• Assigned by your ISP (Internet Service Provider)
• Example: [Link]
Real Example: When you visit Google, Google's server sees your public IP — not your
private IP.
Q2. Can We Trace a Private IP Address?
Short Answer: Only inside the local network — NOT from the internet.
A private IP address can only be seen and traced within the same LAN (Local Area
Network).
• Devices on the same WiFi or LAN can see each other's private IPs
• The internet cannot see private IP addresses at all
• Outside networks only see the public IP of the router (through NAT)
How NAT works:
Your Phone ([Link]) ──► Router ──► Internet sees: [Link]
[Private IP] [NAT] [Public IP]
Example: If someone on the internet tries to find [Link] — they cannot. It is invisible to
them. Only devices in your home network can see it.
Q3. Key Features of Private IP Address
Feature Explanation
Not reachable from internet Reduces exposure to attacks and unwanted traffic
Large address space Many devices can use private IPs — easy to scale
Free to use No need to buy from ISP — cost efficient
Needs NAT Cannot go to internet directly — needs NAT or proxy
Extra config needed Connecting to external services needs extra setup
NAT adds overhead NAT causes extra processing, slight delay, and complexity
Q4. Types of Public IP Addresses
There are 2 types of Public IP:
1. Dynamic Public IP Address:
• Changes over time — when connection resets or ISP decides to change it
• Automatically assigned by the ISP
• Most home and mobile internet users have this
• Cheaper — but not reliable for hosting servers
Example: Your home broadband IP today is [Link]. After router restart, it may become
[Link]. It changes!
2. Static Public IP Address:
• Stays fixed — never changes
• Used by web servers, mail servers, DNS servers — services that need a
permanent address
• More expensive than dynamic IP
• Very reliable for hosting services
Example: Google's server always has the same IP — [Link]. It never changes.
That's a static IP.
Q5. Can We Trace a Public IP Address?
Short Answer: Yes — but only approximately.
A public IP address can be traced to:
• The ISP that owns and assigned it
• An approximate location (city or region) — not exact home address
Privacy Tools people use to hide their Public IP:
Tool How it works
VPN Routes your traffic through another server — hides your real IP
Proxy Server Works as a middleman — websites see proxy IP, not yours
Tor Network Sends traffic through multiple servers — very hard to trace
Example: If you visit a website without VPN, the website sees your real public IP like
[Link] and knows you are from Chittagong, Bangladesh. With VPN, they see a
different IP — maybe from Germany.
Q6. Key Features of Public IP Address
Feature Explanation
Directly reachable Any device on the internet can connect to it
Used for hosting Websites, game servers, cloud services use public IPs
No NAT needed Can communicate over internet directly
Assigned by ISP ISP or cloud provider gives the IP — may cost extra
IPv4 running out Public IPv4 addresses are becoming limited worldwide
Visible on internet Can reveal ISP and approximate location — privacy concern
Q7. Difference Between Private and Public IP Address
Feature Private IP Public IP
Used for Local network (LAN) Internet communication
Routable on internet? No Yes
Assigned by Router / DHCP server ISP
Unique scope Within local network only Globally unique
Requires NAT? Yes No
Visible on internet? No (hidden) Yes
Cost Free May cost extra
Example [Link] [Link]
One Line to Remember Each:
Private IP = Works INSIDE your home/office network only
Public IP = Works on the INTERNET — visible worldwide
NAT = The translator between Private ↔ Public IP
এই েব প্রশ্ন exam এ আেন এই notes যেনক েরােতর ত খনি পারনব! docx file াগন বন া।
— End of Notes —