HTTP Overview and Client-Server Model
You'll learn what HTTP is and how it enables communication between web clients and servers.
What is HTTP?
HTTP (Hypertext Transfer Protocol) is an application-layer protocol that powers the World Wide Web. It sits at the top of the TCP/IP stack (remember Layer 7 from the OSI model?) and defines how web browsers and web servers exchange information.
Think of HTTP as the language spoken between your browser and websites. Just as you need a common language to order food at a restaurant, browsers and servers need HTTP to request and deliver web pages.
The Client-Server Model
HTTP follows a strict request-response pattern:
- Client (usually a web browser) initiates communication by sending an HTTP request
- Server (web server hosting content) processes the request and sends back an HTTP response
- The connection typically closes after each transaction
This is fundamentally different from peer-to-peer models—the client always starts the conversation, and the server always responds. The server never spontaneously pushes data to clients without a prior request.
Real-World Analogy
Think of a restaurant: You (client) read the menu and tell the waiter what you want. The kitchen (server) prepares your order and sends it back. You don't walk into the kitchen, and the kitchen doesn't force-feed you—there's a clear initiator (you) and responder (kitchen).
Built on TCP
HTTP typically runs over TCP (port 80 for HTTP, port 443 for HTTPS), which means it inherits TCP's reliability features: ordered delivery, error checking, and retransmission. The three-way handshake happens before any HTTP request is sent.
Key Takeaway: HTTP is the application-layer protocol that enables client-server communication on the web, using a request-response model where clients initiate requests and servers provide responses, all built on top of TCP's reliable transport.