Introduction:
Today in this blog we learn about what is difference between ipv4 and ipv6 the with out ip (Internet Protocol) address we cannot communicate the computers. The Internet Protocol (IP) is a set of rules.
TCP Ipv4 VS V6 :
IPV4 | IPV6 |
The length of IPV4 is 32 bit (4.3 billion addresses). | The length of IPV6 is 128 bit (340 undecillion addresses) |
Address: The ipv4 have Dotted decimal (192.168.1.1 ) | Address: The ipv6 have Hexadecimal (2001:0db8::7334 ) |
Header Size: The ipv4 have 20 bytes | Header Size: The ipv6 have 40 bytes |
Security: The ipv4 have Optional (via IPsec add-ons) | Security: The ipv6 have Mandatory (IPsec built-in) |
Speed: The ipv4 have Slower, due to more overhead in NAT | Speed: The ipv6 have Faster, optimized for routing |
Address Configuration: The ipv4 have Manual or DHCP | Address Configuration: The ipv6 have Automatic using Stateless Address Auto-configuration (SLAAC) |
NAT (Network Address Translation): The ipv4 Required due to address scarcity | NAT (Network Address Translation): The ipv6 Not required (enough addresses for all devices) |
Multicasting: The ipv4 have Basic | Multicasting: The ipv6 have Advanced, with more efficient multicast routing |
Checksum: The ipv4 have Checksum | Checksum: The ipv6 No (eliminated for better efficiency) |
Fragmentation: The ipv4 have Routers handle fragmentation | Fragmentation: The ipv6 have Only the sending host fragments packets |
Mobility Support: The ipv4 have Mobility Support Limited | Mobility Support: The ipv6 have Better mobility, with seamless connections |
Transition Mechanism: The ipv4 No transition needed | Transition Mechanism: The ipv6 have Tunneling (IPv4-in-IPv6, Dual-stack) |
IP Version 4:
IPv4 addresses are normally expressed in dotted-decimal format, with four numbers separated by periods, such as 192.168.10.10. It consists of 4-octets (32-bit) number that uniquely identifies a specific TCP/IP (or IoT) network and a host (computer, printer, router, IP-enabled sensor, any device requiring a network interface card) within the identified network. Hence, an IPv4 address consists of two main parts: the network address part and the host address part. A subnet mask is used to divide an IP address into these two parts. It is used by the TCP/IP protocol to determine
whether a host is on the local subnet or on a remote network.
IPv4 Subnet Mask:
It is important to recall that in TCP/IP (or IoT) networks, the routers that pass packets of data between networks do not know the exact location of a host for which a packet of information is destined. Routers only know what network the host is a member of and use information stored in their route table to determine how to get the packet to the destination host’s network. After the packet is delivered to the destination’s network, the packet is delivered to the appropriate host. For this process to work, an IP address is divided into two parts: network address and host address.
To better understand how IP addresses and subnet masks work, IP addresses should be examined in binary notation. For example, the dotted-decimal IP address 192.168.10.8 is (in binary notation) the 32 bit number 11000000.10101000.00001010.00001000. The decimal numbers separated by periods are the octets converted
from binary to decimal notation.
The first part of an IP address is used as a network address and the last part as a host address. If you take the example 192.168.10.8 and divide it into these two parts, you get the following: 192.168.10.0 network address and .8 host address or 192.168.10.0 network address and 0.0.0.8 host address
In TCP/IP, the parts of the IP address that are used as the network and host addresses are not fixed, so the network and host addresses above cannot be determined unless you have more information. This information is supplied in another 32-bit number called a subnet mask. In the above example, the subnet mask is 255.255.255.0. It is not obvious what this number means unless you know that 255 in binary notation equals 11111111; so, the subnet mask is:
11111111… 11111111 11111111 0000000
Lining up the IP address and the subnet mask together, the network and host portions of the address can be separated:
11000000 10101000 00001010 10001000 … IP address (192.168.10.8)
11111111 11111111 11111111 00000000 … Subnet mask ( 255.255.255.0)
The first 24 bits (the number of ones in the subnet mask) are identified as the network address, with the last 8 bits (the number of remaining zeros in the subnet mask) identified as the host address. This gives you the following:
11000000 10101000 00001010 00000000…−Network address (192.168.10.0)
00000000 00000000 00000000 00001000-Host address (000.000.000.8)
IPv4 Classes:
Five classes (A, B, C, D, and E) have been established to identify the network and host parts. All the five classes are identified by the first octet of IP address. Classes A, B, and C are used in actual networks. Class D is reserved for multicasting (data is not destined for a particular host; hence there is no need to extract host address from the IP address). Class E is reserved for experimental purposes.
Figure shows IPv4 address formats for classes A, B, and C. Class A networks provide only 8 bits for the network address field and 24 bits for host address. It is intended mainly for use with very large networks with large number of hosts. The first bit of the first octet is always set to 0 (zero). Thus the first octet ranges from 1 to 127, i.e., 00000001–011111111. Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range 127.x.x.x is reserved for loopback IP addresses. The default subnet mask for class A IP address is 255.0.0.0 which implies that class A addressing can have 126 networks .
Class B networks allocate 16 bits for the network address field and 16 bits for the host address filed. An IP address which belongs to class B has the first two bits in the first octet set to 10, i.e., 10000000 – 10111111 or 128–191 in decimal. Class B IP addresses range from 128.0.x.x to 191.255.x.x. The default subnet mask for class B is 255.255.x.x. Class B has 16384 (2^14) network addresses and 65534 (2^16-2) host addresses.
Class C networks allocate 24 bits for the network address field only 8 bits for the host field. Hence, the number of hosts per network may be a limiting factor. The first octet of Class C IP address has its first 3 bits set to 110, that is: 1110 0000–1110 1111 or 224–239 in decimal.
Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default subnet mask for Class C is 255.255.255.x. Class C gives 2097152 (2^21) Network addresses and 254 (2^8–2) Host addresses.
Finally, IP networks may also be divided into smaller units called subnetworks or subnets for short.
IP Version 6:
IPv4 has room for about 4.3 billion addresses, which is not nearly enough for the world’s people, let alone IoT with a forecast of 20 billion devices by 2020. In 1998, the Internet Engineering Task Force (IETF) had formalized the successor protocol: IPv6. IPv6 uses a 128-bit address, allowing 2^128 or 340 trillion trillion trillion (3.4 × 10^38) addresses. This translates to about 667 × 10^21 (667 sextillion) addresses per square meter in earth. Version 4 and version 6 protocols are not designed to be interoperable, complicating the transition to IPv6. However, several IPv6 transition mechanisms have been devised to permit communication between IPv4 and IPv6 hosts.
IPv6 delivers other benefits in addition to a larger addressing space. For example, permitting hierarchical address allocation techniques that limit the expansion of routing tables simplified and expanded multicast addressing and service delivery optimization. Device mobility, security, and configuration aspects have been considered in the design of IPv6.
IPv6 Addresses Are Broadly Classified Into Three Categories:
- Unicast addresses: A unicast address acts as an identifier for a single interface. An IPv6 packet sent to a unicast address is delivered to the interface identified by that address.
- Multicast addresses: A multicast address acts as an identifier for a group/set of interfaces that may belong to different nodes. An IPv6 packet delivered to a multicast address is delivered to the multiple interfaces.
- Anycast addresses: Anycast addresses act as identifiers for a set of interfaces that may belong to different nodes. An IPv6 packet destined for an anycast address is delivered to one of the interfaces identified by the address.
IPv6 Address Notation:
The IPv6 address is 128 bits long. It is divided into blocks of 16 bits. Each 16-bit block is then converted to a 4-digit hexadecimal number, separated by colons. The resulting representation is called colon-hexadecimal. This is in contrast to the 32-bit IPv4 address represented in dotted-decimal format, divided along 8-bit boundaries,
and then converted to its decimal equivalent, separated by periods.
IPV6 Example
- Binary Form
- 0111000111011010000000001101001100000000000000000010111100111011
- 0000001010101010000000001111111111111110001010001001110001011011
- 16-Bit Boundaries Form
- 0111000111011010 0000000011010011 0000000000000000 0010111100111011
- 0000001010101010 0000000011111111 11111110001010001001110001011011
- 16-Bit Block Hexadecimal and Delimited with Colons Form
- 71DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5B.
- i.e., (0111000111011010)2 = (71DA)16, (0000000011010011)2 = (D3)16, and so
on. - Final Form (16-Bit Block Hexadecimal and Delimited with Colons Form,
Simplified by Removing the Leading Zeros). - 71DA:D3:0:2F3B:2AA:FF:FE28:9C5B