Load Balancing

Load balancing refers to efficiently distributing incoming network traffic across a group of servers or services. It improves responsiveness and increases availability of applications.

A load balancer is a device that sits between the client and the server cluster accepting incoming network and application traffic and distributing the traffic across multiple backend servers using various methods. By balancing application requests across multiple servers, a load balancer reduces individual server load and prevents any one application server from becoming a single point of failure, thus improving overall application availability and responsiveness.

On high-level, there are three types of load balancers-

  1. Hardware-based
  2. Cloud-based
  3. Software-based

Hardware-based

It is a dedicated appliance to provide load distribution, and its relevant features. They are expensive but give you full control. Barracuda and TP-Link are 2 of the most used hardware-based Load balancers.

Cloud-based

Cloud load balancing is the process of distributing workloads across multiple computing resources. Cloud load balancing reduces costs associated with document management systems and maximizes availability of resources. It can transfer loads to servers globally as opposed to distributing it across local servers. In the event of a local server outage, cloud load balancing delivers users to the closest regional server without interruption for the user.

Cloud load balancing uses services offered by various computer network companies. AWS, Google Cloud and Azure are few of the most used Cloud-based Load Balancers in the industry today.

Software-based

One can install, manage and configure LB software themselves mostly used to distribute load across local servers.

HAProxy, Varnish, Balance, Kemp, Nexus are some of most notable Software Load Balancers.

Load Balancing in OSI model

Load balancing can be performed at various layers in the Open Systems Interconnection (OSI) Reference Model for networking.

Layer 4 (Transport Layer) load balancing

It operates at the intermediate transport layer, which deals with delivery of messages with no regard to the content of the messages. A layer 4 load-balancer takes routing decision based on IPs and TCP or UDP ports. It has a packet view of the traffic exchanged between the client and a server which means it takes decisions packet by packet. Layer 4 load balancers simply forward network packets to and from the upstream server without inspecting the content of the packets. They can make limited routing decisions by inspecting the first few packets in the TCP stream.

Layer 7 (Application Layer) load balancing

It operates at the high‑level application layer, which deals with the actual content of each message. HTTP is the predominant Layer 7 protocol for website traffic on the Internet. Layer 7 load balancers route network traffic in a much more sophisticated way than Layer 4 load balancers, particularly applicable to TCP‑based traffic such as HTTP. A Layer 7 load balancer terminates the network traffic and reads the message within. It can make a load‑balancing decision based on the content of the message (Example: URL or cookie). It then makes a new TCP connection to the selected upstream server and writes the request to the server. Let’s take an example-

A user visits a high‑traffic website. Over the course of the user’s session, he or she might request static content such as images or video, dynamic content such as a news feed, and even transactional information such as order status. Layer 7 load balancing allows the load balancer to route a request based on information in the request itself, such as what kind of content is being requested. So now a request for a video can be routed to the servers that store it and are highly optimized to serve up multimedia content. Requests for transactional information such as a discounted price can be routed to the application server responsible for managing pricing and so on.

Load balancing Algorithms and methods

Load balancing uses various algorithms/methods to select the service to which to redirect each client request. Some of the load balancing algorithms are-

  • The Least Connection Method
    When a virtual server is configured to use the least connection, it selects the service with the fewest active connections.
  • The Round Robin Method
    This method continuously rotates a list of services that are attached to it. When the virtual server receives a request, it assigns the connection to the first service in the list, and then moves that service to the bottom of the list.
  • The Least Response Time Method
    This method selects the service with the fewest active connections and the lowest average response time.
  • The Least Bandwidth Method
    This method selects the service that is currently serving the least amount of traffic, measured in megabits per second (Mbps).
  • The Least Packets Method
    This method selects the service that has received the fewest packets over a specified period of time.

If you would like to install and explore Load Balancers, there are a few open-source ones available which you may explore like LoadMaster by Kemp, Zevenet, GoBetween and a lot more. A quick google search should turn out a few more. Happy Balancing!

Single Sign-On (SSO)

Ever wondered how by logging in to Gmail, you are also able to navigate to Google’s other children like YouTube, Google Drive, G+ etc without being prompted for an ID or password?

Single sign-on (SSO) is an authentication process that allows a user to access multiple applications with one set of login credentials. With SSO, a user logs in once and gains access to different applications without the need to re-enter log-in credentials at each
application.

SSO is a common procedure in enterprises, where a client accesses multiple resources/applications. The service authenticates the end user for all the applications the user has been given rights to and eliminates further prompts when the user switches applications during the same session. On the back end, SSO is helpful for logging user activities as well as monitoring user accounts. SSO mechanisms vary, depending on application type.

However, SSO is not suited for systems requiring guaranteed access, as the loss of log-in credentials results into denial of access to all systems. Ideally, SSO is used with other authentication techniques, such as smart cards and one-time password (OTP) tokens.

Common SSO Mechanisms:

Following are the most common mechanisms used for SSO. We will not delve deep into them for now but in future blogs.

Kerberos-based – Initial sign-on prompts the user for credentials, and gets a Kerberos ticket-granting ticket (TGT). Additional applications that the user navigates to use these TGT proving the user’s identity without prompting the user to re-enter credentials

Smart-card-based Initial sign-on prompts the user for the smart card. Additional software applications also use the smart card, without prompting the user to re-enter credentials. This method either uses certificates or passwords stored on the smart card.

Security Assertion Markup Language (SAML) – SAML is an XML-based solution for exchanging user security information between an SAML identity provider and a SAML service provider.

Pros of SSO:

· Reduce password fatigue from different username and password combinations

· Reduce time spent re-entering passwords for the same identity

· Reduce IT costs due to lower number of IT help desk calls about passwords

· Mitigate risk for access to 3rd-party sites (user passwords not stored or managed externally)

· Minimizes phishing.

· Improves compliance through a centralized database.

· Provides detailed user access reporting.

Cons of SSO

· It increases the negative impact in case the credentials are available to other people and misused or if hacked. This can be prevented with high security, governance and 2-factor or multi factor authentication.

· A loss of SSO can result in denial of access to all systems unified under the SSO. A workaround is to keep highly critical applications out of SSO.

IBM ISAM, Okta, RSA etc are among the leading SSO solutions in the industry.

  • Stay tuned for future blogs. Please leave a comment or suggestions if any.