Bird
Raised Fist0
GCPcloud~5 mins

TCP/UDP Load Balancer (Layer 4) in GCP - Cheat Sheet & Quick Revision

Choose your learning style10 modes available
Recall & Review
beginner
What is a TCP/UDP Load Balancer at Layer 4?
It is a network device that distributes incoming TCP or UDP traffic to backend servers based on IP address and port without inspecting the content of the packets.
Click to reveal answer
intermediate
How does a Layer 4 Load Balancer differ from a Layer 7 Load Balancer?
Layer 4 Load Balancer routes traffic based on IP and port (transport layer), while Layer 7 Load Balancer routes based on application data like HTTP headers or URLs.
Click to reveal answer
beginner
What are the benefits of using a TCP/UDP Load Balancer in GCP?
It provides high availability, scales traffic efficiently, supports both TCP and UDP protocols, and offers global or regional load balancing with health checks.
Click to reveal answer
beginner
What is a health check in the context of a TCP/UDP Load Balancer?
A health check is a periodic test that verifies if backend servers are available and responsive to receive traffic, helping the load balancer avoid sending traffic to unhealthy servers.
Click to reveal answer
intermediate
Why is session affinity less common in Layer 4 Load Balancers compared to Layer 7?
Because Layer 4 Load Balancers only see IP and port information, they have limited ability to track user sessions compared to Layer 7 which can use cookies or application data for affinity.
Click to reveal answer
Which OSI layer does a TCP/UDP Load Balancer operate on?
ALayer 3 (Network Layer)
BLayer 7 (Application Layer)
CLayer 4 (Transport Layer)
DLayer 2 (Data Link Layer)
What protocols does a Layer 4 Load Balancer typically support?
ADNS and DHCP
BHTTP and HTTPS
CFTP and SMTP
DTCP and UDP
In GCP, what feature helps a TCP/UDP Load Balancer avoid sending traffic to a down server?
AHealth Checks
BCloud CDN
CFirewall Rules
DIAM Policies
Which of these is NOT a characteristic of a Layer 4 Load Balancer?
ARouting based on IP and port
BInspecting HTTP headers
CSupporting TCP and UDP traffic
DProviding high availability
What is a common use case for a TCP/UDP Load Balancer in GCP?
ABalancing database or gaming server traffic
BDistributing web page requests based on URL
CCaching static content
DManaging user authentication
Explain how a TCP/UDP Load Balancer works and why it is useful in cloud environments like GCP.
Think about how traffic is split without looking inside the data.
You got /4 concepts.
    Describe the differences between Layer 4 and Layer 7 load balancing and when you might choose each.
    Consider what information each layer can see in the network stack.
    You got /4 concepts.

      Practice

      (1/5)
      1. What is the primary function of a TCP/UDP Load Balancer in GCP?
      easy
      A. Store and cache static website content for faster delivery
      B. Analyze HTTP headers to route requests based on URL paths
      C. Encrypt data packets before sending them to clients
      D. Distribute incoming TCP or UDP traffic evenly across backend servers

      Solution

      1. Step 1: Understand Layer 4 Load Balancing

        TCP/UDP Load Balancers operate at Layer 4, handling raw TCP or UDP traffic without inspecting application data.
      2. Step 2: Identify the main role

        The main role is to distribute incoming network traffic evenly across multiple backend servers to balance load and improve availability.
      3. Final Answer:

        Distribute incoming TCP or UDP traffic evenly across backend servers -> Option D
      4. Quick Check:

        Layer 4 Load Balancer = Traffic distribution [OK]
      Hint: Layer 4 means TCP/UDP traffic distribution only [OK]
      Common Mistakes:
      • Confusing Layer 4 with Layer 7 load balancing
      • Thinking it inspects HTTP headers
      • Assuming it caches content
      2. Which GCP component is essential to define where TCP/UDP Load Balancer sends traffic?
      easy
      A. Cloud Storage Bucket
      B. Forwarding Rule
      C. Cloud Pub/Sub Topic
      D. Cloud SQL Instance

      Solution

      1. Step 1: Identify GCP components for Load Balancing

        Forwarding rules in GCP specify the IP address, port, and protocol that the load balancer listens on.
      2. Step 2: Understand traffic routing

        Forwarding rules direct incoming TCP/UDP traffic to the backend service or instance group.
      3. Final Answer:

        Forwarding Rule -> Option B
      4. Quick Check:

        Forwarding Rule = Traffic entry point [OK]
      Hint: Forwarding Rule directs traffic to backends [OK]
      Common Mistakes:
      • Choosing unrelated services like Cloud Storage
      • Confusing Pub/Sub with load balancing
      • Selecting Cloud SQL which is a database
      3. Given a TCP Load Balancer with 3 backend instances, if 300 connections arrive evenly, how many connections does each instance handle?
      medium
      A. 100 connections
      B. 300 connections
      C. 150 connections
      D. 50 connections

      Solution

      1. Step 1: Understand even distribution

        The load balancer distributes connections evenly across all backend instances.
      2. Step 2: Calculate connections per instance

        300 connections divided by 3 instances equals 100 connections per instance.
      3. Final Answer:

        100 connections -> Option A
      4. Quick Check:

        300 ÷ 3 = 100 [OK]
      Hint: Divide total connections by backend count [OK]
      Common Mistakes:
      • Multiplying instead of dividing
      • Ignoring even distribution assumption
      • Choosing total connections as answer
      4. You configured a TCP Load Balancer but backend instances are not receiving traffic. What is a common misconfiguration to check?
      medium
      A. Backend instances lack proper health checks
      B. Forwarding rule uses HTTP protocol instead of TCP
      C. Backend instances are in different cloud provider
      D. Load balancer IP is not public

      Solution

      1. Step 1: Check health checks configuration

        Load balancer only sends traffic to healthy backends. Missing or failing health checks cause no traffic routing.
      2. Step 2: Verify backend health status

        Ensure health checks are properly configured and passing for backend instances.
      3. Final Answer:

        Backend instances lack proper health checks -> Option A
      4. Quick Check:

        Health checks enable traffic routing [OK]
      Hint: Always verify backend health checks first [OK]
      Common Mistakes:
      • Assuming protocol mismatch blocks traffic
      • Ignoring health check failures
      • Thinking IP must be public for internal load balancer
      5. You want to design a highly available TCP Load Balancer in GCP that handles millions of connections. Which combination ensures scalability and fault tolerance?
      hard
      A. Use a global HTTP(S) Load Balancer with TCP backend services
      B. Deploy multiple zonal TCP Load Balancers without health checks to reduce latency
      C. Use a single regional TCP Load Balancer with multiple backend instance groups and health checks
      D. Configure a single backend instance with autoscaling but no load balancer

      Solution

      1. Step 1: Understand GCP TCP Load Balancer types

        Regional TCP Load Balancers distribute traffic across multiple backend instance groups within a region, supporting health checks and autoscaling.
      2. Step 2: Evaluate scalability and fault tolerance

        Multiple backend groups with health checks ensure traffic only goes to healthy instances, enabling fault tolerance and scaling to millions of connections.
      3. Final Answer:

        Use a single regional TCP Load Balancer with multiple backend instance groups and health checks -> Option C
      4. Quick Check:

        Regional LB + backends + health checks = scalable & fault tolerant [OK]
      Hint: Regional LB + health checks = scalable, fault tolerant [OK]
      Common Mistakes:
      • Ignoring health checks reduces reliability
      • Using HTTP(S) LB for TCP traffic is incorrect
      • Single backend instance limits scalability
      Recommended

      Ready to prove it?

      Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

      10 questions~5 mineasy hard