What is a computer network?
A computer network is a system of interconnected devices that share resources and communicate using agreed-upon protocols. Every network — from two laptops on Wi-Fi to the global internet — follows the same fundamental principles: addressing, routing, and protocol layering.
Network types by scale
Networks are classified by their geographic scope:
| Type | Scale | Example |
|---|---|---|
| PAN | ~10 m | Bluetooth between phone and earbuds |
| LAN | Building | Office Wi-Fi, home network |
| MAN | City | University campus network |
| WAN | Country/globe | The internet, corporate MPLS links |
| WLAN | Wireless LAN | Any Wi-Fi network |
| VPN | Logical overlay | Remote-access tunnel over public internet |
How data flows — packet switching
Every message you send — an email, a video stream, a web request — is broken into packets. Each packet carries the destination address and a sequence number. Routers forward packets independently, and the destination reassembles them. This makes the network resilient: if one path is congested or broken, packets simply take another route.
TCP vs UDP — the two workhorses of transport
The choice between TCP and UDP is one of the most fundamental design decisions in networking.
| Feature | TCP | UDP |
|---|---|---|
| Connection | 3-way handshake | Connectionless |
| Reliability | Guaranteed delivery | Best-effort |
| Order | In-order delivery | No ordering |
| Speed | Slower (overhead) | Faster (minimal overhead) |
| Flow control | Yes | No |
| Use cases | HTTP, email, file transfer | Video streaming, DNS, gaming, VoIP |