Mind~G
System-Design

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.

[Your Phone] --- [WiFi Router] --- [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:

Home address: 12 Apple Street
IP address: 192.168.1.5

There are two main types:

  • IPv4: looks like 192.168.1.5
  • IPv6: looks like 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Diagram:

[Computer A: 192.168.1.2] <----> [Computer B: 192.168.1.3]

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:

[Phone 192.168.1.2]
[PC 192.168.1.3]
        |
     [Router]
     Public IP: 45.67.89.10
        |
     [Internet]

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:

You type: google.com
DNS says: google.com = 142.250.185.206

Diagram:

[You type google.com]
       |
     [DNS Server]
       |
   Gives IP -> 142.250.185.206
       |
   [Connects to Google]

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:

Packet 1: HE
Packet 2: LL
Packet 3: O

Each packet travels separately and may take different routes.

Diagram:

[You] --(Packet 1)-->
[You] --(Packet 2)-->
[You] --(Packet 3)-->
                Internet

                 [Friend]

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:

Sender --- TCP ---> Receiver
   |                    ^
   |--- packet 1 ------>|
   |--- packet 2 ------>|
   |--- packet 3 ------>|
         (acknowledged)

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:

Sender --- UDP ---> Receiver
   |--- packet 1 ------>|
   |--- packet 2 ------>|
   |--- packet 3 --X--> (lost)

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):

Application (You use browser)
Transport    (TCP / UDP)
Internet     (IP)
Network      (Physical wires, Wi-Fi)

Example: When you open google.com:

  1. DNS gives IP
  2. Browser uses TCP
  3. TCP uses IP to reach Google server
  4. Data comes back in packets

Summary

ConceptMeaningExample
NetworkConnected computersWi-Fi network
IP AddressDevice's number on network192.168.1.5
Public IPSeen by internet45.67.89.10
Private IPUsed inside home192.168.1.5
DNSConverts name to IPgoogle.com → 142.250.185.206
PacketSmall piece of data"HELLO" split into packets
TCPReliable, slowWeb browsing
UDPFast, not reliableVideo call

On this page