IPv4
The IPv4 address space is maintained by a non profit organization call the Internet Assigned Number Authority (IANA).
IPv4 is the primary protocol for everything we do today. IPv4 stands for Internet Protocol version 4. It’s an OSI Layer 3 address. An IPv4 address consists of 4 separate numbers (from 0 to 255) separated by a period.
Let’s take for example an IP address of 192. 168.1.5:
- Each of the numbers represents a binary number. For example, the 192.168.1.5 IP address would be written in binary as: 11000000.10101000.00000001.00000101
- Each number is 8 bits = 1 byte = 1 octet. Therefore an IPv4 address is 32 bits or 4 bytes or 4 octets long.
- The first part of an IPv4 address represents the network ID and the remaining part of the address represents the host ID. So for example, 192.168.1 could be the network ID and 5 is the host ID. View the section on Subnet Mask for more information on how to determine the network ID.
IPv4 has a series of network classes:
Class | First Octet | Default Subnet Mask | Notes |
A | 1-126 | 255.0.0.0 | For large networks. 127 is reserved for loopback address |
B | 128-191 | 255.255.0.0 | For medium size networks |
C | 192-223 | 255.255.255 | For smaller size networks |
D | 224-239 | N/A | Reserved for multicast (sending messages to multiple systems) |
E | 240-255 | N/A | Reserved for testing/experimental IPs |
IPv4 offers only 4 billion addresses. This may seem like a huge number, but we’ve already exhausted all these addresses. Therefore IPv6 was created which offers 2128 addresses.
IPv4 Reserved IPs:
- Loopback address: 127.0.0.1
- Private IP address ranges: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, 192.168.0.0 to 192.168.255.255
- Autoconfigured (APIPA) addresses: 169.254.0.0
IPv6
IPv6 is included in modern operating systems. IPv6 provides for more IP addresses to be distributed. An IPv6 address is a 128 bit address. IPv6 addresses are separated into 8 different sections. Each section is 16 bits (2 byte). A colon seperates each section.
An IPv6 address is represented in hexidecimal rather than decimal.
The first 64 bits are generally the network prefix. The last 64 bits are the host network address.
Nomenclature:
- IPv6 is 128 bits using eight hextets (4 hexidecimal characters) separated by a :
- Leading zeros can be dropped from a group:
- Example: 2001:0000:0000:3210:0800:200C:00CF:1234 is equivalent to 2001:0:0:3210:800:200C:CF:1234
- You can remove consecutive groups of all zeros, leaving two colons together, but this can only be done once:
- Example: 2001:0:0:3210:800:200C:CF:1234 is equivalent to 2001::3210:800:200C:CF:1234
- FEDC:0000:0000:0000:00CF:0000:BA98:1234 is equivalent to FEDC::CF:0:BA98:1234
IPv4 address either comes from DHCP or you can manually input the IP address yourself vs. IPv6 has multiple IP addresses on a single network card:
- Link Local Address: computer running Ipv6 gives itself this address, equivalent to IPv4 APIPA address
- First 64 bits of link local address are FE80:: (FE80:0000:0000:0000)
- Windows adds a random value for the last 64 bits of the address
- Mac/Linux builds the last 64 bits from the MAC address of the network card.
Global Address requested from the default gateway router which must be configured to pass out IPv6 addresses. Router provides network ID, subnet, and DNS server (if configured). Computer generates the rest of the address like link local address.
Most Windows machines have 2 global addresses. One stays the same, and the second is a temporary addressed used to make it harder for your system to be tracked by IP address.
Currently IANA only passes out global addresses beginning with the number 2.
Global address required to access the Internet
IPv6:
*128 bit addressing scheme to provide for 340,282,366,920,938,463,463,374,607,431,768,211,456 unique addresses.
*Loopback address: 0:0:0:0:0:0:0:1 (::1)
*Private ranges: FEC0:: (proposed)
*Autoconfigured addresses: FE80::