Thursday, January 8, 2015

Net Scaler - L4 Load balancer

Netscaler - A hardware and software solution providing advanced application and service delivery. Netscaler is a reverse-proxy with high-speed load balancing and content switching, data compression, content caching, SSL acceleration, network optimization, application visibility and application security on a single platform

L4 Router and Load Balancer

Layer 4 -Basically a router with NAT capability 
The level 4 refers to the Transport layer in the OSI model. A router with NAT (Network Access Translation) feature is considered a Layer 4 router instead of a typical network router which resides in the Layer 3 of the OSI model. The layer 4 Load Balancing router uses different rules to make decisions on where to route traffic. So servers and other machines with least load or fastest response times will receive the packets from the L-4 router

A typical network router simply sends incoming packets onto the appropriate IP address on its network. A layer 4 router, more correctly a NAT with port and transaction awareness, uses a little trickery and sends incoming packets to one or more machines which are hidden behind a single IP address.
The layer 4 refers to the 7 layer OSI model. The router is on the Transport Layer and makes decisions on where to send the packets. Modern load balancing routers can use different rules to make decisions on where to route traffic. This can be based on least load, or fastest response times, or simply balancing requests out. This is also a redundancy method, so if one machine is not up, the router will not send traffic to it. 

L4 Load Balancer capability 
A hardware and software solution providing advanced application and service delivery. Netscaler is a reverse-proxy with high-speed load balancing and content switching, data compression, content caching, SSL acceleration, network optimization, application visibility and application security on a single platform



Monday, December 22, 2014

DNS

Recursive DNS Server (client) 
1. Queries Root Server  for  Authoritative server IP for TLD -top level domain ( .com ) .
2. Queries Authoritative server of TLD (.com) for example domain Authoritative server  IP address (second level domain)
3.  Once the IP address for example.com is received by the Recursive DNS server , it's sends it back to the client

===Two Types of DNS Servers===
1. Recursive DNS Servers :  When your browser sends out a DNS query — assuming the browser doesn’t already have the mapping stored in its cache — it is sent to a recursive DNS server. Recursive servers are the part of the DNS that provides the required information to web clients.  Managed  by ISPs,  Companies , Google, etc

2. Authoritative DNS Servers : Authoritative DNS servers “know” the mapping of URL to IP for a domain. They are the source of the information that the recursive DNS servers send to web clients like browsers. Authoritative DNS servers for a website are usually provided by web hosting companies or specialist DNS hosting companies.

===How it works ===
Each part of a URL like “www.example.com” has a specific DNS server (or group of servers) that is authoritative. Right at the top of the tree are the root domain servers. They know the IP addresses of the authoritative servers that handle DNS queries for the Top Level Domains (TLD) like “.com”.
Assuming a particular recursive DNS server doesn’t have any information cached, first it asks the root domain servers what the IP address is of the authoritative servers for the “.com” TLD. Then it asks the authoritative server for “.com” where it can find the “example” domain’s authoritative server, and so on. They are called recursive servers because they “recurse” through the hierarchical DNS tree from top to bottom until they hit the authoritative server for the domain in question, which knows the required IP number.


CLIENT/SERVER MODEL 

DNS Resolver (CIENT)----> Root Server and Authoritative Servers

DNS resolver 
The client side of the DNS is called a DNS resolver. It is responsible for initiating and sequencing the queries that ultimately lead to a full resolution (translation) of the resource sought, e.g., translation of a domain name into an IP address


Within PC
1. Browser or Mail or any other Client send DNS Requests
2. Within OS DNS Resolver Check its own local Cache, If request doesn't exist 
3. The request is sent to ISP's DNS Recursive resolver, which check its own Cache
4.  If not found, Recursive (DNS) resolver  sends request to Root Domain Server (root server ) asking about the  Authoritative  DNS server for Top level doomain  .com  . The root server returns with the IP of the Authoritative  DNS server
the root server contains information about the top level domain (TLD) i.e. .com , .net , etc . companies such as verisign operate root servers 


5. The Recursive resolver send query to  Top Level Domain (TLD ) DNS Name Server which stores address information for second level domain (yahoo.com) within  Top level domain (.com) . The Authoritative DNS server comes back with the IP for Yahoo.com 










3-DNS

DNS load balancer. It looks at the availability of different servers and re-directs you to the one that is least utilized.

LTM vs GTM



===Global Traffic Manager===
 GTM load balances data centers.  It returns a IP   for client to connect to which is usually the LTM (VIP) . The LTM than load balances between servers .  For GTM to work properly, customers delegate DNS resolution to GTM. Clients send a DNS Lookup

-The GTM is an intelligent name resolver, intelligently resolving names to IP addresses.
-Traffic does not “route” through the GTM
-Tells best IP to route to based on metrics for the URL (WIP - Wide IP ) in question . WIP Common URL 

===Local Traffic Manager ===
LTM load balances servers and also does caching, compression, persistence, etc. 

- LTM doesn’t do any name resolution
-When traffic is directed to the LTM traffic flows directly through its’ full proxy architecture to the servers it’s load balancing.

Example
In a typical deployment, a customer will have 2 or more data centers, each with GTM and LTM devices. For GTM to work properly, customers delegate DNS resolution to GTM. 

So, a user could type into their browser "www.example.com." GTM would see the DNS request and see which data center was performing best. If it was data center 1, GTM would return the IP address from the LTM in data center 1. Then, the user would connect to that IP and LTM would load balance the user's request to a server.


1. Users Requests sent to common URL www.example.com (WIP)
2. Request goes to GTM acting as the DNS resolution (authoritative DNS) 
3.  GTM comes back with IP (or VIP) of  LTMs in one of the Datacenters 
4. The Traffic is forwarded to the LTM which load balances between the servers 


Communication between GTM and LTM :
The gtmd agent on BIG-IP® Global Traffic Manager™ (GTM™) uses the iQuery® protocol to communicate with the local big3d agent, and the big3d agents installed on other BIG-IP systems. The gtmd agent monitors both the availability of the BIG-IP systems, and the integrity of the network paths between the systems that host a domain and the local DNS servers that attempt to connect to that domain.

Example of communications between big3d and gtmd agents
The GTM and LTM can work together or they can be totally independent. If your organization owns both modules it’s usually using them together, and that’s where the real power comes in.. They do this via a proprietary protocol called iQuery. iQuery, functioning on TCP port 4353, reports VIP availability / performance back to the GTMs. The GTMs can then dynamically resolve VIPs that live on an LTM(s).
When a GTM has LTMs as servers in its’ configuration there is no need to monitor the actual VIP(s) with application monitors, as the LTM is doing that & iQuery reports the information back to the GTM.

Load Balancer Intro

A load balancer is a device that acts as a reverse proxy and distributes network or application traffic across a number of servers. 

 a reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers.

Load balancers are generally grouped into two categories: Layer 4 and Layer 7. 
Layer 4 : Load balancers act upon data found in network and transport layer protocols (IP, TCP, FTP, UDP). 
Layer 7:  Load balancers distribute requests based upon data found in application layer protocols such as HTTP.

Load Balancing Algorithm
Requests are received by both types of load balancers and they are distributed to a particular server based on a configured algorithm. Some industry standard algorithms are:
  • Round robin
  • Weighted round robin
  • Least connections
  • Least response time

Layer 7 Load Balancing 
Layer 7 load balancers can further distribute requests based on application specific data such as HTTP headers, cookies, or data within the application message itself, such as the value of a specific parameter.
Load balancers ensure reliability and availability by monitoring the "health" of applications and only sending requests to servers and applications that can respond in a timely manner.