Learning Objectives
By the end of this chapter, you will be able to:
- Explain what an IP address does for routing.
- Compare IPv4 and IPv6 and why both exist.
- Classify addresses as public or private and static or dynamic.
- Describe how DNS translates names to numbers and why caching matters.
- Break a Nepali domain and URL into parts.
Why Addresses Come Before Names
Routers forward packets by numbers, not names. An IP address is that number, like a street address for each device. People prefer names such as www.example.com.np, so DNS bridges the two. For BBM, your public address controls reachability, your domain controls brand, and your DNS controls availability.
Grouped Framework: Three Address Lenses Plus DNS
Lens 1: Version - IPv4 and IPv6
IPv4 is 32 bit, four decimals with dots, each 0 to 255, for example 202.70.64.10. It allows about 4.3 billion addresses (2 to the power 32) and still dominates older gear. 300.12.5.1 is invalid because 300 exceeds the 8 bit limit.
IPv6 is 128 bit, eight hex groups with colons, for example 2001:0db8:85a3:0000:0000:8a2e:0370:7334. It allows about 3.4 x 10 to the power 38 addresses (2 to the power 128), effectively unlimited for mobiles and IoT.
| Aspect | IPv4 | IPv6 |
|---|---|---|
| Length | 32 bits | 128 bits |
| Format | Four decimals with dots | Eight hex groups with colons |
| Example | 202.70.64.10 |
2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
| Count | About 4.3 billion | About 3.4 x 10^38 |
| Status | Still most used | Growing for mobile and IoT |
Many Nepali ISPs run dual stack, giving both.
Lens 2: Scope - Public or Private
- Public IP - globally routable, assigned by ISP, reachable from internet. Used for website servers and router WAN ports.
- Private IP - inside a LAN only, such as
192.168.1.10or10.0.0.5. Not reachable from internet. A router shares one public address among many private devices using NAT. This is why 50 hotel phones can share one public IP.
flowchart LR
Phone[Phone 192.168.1.21 private] --> R[Router NAT]
POS[POS 192.168.1.10 private] --> R
R -->|Public 103.145.12.8| ISP[Internet]
ISP --> Server[Server 203.0.113.25 public]
Lens 3: Assignment - Static or Dynamic
- Static IP - fixed, for servers that must be found at the same address: websites, VPN gateways, CCTV.
- Dynamic IP - assigned by DHCP, may change after reconnect, fine for homes and phones.
Pay for static only where reachability is required.
DNS: The Internet Phone Book
DNS is a global distributed system that translates a domain name to an IP so the browser knows where to connect.
When you type www.example.com.np:
- Browser and OS check cache.
- Resolver (often ISP or 1.1.1.1 or 8.8.8.8) queries the hierarchy: root, then
.npservers, thencom.np, then the authoritative server for the domain. - It returns the IP and caches it for TTL seconds.
sequenceDiagram
participant B as Browser
participant D as DNS resolver
participant A as Authoritative DNS
participant W as Web server
B->>D: IP for www.example.com.np?
D->>A: Query
A-->>D: 203.0.113.25
D-->>B: 203.0.113.25 (cached)
B->>W: GET from 203.0.113.25
W-->>B: Page
Lower TTL before moving a site so old addresses expire quickly.
Parts of a Domain and URL
Read domains from right to left.
- TLD -
.com,.org, or.npfor Nepal. - Category -
com.npis the commercial space under.np. - Registered name and subdomain - in
www.arjankc.com.np,arjankcis registered,wwwis subdomain.
A URL is the full locator: https://www.example.com.np/products/index.html where https is protocol, www.example.com.np is domain, and /products/index.html is path.
Nepal BBM Angle: Retail, Hotel, and Supply Chain
Retail. A chain on familyMart.com.np uses shop.familyMart.com.np for catalogue and pos.familyMart.com.np for POS sync, each pointing via DNS to different public addresses. Shop devices stay on private addresses behind NAT. The warehouse keeps a static public IP for VPN so branches sync to one fixed address.
Hotel. A 40 room hotel splits private subnets, for example 192.168.10.0/24 for guests and 192.168.20.0/24 for staff, isolated for security. With short TTL, it can shift www.hotelpokhara.com.np to a backup server if the primary fails in season.
Supply chain. Vans get dynamic private addresses on 4G, but the dispatch server needs one static public IP so all vans report to one endpoint. IPv6 helps as fleets add scanners and sensors.
Nepal: .np is managed by Mercantile Communications, .com.np is free with documents, which is why SMEs secure it early. ISPs such as Nepal Telecom and WorldLink run resolvers and are rolling out IPv6. Hard coding an IP instead of a name breaks when the ISP renumbers after maintenance.
Worked Example: NPR Cost on BS 2081
Scenario dated Jestha 10, 2081. A Lalitpur boutique budgets one year:
- Domain:
.com.npadmin NPR 1,000 plus.comNPR 1,800 for brand protection - Hosting with DNS: NPR 6,000 per year
- Static IP for warehouse VPN: NPR 2,000 x 12 = NPR 24,000
Total = 1,000 + 1,800 + 6,000 + 24,000 = NPR 32,800. The static address costs more than the names, so keep one static for the server and keep phones and PCs on dynamic NAT.
Self-Check
Check your understanding
1. Is `192.168.5.256` valid? No, last octet exceeds 255. 2. Phone shows `10.15.2.8`. Reachable from internet? No, private behind NAT. 3. Why does a server need static but a phone not? Server must be found at same address, phone initiates outbound and can be dynamic. 4. Why lower TTL before migration? So resolvers cache old address for shorter time and new address spreads faster.Try This
You run DNS for everestRetail.com.np. www points to 203.0.113.40 with TTL 86,400 seconds (24 hours). You will move to 198.51.100.20 on Ashoj 5, 2081 at 18:00.
- Without change, worst stale time after 18:00? 24 hours.
- If you set TTL to 300 seconds 24 hours early, worst stale after 18:00? 5 minutes.
- At NPR 15,000 loss per hour on old server, worst exposure drops from 24 x 15,000 = NPR 360,000 to 5/60 x 15,000 = NPR 1,250, saving about NPR 358,750.
Answer sketch
Lower TTL at least one old TTL before move. Short TTL adds queries but avoids long outage.Summary
IP addresses locate devices for routing. IPv4 and IPv6 differ in size, public and private in reachability, static and dynamic in assignment. NAT shares one public address among many private. DNS translates names via hierarchy and caches by TTL. Domain names have TLD, registered part, and subdomain, forming the host part of a URL.
Key Takeaways
- Routing uses numbers, names use DNS.
- IPv4 32 bit, IPv6 128 bit.
- Public reachable, private behind NAT.
- Static for servers, dynamic for clients.
- TTL controls DNS caching.
Exam-Style Questions
Short answer
- Is
300.12.5.1valid IPv4? Why? - Differentiate public and private IP.
- Identify protocol, domain, and path in
https://www.nrb.org.np/about.html.
Long answer
- Compare IPv4 and IPv6. Why shift to IPv6 for Nepal growth?
- Explain DNS for a
.com.npsite and how TTL affects migration.


