BCA Sem 5 | Unit 1 | ASP.NET
Client Server Architecture
How does the Internet actually work behind the scenes? Let's find out!
Every time you open a website — say google.com — your browser sends a message to Google's computer asking for the page. Google's computer sends the page back. This simple exchange is the heart of Client-Server Architecture.
It is a computing model in which tasks and workloads are divided between two types of computers:
- Client — the computer that requests a service or resource.
- Server — the computer that provides the service or resource.
In ASP.NET web development, the browser is the client and the IIS web server running ASP.NET is the server.
💻 Client
- Sends requests to the server
- Runs on user's machine (browser, app)
- Displays the response to the user
- Examples: Chrome, Firefox, Mobile App
- Handles UI — what user sees
- Needs internet to communicate
- Also called Front-end
🖧 Server
- Receives and processes requests
- Runs on a powerful remote machine
- Sends back data or HTML response
- Examples: IIS, Apache, Nginx
- Handles logic + database
- Runs 24/7, always listening
- Also called Back-end
Request-Response Cycle in Client-Server Model
① Client sends HTTP Request → ② Server processes → ③ Fetches data from DB
④ DB sends data back → ⑤ Server builds HTML → ⑥ Client displays page
You type a URL in the browser
Example: http://bcaschool.blogspot.com — browser creates an HTTP Request.
DNS lookup
The browser finds the server's IP address using the Domain Name System (DNS). Like finding a phone number from a name.
Request travels over the Internet
The HTTP/HTTPS request packet travels through routers and reaches the web server.
Server receives and processes the request
IIS hands it to ASP.NET. ASP.NET runs your C# code — maybe fetches data from SQL Server database.
Server generates HTML response
ASP.NET builds the final HTML page with dynamic data and sends it back as an HTTP Response.
Browser renders the page
Your browser receives the HTML + CSS + JS and displays the final webpage on your screen.
1-Tier Architecture
Client, server, and database are all on the same machine. Used for small standalone apps. Example: MS Access database app on your PC.
2-Tier Architecture
Client directly talks to the server/database. No middle layer. Simple and fast but hard to scale. Example: Desktop app connecting directly to SQL Server.
3-Tier Architecture
Presentation + Logic + Data on separate layers. Most common in web development. Example: Browser → ASP.NET → SQL Server.
N-Tier Architecture
Multiple layers — used in large enterprise applications. Extra layers for caching, API gateway, microservices. Example: Amazon, Google.
| Tier | Also Called | What It Does | ASP.NET Example |
|---|---|---|---|
| 1st Tier | Presentation Layer | What the user sees — UI and forms | .aspx pages, HTML, CSS, JavaScript |
| 2nd Tier | Business Logic Layer | Rules and processing of the app | C# code-behind files, .cs classes |
| 3rd Tier | Data Access Layer | Stores and retrieves data from DB | ADO.NET, SQL Server, Entity Framework |
| Protocol | Full Form | Used For |
|---|---|---|
| HTTP | HyperText Transfer Protocol | Normal web page requests |
| HTTPS | HTTP Secure | Encrypted, secure web requests |
| FTP | File Transfer Protocol | Uploading/downloading files |
| SMTP | Simple Mail Transfer Protocol | Sending emails |
| TCP/IP | Transmission Control Protocol / IP | Core internet communication |
| Advantages ✅ | Disadvantages ❌ |
|---|---|
| Centralized data — easy to manage and backup | Server failure affects all clients |
| Easy to scale — add more clients anytime | Requires network connection always |
| Security is easier to implement at server side | Server can become a bottleneck under heavy load |
| Multiple clients can share the same server | Server setup and maintenance is costly |
| Updates only needed on the server | Network latency can slow down performance |
When a user submits a login form on an ASP.NET page, here is what happens:
Client side (.aspx — what user sees):
Server side (.aspx.cs — runs on SERVER):
- Client-Server is a model where client requests and server responds.
- Client = Browser (Front-end) | Server = IIS + ASP.NET (Back-end).
- Communication happens via HTTP / HTTPS protocol.
- 1-Tier: Everything on one machine.
- 2-Tier: Client directly talks to DB — no middle layer.
- 3-Tier: Presentation → Business Logic → Data (most used in ASP.NET).
- N-Tier: Many layers for large enterprise apps.
- ASP.NET uses 3-Tier Architecture — .aspx (UI) + .cs (Logic) + SQL Server (Data).
- Server processes all logic; client only displays the final HTML.
- Advantages: Centralized, scalable, secure. Disadvantage: Server failure = all down.
