Layer 4 load balancing works at the transport layer. It routes traffic based on IP address and TCP/UDP ports without inspecting the content of the messages.
Click to reveal answer
beginner
What is Layer 7 load balancing?
Layer 7 load balancing works at the application layer. It routes traffic based on content like HTTP headers, URLs, cookies, or data inside the message.
Click to reveal answer
intermediate
Which layer load balancer can make routing decisions based on URL paths?
Layer 7 load balancer can inspect the URL paths and route requests accordingly, unlike Layer 4 which only uses IP and port information.
Click to reveal answer
intermediate
What is a key advantage of Layer 4 load balancing?
Layer 4 load balancing is faster and uses fewer resources because it does not inspect the message content, only IP and port information.
Click to reveal answer
intermediate
Name a scenario where Layer 7 load balancing is preferred over Layer 4.
When you need to route requests based on application data like HTTP headers, cookies, or URL paths, such as directing users to different services or versions.
Click to reveal answer
Which layer does Layer 4 load balancing operate on?
AData link layer
BApplication layer
CTransport layer
DNetwork layer
✗ Incorrect
Layer 4 load balancing works at the transport layer, handling IP addresses and TCP/UDP ports.
Which load balancer can route traffic based on HTTP headers?
ALayer 2 load balancer
BLayer 7 load balancer
CLayer 4 load balancer
DLayer 3 load balancer
✗ Incorrect
Layer 7 load balancers operate at the application layer and can inspect HTTP headers to route traffic.
What is a main benefit of Layer 4 load balancing?
AFaster processing with less resource use
BContent-based routing
CSSL termination
DURL rewriting
✗ Incorrect
Layer 4 load balancing is faster because it only looks at IP and port, not the message content.
Which load balancer type is best for routing based on user session cookies?
ALayer 2 load balancer
BLayer 4 load balancer
CLayer 3 load balancer
DLayer 7 load balancer
✗ Incorrect
Layer 7 load balancers can inspect cookies and route traffic based on session data.
If you want to balance TCP traffic without inspecting content, which load balancer would you choose?
ALayer 4 load balancer
BLayer 3 load balancer
CLayer 7 load balancer
DLayer 2 load balancer
✗ Incorrect
Layer 4 load balancers handle TCP traffic based on IP and port without inspecting the content.
Explain the main differences between Layer 4 and Layer 7 load balancing.
Think about what each layer can see in the network stack.
You got /4 concepts.
Describe a use case where Layer 7 load balancing is necessary and why Layer 4 would not be sufficient.
Consider scenarios needing smart routing based on user data.
You got /3 concepts.
Practice
(1/5)
1. Which layer does Layer 4 load balancing operate on?
easy
A. Network layer using routing tables
B. Application layer using request content
C. Transport layer using IP and port
D. Physical layer using hardware signals
Solution
Step 1: Understand OSI layers relevant to load balancing
Layer 4 corresponds to the transport layer, which handles IP addresses and ports.
Step 2: Match Layer 4 load balancing function
Layer 4 load balancing uses IP and port information to distribute traffic without inspecting content.
Final Answer:
Transport layer using IP and port -> Option C
Quick Check:
Layer 4 = Transport layer [OK]
Hint: Layer 4 uses IP and port, Layer 7 uses content [OK]
Common Mistakes:
Confusing Layer 4 with Layer 7
Thinking Layer 4 inspects request content
Mixing network and transport layers
2. Which of the following is a correct characteristic of Layer 7 load balancing?
easy
A. Routes traffic based on IP address only
B. Does not inspect HTTP headers
C. Is faster than Layer 4 load balancing
D. Operates at the application layer inspecting request content
Solution
Step 1: Identify Layer 7 load balancing features
Layer 7 load balancing works at the application layer and inspects request content like HTTP headers.
Step 2: Evaluate options
Operates at the application layer inspecting request content correctly states Layer 7 inspects request content; others are incorrect or misleading.
Final Answer:
Operates at the application layer inspecting request content -> Option D
5. You need to design a scalable web service that routes requests based on user authentication tokens in HTTP headers and also requires high throughput. Which load balancing approach is best?
hard
A. Layer 7 load balancing to inspect tokens despite some overhead
B. Layer 4 load balancing for speed, ignoring tokens
C. Use DNS round-robin instead of load balancers
D. Combine Layer 2 switching with Layer 3 routing
Solution
Step 1: Identify requirement to inspect authentication tokens
Authentication tokens are in HTTP headers, requiring application-level inspection.
Step 2: Choose load balancing approach balancing inspection and throughput