Chapter 1: Networking Fundamentals
1.5 IPv6
Friends, IPv4 addresses are running out, and that is why IPv6 came. Don't worry – the address looks long, but once you understand the two shortening rules it becomes very easy to read.
मित्रांनो, IPv4 चे ॲड्रेसेस संपत आले आहेत, म्हणून IPv6 आलं. घाबरू नका – ॲड्रेस लांब दिसतो, पण शॉर्टनिंगचे दोन नियम समजले की वाचायला एकदम सोपे वाटेल.
दोस्तों, IPv4 के ऐड्रेसेस ख़त्म होने को हैं, इसलिए IPv6 आया. घबराओ मत – ऐड्रेस लंबा दिखता है, लेकिन शॉर्टनिंग के दो नियम समझ लिए तो पढ़ना बिल्कुल आसान लगेगा.
Why IPv6 is needed
- IPv4 has only ~4.3 billion addresses, and the regional registries have run out of fresh IPv4 blocks.
- IPv6 has 2^128 ≈ 3.4 × 10^38 addresses — enough to give every device its own public address, removing the need for NAT.
- Built-in features: simpler header, auto-configuration (SLAAC), better multicast, and no broadcast.
- On AWS, public IPv4 addresses are charged per hour, whereas IPv6 addresses are free — another practical reason to learn IPv6.
Format
IPv6 is 128 bits, written as 8 groups of 4 hexadecimal digits (16 bits each), separated by colons:
2001:0db8:0000:0000:0000:ff00:0042:8329
|16b| 8 groups x 16 bits = 128 bits
Shortening rules
- Leading zeros in any group may be removed:
0db8→db8,0042→42,0000→0. - One continuous run of all-zero groups may be replaced by
::— only once per address (otherwise the length would be ambiguous).
| Full form | Short form |
|---|---|
2001:0db8:0000:0000:0000:ff00:0042:8329 |
2001:db8::ff00:42:8329 |
fe80:0000:0000:0000:0202:b3ff:fe1e:8329 |
fe80::202:b3ff:fe1e:8329 |
0000:0000:0000:0000:0000:0000:0000:0001 |
::1 (loopback) |
2001:0db8:0000:0001:0000:0000:0000:0001 |
2001:db8:0:1::1 |
Important IPv6 address types
| Prefix | Type | IPv4 equivalent |
|---|---|---|
::1/128 |
Loopback | 127.0.0.1 |
fe80::/10 |
Link-local (auto on every interface) | 169.254.x.x |
fc00::/7 (fd00::/8 in practice) |
Unique local (private) | RFC1918 ranges |
2000::/3 |
Global unicast (public) | Public IPv4 |
ff00::/8 |
Multicast | 224.0.0.0/4 |
::/0 |
All IPv6 addresses | 0.0.0.0/0 |
In AWS, a VPC can get an Amazon-provided /56 IPv6 block and each subnet a /64. Remember to add ::/0 rules in security groups if you want IPv6 clients to reach your server.
Ravindra Bagale's Tip
A common mistake is using :: twice in the same address (2001::1::5) – that is invalid. Use :: only once, and in the other groups remove only the leading zeros. And on AWS, don't forget that IPv6 clients need a separate ::/0 rule in the security group.
Ravindra Bagale's Tip – मराठी
एक common चूक म्हणजे एकाच address मध्ये :: दोन वेळा वापरणं (2001::1::5) – हे invalid आहे. :: फक्त एकदाच, आणि बाकी groups मध्ये फक्त leading zeros काढायचे. आणि AWS वर IPv6 clients साठी security group मध्ये ::/0 चा rule वेगळा लागतो, हे विसरू नका.
Ravindra Bagale's Tip – हिंदी
एक common गलती है एक ही address में :: दो बार इस्तेमाल करना (2001::1::5) – ये invalid है. :: सिर्फ़ एक बार, और बाकी groups में सिर्फ़ leading zeros हटाने हैं. और AWS पर IPv6 clients के लिए security group में ::/0 का rule अलग से चाहिए, ये मत भूलना.
Practice task
Hya don addresses che short form liha: 2001:0db8:0000:0000:0000:ff00:0042:8329 aani fe80:0000:0000:0000:0202:b3ff:fe1e:8329. Mag varchya table ne tumche uttar match kara, aani 2001:db8::1::2 ka chuk aahe te ek line madhe liha.