Unit 5

Application Layer (Layer 7)

Topmost layer (Layer 7) of OSI model. Provides network services directly to user applications. Handles interface between user software and network. Doesn't transmit data - formats and requests lower layers.

Key Services: File transfer, email, web access, remote login, name resolution

DNS (Domain Name System)

What DNS Does

Translates human-readable domains (google.com) → machine-readable IPs (142.250.190.78)

DNS Resolution Process

  1. Browser: Type google.com
  2. Local cache check
  3. Recursive resolver → ISP DNS
  4. Root servers (13 worldwide) → TLD (.com)
  5. TLD → Authoritative NS
  6. Google NS returns IP → Cached (TTL)

DNS Record Types

TypePurposeExample
AIPv4google.com → 142.250.190.78
AAAAIPv6google.com → 2607:f8b0:...
CNAMEAliaswww → google.com
MXMailgoogle.com → gmail-smtp...
NSName servergoogle.com → ns1.google.com

Port: UDP/TCP 53 | Security: DNSSEC

FTP (File Transfer Protocol)

Modes

ModeClient SaysConnection
Active"You call me"Server→Client (port 20)
Passive"I'll call you"Client→Server (random port)

Commands

CommandPurposeExample
USERUsernameUSER john
PASSPasswordPASS secret123
LISTDirectoryLIST
RETRDownloadRETR file.txt
STORUploadSTOR file.txt

Ports: Control=21, Data=20 | Security: FTPS, SFTP

WWW & HTTP

WWW Components

URL Structure

https://www.example.com:8080/path/to/page.html?query=value#section
Protocol | Domain | Port | Path | Params | Anchor

HTTP Methods

MethodPurposeIdempotentSafe
GETRetrieveYesYes
POSTSendNoNo
PUTUpdateYesNo
DELETERemoveYesNo

Status Codes

CodeCategoryMeaning
200SuccessOK
301RedirectionMoved Permanently
404Client ErrorNot Found
500Server ErrorInternal Error

Ports: HTTP=80, HTTPS=443

TELNET

Remote terminal access over TCP 23. Gets interactive shell remotely.

TELNET vs SSH

FeatureTELNETSSH
EncryptionNoneEncrypted
AuthPasswordKeys+Password
SecurityInsecureSecure
Port2322

Bluetooth

Versions

VersionSpeedRangeFeature
4.01 Mbps10mLow Energy
5.02 Mbps40mBetter range
5.22 Mbps240mLE Audio

Architecture: Piconet (1 master + 7 slaves), Scatternet | Frequency: 2.4 GHz

Firewalls

Types

TypeLayerInspection
Packet FilterL3IP/Port
StatefulL3+L4Connection tracking
ProxyL7Deep inspection
NGFWAllApp-aware + threats

Rules Example

ALLOW TCP 192.168.1.0/24 → 80 (web)
ALLOW UDP 192.168.1.0/24 → 53 (DNS)
DENY TCP port 23 (Telnet)
ALLOW ESTABLISHED,RELATED

Cryptography

Key Concepts

TermMeaning
SymmetricSame key (AES)
AsymmetricPublic/private (RSA)
HashOne-way (SHA-256)
SignatureAuthenticity proof

TLS Handshake

  1. Client Hello (ciphers)
  2. Server Hello + Certificate
  3. Client verifies → Key exchange
  4. Session keys derived
  5. Encrypted data

Algorithms: AES-256, RSA-4096, SHA-256, Diffie-Hellman