Skip main navigation

The client/server model

The internet is a vast network containing many servers that provide services such as web browsing and file transfers. When you connect to these.

I am now going to introduce you to another important model used in networking: the client/server model. The layered model I showed you in the last step guides communication across the internet; the client/server model describes how we make applications that use it.

Networked applications

The internet is a vast network containing many servers that provide services such as web browsing and file transfers. When you connect to these services, your device is playing the role of client. Clients make requests and servers handle and respond to those requests.

Servers

A server is a computer on a network that provides a resource that can be used by any authorised client station.

In the client/server model, servers are the boss. They hold the power and have the authority to grant or deny any request they get. Obviously you don’t want them to reject every request that comes in, but the inclusion of authorised in the definition is important.

The level of access a server grants to any given client is an important security consideration. Sometimes, the data on a server is designed to be open and so the server will respond to any request it receives (in this case, all clients are authorised). In other cases, the data may be sensitive or commercially valuable, in which case the server will need to ensure the request is from a legitimate source. If it did not, it would risk exposing the data, and potentially the network, to malicious actors.

Servers are usually always on and connected to the internet so that users can access their resources and services at any time. There are many types of server:

  • The most common type of server you will interact with is a web server; web servers store and provide the webpages we browse. This course is stored on a server; every time you complete a step, your device will request the next one.
  • Email servers direct email to the intended recipient and sometimes filter out spam.
  • File transfer servers provide files to users, like those that provide the songs we listen to on Spotify.

When thinking about servers, most people think of huge stacks in massive warehouses; while these are indeed what most of the large internet services mentioned run on, these are not the only servers that exist. People have personal servers in their homes, where they can store files and share them with others, or store media libraries and play them on speakers or televisions around their homes. Companies can also run servers for their employees, to access shared work or for video conferencing.

Clients

A client is a computer or computer-controlled device that provides a user with access to a network.

Clients are user-facing computers that run software to make requests to servers and interpret or display the responses. They do not hold the power, and cannot force a server to respond to a request. If the server requires authentication that the client cannot provide, the requested data will not be sent to the client.

Clients do not always have to be on, and should be able to start up and connect to a server at any time — this is why it is useful to have servers on all the time. Some clients are dedicated hardware devices, for example speed cameras. They capture photos and licence plate numbers and send a request to a central server to store and process them; that is their entire functionality. General-purpose computers can be turned into clients by the software running on them. A lot of applications turn your smartphone into a client, not processing or computing much itself but instead making requests to servers. This model has granted immense computing power to mobile devices, allowing them to perform a wider range of networked tasks.

The scope of this course

What you will create over the next three weeks will demonstrate how servers and clients operate. I want to be clear, however, that I do not have the scope to take you through creating an entire server system. “Real” server systems are hugely complex and come with many security considerations. What I want to demonstrate is how you can use the client/server model and the TCP/IP layers in your programs to facilitate communication.

I do not recommend placing a server at home or at work without first ensuring it is secure and cannot be accessed from outside your network without authorisation. To this end, the programs you will be creating in this course will be designed to connect computers that are on your network only. I will point out where there are opportunities to open it up and access it from elsewhere, but this is entirely at your own risk.

Clients in your life

Think of an internet resource or service you use every day.

What kind of client does it use? What do you need to provide to authenticate yourself?

Post your answers in the comments below.

This article is from the free online

Networking with Python: Socket Programming for Communication

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now