
The internet is a global network of networks that moves packets between devices using shared protocols. As a developer, understanding this path helps you debug slow requests, failed API calls, and region-specific issues much faster.
Table of Contents
Open Table of Contents
- Quick Definition
- The Core Building Blocks
- How Data Moves Across the Internet
- Step-by-Step: Loading a Website
- Why CDNs Matter in Real Systems
- What Actually Causes Latency
- Common Misconceptions
- Developer Debugging Checklist
- Interview Questions
- 1. What is the role of BGP in how the internet works?
- 2. Why can two users in different cities get very different response times for the same API?
- 3. How would you explain the difference between internet, intranet, and web in one minute?
- 4. If DNS and TLS are both healthy, why might users still see timeouts?
- 5. Why do CDNs improve performance for static content more than dynamic personalized content?
- Conclusion
- References
- YouTube Videos
Quick Definition
The internet is not one company or one server. It is a federated system where:
- Devices connect to local networks.
- Local networks connect to Internet Service Providers (ISPs).
- ISPs exchange traffic through peering and transit agreements.
- Routers forward packets hop by hop until they reach the destination network.
At the application layer, protocols like HTTP rely on transport and network layers below them to get data delivered.
The Core Building Blocks
1. IP addresses and packet routing
Every internet-connected endpoint uses IP addressing. Routers use destination IPs to decide the next hop.
2. DNS (name to IP resolution)
Humans use domain names. Computers route by IP. DNS translates names like adevguide.com into reachable addresses.
3. Transport protocols (TCP or UDP)
- TCP: reliable, ordered delivery.
- UDP: lower overhead, best-effort delivery.
4. Encryption with TLS
Most web traffic uses HTTPS, which is HTTP over TLS. TLS protects confidentiality and integrity between client and server.
5. Autonomous Systems and BGP
The global internet is made of Autonomous Systems (AS). Border Gateway Protocol (BGP) advertises which IP ranges each AS can reach.
How Data Moves Across the Internet
flowchart TD
A[User Device] --> B[Home or Office Router]
B --> C[Local ISP]
C --> D[Regional Backbone]
D --> E[Transit or Peering Network]
E --> F[Destination ISP]
F --> G[CDN Edge or Origin]
G --> H[App Service]
H --> I[(Database or Cache)]
I --> H
H --> G
G --> A
A --> J{Next Request?}
J -->|Yes| C
J -->|No| K[Idle]
classDef net fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#000000;
class A,B,C,D,E,F,G,H,I,J,K net;
Key point: internet paths are often asymmetric. The request path and response path may traverse different networks.
Step-by-Step: Loading a Website
When a user opens https://adevguide.com, this sequence typically happens:
- Browser parses URL and checks local cache/HSTS rules.
- DNS resolver finds IP address for the hostname.
- Client establishes connection (TCP or QUIC).
- TLS handshake validates certificate and negotiates keys.
- Browser sends HTTP request.
- CDN edge serves from cache or forwards to origin.
- Origin application reads cache/database and returns response.
- Browser renders HTML/CSS/JS and fetches secondary assets.
Each step can fail independently. That is why network debugging should isolate the failing stage first.
Why CDNs Matter in Real Systems
Without a CDN, users in distant regions always hit the origin directly. That increases latency and origin load.
With a CDN:
- Static assets are cached near users.
- TLS termination can happen at edge locations.
- Origins are protected from spikes and DDoS patterns.
Real-world examples:
- Streaming platforms cache video segments at edge POPs to reduce buffering.
- E-commerce sites cache product images and static bundles globally during traffic peaks.
What Actually Causes Latency
Latency is rarely just one thing. Common contributors:
- DNS resolution delays.
- TCP/TLS handshake overhead.
- Long physical distance between user and serving region.
- Packet loss and retransmissions.
- Congested intermediary networks.
- Slow backend queries after request reaches origin.
A practical insight: developers often blame “the network” when the largest delay is actually database time in the backend.
Common Misconceptions
”The internet is the same as the web”
Not true. The web (HTTP/HTML/JS) is one service on top of the internet. Email, gaming traffic, and VoIP also use the internet but not the web stack.
”DNS is only needed once”
Not always. DNS answers expire based on TTL and may change because of failover or load balancing.
”If ping works, the app is healthy”
Ping only validates basic reachability for ICMP. Your application can still fail due to TLS, HTTP, auth, or backend dependency issues.
Developer Debugging Checklist
Use this sequence in production incidents:
- Verify DNS answer:
dig yourdomain.com +short - Verify TCP/TLS reachability:
curl -I https://yourdomain.com - Check CDN/cache headers:
cache-control,age,x-cache(provider-specific) - Inspect browser waterfall: DNS, connect, SSL, TTFB, content download
- Correlate with server logs and request IDs
- Compare behavior by region/network provider
Interview Questions
1. What is the role of BGP in how the internet works?
BGP is the control-plane protocol used between Autonomous Systems to announce reachable IP prefixes and preferred paths. It does not move user payload directly; it decides routing policies that data-plane routers later follow.
In interviews, mention that BGP decisions are policy-driven, not strictly shortest-path, which explains why routes can look non-intuitive.
2. Why can two users in different cities get very different response times for the same API?
They may hit different DNS resolvers, CDN edges, network paths, and peering relationships. One path may include extra hops or congested links, while another has a direct edge hit.
Strong answers combine network-path variance with application-layer effects like cache hit ratio and regional backend capacity.
3. How would you explain the difference between internet, intranet, and web in one minute?
The internet is the public global network of networks. An intranet is a private network using similar TCP/IP technologies but restricted access. The web is an application layer ecosystem (HTTP + browsers + web servers) running on top of either internet or intranet.
This distinction matters because transport and routing concerns exist even when no browser is involved.
4. If DNS and TLS are both healthy, why might users still see timeouts?
Request might reach origin but stall in application processing: overloaded thread pools, slow DB queries, downstream service failures, lock contention, or queue saturation.
Always separate connection establishment success from end-to-end application response success.
5. Why do CDNs improve performance for static content more than dynamic personalized content?
Static content has high cache reusability across users, so edge servers can serve it without origin trips. Personalized dynamic responses often vary per user and have low cache hit potential.
You can still optimize dynamic paths with partial caching, edge compute, and smart cache keys, but gains are usually smaller than static asset caching.
Conclusion
Understanding how the internet works gives developers a concrete mental model for production troubleshooting. Instead of guessing, you can pinpoint whether an issue is in DNS, routing, transport, TLS, CDN, or backend execution.
That clarity reduces incident resolution time and helps you design systems that perform well across regions and network conditions.
References
- MDN: How the Internet Works https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/How_does_the_Internet_work
- RFC 791 - Internet Protocol (IPv4) https://www.rfc-editor.org/rfc/rfc791
- RFC 9293 - Transmission Control Protocol (TCP) https://www.rfc-editor.org/rfc/rfc9293
- RFC 4271 - A Border Gateway Protocol 4 (BGP-4) https://www.rfc-editor.org/rfc/rfc4271
- Cloudflare Learning Center: What Is a CDN? https://www.cloudflare.com/learning/cdn/what-is-a-cdn/
- AWS: What Is a CDN? https://aws.amazon.com/what-is/cdn/
- IBM: BGP (Border Gateway Protocol) https://www.ibm.com/think/topics/bgp
YouTube Videos
- “What is DNS? (Domain Name System)” - PowerCert Animated Videos https://www.youtube.com/watch?v=mpQZVYPuDGU
- “DNS Explained” - IBM Technology https://www.youtube.com/watch?v=72snZctFFtA
- “How a DNS Server (Domain Name System) works” - CBT Nuggets https://www.youtube.com/watch?v=2ZUxoi7YNgs
- “DNS and How it Works” - NetworkChuck https://www.youtube.com/watch?v=UVR9lhUGAyU