📘 CodingMarble Learn

Developing Network Systems: Services, Servers and Network Apps

A network service is a job done by a server for clients, such as showing web pages, carrying email or sharing files. To build a server we set up hardware, an operating system, service software, an address and a port, and a firewall decides which ports are open. A network application is two programs, a client that asks and a server that answers, which follow an agreed message format.

🎬 Step-by-step story

  1. A service is a job done over the network. The client (your PC) asks. The server answers. See the blue dot go out as a question and come back as an answer.
  2. Different jobs need different servers. A web server shows pages, a mail server carries email, a file server keeps shared files. Each one listens at its own door, called a port number.
  3. To build a server we stack layers. First the hardware, then the operating system (OS), then the service software, last the address and the port. Watch the stack grow.
  4. A firewall is a wall with doors. It lets data in only through open ports. The mail door is closed, so the mail question is stopped at the wall.
  5. A network app is two programs. The client program sends a short, agreed question. The server program reads it and sends back the reply. Both must use the same message form.
  6. Your turn. Pick a service. Switch its server off, or close its port. See which of the three things stops the reply: the wall, the server, or nothing.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Is a server always a big special computer?

No. A server is a role. Any computer running service software and waiting for clients can be a server. Big ones are used when many clients come.

Why does each service need its own port?

One computer can run web, mail and file services together. The port tells which program should get the message, like different door numbers in one building.

Why do we install the OS before the service software?

The service software needs the OS to run, to use the disk and to talk to the network. So the OS sits under it in the stack.

The server is on, so why did the mail question stop?

The firewall's mail door was closed, so the question never reached the server. See the red door in the 3D.

What is a protocol in a network app?

It is the agreed form of messages: what the client may ask and how the server replies. Both programs must follow it.

How can I tell if the wall or the server stopped my request?

In the play step the red message tells you: the firewall stopped it at the wall, or the server was off and sent no reply.

Services using network systems

A network service is a job that one computer does for others over a network. The computer that asks is the client. The computer that does the job is the server.

Common services:

Why use services? One strong server can serve many clients, files stay in one safe place, and updates and backups are done once.

Building network servers

A server is built in layers. Each layer needs the one below it.

  1. Hardware: a computer with enough processor, memory, disk and a network card. Servers run all day, so they need steady power and cooling.
  2. Operating system (OS): for example Linux or Windows Server. It runs programs and looks after the network card.
  3. Service software: a web server program, a mail server program, a file sharing program. This does the real job.
  4. Settings: a fixed IP address, the service port, user names and who may do what.
  5. Firewall and security: open only the ports you need, keep software updated, use strong passwords.
  6. Test and back up: ask from a client PC, check logs, and copy the data to a safe place.

What is a port?

An IP address finds the computer. A port number finds the service on that computer. Web over a safe link uses 443, plain web uses 80, and mail sending uses 25. A firewall checks each message and lets it pass only if its port is open.

Developing network applications

A network application has two programs: a client program and a server program. They talk by sending messages.

The steps to make one:

  1. Decide the job: for example, a class marks service that gives a student's marks.
  2. Agree the message form (a small protocol): the client sends GET marks roll=12, the server replies OK marks=78 or ERROR not found.
  3. Write the server: it waits at a port, reads each question, finds the answer and replies.
  4. Write the client: it connects, sends the question, shows the reply.
  5. Handle trouble: no reply, wrong question, many users at once.
  6. Test and secure: try good and bad questions, check who is allowed, and do not trust what clients send.

Both programs must follow the same form, or they will not understand each other.

Try it: find the doors on your own network

At home, list three services you use: a website, a video call and sharing a photo. For each one, say which side is the client and which is the server. Then play with the 3D: close the file port and send a file request. Say which layer stopped it. Last, write a two-line message form for a pretend 'lunch menu' service: one line to ask and one line to reply.

Key formulas and definitions

Worked examples

1. A school wants students to read notices on a website. Which service and which common port (safe link) are needed?

A web service. Safe web pages use port 443, so the firewall must keep port 443 open.

2. A new server is installed, but a client cannot reach its web page. The OS and web software are installed. Name three things to check.

1) The server has the right IP address and the web software is running. 2) The web port is set correctly. 3) The firewall has the web port open. Test from a client after each fix.

3. Write a simple message form for a service that tells a bus time. Give one question and two possible replies.

Question: GET bus route=5. Replies: OK time=07:45 or ERROR no such route. Both programs agree on these words.

Common mistakes

Practice quiz

1. In a network service, which side asks for something?
2. What does a port number identify?
3. Which layer is the lowest when building a server?
4. What does a firewall do with a message to a closed port?
5. What must a client program and a server program share?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is the difference between a client and a server?

A client asks for a service, like your browser. A server waits and does the job, like the computer that sends the web page.

What are the steps to build a network server?

Get the hardware, install the OS, install the service software, set the IP address and port, set the firewall and security, then test and back up.

How is a network application made?

Decide the job, agree on the message form, write a server program and a client program, handle errors, then test and secure it.

Where this is taught

Japan高校(専門学科)1〜3年Network Systems

Learn first

Learn next

Related lessons

All Computer Science lessons