In this lesson,
we will learn about network traffic management.
Network traffic management involves the control, direction,
and optimization of data flow across a network.
Network traffic management tools
include forward and reverse proxies
as well as content delivery networks, or CDNs.
Let's dive deeper into proxies
and content delivery networks.
We'll begin by discussing different types of proxy servers.
Proxy servers are devices that create a connection
between an end user's client machine
and a remote resource, such as a web server.
Proxies can be either physical, hardware-based appliances
or software installed on a server
within your infrastructure.
Either way, proxy servers offer several key benefits,
including improved speed, efficiency, security,
and enhanced auditing capabilities.
Speed and efficiency are enhanced
through a process called Web caching.
When a user requests a website through the proxy,
the proxy retrieves the site from the web server
and delivers it to the user.
Simultaneously, the proxy stores a local copy of the website
in its cache.
The next time someone requests the same site,
instead of retrieving it from the web server
over a slow wide area network link,
the proxy sends the cached version,
saving both time and bandwidth.
This works particularly well for static websites.
However, this technique is less effective
for modern Web 2.0 websites,
like Facebook, Twitter, or Reddit,
which rely heavily on user-generated content.
Since each user receives a personalized experience,
caching is far less efficient for these dynamic sites.
Beyond caching.
Another key benefit of a proxy server
is increased security through content filtering.
This is achieved by configuring the proxy
with a list of acceptable and non-acceptable sites,
allowing it to block access to sites
deemed inappropriate or harmful.
For instance, if an employee attempts to visit a website
containing pornography or gambling while at work,
the proxy can be configured to deny access.
Similarly, it can block websites known to host malware
or other harmful content,
helping to protect the corporate network
from security threats.
A final benefit to proxy servers
is that they provide valuable auditing capabilities
as they can log every user request
made to access the wide area network.
These logs can be used to track attempts
to access restricted sites,
such as gambling or pornography, as mentioned earlier.
Additionally, they allow for monitoring
how much time employees spend on particular websites.
For instance, if a manager suspects an employee
is spending an excessive time on social media
instead of working,
they can request a report from the system administrators,
who can query the proxy server logs
to determine the exact time spent on each site,
provided this is in line with the organization's policies.
Now, everything I've discussed so far
refers to a specific type of proxy
known as a forward or transparent proxy.
This type of proxy is typically positioned
at the edge of a corporate network,
and it is responsible for regulating outbound traffic
according to your acceptable use policies.
Often, it also hides the client's IP address
and blocks any malicious incoming traffic
that may be sent in response
to the client's request to a remote server.
But there is another type of proxy known as a reverse proxy.
Unlike a forward proxy,
a reverse proxy acts as an intermediary
positioned at the edge of your corporate network,
functioning as the endpoint for external users.
Essentially, it serves as a gateway
between your users and your application's origin server.
For instance, if I'm hosting a web application
on one of my servers,
I can set up a reverse proxy to act as a middleman
between remote users and my application.
This allows the reverse proxy
to receive connection requests,
complete the TCP three-way handshake,
and then connect the application's origin server
to the end user.
So, why would you want to use a reverse proxy?
Well, it offers four main benefits,
content caching, traffic scrubbing,
IP masking, and load balancing.
First, reverse proxies are useful for content caching.
By deploying a reverse proxy
in various locations around the world,
they can act as part of a content delivery network, or CDN.
For example, if my main web server hosting my website
is in Miami, Florida,
I could place reverse proxies in Japan,
Germany, New York, and San Francisco.
These proxies would each store a cached copy of my website,
and any time I update the content in Miami,
the changes would be compressed
and cached across all these locations.
This way, if a student in India requests my homepage,
they would receive it from the closest and fastest proxy,
such as the one in Japan,
reducing load times and enhancing the user experience.
As far as content delivery networks are concerned,
a reverse proxy is part of the solution,
but it doesn't fully address the challenge
of delivering content quickly on a global scale.
More on this in a few minutes.
Second, reverse proxies can handle traffic scrubbing.
Placing them in front of a backend web application server
allows them to inspect and filter traffic
before it reaches the servers.
This helps mitigate distributed denial-of-service attacks
since the proxies absorb the attack,
keeping the backend servers safe.
Reverse proxies also enhance security
by filtering out malicious traffic
when paired with a web application firewall.
Third, reverse proxies provide IP masking.
Just like a forward proxy hides the client's IP address,
a reverse proxy hides the IP address
of the application servers.
This means clients only communicate with the proxy,
keeping the server's IP addresses hidden.
Fourth, reverse proxies can be used for load balancing.
As gateways between users and web application servers,
reverse proxies can distribute individual requests
to any available server.
This helps distribute the load
across multiple backend servers,
ensuring better performance and quality of service
for end users.
So, while both forward and reverse proxies
offer valuable features like caching,
traffic filtering, and security improvements,
they don't fully address the challenge
of delivering content quickly and efficiently
to users across the globe.
This is where content delivery networks, or CDNs,
come into play.
CDNs are designed to ensure that content
such as website data, videos, or files
is available to users as quickly as possible
by distributing copies of the content
to multiple servers located in different geographic regions.
When a user requests content,
the CDN delivers it from the server closest to them,
reducing latency and improving the overall user experience.
CDNs offer global scalability
and are specifically optimized
for handling large volumes of traffic.
They can automatically route traffic
to the most efficient server
based on factors like location and network conditions,
while also providing dynamic content acceleration
and built-in distributed denial-of-service protection.
This makes CDNs effective at delivering content seamlessly
across large, geographically dispersed networks.
So, remember, when you're thinking about proxies,
there are two basic types,
forward or transparent proxies, and reverse proxies.
Forward proxies are focused
on filtering and managing information
that is leaving our networks,
helping out with things like content filtering,
security, and user activity monitoring.
Reverse proxies filter information coming into our networks,
serving as intermediaries between external users
and our internal application servers.
And they provide benefits like load balancing,
content caching, and security.
Finally, content delivery networks distribute content
across multiple servers distributed globally,
allowing users to access data from the nearest server.
This ensures faster load times, reduced latency,
and an overall better user experience.
Content delivery networks also provide content acceleration,
optimizing the delivery of dynamic and static content
by routing traffic through the most efficient paths.
By doing so, they reduce congestion
and improve the speed at which content is delivered,
even during periods of high traffic.