This post explains briefly the network protocol IPv4 and summarizes the main aspects of it.

IPv4 Address

An IPv4 address represents a single device on an IP network.

An IPv4 address consist of 32 bits. Example: 11000110001100110110010000000000

These 32 bits are usually divided in 4 octets, and separated with a dot. Example: 11000110.00110011.01100100.00000000

In order to make them more familiar to humans, these 4 octets are usually represented using decimal notation. Example:

Networks, Hosts and Subnet Masks

The 32 binary bits are broken down into the network and host sections:

  • Network number / routing prefix: identify a network (for example, University of Salamanca).
  • Host identifier: identify a host inside a network (for example, Juan Garcia’s laptop at University of Salamanca).

Subnet mask or net mask is used to identify which part of an IPv4 address belongs to a network. The subnet mask can be represented in different ways:

  • In Classless Inter-Domain Routing (CIDR) representation, a decimal number placed  at the end of the IP address represents the number of bits reserved for the network. This decimal number is written after a slash (/) at the end of IPv4 address. Example:
  • As 32-bit number, where 1 is written for each position that belongs to the network. Example: 11111111.11111111.11111111.11111000. The subnet mask is usually represented with decimal octets in the same way as an IPv4 address: Executing AND operator on the original IPv4 address and submask gives the first value for the network.

If the submask size is not specified, then it would use a default submask. The default submask differs depending on the IPv4 address class where they belong to. See the IPv4 address class for further information.

The wildcard would be the oppositve of the submask, it means, it is used to identify which part of an IPv4 belongs to a host.

Example:, the mask is 00000000.00000000.00000000.00000111

The first address available within a subnet is the Network Address.
 It means, it does not represent a host but the network itself. It may be informed along with the subnet mask. The network address is the result of applying the AND operator to the IPv4 address and the submask.

The last address in a subnet is the Broadcast Address. It represents all of the hosts inside that network, and is used to communicate to all hosts within it.

The addresses between network address and broadcast address are the host addresses.

You can calculate these address using some webs like ipcalc.


Ipv4 address:
Subnet mask:

Network address:
Broadcast address:
Host addresses: –

A default gateway is a device on a TCP/IP network, usually a router, which forwards IP packets to other subnets.

In most cases, you can use a Dynamic Host Configuration Protocol (DHCP) server to assign the default gateway automatically to a DHCP client. This approach is more straightforward than manually assigning a default gateway on each host.

IPv4 Address Classes

Internet has networks with many different sizes. Some of them contains thousands of devices, and some other just a couple of them. IPv4 offers an addressing scheme with different address classes, that represent network with different sizes, and optimize the use of addresses.

Without IPv4 Address Classes, smaller networks would cope thousands of unused host IPs. This is why different IPv4 address classes are used.

The IPv4 Address Class can be identified just by inspecting the 8 first bits in the IPv4 address:

  • Class A Address: 1.x.x.x – 127.x.x.x
  • Class B Address: 128.x.x.x – 191.x.x.x
  • Class C Address: 192.x.x.x – 223.x.x.x
  • Class D Address: 224.x.x.x – 239.x.x.x
  • Class E Address: 240.x.x.x – 255.x.x.x is the loopback address.

APIPA is a OSI layer 3 (network) protocol that only exists on Microsoft Windows OS and that is activated in the absence of a DHCP server. When the server is not found, an APIPA address is self-assigned within the range

IPv4 Private Addresses

The Internet Assigned Numbers Authority (IANA) assigns some addresses ranges to public networks and some other to private.

Private addresses are define through the RFC 1918 document “Address Allocation for Private Internets“.

Address ranges to be use by private networks are:

  • Class A: –
  • Class B: –
  • Class C: –

An IP address within private ranges is therefore considered non-routable from any external networks, as it is not unique. Any private network that needs to use IP addresses internally can use any address within these ranges without any coordination with IANA or an Internet registry. Addresses within this private address space are only unique within a given private network.

All addresses outside private ranges are considered public.

Class A Address

Default subnet mask:

Private network address range: –

Class B Address

Default subnet mask:

Private network address range: –

Class C Address

Default subnet mask:

Address range: 192.x.x.x – 223.x.x.x

Private network address range: –

Class D Address

This class is reserved for multicast.

Not equipped with any submask.

Class E Address

This class is reserved for experimental purposes only for R&D or Study by the Internet Engineering Task Force IETF.

Not equipped with any submask.

IPv4 Header

IPv4 header contains:

  • IP Source
  • IP Destination
  • Time-to-live (TTL)
  • Type-of-Service (ToS)
  • Protocol
  • Fragment Offset

Time-to-Live (TTL) is an 8-bit binary value that indicates the remaining “life” of the packet. The TTL value is decreased by at least one each time the packet is processed by a router (that is, each hop). When the value becomes zero, the router discards or drops the packet and it is removed from the network data flow. This mechanism prevents packets that cannot reach their destination from being forwarded indefinitely between routers in a routing loop.

You might be also interested in…


One comment

Leave a Reply

Your email address will not be published. Required fields are marked *