What is an L4 Switch?
An L4 switch, told as a story about a sorter who reads the counter number too, not just the town name, when handing off packages.
The sorter only reads the town name, then tosses the envelope to any counter.The same town has separate counters by purpose — but the envelopes get mixed up.
Different counters need different speed and priority.The town name alone can't tell the counter-80 envelope from the counter-25 one.
An L4 switch = a sorter who reads the counter number (port) too.An L4 switch splits the path by purpose, even within the same town.
Devices at each layer read different information.L4 reads the port too and spreads load evenly across same-type counters (load balancing).
An L4 switch can't read what's inside the envelope.Reading what's inside the envelope is an L7 device's job.
L4 switch = a sorter that reads the counter number (port) too, not just the town (IP), spreading traffic evenly across same-purpose counters.
An L4 switch distributes traffic by also referencing OSI Layer 4 (transport layer) information — TCP/UDP port numbers. Compared to L3 routing, which only sees IP addresses, it load-balances more precisely by service and session, but it doesn't inspect the packet's content (application data) itself.
When grown-ups say it
- Port Number
- Which counter inside the building. Distinguishes services at the same address.
- Load Balancing
- Spreading work evenly across same-type counters. A signature use of an L4 switch.
- L2/L3/L4
- Neighbor, town, counter number — each layer sees a wider scope. Layers 2 through 4 of the OSI 7-layer model. → the delivery process split into 7 stages
- Transport Layer
- The stage that handles ports and the registered/plain choice. The very layer an L4 switch references. → the stage that splits ports and picks reliability
- Traffic Shaping/Policing
- The rule controlling intake at each counter. A rule applied once counters are split this way. → the counter that controls the flow
- Subnetting
- Splitting a town into smaller zones. The L3-level story of splitting a town. → splitting the town into smaller zip-code zones
- WAF/L7 Device
- A device that reads inside the envelope too. A topic covered in the Security field.
- Network IPC
- The dedicated mailbox that picks its target by port. A concrete example of using port numbers. → the dedicated mailbox between processes