Skip to content

Clients and Servers

We have seen how web browsers make requests, and web servers return data. * The browser knows how to read the data and display it as an HTML page.

request-response cycle

This is an example of the client-server model.

Client-Server Model

Clients request data from a resource or service.

Servers are the locations of those resources or services.

The transfer of data, initiated by the client, is called the request-response cycle.

request-response cycle

  1. Client initiates a request.
  2. Server processes (handles) the request.
  3. Server returns a response.

The client and server are programs running on a host.

Host vs. Server

A host is a device connected to a network. * It has an address, such as an IP (Internet Protocol) address like 86.75.30.9. * A host could be a server, client, or both.

request-response cycle

Practice Exercise

In conversation, when we refer to a "server" we are often describing a remote computer that is both a host (connected to a network) and server (accepts requests from clients).

Though server and host are often used interchangeably, know that a host is a computer connected to a network - a physical device - and a server accepts requests.

Localhost

In networking, localhost is the name for "this computer."

The name localhost is used by a client (like a web browser) on your computer to access resources from a server running on your computer.

Practice Exercise

The name localhost usually resolves to the IP address 127.0.0.1.


Prev -- Up -- Next