optional · CSS study notes
Network Application Architectures
🧭
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 network application architecture is the structural pattern by which processes on different hosts are organised to communicate and divide work.
Client-Server Architecture
- Server — provides a service at a discoverable endpoint, often through DNS; it may use changing addresses, replication or load balancing.
- Client — intermittently connected, may have dynamic IP; initiates requests
- Clients do not communicate directly with each other
- Server farms / data centres used to scale a single logical server
- Examples: Web (HTTP), email (SMTP/IMAP), FTP, online banking
Advantages
- Centralised control, backup, and security policy
- Easier administration and data consistency
- Well-defined accountability
Disadvantages
- Server is a single point of failure and a bottleneck
- Costly infrastructure and bandwidth at server side
- Scalability requires expensive replication/load balancing
Peer-to-Peer (P2P) Architecture
- Minimal or no reliance on always-on servers
- Each peer acts as client and server simultaneously
- Self-scalability — each new peer adds demand but also adds service capacity
- Examples: BitTorrent, blockchain node networks, early Skype
Advantages
- Highly scalable and cost-effective
- No single point of failure; resilient
- Uses otherwise idle end-user resources
Disadvantages
- Security and trust difficult to enforce
- Free-riding (peers download without uploading)
- ISP-unfriendly (heavy upstream traffic); legal/copyright issues
- Peer churn — nodes join and leave unpredictably
Hybrid Architecture
- Central server for indexing, login, or discovery; data transfer directly peer-to-peer
- Examples: original Napster (central index), Skype (central login + P2P media), BitTorrent with trackers
Process Communication Basics
- Socket = interface between application process and transport layer; identified by IP address + port number
- Client process initiates contact; server process waits to be contacted
- Application requirements shaping architecture choice: reliable data transfer, throughput (bandwidth-sensitive vs elastic apps), timing/delay, security
Comparison
| Basis | Client-Server | Peer-to-Peer |
|---|---|---|
| Control | Centralised | Decentralised |
| Cost | High (server infra) | Low |
| Scalability | Limited, costly | Self-scaling |
| Reliability | Single point of failure | Resilient |
| Security | Easier to enforce | Difficult |
| Example | Web, email | BitTorrent, blockchain |
Numericals
Q1 — Client-server distribution time
File F = 100 Mb, server upload rate u_s = 10 Mbps, N = 10 clients, slowest client download d_min = 5 Mbps.
- Server must upload N×F = 1,000 Mb → 1,000 ÷ 10 = 100 s
- Slowest client needs F ÷ d_min = 100 ÷ 5 = 20 s
- D_cs = max(100, 20) = 100 seconds
- Note: time grows linearly with N
Q2 — P2P distribution time
Same file, peer upload rates sum Σuᵢ = 40 Mbps, u_s = 10 Mbps, d_min = 5 Mbps.
- F ÷ u_s = 10 s
- F ÷ d_min = 20 s
- N×F ÷ (u_s + Σuᵢ) = 1,000 ÷ 50 = 20 s
- D_P2P = max(10, 20, 20) = 20 seconds
- Conclusion: P2P is 5× faster here and scales far better as N grows
Q3 — Scaling comparison
For N = 100 with same rates:
- Client-server = 10,000 ÷ 10 = 1,000 s (10× worse)
- P2P ≈ max(10, 20, 10,000 ÷ (10 + 400)) ≈ 24.4 s (barely worse)
CSS Exam Angle
- A direct 2017 client–server/P2P comparison was not verified. Related three-tier questions and the 2026 P2P MCQ are identified with exact references below.
- The self-scalability argument plus the distribution-time numerical is what separates a top answer from a generic one
- Mention hybrid architecture; most candidates cover only two models
- Cite blockchain/BitTorrent as modern P2P and online banking as security-critical client-server
Likely Questions
- Practice: compare client-server and peer-to-peer architectures with examples.
- What is self-scalability in P2P? Prove it with a distribution-time calculation.
- Explain sockets and process addressing in network applications.
📜 Past-Paper Questions & Structured Answers
Questions are paraphrased; answer focus is suggested guidance, not an official marking scheme.
Attribution correction: no direct 2017 client–server versus P2P comparison was located. The year in the old topic title was not a verified question reference. The following are related application-architecture questions from the web-engineering portion.
2018 · Paper-II · Q8(A) · 8 marks
Question (paraphrased): Explain three-tier architecture through presentation, business logic and data access.
Answer focus: Labelled diagram, duties, request flow, advantages and one trade-off.
Three-tier architecture separates an application into independently organised responsibilities:
User / browser
↓ request / ↑ response
Presentation tier (UI, forms, rendering)
↓ service call / ↑ result
Business tier (rules, validation, authorisation)
↓ query / ↑ records
Data tier (database access, storage, transactions)
Presentation: collects input and displays output; it should not be trusted to enforce all security rules. Business: validates requests, applies rules and coordinates work. Data: persists information and manages queries, transactions and access to records.
Example: a university student selects a course in the browser. The business service checks prerequisites, capacity and enrolment rights; the data tier stores the registration in a transaction. The result returns to the interface. The browser should not receive direct database credentials.
Benefits: each tier can be maintained, secured, tested and scaled separately; one change need not require redesigning all tiers. Trade-offs: extra network calls, deployment complexity and failure points. Logical layers may share a machine; physically separate deployment creates tiers. This is a specialised client–server arrangement, not the same classification as client–server versus P2P.
2022 · Paper-II · Q7(a) and 2025 · Paper-II · Q8(c) · 8 marks each
Both papers ask for three-tier web application architecture. The answer below applies to each. 2025 source
Question (paraphrased): Explain three-tier web application architecture.
Answer focus: Use the complete architecture answer above, with a web request example.
Structure: browser/presentation → application/business service → database/data tier. Presentation manages interaction; business logic checks rules and authorisation; data services store and retrieve persistent records.
Worked flow: a customer places an order, the application validates items and stock, the database commits the order and stock update, and the browser displays confirmation. Validation on the server is necessary even when the browser checks inputs.
Diagram: User → Web UI ↔ Business service ↔ Database. Label requests and responses; explain that database access is restricted to authorised services.
Evaluation: separation improves maintainability, reuse, testing and independent scaling. Authentication and access rules can protect each boundary. Additional communication, operational complexity and possible bottlenecks are costs; replication and load balancing may be needed. Include the fuller tier table/diagram above when writing the eight-mark answer.
2026 · Paper-II · Q1 item 17 · 1 mark
Question: What characterises peer-to-peer networking?
Answer: B — peers can act as both clients and servers. A peer may request a resource and provide resources to others; some P2P systems still use central discovery services. Full question coverage is in Peer To Peer Systems. Paper