IPv4

IPv4

IPv4 (Internet Protocol version 4) is the fourth version of IP (Internet Protocol), a protocol for interconnection of Internet based networks, and which was the first version implemented in 1983 for the production of ARPANET

Defined in the RFC 791, IPv4 uses 32 bit addresses, limited to 2^{32}= 4294967296 unique addresses, many of them LAN

Where the decimal value of each of the bytes follows the following format: XXX . XXX. XXX. XXX, which is composed of values in the range 0-254

Valid address example: 192.168.0.1

Every IPv4 address has two parts:

  • Network id
    Identifies all hosts on a same physical network
  • Host id
    Identifies a host within a network

In the example, the network ID is 192.168.0 and the host ID is 1

Due to the enormous growth in electronic security and automation, combined with the fact that addresses are being wasted, it was observed several years ago that IPv4 addresses were in short supply

This limitation helped stimulate the study of the implementation of the new protocol IPv6, which in 2016 was already in the first phase of testing, and which will end up replacing the IPv4 protocol

The addresses available in the IANA global reserve belonging to the IPv4 protocol were officially exhausted on Monday, January 31 of 2011

The Regional Internet Registries, from that moment, had to allocate their own reservations, which were estimated to last until the year 2020 and not for much longer

To this day, they continue to be used and the migration to the IPv6

Reserved addresses

  • 0.0.0.0 is used exclusively for the Internet, because it represents any network
  • 127.0.0.0

    is reserved for testing, loopback

    The Routers or local machines can use this address to send packets back to themselves

    Therefore, it cannot be assigned to any network

  • Addresses between 169.254.0.0 and 169.254.255.255

    are addresses assigned by the Internet Assigned Numbers Authority (IANA) for automatic private IP addressing

    This ensures no conflicts with addresses routable

Classes

IPv4 classes
Type
A \frac{\color{Green}\text{0XXXXXXX}}{\color{Green}net} \frac{\color{Blue}\text{XXXXXXXX XXXXXXXX XXXXXXXX}}{\color{Blue}host}
B \frac{\color{Green}\text{10XXXXXX XXXXXXXX}}{\color{Green}net} \frac{\color{Blue}\text{XXXXXXXX XXXXXXXX}}{\color{Blue}host}
C \frac{\color{Green}\text{110XXXXX XXXXXXXX XXXXXXXX}}{\color{Green}net} \frac{\color{Blue}\text{XXXXXXXX}}{\color{Blue}host}
D \frac{\color{Green}\text{1110XXXX XXXXXXXX XXXXXXXX XXXXXXXX}}{\color{Green}net} \frac{}{\color{Blue}host}
E \frac{\color{Green}\text{11110XXX XXXXXXXX XXXXXXXX XXXXXXXX}}{\color{Green}net} \frac{}{\color{Blue}host}

A Class

They are used in networks of extremely large size

Its range goes from 1-126 in its first value

The rest are made up of values ​​in the range 0-254

The first bit is a 0, then 7 bits are used to identify the network and 24 to identify the host

The smallest number that can be represented is 00000000, which is the decimal 0

The highest value that can be represented is 01111111, which is the decimal 127

The numbers 0 and 127 are reserved and cannot be used as network addresses

In principle there are 2^7 = 128 class A networks and 2^{24} = 16777216 hosts for those networks

Example of a valid A class address: 80.78.32.254

B Class

They are used in networks of moderate to large size

Its range goes from 128-191 in its first value

The rest are made up of values ​​in the range 0-254

The first two bits are 10, then 14 bits are used to identify the network and 16 to identify the host

The smallest number that can be represented is 10000000, which is the decimal 128

The highest number that can be represented is 10111111, which is the decimal 191

In principle there are 2^{14} = 16384 class B networks and 2^{16} = 65536 hosts for those networks

Example of a valid B class address: 130.254.10.99

C Class

They are used in networks of small size and that have a maximum of 254 hosts, generally local area networks

Its range goes from 192-223 in its first value

The rest are made up of values ​​in the range 0-254

The first three bits are 110, then 21 bits are used to identify the network and 8 to identify the host

The smallest number that can be represented is 11000000, which is the decimal 192

The highest number that can be represented is 11011111, which is the decimal 223

In principle there are 2^{21} = 2097152 of C class networks and 2^8 = 256 hosts for those networks

Example of a valid C class address: 192.168.240.5

D Class

They are used for multicast traffic, where the destination address directs the packets to predefined groups of IP addresses, it is usually used to transmit video, cable television or streaming

Its range goes from 224-239 in its first value

The rest are made up of values ​​in the range 0-254

The first four bits are 1110, then 28 bits are used to identify the network and 0 to identify the host

The smallest number that can be represented is 11100000, which is the decimal 224

The highest number that can be represented is 11101111, which is the decimal 239

In principle there are 2^{28} = 268435456 D class networks and 2^0 = 1 hosts for those networks

Example of a valid D class address: 230.20.230.106

E Class

Are used for broadcast traffic

The Internet Engineering Task Force (IETF) has reserved these addresses for its own investigation

Its range goes from 240-255 in its first value

The rest are made up of values ​​in the range 0-255

The first five bits are 11110, then 32 bits are used to identify the network and -8 to identify the host

The smallest number that can be represented is 11110000, which is the decimal 240

The highest number that can be represented is 11111111, which is the decimal 255

In principle there are 2^{32} = 4294967296 of networks of class E and 2^{-8} = 0,00390625 hosts for those networks

Example of a valid E class address: 254.10.0.15