[Noob Question] Network Routing through the internet

Hi, Noob here, just have a question how the network is routed through the internet when the client hits the url.

I want to know how the traffic is routed using with/without WAF, Route 53(hostedzone) and cloudfront

This is my understanding so far

with cloudfront, route 53, Waf

CLient(http request) ----> Domain registrar DNS servers ----> Route53 DNS ----> cloudfront ----> WAF ----> EC2 live server

THIS MIGHT VERY WELL BE A BLUNDER. I want to know the correct traffic travel path. Thank You. Experts please help!!

I believe it’s something like

Client > DNS (route 53) > Client (get the IP)
Client > CloudFront > WAF > EC2/Lambda/Whatever

Your registrar does nothing here, just is what you use to set your DNS zone

The short answer is you’re pretty close.

The long answer assuming there is no dns caching.

Client request to example.com

DNS lookup for example.com >> DNS root hint servers >> .com name servers >> example.com name servers.

Http request to IP obtained from example.com name servers with a host header for example.com.

This would be your EC2/lambda/cloudfront whatever.

There are also TCP sessions under all that as well.

To make your picture simple, forget about the DNS part. DNS is neede to translate the keys into values (eg hostname to IP).
Client connects to an IP.

If you want to add DNS Servers to your pic it’s going to get complex. The client probably uses a different DNS server.

And just to add to this re: dns caching. Take a look at authoritative and recursive DNS if you want to understand more.

that makes sense. thnks :heart:

right. understood. thnks :heart:

i’ll take a look. thnks :heart:

This is actually very detailed and exactly what i was confused. This clears up a lot . thank you :heart:

DNS servers don’t carry the main traffic. Your browser asks a DNS server: what is example.com’s IP address? Then it talks to that IP address directly.

It’s worth understanding how the VPC parts work around your EC2 instance as well. Your EC2 instance will live in a subnet which is part of a VPC. Your VPC can have an internet gateway attached to it. Your subnet can then have a route configured to your internet gateway. This makes the subnet ‘public’ allowing which allows public IPs to be associated with your EC2 instance. It’s important to note that the public IPs are not assigned directly to your EC2 instance, but to the internet gateway, which then maps that traffic to the internal IP of your EC2 instance within the subnet. This is why you won’t ever see your public IP configured on a nic in the OS of your EC2 instance. WAF either runs on cloudfront, or on an application load balancer, so the more detailed side of the right side of your network flow is

Cloudfront (+WAF) > VPC( Internet Gateway > Public Subnet > EC2 instance)

Or VPC( Internet Gateway > Public Subnet > Application Load Balancer (+ WAF) > EC2)

Usually with load balancer you put EC2 in a private subnet (no route to internet gateway) so it’s isolated from the internet

Thank you.

Wow. Thanks for this piece of info. Now that makes much better sense. Do you recommend me any Material, videos, courses online to get familiar with aws and more imp networking in general