Networks from the till to the data centre
When a till says "prices offline", the fault can sit in a cable, a lease, a name, a route, a firewall rule or a VPN tunnel. This lesson shows how each of those works in a Mangrove store, and gives you a calm, bottom-up method to find which one broke.
By the end you can
- Read an address like 10.20.142.31/24, work out its subnet, and say whether traffic goes direct or through the gateway
- Explain how DHCP hands a till its address, gateway and DNS servers, and what a lease and a reservation are
- Follow a request from a till through DNS, the store router, the VPN tunnel and the data centre firewall
- Troubleshoot bottom-up with ip, ping, mtr, dig, ss and curl, and tell a refused connection from a timeout
The everyday picture
Think of a big hotel. When you arrive, the front desk gives you a room number and a key card that works for three nights. If you stay longer, you go back to the desk and extend it. If you leave, the room goes to someone else.
Room 1423 is on floor 14. To visit room 1407 you walk down the corridor, because it is on your floor. For anything outside the hotel, you hand it to the post room on the ground floor, and the post room knows the way to the rest of the city. When you want to call someone by name, you ask the hotel operator for their number. A guard at the door checks a list before letting anything in. And the hotel has a private shuttle with tinted windows to its head office, so staff documents never travel on the public bus.
A store network has the same parts: DHCP is the front desk, the subnet is the floor, the default gateway is the post room, DNS is the operator, the firewall is the guard and the VPN is the shuttle. When a till cannot reach the price API, one of them has failed, and you find it by checking them in order.
Addresses, subnets and the default gateway
You met IP addresses, ports and the three private ranges in Networking you actually need. Here we look closer. An IPv4 address is 32 bits, written as four numbers from 0 to 255, such as 10.20.142.31. Each number is one octet.
Every address has two parts, like the floor and the room. The first part names the network, and the rest names one device on it. CIDR notation says where the split is. In 10.20.142.0/24, the first 24 bits (the first three numbers) are the network. The last 8 bits are for devices. 8 bits give 256 addresses, from 10.20.142.0 to 10.20.142.255. The first one is the network's own name and the last is the broadcast address, so 254 are usable. Older tools write the same split as a subnet mask: /24 is 255.255.255.0.
The number after the slash can be anything from 0 to 32. Each step down doubles the size. A /25 is half a /24 (128 addresses), a /16 is 256 times bigger (65,536 addresses), and a /32 is exactly one address. A /14 is four /16s in a row: 10.20.0.0/14 runs from 10.20.0.0 to 10.23.255.255. The network address must start on a boundary of its size, which is why a /14 can start at 10.20 but not at 10.21.
A device uses the split for one decision, many times a second. When it sends a packet, it asks: is the destination inside my subnet? If yes, it sends the packet straight to that device on the local network. If no, it sends it to its default gateway, the router, and lets the router find the way. So a till at 10.20.142.31/24 talks to the store box at 10.20.142.10 directly, and everything else, the data centre and the internet, goes to the router at 10.20.142.1.
Two odd addresses are worth knowing on sight. 127.0.0.1 is the device itself. An address starting 169.254. is a link-local address: Windows and many other systems give themselves one when they asked DHCP for an address and nobody answered. A till showing 169.254.33.7 is not on the network in any useful way, and the problem is below DNS, VPN and firewall.
Quick check
A till has the address 10.20.142.31/24. Which destination does it send straight to, without the default gateway?
With /24, the first three numbers must match: 10.20.142. The printer matches, so the till reaches it directly. 10.20.143.10 is in a different /24, however close it looks, and "private" says nothing about being on the same subnet: 10.0.20.15 is in the data centre, behind the router.