Guides
Last updated
August 7, 2023

What are the parts of an IP address?

Emma Jagger

Table of Contents:

Get your free
IP Geolocation
API key now
4.8 from 1,863 votes
See why the best developers build on Abstract
START FOR FREE
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
No credit card required

Before we begin to describe the differences between the parts of an IP address, we need to distinguish between traditional, or IPv4 addresses, and IPv6 addresses. IPv4 addresses are the type that take the format of 123.234.345.456 that you may be used to seeing.They are 32-bit addresses, meaning that they contain 232 different combinations. IPv6 addresses are 128 bit addresses, or have 2128 different combos. For the purpose of this article, we will be focusing on IPv4. You can use our tool to find out what is your IP address and location.

The Hierarchy of an IP Address

Let’s first look at this form of IP address, which is the type with which you might be most familiar. It is made up of four octet, each. In an IPv54 address, the 32 bits are divided into four octets, made up of 8 bits (with 256 different possible entries, represented as 0-255).These represent, in order

  • First Octet: Network
  • Second Octet: Network
  • Third Octet: Sub-network
  • Fourth Octet:Host

In this way, a single IP address will identify which network an address belongs to, which sub-network within that network, and eventually the final endpoint, or the host.It is worth noting that the “host” in this case can represent another internal network (e.g., a wireless network inside a home.)These internal networks are also assigned individual hosts.In home networks these are typically within the 192.168.*.* range, and in corporate or company networks they tend to reside under 10.*.*.* These are reserved internal networks, which we discuss in a separate article. 

Binary representation in IP

It is important to understand that these are represented as binary objects, with each position representing a different value.We can think of these as on/off switches.The values in IP address can be seen in the table below:

Source: https://www.tutorialspoint.com/ipv4/ipv4_addressing.htm


Let’s send your first free
IP Geolocation
call
See why the best developers build on Abstract
Get your free api

Types of IP Addresses

While these are divided into 4 groups, we can actually split them into two. The first two octets refer to the network, and the last two reference the host.

The first octet defines the class of the object; it is the only part of the IP address that is assigned by the InterNIC authority.

Class A

If an address falls in the first 128 bits (0-127) this means that is a class A network. There are only, therefore, 127 class A addresses. Each of these can handle up to 16,777,214 hosts.For class A networks, these remaining numbers can be set up by the network administrator to manage hosts. In other words these are reserved for very large networks such as major governmental resources or major providers. 

Class B

Class B networks, which fall in the range of 128-191, use 16 bits for the network address, and 16 bits for the host numbers. In this case, the first two bytes are assigned by the InterNIC , and the remaining bytes are assigned by the network administrator.

Class C

Class C addresses cover the range between 192.0.0.* and 223.255.255.*.

Class D

Class D covers the range between 224.0.0.0 to 239.255.255.255, and is reserved for multicasting. Tthis data is not limited to a particular host.

Class E

Class E is an experimental range which covers between 240.*.*.* and 255.*.*.*

What information can I get from an IP address?

There is certain information you can get directly from an IP address, such as its location and whether the IP address is using a VPN or if the IP address is using a proxy. However, you typically would need a third party data provider like Abstract's IP Geolocation API to enrich this data for you.

Conclusion

These concepts are a little difficult to cover in a short article such as this one, and there are many more elaborations that can occur, such as with the use of subnets, and more for distributing resources within a network. What we can see is that there is a great deal to be understood in the structure of an IP address. 

While you can break apart each of these elements and then look them up one of the central databases for determining who manages which ranges, it’s often easier to make uses of external APIs, which do a lot of the difficult legwork with you. 

Emma Jagger

Emma Jagger is an experienced engineer and Google alumna with a degree from Carnegie Mellon University. She specializes in email validation, IP geolocation, and API integration, focusing on creating practical and scalable solutions through her technical writing.

Get your free
IP Geolocation
key now
See why the best developers build on Abstract
get started for free

Related Articles

Get your free
IP Geolocation
key now
4.8 from 1,863 votes
See why the best developers build on Abstract
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
No credit card required