<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< IPv4 >>>>>>>>>>>>>>>>>>>>>>>>>>>> 32bits 4 octets each block of 8 bits that's why it is called octet written in DECIMAL form every octet sepaarted by period "." Classes 5: A 1-127 B 128-191 C 192-223 D 224-239 MULTICAST E 240-255 RESEARCH -----------Reserved IPv4 Addresses----------- Class A 10.0.0.0/8 10.0.0.0 - 10.255.255.255 Private addresses Class A 127.0.0.0 /8 127.0.0.1 - 127.255.255.254 Loopback addresses Class B 169.254. 0.0/16 169.254. 0.0 - 169.254. 255.255 IPv4 Link-Local Address/APIPA Class B 172.16.0.0/12 172.16.0.0 - 172.31.255.255 Private addresses Class C 192.168.0.0/16 192.168.0.0 - 192.168.255.255 Private addresses Class D 224.0.0.0/8 224.0.0.0 - 239.255.255.255 MULTICAST Class E 240.0.0.0/4 240.0.0.0 - 255.255.255.255 RESEARCH ---------------------Decimal to Binary------------------- 228 128+64+32+4 128 64 32 16 8 4 2 1 1 1 1 0 0 1 0 0 ---------------------Binary to Decimal------------------- 11010010 1 1 0 1 0 0 1 0 128 64 0 16 0 0 2 0 OR if mostly 1s in given binary value 255 minus all zero values if mostly 0s in given binary value then add those equivalent decimal -----------------Subnetting scenarios----------------- 1(a). need = number of NETWORKS = 64 2^6 = 64 (6 is bits occupied from hosts) e.g 192.168.10.0/25 11111111.11111111.11111111.11000000 1(b). need = number of NETWORKS = 100 2^7 = 128 (7 is number of 1s required from left to right in last octet) e.g 192.168.10.0/25 11111111.11111111.11111111.10000000 2(a). need = number of HOSTS = 60 2^6 = 64 (6 is number of 0s required from right to left in last octet) e.g 192.168.10.0/26 11111111.11111111.11111111.11000000 2(b). need = number of HOSTS = 100 2^7 = 128 (7 is number of 0s required from right to left in last octet) e.g 192.168.10.0/25 11111111.11111111.11111111.10000000 <<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>> map IPv4 adress in last 32 Bits of IPv6 Mapping address given above like: Given: 1. IPv4 Mapping Address in hexadecimal ::FFFF:0:0/96 0000:0000:0000:0000:0000:FFFF:0000:0000 2. IPv4 address to be mapped 192.168.10.20 map 192.168.10.20 to IPv6 address by converting IPv4 to Binary and then to hex Like 192.168.10.20 Decimal 11000000.10101000.00001010.00010100 Binary C0.A8.0A.14 Hexadecimal now place 32 bits IPv4 (hex format) in last 32 bits of given IPv6 address like 0000:0000:0000:0000:0000:FFFF:0000:0000 IPv6 in hex 0000:0000:0000:0000:0000:FFFF:C0A8:0A14 IPv4 mapped Ipv6 <<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>> ----------------Dual stack---------------- allows IPv4 and IPv6 to coexist on the same network segment. Dual stack devices run both IPv4 and IPv6 protocol stacks simultaneously. Known as native IPv6, this means the customer network has an IPv6 connection to their ISP and is able to access content found on the internet over IPv6. ------------------Tunneling------------------ is a method of transporting an IPv6 packet over an IPv4 network. The IPv6 packet is encapsulated inside an IPv4 packet, similar to other types of data. ---------------------------Network Address Translation 64 (NAT64)------------------------- allows IPv6-enabled devices to communicate with IPv4-enabled devices using a translation technique similar to NAT for IPv4. An IPv6 packet is translated to an IPv4 packet and an IPv4 packet is translated to an IPv6 packet. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< IPv6 >>>>>>>>>>>>>>>>>>>>>>>>>>>> 128 bits 8 blocks/Hexets each Hexet has 16 bits written in HEXADECIMAL form every octet sepaarted by colon ":" ----------------------IPv6 summarization/Shortening/Reducing Rules---------------------- 1. Remove Leading Zeros in any Hexet e.g. 00AB:125F:0012:BCDE IPv6 Example AB:125F:12:BCDE Reduced Form 2. Leading zeros can be summarized/Reduced with double colon like 2001:0000:0000:1FA3:001F:012C:20AB:58BD IPv6 Example 2001::1FA3:1F:12C:20AB:58BD Reduced Form 2(a). If zeros found in two consecutive hexets, two times in a Adresses, reduce only one consecutive zero Hexets with :: and Reduce other pair of hexts by removing leading zeros ABCD:0000:0000:1234:0000:0000:5678:BCDE IPv6 Example ABCD::1234:0:0:5678:BCDE Reduced Form 2(b). if once found 2 consecutive zeros hexets and also anpther more than 2 consecutive zeros hexets i.e 3 or 4 Reduce more Consecutive zeros hexets and reduce two consective zeros hexet by removing leading zeros ABCD:0000:0000:1234:0000:0000:0000:BCDE IPv6 Example ABCD:0:0:1234::BCDE Reduced Form ************************IPv6 Addresses Types**************************** -----------------IPv6 Reserved Addresses----------------- 2001:db8::/32 documentation purposes, including use in examples. fc00::/7 to fdff::/7 Unique local addresses FE80::/10 Link-local Address (LLA) ::/0 Default Route ::1/128 Loopback ::/128 unspecified FF00::/8 Multicast IPv6 Address ::FFFF:0:0/96 IPv4 Mapping Address ------------Unicast Addresses----------- Range = 2000::/3 means first three bits of first hexet cannot be modified for now only this range is assigned to Global registries by IANA 2000::/16 (2000) to (3FFF) ------------Multicast Addresses----------- prefix ff00::/8 ff00::1 = special case, means all nodes on a link -------------Anycast Addresses----------- it does not have any range assign a same unicast adrress to all devices it will be considered as anycast adres in that network *Note: IPv6 Does not use BROADCAST Address ******************************* Unicast Addresses Types******************************* Global Unicast Address (GUA) Like Public IPv4 Link-local Address (LLA) Like APIPA in IPv4 Unique local addresses Like Private IPv4 Loopback ::1/128 Like 127.0.0.0 /8 in IPv4 unspecified ::/128 -------------------1. Global Unicast Address (GUA)---------------------- This is similar to a public IPv4 address. These are globally unique, internet-routable addresses. GUAs can be configured statically or assigned dynamically. ----------------GUAs IP Assignment Methods---------------- There are two ways in which a device can obtain an IPv6 GUA automatically: 1. Stateless Address Autoconfiguration (SLAAC) 2. Stateful: DHCPv6 ----------------GUA Structure---------------- Global Routing Prefix 48 bits Networks Subnet ID 16 bits sub/Super networks, can be used by routing prefix of interface ID. Interface ID 64 bits Hosts Total 128 Bits Range = 2000::/3 means first three bits of first hexet cannot be modified i.e (2000) to (3FFF) 0010 0000 0000 0000 (2000) to 0011 1111 1111 1111 (3FFF) Currently, only /16 IPv6 GUAa are being assigned to RIRs by ICANN/IANA i.e 001 or 2001::/16 IPv6 GUA SUBNETS examples: 2001:db8:acad:1::/64 2001:db8:acad:2::/64 2001:db8:acad:3::/64 IPv6 GUA HOSTS examples: 2001:db8:acad:1::1/64 2001:db8:acad:1::2/64 2001:db8:acad:1::3/64 Subnet 1 2001:db8:acad:2::1/64 2001:db8:acad:2::2/64 2001:db8:acad:2::3/64 Subnet 2 2001:db8:acad:3::1/64 2001:db8:acad:3::2/64 2001:db8:acad:3::3/64 Subnet 3 ------------------------------------2. Unique local addresses------------------------------------- *Unique local addresses are used for local addressing within a site or between a limited number of sites. *Unique local addresses can be used for devices that will never need to access another network. *Unique local addresses are not globally routed or translated to a global IPv6 address. Range: fc00::/7 to fdff::/7 Like Private IPv4 --------ULA Structure-------- FC00 16 Bits Global ID 32 Bits Subnet ID 16 Bits Interface ID 64 Bits Total 128 Bits i.e FC00:Global ID: 64-Bits interface ID ---------------------3. Link-local Address (LLA)------------------- This is required for every IPv6-enabled device. LLAs are used to communicate with other devices on the same local link. With IPv6, the term link refers to a subnet. LLAs are confined to a single link. Their uniqueness must only be confirmed on that link because they are not routable beyond the link. In other words, routers will not forward packets with a link-local source or destination address. ----------------LLA IP Assignment Methods---------------- There are two ways that a device can obtain an LLA: ------1. Statically------ This means the device has been manually configured. ------2. Dynamically----- This means the device creates its own interface ID by using randomly generated values or using the Extended Unique Identifier (EUI) method, which uses the client MAC address along with additional bits. --------LLA Structure-------- FE80 16 Bits 0000:0000:0000 48 Bits 1/2 MAC Address 24 Bits Part of interface ID FFFE 16 BIts Part of interface ID 1/2 MAC Address 24 Bits Part of interface ID Total 128 Bits i.e Network ID 64 Bits FE80:0000:0000:0000: Interface ID 64 BIts 64-Bits interface ID[1/2 MAC Address + FFFE + 1/2 MAC Address] ---------interface ID process--------- Given: MAC of machine 00:11:22:AA:BB:CC FFFE first make EUI value break MAC from into two 24 bits Parts/separate VENDOR (OUI) and NIC ID in MAC and Punch FFFE in b/w VENDOR and NIC ID i.e 00:11:22: FFFE :AA:BB:CC convert fist hexadecimal octet in binary i.e 00 and compliment/invert or apply NOT operation on 7th bit from left i.e 0 to 1 & 1 to 0 00 hex 0000 0000 bin 02 hex 0000 0010 NOT-bin now again merge into EUI, it is now Interface ID i.e 02:11:22: FFFE :AA:BB:CC Final Interface ID -------Scope ID-------- The “%xx” value sometimes seen following an IPv6 address is called the scope ID. This is used to identify the interface to which a local address belongs. fe80::5fff:575e:2914:3428%22 fe80::1:1%31 -----------------Range----------------- The first hextet has a range 1111 1110 1000 0000 (fe80) to 1111 1110 1011 1111 (febf) Complete Subnet address Range: fe80::/10 fe80:0000:0000:0000:0000:0000:0000:0000/10 to febf::/10 febf:0000:0000:0000:0000:0000:0000:0000/10 The /10 indicates that the first 10 bits: 1111 1110 10xx xxxx ----------------IPv6 LLA SUBNETS examples---------------- The double colon (::) following the "/" notation or prefix length defines that this is a Network Address fe80::/10 to febf::/10 ---------------IPv6 LLA HOSTS examples--------------- fe80:0000:0000:0000:0000:0000:0000:0001/10 fe80::1/10 fe80:0000:0000:0000:0000:0000:0000:0002/10 fe80::2/10 fe80:0000:0000:0000:0000:0000:0000:0003/10 fe80::3/10 fe80::1:1 fe80:0000:0000:0000:0000:0000:0001:0001/10 fe80::2:1 fe80:0000:0000:0000:0000:0000:0002:0001/10 fe80::3:1 fe80:0000:0000:0000:0000:0000:0003:0001/10 FE80::204:9AFF:FE05:A819 FE80::20C:CFFF:FE03:CD59 FE80::230:A3FF:FE94:EE53 FE80::290:CFF:FEA8:6335 fe80::207b:4ff:fef4:3285 fe80::207b:4ff:fef4:3285 fe80::a92a:e678:e190:b1c2 ---------------conversions----------------- Hexet Bin Hex 1 0010 0000 0000 0001 2001 2 0000 0000 0000 0000 0000 3 0000 0000 0000 0000 0000 4 0001 1111 1010 0011 1FA3 5 0000 0000 0001 1111 001F 6 0000 0001 0010 1100 012C 7 0010 0000 1010 1011 20AB 8 0101 1000 1011 1110 58BD ---------------------------------------------- Bin Dec Hex 0000 0 0000 0001 1 0001 0010 2 0010 0011 3 0011 0100 4 0100 0101 5 0101 0110 6 0110 0111 7 0111 1000 8 1000 1001 9 1001 1010 10 A 1011 11 B 1100 12 C 1101 13 D 1110 14 E 1111 15 F -------------- Leading 0 omission/compression examples ------------- 1 0000:0000:FFFF:0000:0000:0000:0000:0000 Expended Notation 0:0:FFFF:: Compression Notation 2 1236:1236:0000:0000:0000:0000:0000:1111 Expended Notation 1236:1236::0000:1111 Compression Notation 3 0000:0000:0000:0000:0000:0000:0000:0000 Expended Notation :: Compression Notation 4 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation --------------iPv6 Subnetting Examples--------------- 1 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/128 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/128 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 1 2 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/0 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation ::/128 N/W Prefix :: First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses more than 18 Bn Bn 3 0000:0000:0000:0000:0000:0000:0000:0000/128 Expended Notation :: Compression Notation 0000:0000:0000:0000:0000:0000:0000:0000/128 N/W Prefix :: First Address :: Last ADdress Usable Addresses 1 4 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/32 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF::/32 N/W Prefix FFFF:FFFF:: First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses more than 18 Bn Bn 5 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/64 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF::/64 N/W Prefix FFFF:FFFF:FFFF:FFFF:: First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses more than 18 Bn Bn 6 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/96 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF::/96 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:: First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 4,294,967,296 7 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/112 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0/112 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0 First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 65,536 8 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/120 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:ff00/120 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:ff00 First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 256 9 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/121 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF80/121 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF80 First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 128 10 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/122 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFC0/122 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFC0 First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 64 11 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/123 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFE0/123 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFE0 First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 32 12 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/124 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0/124 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0 First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 16 13 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/125 Expended Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Compression Notation FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF8/125 N/W Prefix FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF8 First Address FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF Last ADdress Usable Addresses 8 ******************** Bogon IP Address Ranges ******************** information Source: https://ipinfo.io/bogon Some IP addresses and IP ranges are reserved for special use, such as for local or private networks, and should not appear on the public internet. These reserved ranges, along with other IP ranges that haven't yet been allocated and therefore also shouldn't appear on the public internet are sometimes known as bogons. Because bogon IP addresses don't belong to a specific user or server on the internet, so there's no way to geolocate them. Therefore our IP geolocation API won't return location information for IP addresses within bogon ranges, but it will return a bogon field to indicate that the IP address is a bogon. IPv4 Bogon Ranges NETBLOCK DESCRIPTION 0.0.0.0/8 "This" network 10.0.0.0/8 Private-use networks 100.64.0.0/10 Carrier-grade NAT 127.0.0.0/8 Loopback 127.0.53.53 Name collision occurrence 169.254.0.0/16 Link local 172.16.0.0/12 Private-use networks 192.0.0.0/24 IETF protocol assignments 192.0.2.0/24 TEST-NET-1 192.168.0.0/16 Private-use networks 198.18.0.0/15 Network interconnect device benchmark testing 198.51.100.0/24 TEST-NET-2 203.0.113.0/24 TEST-NET-3 224.0.0.0/4 Multicast 240.0.0.0/4 Reserved for future use 255.255.255.255/32 Limited broadcast IPv6 Bogon Ranges NETBLOCK DESCRIPTION ::/128 Node-scope unicast unspecified address ::1/128 Node-scope unicast loopback address ::ffff:0:0/96 IPv4-mapped addresses ::/96 IPv4- compatible addresses 100::/64 Remotely triggered black hole addresses 2001:10::/28 Overlay routable cryptographic hash identifiers (ORCHID) 2001:db8::/32 Documentation prefix fc00::/7 Unique local addresses (ULA) fe80::/10 Link-local unicast fec0::/10 Site-local unicast (deprecated) ff00::/8 Multicast (Note: ff0e:/16 is global scope and may appear on the global internet.) IPv6 Additional Bogon Ranges These ranges aren't officially IPv6 bogon ranges - they're IPv6 representations of different IPv4 bogon ranges. NETBLOCK DESCRIPTION 2002::/24 6to4 bogon (0.0.0.0/8) 2002:a00::/24 6to4 bogon (10.0.0.0/8) 2002:7f00::/24 6to4 bogon (127.0.0.0/8) 2002:a9fe::/32 6to4 bogon (169.254.0.0/16) 2002:ac10::/28 6to4 bogon (172.16.0.0/12) 2002:c000::/40 6to4 bogon (192.0.0.0/24) 2002:c000:200::/40 6to4 bogon (192.0.2.0/24) 2002:c0a8::/32 6to4 bogon (192.168.0.0/16) 2002:c612::/31 6to4 bogon (198.18.0.0/15) 2002:c633:6400::/40 6to4 bogon (198.51.100.0/24) 2002:cb00:7100::/40 6to4 bogon (203.0.113.0/24) 2002:e000::/20 6to4 bogon (224.0.0.0/4) 2002:f000::/20 6to4 bogon (240.0.0.0/4) 2002:ffff:ffff::/48 6to4 bogon (255.255.255.255/32) 2001::/40 Teredo bogon (0.0.0.0/8) 2001:0:a00::/40 Teredo bogon (10.0.0.0/8) 2001:0:7f00::/40 Teredo bogon (127.0.0.0/8) 2001:0:a9fe::/48 Teredo bogon (169.254.0.0/16) 2001:0:ac10::/44 Teredo bogon (172.16.0.0/12) 2001:0:c000::/56 Teredo bogon (192.0.0.0/24) 2001:0:c000:200::/56 Teredo bogon (192.0.2.0/24) 2001:0:c0a8::/48 Teredo bogon (192.168.0.0/16) 2001:0:c612::/47 Teredo bogon (198.18.0.0/15) 2001:0:c633:6400::/56 Teredo bogon (198.51.100.0/24) 2001:0:cb00:7100::/56 Teredo bogon (203.0.113.0/24) 2001:0:e000::/36 Teredo bogon (224.0.0.0/4) 2001:0:f000::/36 Teredo bogon (240.0.0.0/4) 2001:0:ffff:ffff::/64 Teredo bogon (255.255.255.255/32)