AlgoViz
Networking
Networking · EasyLesson 2 of 13

Client & server

Once computers can message each other, they fall into two roles in any given conversation: one ASKS, the other ANSWERS. The one asking is the client (your browser, your phone, an app). The one answering is the server. Almost everything you do online — loading a page, sending a message, watching a video — is a client asking a server for something and the server answering.

Client asks, server answers

When you type a web address and press enter, your browser becomes a client: it sends a request across the network — 'please give me this page.' Somewhere, a server is sitting and waiting for exactly that kind of request. It reads your ask, finds the page, and sends back a response. That's the shape of nearly every networked conversation: request out, response back. The client starts it (it asks first); the server reacts (it waits to be asked).

'Client' and 'server' are roles, not types of machine

The same computer can be a client in one moment and a server in the next — it just depends on who's asking whom. Your laptop is a client when it asks a website for a page; it's a server if a friend's machine asks IT for a file. So don't picture the server as a special golden box. 'Server' just means 'the one answering this request,' and 'client' means 'the one asking.' (System design digs into the answering side — what a server is and how it scales. Networking is about the conversation between them.)

Before they talk, they shake hands

A client can't just start blurting data at a server — first the two have to agree they're both there and listening. They do this with a quick three-step hello called the TCP handshake: the client says SYN ('let's talk'), the server says SYN-ACK ('heard you, hello back'), the client says ACK ('got it'). Only then does real asking and answering begin. Press play on the animation for this topic to watch that handshake happen — it's the opening move of basically every connection on the internet.

Questions you might have

Can one computer be both a client and a server?

Yes, all the time. It's about the role in a particular conversation, not the machine. Your laptop is a client when it asks Google for a page, and could be a server if another device asks it for something. Big servers usually only answer, but the labels are about who's asking whom right now.

Does the server always wait, and the client always start?

Yes — that's the defining difference. The server sits and listens; it never speaks until spoken to. The client makes the first move by sending a request. The whole conversation is kicked off by the client asking.

Why do they need a handshake before talking?

So both sides know the other is really there and ready. Without it, the client might fire off a big request to a server that's asleep or unreachable, and never know. The three-step hello confirms both can send and receive before any real data moves.

Is the server the same thing system design talks about?

Same machine, different lens. System design asks 'how does the answering computer handle a million requests?' Networking asks 'how does the request actually get from the client to that computer and back?' Here we care about the conversation crossing the network.

🧠In any networked conversation, the client asks and the server answers — roles, not machine types. And before they exchange real data, a quick three-step handshake confirms both sides are listening.
✅ Check yourself3 quick questions — prove the idea stuck.Start →▶ Now watch it moveOpen the animation →

Best read after: What is a network?