Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials Computer Science How the Internet Works
Computer Science Beginner FREE

How the Internet Works

Lesson 1 of 17 Beginner Interactive

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("
Response:")
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.

Interview Questions

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