An IP address is a physical location on the internet. It is a set of numerical codes that identify where a website or a user, or any internet access points resides.
All users, when connected to the internet are connected to an IP or Internet Protocol address. For IPv4, it uses 32-bit internet addresses which means that it will support up to 232 internet addresses. There are 256 possible identifiers for each three-digit grouping (0-255), so that comes out to approximately 4.39 billion individual addresses. While this seem like a lot, the number of IP addresses is already being depleted, so IPv6 was created which is takes the format of a 128-bit IP address, or 2128 (or precisely 40,282,366,920,938,463,463,374,607,431,768,211,456 addresses).
IPv4 typically will take a structure of xxx.xxx.xxx.xxx using decimal representations of numbers. IPv6 takes the format of xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx where each “x” represents a hexadecimal (base-16) digit.
For the intent of this article, we will be focusing on the more commonly used IPv4 address.
Adaptation to IPv6 has been somewhat slow as the two technologies are not cross-compatible. As a result, most ISPs make use of dynamic ISPs, meaning that they assign a different IP address to a user each time they access the internet to make use of the limited number of IP4 addresses which are available.
Businesses, on the other hand, may use a static IP address, meaning that the IP address does not change.
As we mentioned, all IPv4 addresses take a format of xxx.xxx.xxx.xxx. However, not all IP addresses are the same. The first set of numbers may often tell us something specific, such as whether an IP address is public or private. While almost all IP addresses are public (meaning that they can be accessed by anyone, and reference specific locations), there are three ranges reserved for private IP access. These are used to designate private networks.
Private addresses include the following ranges:
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
If you are running a local wireless network in your home (I.e. you have a wireless router which multiple devices in your house can connect to the internet, such as several laptops, televisions, phones, any smart appliances, etc.), you are most likely using the 192.168.*.* range. You can determine which local or private range you are connected to by running ipconfig from the command line on your computer.
Due to the availability of IP address databases, provided by government authorities in different regions of the world, we can get a large amount of information from an IP address. We can get information about the city of the user, their region, the IP's geolocation (longitude and latitude), their connection type (such as a proxy or VPN), their internet provider and more.
There are several methods for getting your visitor or users' IP addresses, depending on the language or framework you're using. Abstract has a few guides on this, including "How to get a visitor's IP address in Ruby", "How to get a visitors IP address using PHP", and "How to get an IP address using jQuery".