CSS Prepare

optional · CSS study notes

Servers, Server Types & Protocol Stack

🧭

On this page — click any heading below to jump straight to it. ⬅️ Back to P-II.II. Computer Communications & Networks


OSI Layer: Application Layer (L5–L7)

Definition

A server is a program (and, by extension, the physical/virtual machine running it) that provides a service to other programs (clients) on request, typically running continuously and listening on a well-known port number for incoming connections — the provider side of the client-server architecture covered on the Network Application Architectures page.

Types of Servers (Classification by Function)

1. Web Server

  • Serves web pages and other content to browsers using HTTP (port 80) or HTTPS (port 443).
  • Examples: Apache HTTP Server, Nginx, Microsoft IIS.
  • Distinguished from an Application Server: a web server serves mostly static content and simple dynamic pages; an application server hosts the actual business logic/application code (e.g., Java EE, .NET) and is often placed behind a web server — a classic exam trap is treating the two as identical.

2. Mail Server

  • Actually two cooperating roles, often on separate protocols:
    • Outgoing/relay — SMTP (Simple Mail Transfer Protocol), port 25 (server-to-server relay) or 587 (client submission) — pushes mail from sender to recipient's mail server.
    • Incoming/retrieval — POP3 (port 110) downloads mail to one device and typically deletes it from the server, vs IMAP (port 143), which keeps mail synchronised on the server so it stays consistent across multiple devices.
  • This POP3-vs-IMAP distinction (download-and-delete vs synchronise) is a frequently tested comparison.

3. FTP Server

  • Transfers files using FTP, which uniquely uses two separate connections: a control connection (port 21) that stays open for commands, and a data connection (port 20 in active mode, or a dynamically negotiated port in passive mode, used for the actual file transfer).
  • Passive mode is preferred when the client is behind a firewall/NAT that would block an inbound active-mode data connection.

4. DNS Server

  • Resolves domain names to IP addresses, using port 53. Classified by role in the resolution hierarchy:
    • Root server — the top of the hierarchy, directs a query to the correct TLD server.
    • TLD (Top-Level Domain) server — handles one suffix (.com, .pk, etc.), directs to the correct authoritative server.
    • Authoritative server — holds the actual DNS records for a specific domain and gives the final answer.
    • Recursive resolver — the server a client actually queries (often run by an ISP); it performs the full root → TLD → authoritative walk on the client's behalf and caches the result.

5. DHCP Server

  • Dynamically assigns IP addresses (and related configuration: subnet mask, gateway, DNS servers) to hosts joining a network, using ports 67 (server) and 68 (client).
  • Operates via the DORA process: Discover (client broadcasts for a server) → Offer (server offers an address) → Request (client requests that specific offer) → Acknowledge (server confirms the lease).

6. Proxy Server

  • Forward proxy — sits in front of clients, forwarding their requests onward; hides the client's identity from the destination server and can enforce content filtering/caching for an organisation.
  • Reverse proxy — sits in front of one or more servers, forwarding client requests to them; hides the server's identity/topology from clients and commonly performs load balancing, SSL termination, and caching.

7. File Server

  • Shares files/storage over a network using protocols such as SMB/CIFS (port 445) (Windows-native file sharing) or NFS (Network File System) (common in Unix/Linux environments).

8. Database Server

  • Hosts a DBMS and answers structured queries from client applications, typically over a vendor-specific TCP port (e.g., MySQL 3306, PostgreSQL 5432, MS SQL Server 1433), often accessed via a driver interface such as ODBC/JDBC.

9. Application Server

  • Hosts and executes the core business-logic layer of an application (as opposed to just serving static pages), commonly sitting between a web server (front end) and a database server (back end) in a classic three-tier architecture.

10. Print Server

  • Manages and queues print jobs from multiple clients to shared network printers.

11. Virtual / Cloud Server

  • A virtualised compute instance (e.g., AWS EC2, Azure VM) that can be configured to run any of the above server roles without dedicated physical hardware — the modern deployment model for most of these services.

Well-Known Server Ports (Quick Reference)

Server / ProtocolPort(s)Transport
HTTP80TCP
HTTPS443TCP
FTP20 (data), 21 (control)TCP
SSH22TCP
Telnet23TCP
SMTP25 / 587TCP
DNS53UDP (queries) / TCP (zone transfers, large responses)
DHCP67 (server), 68 (client)UDP
POP3110TCP
IMAP143TCP
SNMP161UDP
SMB/CIFS445TCP

