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:
- Web service: sends web pages to your browser.
- Mail service: stores and forwards email.
- File service: keeps shared files in one place.
- Name service (DNS): turns a name like a website name into an address of numbers.
- Address service (DHCP): gives each new device an address automatically.
- Print service: lets many people use one printer.
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.
- Hardware: a computer with enough processor, memory, disk and a network card. Servers run all day, so they need steady power and cooling.
- Operating system (OS): for example Linux or Windows Server. It runs programs and looks after the network card.
- Service software: a web server program, a mail server program, a file sharing program. This does the real job.
- Settings: a fixed IP address, the service port, user names and who may do what.
- Firewall and security: open only the ports you need, keep software updated, use strong passwords.
- 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:
- Decide the job: for example, a class marks service that gives a student's marks.
- Agree the message form (a small protocol): the client sends GET marks roll=12, the server replies OK marks=78 or ERROR not found.
- Write the server: it waits at a port, reads each question, finds the answer and replies.
- Write the client: it connects, sends the question, shows the reply.
- Handle trouble: no reply, wrong question, many users at once.
- 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
- Service = client request + server reply
- Address finds the computer, port finds the service
- Server layers: hardware, OS, service software, settings
- Common ports: 80 web, 443 safe web, 25 mail sending, 53 names
- Firewall rule: open only the ports you need
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
- Thinking the server and the service are the same. One server can run many services, each on its own port.
- Opening every port 'to be safe'. Open only the ports you need, or attackers get more doors.
- Forgetting to test from a client PC. A server may work on itself but be blocked by the wall.
- Letting the client and server use different message forms. They then cannot understand each other.