Routers, Switches and Traffic-Shaping Devices
Routers and switches carry every packet and provide important security features of their own, while traffic-shaping devices manage performance and availability. This lesson explains switch and router security features, WAN optimisation and load balancing.
Learning outcomes
After completing this lesson, you will be able to:
- Describe switch security features.
- Describe router security measures.
- Explain traffic shaping and WAN optimisation.
- Explain load balancing and its security considerations.
Switches
A switch forwards Ethernet frames at layer 2 using a MAC address table that maps MAC addresses to ports, so traffic goes only to the intended port. Switches also host VLANs, and layer 3 switches route between them. Because they connect every device, switches are the first line of defence against layer 2 attacks. The following list describes key switch security features.
- Port security: limit the number of MAC addresses learned on a port, or bind specific addresses, and shut the port or alert on violation. Counters MAC flooding and unauthorised devices.
- Disabling unused ports and placing them in an unused VLAN.
- 802.1X port-based authentication.
- DHCP snooping: allow DHCP server responses only from trusted ports, blocking rogue DHCP servers.
- Dynamic ARP inspection: drop ARP messages that do not match DHCP snooping records, blocking ARP spoofing.
- VLAN hopping protection: disable automatic trunk negotiation on access ports and do not use the default native VLAN for user traffic.
- Spanning tree protections, such as BPDU guard, which stop rogue switches disrupting the topology.
- Storm control, which limits broadcast floods.
The following diagram shows DHCP snooping dropping offers from a rogue router plugged into a meeting room socket.

Routers
A router forwards packets between networks at layer 3, using routing tables built statically or by routing protocols such as OSPF and BGP. Routers enforce ACLs that permit or deny traffic by address, protocol and port, and they perform network address translation.
Router security includes authenticating routing protocol updates, so that an attacker cannot inject false routes and redirect traffic; ingress and egress filtering of spoofed and bogon (unallocated or private) addresses at the edge; disabling unused services such as source routing and directed broadcasts (which enable smurf attacks); protecting the control plane with rate limits; and secure management as described in the network security management module. At internet scale, BGP hijacking, in which false route announcements divert traffic, is countered by route filtering and Resource Public Key Infrastructure (RPKI).
Traffic shaping and WAN optimisation
Traffic shaping controls the rate and priority of traffic to ensure performance for important applications. Quality of service (QoS) marks and prioritises traffic classes, for example giving voice and video priority over bulk downloads. Shaping can also limit the bandwidth available to non-business applications and, as a security measure, throttle traffic to protect services during attacks.
WAN optimisation appliances improve performance over wide area links between sites, using caching, compression, deduplication and protocol optimisation. Because they inspect and store traffic, they hold copies of business data and must be secured like other systems that handle sensitive information, including encryption of cached data and secure management.
Load balancing
A load balancer distributes incoming requests across a pool of servers, using methods such as round robin, least connections or weighted distribution, and performs health checks so that failed servers are removed from the pool. Load balancing supports availability and scalability: services survive individual server failures and can absorb more traffic. Layer 4 load balancers distribute connections; layer 7 load balancers (application delivery controllers) route requests by content and often terminate TLS.
Load balancers can provide some security benefits: they hide back-end servers, absorb some floods and often integrate WAF functions. Because they may decrypt TLS and see all traffic, they hold private keys and sensitive data, so they must be hardened, patched and monitored. Persistence (sticky sessions) settings and health check configuration affect both reliability and security. The following table summarises the devices in this lesson.
| Device | Layer | Main security role |
|---|---|---|
| Switch | 2 (and 3 for layer 3 switches) | Port security, VLANs, 802.1X, DHCP snooping, ARP inspection |
| Router | 3 | ACLs, anti-spoofing filtering, routing protocol authentication |
| Traffic shaper | 3 to 7 | Prioritising business traffic; throttling during attacks |
| WAN optimiser | 4 to 7 | Performance; must protect cached data |
| Load balancer | 4 or 7 | Availability; hides servers; often TLS termination and WAF |
Routers, switches and load balancers
The rogue DHCP server
Users on one floor suddenly receive IP addresses from an unexpected range and their traffic is routed through an unknown gateway. A small router was plugged into a meeting room socket. Which switch feature would have prevented this?
DHCP snooping: with only the uplink to the legitimate DHCP server marked as trusted, the switch would drop DHCP offers from the rogue router. Port security or 802.1X on the meeting room port would also have stopped the unauthorised device. A rogue gateway enables man-in-the-middle attacks.
Protecting availability
A single web server handles a company's customer portal. During promotions it becomes overloaded and unavailable, and a hardware failure last year caused a day of downtime. What device helps with both problems?
A load balancer in front of a pool of several web servers, with health checks: it spreads load during peaks and removes a failed server from the pool automatically, so a single hardware failure no longer takes the portal down. The load balancer itself should be deployed as a redundant pair.
Which switch feature limits the number of MAC addresses on a port?
Show answer
Port security, which counters MAC flooding and unauthorised devices.
Exam Tips
Remember for the exam
- Port security limits MAC addresses per port; DHCP snooping and dynamic ARP inspection stop rogue DHCP and ARP spoofing.
- Authenticate routing protocol updates and filter spoofed addresses at the edge.
- Load balancers support availability; devices that terminate TLS must be protected.