Upper Layers and Network Design
Open in the Padhaiko app6.1 Functions and services of session, presentation and application layers
In the OSI reference model, the top three layers (Layers 5, 6, and 7) handle user-facing communication, data representation, and application interaction. In the TCP/IP suite, these responsibilities are consolidated inside the single Application Layer.
| Layer | Core Responsibilities | Key Services & Mechanisms | Representative Protocols / Formats |
|---|---|---|---|
| Session Layer (Layer 5) | Establishes, manages, and terminates logical dialogs between applications | Dialog control (half/full-duplex turn management), synchronization (insertion of checkpoints for crash recovery), session authentication | NetBIOS, RPC, PPTP, SIP session state |
| Presentation Layer (Layer 6) | Translates data syntax and semantics between heterogeneous systems | Translation (ASCII/UTF-8, big-endian/little-endian), encryption/decryption, data compression (lossy/lossless) | TLS/SSL, JPEG, MPEG, PNG, JSON, ASN.1 |
| Application Layer (Layer 7) | Provides network services directly to end-user software and humans | Resource sharing, file transfer, web browsing, directory services, electronic mail, network management | HTTP/HTTPS, DNS, DHCP, SMTP, IMAP, FTP, SNMP |
6.2 Introduction to upper layer protocols: DHCP, HTTP, HTTPS, FTP, SMTP, POP, IMAP
1. DHCP (Dynamic Host Configuration Protocol)
DHCP (UDP ports 67 server, 68 client) automates IP address assignment along with subnet mask, default gateway, and DNS server settings using the DORA 4-step exchange:
- Discover: Client broadcasts
DHCPDISCOVERto locate servers. - Offer: Server(s) reply with
DHCPOFFERproposing an available IP lease. - Request: Client broadcasts
DHCPREQUESTaccepting one server's offer. - Acknowledge: Selected server sends
DHCPACKfinalizing the lease timer.
2. HTTP and HTTPS
- HTTP (Hypertext Transfer Protocol — TCP port
80): Stateless request–response protocol transferring web resources (GET,POST,PUT,DELETE,HEAD).- Non-persistent HTTP (HTTP/1.0): Opens a fresh TCP connection for every object ( per object).
- Persistent HTTP (HTTP/1.1+): Reuses one TCP connection for multiple objects, reducing handshake overhead and enabling pipelining (or multiplexed streams in HTTP/2 and QUIC-based HTTP/3).
- HTTPS (HTTP Secure — TCP port
443): Runs HTTP inside an encrypted TLS (Transport Layer Security) tunnel, providing confidentiality (symmetric session encryption), integrity (MAC/AEAD tags), and server authentication (X.509 digital certificates).
3. FTP (File Transfer Protocol)
FTP transfers files reliably between hosts using two separate TCP connections (out-of-band control):
- Control Connection (TCP port
21): Persistent session carrying commands (USER,PASS,LIST,RETR,STOR) and status replies. - Data Connection (TCP port
20in Active mode, or ephemeral port in Passive mode): Opened per file transfer or directory listing.
4. Email Protocols: SMTP, POP3, and IMAP
- SMTP (Simple Mail Transfer Protocol — TCP port
25, submission587): Push protocol used to send mail from a client to a mail server and relay mail between Mail Transfer Agents (MTAs). Transfers 7-bit ASCII text (extended via MIME for binary attachments). - POP3 (Post Office Protocol v3 — TCP port
110, TLS995): Pull protocol following a "download-and-delete" model; suitable when mail is accessed from a single offline device, with minimal server-side folder synchronization. - IMAP (Internet Message Access Protocol — TCP port
143, TLS993): Pull protocol keeping messages and folder hierarchy stored centrally on the mail server, supporting partial header fetching, server-side search, and multi-device synchronization.
| Aspect | POP3 | IMAP |
|---|---|---|
| Primary Storage | Downloads messages locally; typically deletes from server | Retains all messages and folders on the mail server |
| Multi-Device Sync | Poor (read flags/folders do not sync across devices) | Full bidirectional synchronization across laptop, phone, and webmail |
| Bandwidth Efficiency | Downloads entire messages including attachments | Can fetch headers/snippets first and download attachments on demand |
6.3 DNS, its function and DNS queries
Domain Name System (DNS)
The Domain Name System (DNS) is a hierarchical, distributed database implemented over UDP/TCP port 53 that translates human-readable domain names (such as ioe.edu.np) into IPv4 (A), IPv6 (AAAA), mail server (MX), canonical alias (CNAME), and name server (NS) records.
Hierarchical Namespace and Server Tiers
- Root Name Servers: Top of the DNS hierarchy (
.domain); direct queries to appropriate Top-Level Domain (TLD) servers. - TLD Name Servers: Manage top-level domains such as
.com,.org,.edu, and country-code TLDs such as.np. - Authoritative Name Servers: Hold the definitive DNS zone records for specific organizations (e.g.,
pcampus.edu.np). - Local DNS Resolver (Caching Resolver): Operated by an ISP or campus network; accepts client requests, resolves them on the client's behalf, and caches answers according to each record's TTL (Time to Live).
DNS Query Types: Recursive vs. Iterative
- Recursive Query: The requester demands a final answer (or error) from the queried DNS server. Typically used between the client stub resolver and the local DNS resolver.
- Iterative Query: The queried server returns either the final answer (if authoritative/cached) or a referral to the next lower server in the hierarchy. Typically used by the local resolver querying Root TLD Authoritative servers.
6.4 Network management tools and protocols (SNMP)
Essential Network Management & Diagnostic Tools
ping: Uses ICMP Echo Request/Reply to test Layer 3 reachability and measure RTT/packet loss.traceroute/tracert: Probes intermediate router hops by incrementing IPTTLstarting from and capturing ICMPTime Exceededreplies.ip/ifconfig,netstat/ss,nslookup/dig,tcpdump/ Wireshark: Inspect interface configurations, active sockets, DNS records, and live packet captures.
Simple Network Management Protocol (SNMP)
SNMP (UDP ports 161 for polling/commands, 162 for asynchronous traps) monitors and manages routers, switches, servers, and printers using three components:
- SNMP Manager (NMS): Central monitoring station that queries managed devices and logs alerts.
- SNMP Agent: Software daemon running on each managed network device.
- Management Information Base (MIB): Hierarchical tree of managed parameters (interface counters, CPU load, uptime), each addressed by a numeric Object Identifier (OID).
Core SNMP Operations (PDUs): GetRequest, GetNextRequest, GetBulkRequest (SNMPv2c/v3), SetRequest, Response, Trap (unsolicited alert from Agent to Manager), and InformRequest (acknowledged alert). SNMPv3 adds authentication and encryption (USM), fixing plaintext community-string weaknesses in SNMPv1/v2c.
6.5 Basics of web, e-mail, DNS and proxy server configurations
| Server Type | Common Software | Key Configuration Elements |
|---|---|---|
| Web Server | Apache HTTPd, Nginx | Listening port (80/443), DocumentRoot / root directory, virtual host (ServerName), TLS certificate/key paths, reverse-proxy upstream blocks |
| E-mail Server | Postfix (SMTP), Dovecot (IMAP/POP3) | Primary domain (mydomain), mail relay restrictions, MX + SPF/DKIM/DMARC DNS records, TLS submission (587), mailbox storage (Maildir) |
| DNS Server | BIND9, Unbound | Authoritative zone files (SOA, NS, A, AAAA, MX, CNAME), serial number, TTL, forwarders and access-control lists (allow-query) |
| Proxy Server | Squid, Nginx | Listening port (e.g., 3128), forward vs. reverse proxy mode, ACL rules (IP/domain filtering), disk/RAM cache size, authentication |
- Forward Proxy: Positioned near clients to enforce content filtering, cache repeated downloads, and hide client IPs from external sites.
- Reverse Proxy: Positioned in front of backend servers to perform TLS termination, load balancing, DDoS protection, and static caching.
6.6 VoIP, FoIP and IP interconnection
1. Voice over IP (VoIP)
VoIP digitizes analog voice, compresses it via a codec (e.g., G.711 at , G.729 at ), and streams frames over IP networks:
- Signaling Plane: SIP (Session Initiation Protocol — port
5060/5061) or H.323 sets up, modifies, and tears down calls. - Media Plane: RTP (Real-time Transport Protocol) over UDP delivers audio packets with timestamps and sequence numbers for jitter-buffer playout; RTCP monitors packet loss and jitter.
- QoS Sensitivity: Voice requires low one-way delay (), minimal jitter (), and low loss (), necessitating DiffServ DSCP prioritization (
EF— Expedited Forwarding).
2. Fax over IP (FoIP)
FoIP transmits traditional facsimile documents across IP backbones rather than PSTN analog lines:
- T.38 Protocol (Real-time FoIP): Demodulates the analog fax tones at the sending gateway into digital T.38 packets over UDP/TCP, avoiding compression distortion caused by voice codecs like G.729.
- T.37 Protocol (Store-and-Forward): Converts fax images into email attachments (TIFF/PDF) delivered via SMTP.
3. IP Interconnection (Peering and Transit)
Autonomous Systems interconnect at Internet Exchange Points (IXPs) or private links via:
- Transit: A customer AS pays an upstream ISP to reach the entire global routing table.
- Peering: Two ASes exchange traffic directly between their own customers (often settlement-free) via BGP to lower latency and transit fees.
6.7 Network design and configuration guidelines
Hierarchical Campus Network Design (Three-Tier Model)
- Access Layer: Connects end-user devices (PCs, IP phones, Wi-Fi APs) using Layer 2 switches; enforces VLAN segmentation, Port Security, and PoE.
- Distribution (Aggregation) Layer: Aggregates access switches; performs inter-VLAN routing, access control lists (ACLs), QoS policies, and redundant uplinks (HSRP/VRRP, STP root placement).
- Core (Backbone) Layer: High-speed, low-latency packet switching connecting distribution blocks and data centers; avoids complex packet inspection/ACLs so traffic forwards at wire speed.
Key Configuration & Design Guidelines
- Redundancy & High Availability: Eliminate single points of failure with dual uplinks, link aggregation (LACP), and redundant power/routing gateways.
- Scalability & Modularity: Summarize IP addressing blocks cleanly per building/VLAN so routing tables remain compact.
- Security & Manageability: Separate management traffic onto a dedicated management VLAN, disable unused switch ports, enforce SSH/SNMPv3 instead of Telnet/SNMPv1, and maintain documented IP plans and backups.
Worked Out Examples
6.1
A client browser fetches an HTML page containing references to small embedded images from the same web server. The network round-trip time is , and object transmission time is negligible. Compute the total time required to receive the HTML file and all images (excluding DNS lookup) under:
- Non-persistent HTTP (one object per sequential TCP connection).
- Persistent HTTP without pipelining (one TCP connection, sequential requests).
- Persistent HTTP with pipelining (one TCP connection, parallel pipelined image requests).
Case 1 — Non-Persistent HTTP: Each object requires for the TCP handshake plus for the HTTP GET/response ( per object). With HTML file and images ( objects total):
Case 2 — Persistent HTTP without Pipelining: TCP connection setup takes once, the HTML file takes , and each of the images is requested sequentially ( each):
Case 3 — Persistent HTTP with Pipelining:
- Non-persistent HTTP: ().
- Persistent HTTP (no pipelining): ().
- Persistent HTTP (pipelined): ().
6.2
A user opens https://portal.example.edu.np. The RTT between the client and its local DNS resolver is . The RTTs from the local resolver to the Root server, .np TLD server, and authoritative example.edu.np server are , , and respectively. Assume the web server itself is also RTT away from the client.
- Compute the DNS lookup delay if the local resolver cache is completely empty (cold iterative lookup).
- Compute the DNS lookup delay if the record is already cached at the local resolver.
- Using the cold DNS lookup, calculate the total time until the client receives the HTML document over a plain HTTP persistent connection (ignore TLS handshake).
Cold Iterative DNS Resolution Delay: The client sends a recursive query to its local resolver and waits for the local resolver to perform three sequential iterative queries (Root TLD Authoritative) and return the reply:
Cached DNS Hit and Total Page Fetch Time:
- On a cache hit, the local resolver answers immediately without contacting Root/TLD/Authoritative servers:
- After resolving the IP in , fetching the HTML page over HTTP requires for TCP handshake plus for HTTP GET/response ():
- Cold DNS lookup delay: .
- Cached DNS lookup delay: .
- Total time (cold DNS HTTP HTML fetch): .
6.3
A VoIP call uses the G.711 codec at with a packetization interval (). Each voice payload is encapsulated with RTP (), UDP (), and IPv4 () headers.
- Calculate the voice payload size (in bytes) per packet.
- Calculate the total Layer 3 IP packet size (in bytes) and the Layer 3 bandwidth required per call direction (in ).
- Compute the percentage of Layer 3 bandwidth consumed by protocol headers.
Calculating Voice Payload per Packet: In each () interval at :
Calculating Total Packet Size, Bandwidth, and Overhead:
- Protocol headers .
- Total Layer 3 packet size ().
- At :
- Header overhead percentage:
- Voice payload per packet: .
- Total IP packet size: ; required IP bandwidth: .
- Header overhead at Layer 3: .
Practice Exercises
Practice Exercises — Upper Layer Protocols, VoIP & Network Design
Distinguish between the roles of the Session Layer, Presentation Layer, and Application Layer in the OSI model, giving two concrete responsibilities and one protocol/format example for each.
Reviewing the Top Three OSI Layers:
- Session Layer (Layer 5): Manages logical conversations between applications through dialog control (half/full-duplex turn-taking) and checkpoint synchronization for resuming interrupted transfers (e.g., NetBIOS, RPC).
- Presentation Layer (Layer 6): Handles syntax/semantics differences across hosts via data translation (UTF-8, endianness), encryption, and compression (e.g., TLS/SSL, JPEG).
- Application Layer (Layer 7): Interfaces directly with user software to deliver network services such as web transport and name resolution (e.g., HTTP, DNS).
Session Layer governs dialog control and checkpoints (e.g., RPC); Presentation Layer handles syntax translation, compression, and encryption (e.g., TLS/JPEG); Application Layer provides user-facing network services like web and mail (e.g., HTTP, SMTP).
Explain the four-message DHCP DORA sequence for dynamic IP address lease acquisition, and compare POP3 vs. IMAP for retrieving electronic mail.
DHCP DORA Sequence (UDP ports 67/68):
- Discover (
DHCPDISCOVER): Client broadcasts to find available DHCP servers. - Offer (
DHCPOFFER): Server(s) propose an IP address, mask, gateway, and lease duration. - Request (
DHCPREQUEST): Client broadcasts acceptance of the chosen offer. - Acknowledge (
DHCPACK): Server commits the lease and confirms parameters to the client.
POP3 vs. IMAP: POP3 (110/995) typically downloads messages to a single client and deletes them from the server, making multi-device folder sync difficult. IMAP (143/993) keeps mail and folders synchronized on the server so multiple devices view identical folder states and read flags.
DHCP uses Discover, Offer, Request, and Acknowledge to lease IP configurations automatically. POP3 downloads mail locally without server-side folder sync, whereas IMAP retains mail on the server for full multi-device synchronization.
A web page consists of one HTML file and embedded CSS/image objects hosted on one server with (assume negligible transmission delay). Calculate the page load time (excluding DNS) for:
- Non-persistent HTTP (serial connections).
- Persistent HTTP without pipelining.
- Persistent HTTP with pipelining.
Evaluating HTTP Variants ( total objects):
- Non-persistent HTTP: .
- Persistent (no pipelining): .
- Persistent (pipelined): .
Non-persistent HTTP: ; Persistent without pipelining: ; Persistent with pipelining: .
A VoIP system uses the G.729 codec () with a packetization interval () and of combined RTP (), UDP (), and IPv4 () headers per packet. Calculate the payload bytes per packet, the total Layer 3 IP bandwidth per direction (in ), and the header overhead percentage.
Computing Payload, Bandwidth, and Overhead:
- Voice payload per packet:
- Total Layer 3 packet size .
- Layer 3 bandwidth at :
- Header overhead percentage:
Payload per packet is , Layer 3 bandwidth is , and protocol header overhead is .
Describe the three architectural components of SNMP and the roles of the three tiers (Access, Distribution, Core) in a hierarchical campus network design.
SNMP Architecture:
- SNMP Manager (NMS): Polls devices via
GetRequest/GetNextRequest, updates settings viaSetRequest, and receives alerts on UDP port162. - SNMP Agent: Embedded daemon on managed devices listening on UDP port
161and sending asynchronousTrapnotifications. - MIB (Management Information Base): Structured database of device metrics identified by numeric OIDs.
Three-Tier Campus Design:
- Access Layer: Connects end hosts and wireless APs; enforces VLANs and port security.
- Distribution Layer: Aggregates access switches; provides inter-VLAN routing, ACLs, QoS, and gateway redundancy.
- Core Layer: High-speed backbone forwarding packets rapidly between distribution blocks without complex policy bottlenecks.
SNMP comprises the Manager, Agent, and MIB (with OIDs). A hierarchical campus design separates user connectivity (Access), policy/routing aggregation (Distribution), and high-speed wire-rate switching (Core).