Skip to content
Home Tutorials Roadmaps Courses Classroom Training Blog
Log in Join free
Computer Science Beginner Free

How the Internet Works

Lesson 6 of 17 · Networking 35%
1. Introduction to CS
What is Computer Science?
6. Operating Systems
OS Fundamentals
7. Cybersecurity Basics
Security Fundamentals
8. Software Engineering
Software Development Life Cycle
9. Cloud Computing
Cloud Computing Basics
10. Dynamic Programming
Dynamic Programming Introduction
11. AI & Machine Learning
Introduction to AI & ML
12. Internet of Things
IoT Fundamentals
13. Blockchain Basics
How Blockchain Works

The internet is a global network of interconnected computers using the TCP/IP protocol.

Key Concepts

  • IP Address — unique device identifier
  • DNS — domain name resolution
  • TCP/UDP — transport protocols
  • HTTP/HTTPS — web protocols

Syntax

COMPUTER-SCIENCE
# Request flow
Browser → DNS → IP → TCP → Server → Response

# Ports
HTTP: 80 | HTTPS: 443 | SSH: 22
HTTP Request Concept
PYTHON
# HTTP request concept (simulated)
import json

# Simulate an HTTP request
request = {
    "method": "GET",
    "url": "/api/users",
    "headers": {
        "Content-Type": "application/json",
        "Authorization": "Bearer token123"
    }
}

response = {
    "status": 200,
    "headers": {"Content-Type": "application/json"},
    "body": json.dumps({"users": ["Alice", "Bob"]})
}

print("Request:")
print(json.dumps(request, indent=2))
print("\nResponse:")
print(json.dumps(response, indent=2))

Practice

1
Exercise

What happens when you type a URL in the browser?

Answer
DNS resolves domain to IP, browser sends HTTP request to server, server responds with HTML, browser renders it.

Quick Quiz

1

What port does HTTPS use?

HTTPS uses port 443. HTTP uses port 80.

Choose an answer to continue.

Interview Questions

TCP is reliable and ordered. UDP is faster but unreliable. TCP for web/email, UDP for gaming/streaming.

Up next

OSI Model

Lesson 7 of 17 · Networking