Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Session, Presentation & Application Layers: HTTP, FTP, DNS & Email Protocols

Lesson 15 of 15 in the free Computer Networks notes on Siksha Sarovar, written by Rohit Jangra.

Session, Presentation & Application Layers: HTTP, FTP, DNS & Email Protocols

---

1. HTTP (HyperText Transfer Protocol)

HTTP is the foundation of data exchange on the World Wide Web.

HTTP Request Methods

MethodPurposeBody?Idempotent?
GETRetrieve a resourceNoYes
POSTSubmit data (create/update)YesNo
PUTReplace resource entirelyYesYes
PATCHPartial update of resourceYesNo
DELETERemove a resourceNoYes
HEADGET but headers onlyNoYes
OPTIONSQuery server capabilitiesNoYes

HTTP Status Codes

Code RangeCategoryCommon Examples
1xxInformational100 Continue
2xxSuccess200 OK, 201 Created, 204 No Content
3xxRedirection301 Moved Permanently, 302 Found, 304 Not Modified
4xxClient Error400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found
5xxServer Error500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable

HTTP Versions

VersionTransportKey Features
HTTP/1.0TCPNew connection per request (no keep-alive)
HTTP/1.1TCPPersistent connections, pipelining, Host header
HTTP/2TCP+TLSBinary framing, multiplexing, header compression (HPACK)
HTTP/3QUIC (UDP)0-RTT, no head-of-line blocking, connection migration
Exam Tip: HTTP is stateless — each request is independent. State (sessions, login) is maintained by cookies, session tokens, or application state. HTTP by default uses TCP port 80; HTTPS = HTTP over TLS on port 443.

---

2. FTP (File Transfer Protocol)

FTP uses two TCP connections simultaneously:

  1. Control connection (port 21): Commands and responses
  2. Data connection (port 20): Actual file data transfer

FTP Modes

ModeData ConnectionFirewall Friendly?
ActiveServer initiates data connection to client (port 20)No — firewall blocks incoming
PassiveClient initiates both connections to serverYes — client initiates all

FTP Commands

CommandPurpose
USER usernameAuthenticate username
PASS passwordAuthenticate password
LISTList directory contents
RETR filenameDownload file
STOR filenameUpload file
QUITClose connection

Security: Standard FTP transmits passwords in plaintext — use SFTP (SSH File Transfer Protocol, port 22) or FTPS (FTP over TLS/SSL) for security.

---

3. Email Protocols

SMTP (Simple Mail Transfer Protocol) — Port 25/587

SMTP is used for sending email between mail servers and from clients to servers.

CommandPurpose
HELO / EHLOIdentify sending server
MAIL FROM:Specify sender email
RCPT TO:Specify recipient email
DATABegin email body
. (single dot)End of email body
QUITClose connection

POP3 (Post Office Protocol 3) — Port 110/995

POP3 downloads email to the local client and (by default) deletes it from the server.

  • Simple and offline-focused
  • Not suitable for accessing mail from multiple devices
  • Port 110 (plain), Port 995 (SSL/TLS)

IMAP (Internet Message Access Protocol) — Port 143/993

IMAP keeps mail on the server and synchronises state across all clients.

  • Access same mailbox from phone, laptop, webmail
  • Supports folders, flags, search on server
  • Port 143 (plain), Port 993 (SSL/TLS)
FeaturePOP3IMAP
Mail storageLocal (downloaded, deleted)Server-side (persistent)
Multi-devicePoorExcellent
Offline accessYes (after download)Limited (headers cached)
SearchLocal onlyServer-side search
Folder syncNoYes
Use caseSingle-device, offlineMulti-device, always-connected

---

4. DHCP (Dynamic Host Configuration Protocol)

DHCP automatically assigns IP configuration to hosts — uses UDP (port 67 server, port 68 client).

DHCP DORA Process

StepMessageDirectionContent
D — DiscoverDHCPDISCOVERClient broadcasts"I need an IP address"
O — OfferDHCPOFFERServer unicast/broadcast"I offer you 192.168.1.50 for 24 hours"
R — RequestDHCPREQUESTClient broadcasts"I accept the offer from that server"
A — AcknowledgeDHCPACKServer unicast"Confirmed — here are your IP, mask, gateway, DNS"

DHCP assigns: IP address, subnet mask, default gateway, DNS server(s), lease duration.

---

5. SSH (Secure Shell) — Port 22

SSH provides encrypted remote shell access and replaces insecure Telnet (port 23).

FeatureSSHTelnet
EncryptionFull (AES, ChaCha20)None (plaintext)
AuthenticationPassword or public keyPassword only
SecuritySecureHighly insecure
Port2223
UseAll secure remote managementLegacy only (avoid)

SSH also supports:

  • SCP (Secure Copy) — file transfer
  • SFTP — full FTP-like file management over SSH
  • SSH tunnelling — encrypt and forward other TCP connections through SSH

---

6. SNMP (Simple Network Management Protocol) — Port 161/162

SNMP manages and monitors network devices (routers, switches, servers).

ComponentDescription
SNMP ManagerManagement station (queries devices)
SNMP AgentSoftware running on managed device
MIB (Management Information Base)Database of variables the agent can report
OID (Object Identifier)Unique identifier for each MIB variable
Community StringPassword-like authentication (SNMPv1/v2c — insecure)
SNMPv3Adds encryption and strong authentication

SNMP Operations

OperationDirectionPurpose
GETManager → AgentRead a variable value
SETManager → AgentWrite a variable value
GETNEXTManager → AgentRead next variable in MIB tree
TRAPAgent → ManagerUnsolicited alert (device event)

---

7. Complete Protocol Reference

ProtocolPort(s)TransportSecure Variant
HTTP80TCPHTTPS (443)
FTP20/21TCPSFTP (22), FTPS (990)
SSH22TCP(itself is secure)
Telnet23TCPUse SSH instead
SMTP25/587TCPSMTPS (465)
DNS53UDP/TCPDoH, DoT
DHCP67/68UDP
POP3110TCPPOP3S (995)
IMAP143TCPIMAPS (993)
SNMP161/162UDPSNMPv3
HTTPS443TCP(itself is secure)
RDP3389TCPVPN + RDP
Exam Tip: Know the port numbers in the table above — they are among the most commonly tested facts in computer networks MCQs. Also remember: DNS uses UDP for queries ≤512 bytes and TCP for zone transfers or large responses. DHCP uses UDP because the client doesn't have an IP address yet.

---

Study Deep: Modern Application Layer Security

  • TLS 1.3 (the latest version of TLS) drastically improved security and performance — 1-RTT handshake (vs 2-RTT in TLS 1.2), removed weak cipher suites, forward secrecy mandatory. Nearly all HTTPS today uses TLS 1.2 or 1.3.
  • QUIC and HTTP/3: By running over UDP, QUIC can establish connections faster (0-RTT for known servers), avoids TCP head-of-line blocking, and can migrate connections between network interfaces (e.g., Wi-Fi to cellular) without dropping the connection.
  • API security: Modern web APIs use HTTPS + JWT (JSON Web Tokens) for stateless authentication — no server-side session storage required. OAuth 2.0 is the standard for delegated authorisation.