1. IP Addressing: IPv4, Subnets, Public and Private IPs
1.3 IPv4 Classes (A to E) and Loopback
Classes aata "historical" aahet, pan interview madhe hamkhas vichartat – Deloitte sarkhya companies madhe candidates ni "class C cha subnet mask kay?" ha prashna report kela aahe. Mhanun he table paathh kara.
| Class | First octet range | Leading bits | Default mask | Networks / Hosts per network | Use |
|---|---|---|---|---|---|
| A | 1 – 126 | 0 | 255.0.0.0 (/8) | 126 / ~16.7 million | Very large networks |
| B | 128 – 191 | 10 | 255.255.0.0 (/16) | 16,384 / 65,534 | Medium networks |
| C | 192 – 223 | 110 | 255.255.255.0 (/24) | ~2 million / 254 | Small networks |
| D | 224 – 239 | 1110 | — | — | Multicast |
| E | 240 – 255 | 1111 | — | — | Experimental / reserved |
What about 127?
127.0.0.0/8 is reserved for loopback. 127.0.0.1 (also called localhost) always means "this same machine". When an app listens on 127.0.0.1:3000, it is reachable only from the server itself — that is exactly what we want behind a reverse proxy.
Why this matters for security
Recognising special ranges quickly is a daily SOC skill. Traffic from 127.0.0.1 in a web log means the request came from the server itself (for example a reverse proxy) – but it can also be a sign of SSRF, where an attacker tricks the server into calling itself. Services listening only on 127.0.0.1 are not reachable from outside, which is exactly how we will protect MySQL later.
Ravindra Bagale's Tip
Many students write the Class A range as 0–127. Remember: 0 and 127 are special, so the usable Class A range is 1–126. And 127 means loopback – "this same machine". In an interview, this small point makes you stand out.
Ravindra Bagale's Tip – मराठी
बरेच students Class A ची range 0–127 अशी लिहितात. लक्षात ठेवा: 0 आणि 127 special आहेत, usable Class A range 1–126 आहे. आणि 127 म्हणजे loopback – "हेच machine". Interview मध्ये हा छोटा point तुम्हाला वेगळं दाखवतो.
Ravindra Bagale's Tip – हिंदी
बहुत से students Class A की range 0–127 लिखते हैं. याद रखो: 0 और 127 special हैं, usable Class A range 1–126 है. और 127 यानी loopback – "यही machine". Interview में यह छोटा point तुम्हें अलग दिखाता है.
Practice task
Identify the class and default mask of: 10.4.5.6, 172.20.1.1, 200.1.2.3, 230.0.0.5, 127.0.0.1.