Protocols Working at Each OSI Layer (Full Classification)

Every server ultimately depends on a full protocol stack beneath its own application-layer protocol — this table is the complete cross-reference tying servers back to the OSI Model page:

OSI LayerProtocolsRelevance to Servers
Application (L7)HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, DHCP, SNMP, Telnet, SSH, SIPThe actual server-provided service protocol
Presentation (L6)SSL/TLS, JPEG, ASCII/EBCDICEncrypts/formats data before it reaches the application (e.g., HTTPS = HTTP + TLS)
Session (L5)NetBIOS, RPC, PPTPManages the logical session between client and server
Transport (L4)TCP, UDP, SCTPDelivers data to the correct server process via its listening port
Network (L3)IP, ICMP, IGMP, RIP, OSPF, BGPRoutes client requests to the server's host across networks
Data Link (L2)Ethernet, PPP, HDLC, ARPDelivers frames on the local link to/from the server's NIC
Physical (L1)Cabling/signal standards (e.g., 802.3 physical specs, DSL, fibre standards)Carries the raw bits to and from the server hardware

Process Walkthroughs

DHCP DORA (getting an IP address)

  1. Discover — client broadcasts a DHCPDISCOVER (no IP yet, so it broadcasts to 255.255.255.255).
  2. Offer — an available DHCP server responds with DHCPOFFER, proposing an address and lease.
  3. Request — client broadcasts DHCPREQUEST, explicitly accepting one specific offer (also tells any other offering servers their offer wasn't taken).
  4. Acknowledge — the chosen server responds with DHCPACK, finalising the lease.

Recursive DNS Resolution (looking up a domain)

  1. Client asks its configured recursive resolver for www.example.com.
  2. Resolver asks a root server, which replies with the address of the .com TLD server.
  3. Resolver asks the TLD server, which replies with the address of example.com's authoritative server.
  4. Resolver asks the authoritative server, which returns the actual IP address.
  5. Resolver caches and returns the answer to the client — subsequent lookups are answered instantly from cache until the record's TTL expires.

CSS Exam Angle

  • A very common short-question format is "differentiate a web server from an application server" or "differentiate POP3 from IMAP" — both are one-paragraph, high-value answers if memorised precisely.
  • The DORA and recursive DNS resolution sequences are favourite "explain the steps" questions — draw them as a simple numbered client/server message sequence.
  • Classifying DNS servers into root/TLD/authoritative/recursive shows depth beyond "DNS resolves names to IPs."
  • Tie this page back to Network Application Architectures (client-server model) and OSI Model (which layer each protocol belongs to) for a well-integrated answer if a question spans multiple topics.

Example / Pakistan Context

A typical Pakistani ISP runs recursive DNS resolvers for its subscribers, a DHCP server to assign home-router IP addresses dynamically, and increasingly hosts reverse proxy/CDN cache servers (see Content Distribution Networks) inside its own network to reduce dependence on expensive international bandwidth — three different server types cooperating invisibly every time a user opens a website.

Likely Questions

  1. Differentiate a web server, an application server, and a database server.
  2. Explain the DORA process by which a DHCP server assigns an IP address to a client.
  3. Differentiate POP3 and IMAP as mail-retrieval protocols.
  4. Classify DNS servers by their role in the resolution hierarchy and explain recursive resolution step by step.
  5. Differentiate a forward proxy from a reverse proxy.
  6. Map each major server protocol (HTTP, FTP, SMTP, DNS, DHCP) to its OSI layer and port number.

📜 Past-Paper Questions & Structured Answers

Questions are paraphrased; answer focus is suggested guidance, not an official marking scheme.

2020 · Paper-I · Q3(a) · 4 marks

Question (paraphrased): Identify conventional ports for five named Internet services.

Answer focus: Write the requested service/port table directly.

ServiceStandard port
HTTP80
FTP21 control; 20 for active-mode server data
SMTP25 for mail transfer between servers
HTTPS443
DNS53

DNS uses both UDP and TCP. FTP passive data uses a negotiated port. HTTP/3 uses QUIC/UDP at 443; classical HTTPS uses TCP. These qualifications prevent the memorised table from becoming an absolute rule.

Related question: 2018 Paper-I Q2(a), 4 marks, asks for TCP/IP layers. The complete layer/function answer is in OSI Model. Server types themselves were not found as a separate descriptive question in the reviewed set.