PadhaikoAll subjects

Upper Layers and Network Design

Computer Networks (ENCT 304)

Open in the Padhaiko app

6.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.

OSI Upper Layers: Functions and Protocols
LayerCore ResponsibilitiesKey Services & MechanismsRepresentative Protocols / Formats
Session Layer (Layer 5)Establishes, manages, and terminates logical dialogs between applicationsDialog control (half/full-duplex turn management), synchronization (insertion of checkpoints for crash recovery), session authenticationNetBIOS, RPC, PPTP, SIP session state
Presentation Layer (Layer 6)Translates data syntax and semantics between heterogeneous systemsTranslation (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 humansResource sharing, file transfer, web browsing, directory services, electronic mail, network managementHTTP/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:

  1. Discover: Client broadcasts DHCPDISCOVER to locate servers.
  2. Offer: Server(s) reply with DHCPOFFER proposing an available IP lease.
  3. Request: Client broadcasts DHCPREQUEST accepting one server's offer.
  4. Acknowledge: Selected server sends DHCPACK finalizing the lease timer.

2. HTTP and HTTPS

3. FTP (File Transfer Protocol)

FTP transfers files reliably between hosts using two separate TCP connections (out-of-band control):

4. Email Protocols: SMTP, POP3, and IMAP

AspectPOP3IMAP
Primary StorageDownloads messages locally; typically deletes from serverRetains all messages and folders on the mail server
Multi-Device SyncPoor (read flags/folders do not sync across devices)Full bidirectional synchronization across laptop, phone, and webmail
Bandwidth EfficiencyDownloads entire messages including attachmentsCan fetch headers/snippets first and download attachments on demand

6.3 DNS, its function and DNS queries

Definition

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

  1. Root Name Servers: Top of the DNS hierarchy (. domain); direct queries to appropriate Top-Level Domain (TLD) servers.
  2. TLD Name Servers: Manage top-level domains such as .com, .org, .edu, and country-code TLDs such as .np.
  3. Authoritative Name Servers: Hold the definitive DNS zone records for specific organizations (e.g., pcampus.edu.np).
  4. 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


6.4 Network management tools and protocols (SNMP)

Essential Network Management & Diagnostic Tools

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:

  1. SNMP Manager (NMS): Central monitoring station that queries managed devices and logs alerts.
  2. SNMP Agent: Software daemon running on each managed network device.
  3. 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

Core Server Roles and Fundamental Configuration Directives
Server TypeCommon SoftwareKey Configuration Elements
Web ServerApache HTTPd, NginxListening port (80/443), DocumentRoot / root directory, virtual host (ServerName), TLS certificate/key paths, reverse-proxy upstream blocks
E-mail ServerPostfix (SMTP), Dovecot (IMAP/POP3)Primary domain (mydomain), mail relay restrictions, MX + SPF/DKIM/DMARC DNS records, TLS submission (587), mailbox storage (Maildir)
DNS ServerBIND9, UnboundAuthoritative zone files (SOA, NS, A, AAAA, MX, CNAME), serial number, TTL, forwarders and access-control lists (allow-query)
Proxy ServerSquid, NginxListening port (e.g., 3128), forward vs. reverse proxy mode, ACL rules (IP/domain filtering), disk/RAM cache size, authentication

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:

2. Fax over IP (FoIP)

FoIP transmits traditional facsimile documents across IP backbones rather than PSTN analog lines:

3. IP Interconnection (Peering and Transit)

Autonomous Systems interconnect at Internet Exchange Points (IXPs) or private links via:


6.7 Network design and configuration guidelines

Hierarchical Campus Network Design (Three-Tier Model)

  1. Access Layer: Connects end-user devices (PCs, IP phones, Wi-Fi APs) using Layer 2 switches; enforces VLAN segmentation, Port Security, and PoE.
  2. Distribution (Aggregation) Layer: Aggregates access switches; performs inter-VLAN routing, access control lists (ACLs), QoS policies, and redundant uplinks (HSRP/VRRP, STP root placement).
  3. 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


Worked Out Examples

Example 6.1

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:

  1. Non-persistent HTTP (one object per sequential TCP connection).
  2. Persistent HTTP without pipelining (one TCP connection, sequential requests).
  3. 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:

Answer:
  1. Non-persistent HTTP: ().
  2. Persistent HTTP (no pipelining): ().
  3. Persistent HTTP (pipelined): ().
Example 6.2

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.

  1. Compute the DNS lookup delay if the local resolver cache is completely empty (cold iterative lookup).
  2. Compute the DNS lookup delay if the record is already cached at the local resolver.
  3. 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 ():
Answer:
  1. Cold DNS lookup delay: .
  2. Cached DNS lookup delay: .
  3. Total time (cold DNS HTTP HTML fetch): .
Example 6.3

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.

  1. Calculate the voice payload size (in bytes) per packet.
  2. Calculate the total Layer 3 IP packet size (in bytes) and the Layer 3 bandwidth required per call direction (in ).
  3. 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:
Answer:
  1. Voice payload per packet: .
  2. Total IP packet size: ; required IP bandwidth: .
  3. Header overhead at Layer 3: .

Practice Exercises

Practice Exercises — Upper Layer Protocols, VoIP & Network Design

Question 1

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).
Answer:

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).

Question 2

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):

  1. Discover (DHCPDISCOVER): Client broadcasts to find available DHCP servers.
  2. Offer (DHCPOFFER): Server(s) propose an IP address, mask, gateway, and lease duration.
  3. Request (DHCPREQUEST): Client broadcasts acceptance of the chosen offer.
  4. 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.

Answer:

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.

Question 3

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:

  1. Non-persistent HTTP (serial connections).
  2. Persistent HTTP without pipelining.
  3. Persistent HTTP with pipelining.

Evaluating HTTP Variants ( total objects):

  • Non-persistent HTTP: .
  • Persistent (no pipelining): .
  • Persistent (pipelined): .
Answer:

Non-persistent HTTP: ; Persistent without pipelining: ; Persistent with pipelining: .

Question 4

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:
Answer:

Payload per packet is , Layer 3 bandwidth is , and protocol header overhead is .

Question 5

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:

  1. SNMP Manager (NMS): Polls devices via GetRequest/GetNextRequest, updates settings via SetRequest, and receives alerts on UDP port 162.
  2. SNMP Agent: Embedded daemon on managed devices listening on UDP port 161 and sending asynchronous Trap notifications.
  3. 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.
Answer:

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).

← Transport LayerAdvanced Topics →