>_
EngineeringNotes
Module 01

IP & Networking

Before the cloud, you must understand how computers find each other.

01

What is an IP Address?

An IP Address (Internet Protocol) is like a home address for your digital device. It is a unique string of numbers that validates the device on a network.

IPv4

Old standard, but still most used.

192.168.1.1

Limit: ~4 billion addresses (Already exhausted!)

IPv6

The new standard.

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Limit: 340 undecillion (Infinite for practical purposes)

02

Localhost vs Network IP

There are two very special numbers you need to know as a developer.

127.0.0.1

Localhost

"Home". This is a loopback address. It points only to your own machine. If you run a server here, only you can see it.

192.168.x.x

Private/LAN IP

Your address on your WiFi router. Other devices connected to the same WiFi can talk to you using this IP.

03

Concept: 'Mild Hosting'

Most students think they need AWS to show their project to a friend. You don't. You can do "Mild Hosting" on your local WiFi.

Steps to host on WiFi:

  1. Connect both your Laptop and Phone to the same WiFi.
  2. Find your Laptop's LAN IP (using ipconfig or ifconfig). Say it's 192.168.1.45.
  3. Run your app on your laptop: npm run dev (Port 3000).
  4. Important: Ensure your app listens on 0.0.0.0 (All interfaces), not just localhost.
  5. Open your Phone's browser and type: http://192.168.1.45:3000.
🎉 Magic: Your phone is now accessing the website running on your laptop!
04

Public vs Private IP Architecture

How can millions of devices exist if Private IPs (like 192.168.1.2) are repeated in every home?
The Router is the Gateway.

THE INTERNET (WAN)
Public IP: 103.45.12.1
My Router
Gateway to Home A

Network A (Local LAN)

My Laptop192.168.1.5
Mom's Phone192.168.1.6
Public IP: 201.99.88.2
Friend's Router
Gateway to Home B

Network B (Local LAN)

Friend's Laptop192.168.1.5
Friend's Phone192.168.1.9
Observation: Both "My Laptop" and "Friend's Laptop" have the192.168.1.5 Private IP. This is allowed because they are in separate networks (isolated by their routers).
05

Communication Flow

Same Network (Inner)

My Laptop (192.168.1.5) → Mom's Phone (192.168.1.6)

  • Communication happens locally via the Router (Switch).
  • Data packets never leave your house.
  • Very fast, low latency.
  • Internet cable can be unplugged, works fine.

Different Network (Outer)

My Laptop (192.168.1.5) → Friend's Laptop (192.168.1.5)

  • Packet leaves My Laptop → My Router.
  • My Router replaces 192.168.1.5 with Public IP (NAT).
  • Travels through Internet → Friend's Public IP.
  • Friend's Router receives packet → Forwards to Friend's Laptop.
06

DNS: The Phonebook

We humans are bad at remembering numbers like 142.250.193.206. We prefer google.com.

DNS (Domain Name System) maps these names to IP addresses.

How DNS workstext
You: "Go to google.com"
Browser: "Hey DNS Server (8.8.8.8), where is google.com?"
DNS: "It lives at 142.250.193.206"
Browser: *Connects to 142.250.193.206*