Hi, everyone, and welcome back.
Now in today's video, we'll be discussing about the basics of OSA model and we'll be looking it from
the perspective of load balancers.
Now, whenever you go ahead and look into the load balancer related documentation or features, one
of the common things that you will generally see, for example, these are the product comparison of
multiple load balances.
Now in the load balancer type, you will see layer seven, you will see layer four, you will see layer
four, slide seven, and so on.
Now the question that comes is what exactly does this mean?
And this also leads to certain confusion.
So this is what we are going to look in today's video.
Now, the layers that were described are primarily associated with the layers that are part of the OSI
model.
So at a high level overview, the OSA model describes the seven layers that the computer system uses
to communicate over a network.
For example, let's say that we open a website through a browser, so when that operation happens behind
the scenes intimately, your traffic packets goes through these set of layers.
So the first are associated with a physical layer where you have Ethernet, then you have the network
layer where you have the IP ICMP protocol, then you have the transport layer associated with TCP and
the last layer is associated with application.
Now one important thing to note here is that each layer is associated with certain set of protocols.
For example, the application layer has certain set of protocols like HTTP, protocol, FTP, SMTP and
so on.
When you discuss about the transport layer, you have the TCP protocol, UDP protocol network layer
is associated with IP, ICMP and so on.
So when you go ahead and read that the application load balancer is associated with Layer seven, it
is nothing but the Layer seven as part of this OSA model.
So you have physical as one detailing, second network, third, fourth, five, six, seven, which
is the application layer.
So it states that the application load balancer works at the application layer.
Now when you discuss about the network load balancer, which is the layer four, so you have one, two,
three, four.
So network load balancer primarily works at the transport layer.
Now the question that comes is what difference does it make for the load balancer to work in application
layer or a transport layer?
Because ultimately the load balancer will go ahead and load balance the traffic between multiple set
of targets.
And the answer to this is the features that a load balancer provides associated with the set of layers.
Now, to demonstrate the concept in a much more practical way, I have a pcap file associated with the
HTTP.
So someone has opened up a specific website and all the traffic is captured.
So this is the packet capture warrior.
Now if you look into the packet capture, it basically starts with SYN Snack and AG.
So basically this is the TCP protocol.
Then in this forth number, you will see that you have a HTTP protocol.
Even from the protocol you see you have a HTTP protocol over here.
And if you look into this, you have the frame at the start, you have the Ethernet, you have the IP
protocol, you have the TCP protocol, you have the HTTP protocol, not the values that we were discussing.
So initially we have Ethernet, then comes the IP, then comes the TCP, then comes to HTTP.
Alright, so as we're discussing, you have the internet, you have the IP in the network layer, you
have the TCP in the transport layer, and then the other is HTTP and the application layer.
And similar thing you can see over here now for today's video, we'll be discussing about the application
load balancer, which works at the layer seven.
Now, layer seven, we know that the HDTV protocol is associated with a layer seven.
So you also have the HTTP protocol related data over here.
So from here, what the user has done using the W gate command, they have made a specific request.
So this is the request that you are here.
You can see even from here you can see this is a gate request on slash images, slash layout slash logo
dot BMG.
This is the U and the host this packet life dot net.
So basically what the user has done he has run the W gate command on the packet live dot net slash images
slash layer slash logo dot png.
So if we construct it in a command, this is how the command would really look like.
So w get on this specific URL and the end point here is the PNG file.
So the image was fetched.
Now in this layer seven protocol of HTTP, there are multiple things that we see over here.
First one is the gate request.
So there are multiple types of requests.
You have gate post and so on.
So this is one part second.
But is this entire A which is the part here which is slice images layout logo that this is the second
important part.
Third important part is this user agent.
So every tool has its own set of user agent.
Chrome has a different user agent Firefox has a different user agent and so on.
Then you have this host header, which is nothing but the host.
Now the important part here is that if a load balancer is a layer seven type load balancer, then that
load balancer will have some kind of a feature where it can root the request based on these data, like
get post and so on, the user agent, the host header and so on.
So based on all of these headers that are part of the HTTP protocol, the layer seven base load balancer
will be able to root the request.
So let's go ahead and look into it practically.
Now for today's demo, I have an application load balancer that is up and running.
And as we're discussing this, application load balancer runs on the Layer seven.
So what I have done, I have configured this application load balancer to look into this user agent
header.
And based on this user agent, the application load balancer will go ahead and return a different response
altogether.
So let's go ahead and look into it practically.
So from a load balancer, let's copy this URL and from my Firefox browser, I'll add the specific URL,
let's press enter and it states Hey Mozilla, you have a great add on.
So what application load balancer has done?
It has looked into the user agent at a high level overview and it is returning the response now from
the CLA.
If we make use of a W gate to send the same request to our load balancer, and the response was basically
the indexed HTML which was downloaded.
So if I open up the indexed HTML, this is nothing but the website zero two.
So same URL when opened from a different set of tools like from a mozilla browser or using the W gate
is returning a different set of response all together.
And all of this is because of the user agent related configuration in the application load balancer.
And all of this is possible because our application load balancer is listing on layer seven.
And within the layer seven we have the HTTP protocol.
And within the HTTP protocol you have this user agent header and the application load balancer can capture
this header, can look into the contents and based on this contents, it can go ahead and send a different
kind of response all together.
Now, when you discuss about the network load balancer, this does not really work on layer seven.
It works on the layer four.
Layer four is associated with TCP and UDP.
So for the network load balancer, you will not really have that flexibility to look into the HTTP headers
grid.
So before we conclude, let's go ahead and quickly revise.
So first point is that each load balancer operates at the specific layer.
This is something that we have seen and you will only be able to perform operations on the request based
on the layer that LP supports.
Great.
So with this will conclude today's video.