What is software and what does it do?
Hardware is the parts you can touch: screen, memory, processor. Software is the instructions that tell the hardware what to do. Without software the hardware does nothing.
Software works in layers:
- Operating system (OS): for example Android, Windows or Linux. It shares memory and the processor, handles files and the network, and lets apps run.
- Application software (apps): for example a chat app or a browser. Each app does one job for the user.
- Utility software: small helper tools such as antivirus or file compressors.
In an information system, software takes the data in, processes it, stores it and shows the result. A chat app takes in your text, adds an address, sends it, and shows the reply.
Clients and servers
Most apps that use the Internet have two programs.
The client runs on your phone or computer. It shows the screen, takes your taps and sends requests.
The server runs on a powerful computer that stays on all day. It receives requests from many clients, does the work, keeps the data and sends answers back.
Why not let two phones talk directly? Phones go offline, change their addresses and sit behind firewalls. A server has a fixed address that everyone can find, so it acts as the meeting place.
How a chat app works
1. Ana types a message. The client builds a small packet: who it is from, who it is to, and the text. For example: MSG|ana|ben|Hi!
2. The client sends the packet over the network to the server's address and port.
3. The server reads the 'to' field, looks up Ben's open connection, and forwards the packet.
4. Ben's client reads the packet and shows the text.
The rules for how messages look and what to do with them are called a protocol. Both programs must follow the same protocol, just like two people must speak the same language.
How an email-style app works
Email uses store and forward. Your mail client sends the message to your mail server. That server passes it to the receiver's mail server, which puts it in the receiver's mailbox. It stays there until the receiver opens the mail app and fetches it. So the receiver does not need to be online when you send.
The common rules are called SMTP (for sending) and IMAP or POP3 (for fetching). Many chat apps also keep messages for offline friends, so they use the same idea.
Steps to develop a simple chat or email app
- Plan: What can users do? Send a message, see messages, log in.
- Design the messages (protocol): choose the fields, such as
MSG|from|to|text. - Write the server: wait for clients, read the address, forward or store the message.
- Write the client: a screen with a text box and send button that talks to the server.
- Test with two clients: online and offline cases, empty messages, very long messages.
- Make it safe: ask users to log in, check every message the server receives, and use encryption so that others cannot read it on the way.
A tiny server in plain steps:
repeat forever: wait for a packet read the 'to' name if that person is online: send the packet to them else: put the packet in their mailbox
Try it at home
Play 'server' with two friends in different rooms. Friend A writes a note 'To: B' and gives it to you. You read the address and walk it to B. If B is out of the room, put the note in a box with B's name and hand it over when B returns. You have just done chat and email by hand!
Key formulas and definitions
- Software = the instructions; hardware = the machine
- Layers: hardware → operating system → application
- Client = asks and shows; server = always on, answers and stores
- Message packet = from + to + text, e.g. MSG|ana|ben|Hi!
- Chat = forward at once; email = store and forward (mailbox)
- Protocol = the agreed rules for messages
Worked examples
1. You open a school portal on your phone. Which part is the client and which is the server?
The portal app or browser on your phone is the client: it shows pages and sends your requests. The computer at the school or company that holds the data and answers is the server.
2. Write a message in the form MSG|from|to|text for Riya telling Aman 'Ready?'. What does the server read to know where to send it?
MSG|riya|aman|Ready? The server reads the 'to' field, which is aman, and forwards the packet to Aman's client.
3. Meera sends an email to Sam, who has his phone switched off. Explain what happens.
Meera's client sends the email to her mail server. It passes the email to Sam's mail server, which puts it in Sam's mailbox. When Sam switches on his phone and opens the mail app, the client fetches the email from the mailbox.
4. A chat server gets 120 messages every minute. How many is that per second, and is it enough to say the server must be always on?
120 ÷ 60 = 2 messages per second. Messages can arrive at any second of the day, so yes, the server must be always on.
5. Put the work of the server in a chat app in order: forward the message, read the address, receive the packet, check Ben is online.
Receive the packet → read the address → check that Ben is online → forward the message. If Ben is offline, the server stores it in his mailbox instead.
Common mistakes
- Thinking the server is a different kind of app screen. It is a separate program that runs on another computer.
- Mixing up chat and email: chat forwards at once to someone online; email stores the message in a mailbox first.
- Saying the operating system and the app are the same. The OS looks after the hardware; the app does one user job.
- Forgetting that every message needs an address. Without 'To:' the server cannot know where to send it.