STR Coding Club logo STR Coding ClubLearn to code, together
First Steps

How Online Gaming Servers Explain the Basics of Networking

Networking is one of those topics that sounds intimidating to beginners: packets, protocols, latency, servers, clients and ports.

Abstract illustration for How Online Gaming Servers Explain the Basics of Networking

Networking is one of those topics that sounds intimidating to beginners: packets, protocols, latency, servers, clients and ports. Yet almost every young coder already has deep, practical experience with networking from playing online games. They know what lag feels like, what happens when a connection drops and why playing on a server far away is worse. Online gaming servers are a perfect, relatable way to explain the basics of networking.

I teach Python and computing basics. Here is how online gaming servers explain the basics of networking, starting from what players already know.

Clients and servers

In most online games, each player's device is a client, and the game runs on a server owned by the game company. Clients send the player's actions to the server, and the server sends back the state of the game world. The server is the referee: it decides what really happened.

This client-server model is used across the internet. When you load a website, your browser is the client and the website's computer is the server. Understanding it through games makes the general idea easy to grasp.

Packets and protocols

Data travels across networks in small chunks called packets. Each packet has an address, like a letter, telling the network where to deliver it. Protocols are the agreed rules for sending and receiving data. Two important ones are TCP, which guarantees every packet arrives in order, and UDP, which is faster but allows some packets to be lost.

Many fast online games use UDP for movement updates, because a late position update is useless; they would rather skip it and use the next one. Chat messages and purchases use reliable methods, because those must arrive. This trade-off is a great introduction to how protocol choices depend on what an application needs.

Latency, or why lag happens

Latency is the time it takes for data to travel from the client to the server and back. Players call it ping, measured in milliseconds. Distance matters: signals take time to travel long distances, so a server on another continent always adds delay. Congested networks, wifi interference and busy servers add more. Beginners can measure latency themselves with a simple ping command.

When I explained latency to a beginner group, we compared ping times to several game servers in different regions, including servers used by an online gaming network linked from ankertoto, and the students immediately saw how distance changed the numbers.

Bandwidth and data size

Bandwidth is how much data can be sent per second. Games try to send as little as possible, only what has changed, compressed into compact formats. This teaches beginners why efficient data formats matter, a concept that also shows up in how websites load, explained in how online gaming sites load data behind the scenes.

Build a tiny networked program

Python makes basic networking accessible. With the socket module, beginners can write a tiny chat program: one script acts as a server waiting for messages, another as a client that sends them. Running both on the same computer, then on two computers on the same network, is a memorable "it works!" moment. From there, a simple turn-based game over the network is a natural next project.

Is networking too advanced for beginners?

Networking is often treated as an advanced topic, reserved for later courses. Some of the details certainly are complex. But I think the core concepts are well within reach of beginners, especially those who play online games.

Clients and servers, packets, latency and the difference between reliable and fast delivery can be explained in an afternoon with game examples. A tiny socket program makes them concrete. Waiting until learners are "ready" often means waiting until their curiosity has faded. Start with the intuition they already have from gaming.

Concepts to explore next

  • IP addresses and ports: how data finds the right program on the right computer.
  • DNS: how names like websites become addresses.
  • Client prediction: how games hide latency by guessing ahead.
  • Security: why servers must never trust what clients send.
  • Scaling: how games handle thousands of players at once.

The security side of this is covered in how online game accounts teach beginners about security.

Why servers sometimes go down

Players often notice outages during big events or launches. Servers have limits on how many players they can handle, and sudden spikes can overwhelm them. Game companies add servers, spread players across regions and use queues to protect their systems. Discussing outages helps beginners understand capacity, load and why scaling matters.

Next time you check your ping before a match, remember that you are reading a real network measurement, the same one engineers use every day.

Players already understand networking

Every player who has complained about lag or picked the nearest server already understands the basics of networking. Teaching starts by naming what they already know. More in our First Steps section.

BN
Bartholomew Ng

Bartholomew taught maths for years before switching to teaching Python. He writes about the basics of the language and about teaching code without drowning learners in syntax.

More posts by Bartholomew

More from the blog