Networking Basics
What is a Network
A network is when two or more computers are connected so they can share data.
Example: When your phone connects to Wi-Fi, it joins a network with the router. That router connects to other networks (like your Internet Provider), and finally to the internet.
What is an IP Address
Every device on a network needs an address so others can find it. This address is called an IP Address (Internet Protocol Address).
It's like your home address, but for computers.
Example:
There are two main types:
- IPv4: looks like 192.168.1.5
- IPv6: looks like 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Diagram:
Public IP vs Private IP
-
Private IP: used inside your home or office network (local). Example: 192.168.1.5
-
Public IP: used on the internet (global). Example: 45.67.89.10
Your router gives private IPs to your devices and has one public IP for the whole network.
Diagram:
What is DNS (Domain Name System)
Humans remember names like google.com. Computers use IP addresses like 142.250.185.206.
DNS is like a phone book that turns website names into IP addresses.
Example:
Diagram:
What is a Packet
When data is sent over the internet, it's broken into small parts called packets.
Each packet carries:
- Header: info like source IP, destination IP
- Data: the actual message part
Example: If you send "HELLO" over the network, it may be sent as packets:
Each packet travels separately and may take different routes.
Diagram:
What is TCP (Transmission Control Protocol)
TCP is like a careful delivery service. It makes sure all packets arrive and in the correct order.
Example:
You send "HELLO".
TCP ensures all packets (H, E, L, L, O) reach safely.
If one is lost, TCP asks for it again.
Diagram:
TCP is used in things that need reliability:
- Web browsing (HTTP)
- Email (SMTP)
- File transfer (FTP)
What is UDP (User Datagram Protocol)
UDP is like a fast but careless delivery service. It sends packets quickly but does not check if they arrive.
Example:
You send 10 packets.
If packet 3 is lost, UDP does not resend.
Diagram:
UDP is used in:
- Online games
- Video calls
- Streaming (speed is more important than perfection)
How TCP and UDP fit with IP
- IP handles addressing (where to send)
- TCP or UDP handles how to send
Together they form the Transport and Internet layers of networking.
Diagram (Simple Layer Model):
Example: When you open google.com:
- DNS gives IP
- Browser uses TCP
- TCP uses IP to reach Google server
- Data comes back in packets
Summary
| Concept | Meaning | Example |
|---|---|---|
| Network | Connected computers | Wi-Fi network |
| IP Address | Device's number on network | 192.168.1.5 |
| Public IP | Seen by internet | 45.67.89.10 |
| Private IP | Used inside home | 192.168.1.5 |
| DNS | Converts name to IP | google.com → 142.250.185.206 |
| Packet | Small piece of data | "HELLO" split into packets |
| TCP | Reliable, slow | Web browsing |
| UDP | Fast, not reliable | Video call |