Learn computing fundamentals, programming, algorithms, systems, and software engineering.
A computer network lets machines exchange data, from two devices in one room to billions across the planet. Networking is built in layers, where each layer has a clear job and talks only to the layer next to it. This layering is the single most important idea in the field. This lesson introduces the OSI and TCP/IP models, how data is wrapped (encapsulated) as it travels down the stack, how IP addressing and DNS turn names into destinations, how TCP and UDP differ, and how HTTP and HTTPS carry the web. By the end you will be able to trace, step by step, what happens between typing a URL and seeing a page load.
A network is a set of devices connected so they can share data and resources.
The OSI model splits networking into seven layers, from the physical wire up to the application.
TCP/IP is the practical model actually used on the internet, with four layers.
| OSI layer | TCP/IP layer | Example |
|---|---|---|
| Application / Presentation / Session | Application | HTTP, DNS |
| Transport | Transport | TCP, UDP |
| Network | Internet | IP |
| Data Link / Physical | Network Access | Ethernet, Wi-Fi |
As data moves down the stack, each layer wraps the data from above with its own header. On the receiving side, the layers are stripped off in reverse.
An IP address identifies a device on a network. IPv4 uses 32-bit addresses (e.g., 192.168.1.10). An address has a network part and a host part, which is how routers know where to send a packet.
| TCP | UDP | |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | Reliable, retransmits | Best-effort |
| Ordering | Ordered | Unordered |
| Overhead | Higher | Lower |
| Use | Web, email, file transfer | Video, gaming, DNS |
DNS translates human-friendly names into IP addresses. Your browser cannot connect to "example.com" directly — it first asks DNS for the address.
HTTP is the request/response protocol of the web. A client sends a request with a method (GET, POST, ...) and receives a response with a status code (200 OK, 404 Not Found, 500 Server Error). HTTPS is HTTP wrapped in TLS encryption, so the data is protected in transit.