A cloud must connect thousands of machines and many customers, and keep their traffic separate. Software has taken over much of this task from fixed hardware.

Software-Defined Networking (SDN)

In a traditional network, each switch and router has its own control logic, which decides where traffic goes, and its data plane, which forwards it. In SDN, the control plane is separated from the data plane and placed in a central controller, which has a view of the whole network and is programmed through software. The controller talks to switches by a protocol such as OpenFlow, through the southbound interface, and to applications through the northbound interface. Benefits are central control, quick change by program, better use of the network and lower cost.

Definition: Software-defined networking. An approach in which the control of a network is separated from the forwarding hardware and placed in a central, programmable software controller.

Network Virtualization

Network virtualization builds virtual networks on top of the physical network, each with its own addresses, rules and security, isolated from others. A cloud customer can have a virtual private cloud (VPC) with its own subnets, routes and firewall, as if it had its own network. Techniques include VLANs and overlay networks such as VXLAN, which wrap traffic in packets for transport. It lets many tenants share one physical network safely.

Load Balancing

A load balancer spreads incoming requests across several servers, so that no server is overloaded, and sends traffic only to healthy servers. This gives higher capacity, availability, since the failure of one server does not stop the service, and scalability. Common methods are round robin, which gives each server a turn in order, least connections, which picks the server with the fewest active connections, weighted methods, which give more traffic to stronger servers, and IP hash, which sends a client always to the same server. Layer 4 balancers work on network addresses and ports, and layer 7 balancers work on the content of the request, such as the URL. Examples are AWS Elastic Load Balancing, NGINX and HAProxy. A health check removes failed servers.

Table 2.3: Cloud networking concepts

Concept Purpose Example
SDN Central programmable control OpenFlow controller
Network virtualization Isolated virtual networks VPC, VXLAN
Load balancing Spread traffic Round robin, least connections
Firewall Filter traffic Security groups

Example 2.3: Round-robin load balancing

Problem: Three servers S1, S2, S3 serve ten requests in round robin order. How many requests does each get?

Solution:

  1. Requests go to S1, S2, S3, S1, S2, S3, S1, S2, S3, S1.
  2. S1 gets requests 1, 4, 7 and 10, which is 4.
  3. S2 gets 3 and S3 gets 3.

Result: S1 gets 4 requests, S2 gets 3 and S3 gets 3.

servers = ["S1", "S2", "S3"]
count = dict.fromkeys(servers, 0)
for i in range(10):
    count[servers[i % 3]] += 1
print(count)

Output

{'S1': 4, 'S2': 3, 'S3': 3}

Common mistakes

  • Making the load balancer a single point of failure, with no backup.
  • Using round robin when the servers have very different power.
  • Forgetting health checks, so that traffic goes to a failed server.

Key takeaways

  • SDN separates the control plane from the data plane.
  • Network virtualization gives each tenant an isolated virtual network, such as a VPC.
  • A load balancer spreads requests and checks the health of servers.
  • Methods include round robin, least connections and weighted.

Practice questions

  1. What is SDN?
  2. What is a VPC?
  3. Name two load-balancing methods.

Answers to the practice questions

  1. A network approach in which a central software controller handles the control plane, separate from the forwarding hardware.
  2. A virtual private cloud, an isolated virtual network that a customer controls inside the cloud.
  3. Round robin and least connections (also weighted, IP hash).

Sources

  • Official BCA syllabus Cloud Computing, course code 25BCA405DS03, Unit II