09 — ROUTERS, SWITCHES, GATEWAYS
What each device actually does.
Estimated 9 minutes.
Three boxes, three jobs.
Walk into any cabinet on a plant floor and you'll see the same handful of boxes: switches, routers, and gateways. They look similar. They do very different things.
Switch — connects one network.
A switch is a multi-port box that lets devices on the same network talk to each other. It works at Layer 2 — it cares about MAC addresses, not IPs. If you have 8 PLCs in one cell, a switch connects them.
Router — connects different networks.
A router connects two or more networks. It works at Layer 3 — it cares about IP addresses. If your office network (192.168.1.x) needs to reach the production network (10.0.0.x), a router sits between them.
Side by side.
Switch: same network. Router: between networks.
Which one for one cell?
A workcell has 1 PLC, 1 HMI, and 3 sensors, all on 192.168.1.x. What's the right device?
- Switch
- Router
- Both
Gateway — the way out.
A "gateway" is just the IP address a device uses to send packets meant for other networks. Practically, it's the router's IP. Every device has a "default gateway" setting. If it's wrong, the device can talk locally but can't reach anywhere else.
Same name, different things.
You'll also hear "protocol gateway" — a box that translates between two industrial protocols (Modbus to Profinet, for example). Same word, totally different device. Context tells you which.
Default gateway missing.
A PLC can ping other PLCs in its cell, but cannot reach the SCADA server in another network. What's most likely?
- Bad cable
- Wrong or missing default gateway
- IP conflict
Build a working network.
Two subnets are already wired. Add or remove the router. Pick any two PCs and ping. Try same-subnet, cross-subnet with router, and cross-subnet without — feel the difference.
Managed vs unmanaged switches.
A cheap switch just forwards packets. A managed switch lets you configure VLANs, monitor ports, set up redundancy, and prioritize traffic. Industrial environments almost always use managed switches — they cost more but give you control and visibility.
Industrial switches are special.
Industrial switches are built for harsh environments: wide temperature range, no fans, DIN-rail mounting, dual power inputs. Many also support ring redundancy protocols like MRP or HSR — if one cable fails, traffic re-routes in milliseconds.
Why ring redundancy?
In a star topology with one switch, what happens if the switch fails?
- Nothing — devices keep talking
- Every device loses connectivity
- Only the closest device is affected
Quick rule of thumb.
Switches grow networks horizontally — more devices on the same subnet. Routers grow them vertically — more subnets connected together. Gateways are how a device "leaves home." Get those three right and the rest is detail.
You can map any cabinet now.
- Switch = same network, MAC-based, Layer 2.
- Router = between networks, IP-based, Layer 3.
- Default gateway = the router's IP, set on every device.
- Industrial = managed switches, often with ring redundancy.
Lesson 09 complete.
- You can identify each device by its job.
- You know what a default gateway does.
- You understand why industrial gear is built differently.