IP Address Location Data
By Leo Vegoda
June 14, 2022
The last few years have shown us how the internet shrinks distances between distributed teams, organizations and families. This poses a challenge for some organizations.
Many of the business relationships and contractual agreements involving the internet have geographical implications and restrictions. Many organizations need information about the physical location of an IP address that may be accessing content of one kind or another. This matters to anyone operating a network. It is most important for networks that get new address space. If your IP addresses are mapped to the wrong country or city for your users, it can be a painful experience for you and them. In other words, an IP must have accurate information about its location.
IPv4 Distribution Challenges
Recently, the Regional Internet Registries and National Internet Registries (the RIRs and NIRs, see here) have not been able to distribute more than a tiny number of fresh IPv4 addresses to network operators. They implemented these policies to give new market entrants enough IPv4 space for core infrastructure. So, organizations that need additional IPv4 for more than core infrastructure need to transfer addresses from other organizations that don’t have a need for their entire supply.
In the 1980s it was not possible to give networks the precise number of addresses they would need. Many organizations got much larger blocks than their actual requirements. The alternative to distributing too many was to provide too few. Since there was plenty of space available, surpluses were provided to nearly anyone in need. Today, many of these early internet adopters are transferring their excess IPv4 address space to expanding networks.
Lots of databases track every IPv4 address. They record its reputation and its location. And the location is very important if the source and destination of a transfer are distant from each other.
Managing IPv4 Data Locations
Locating addresses has been an issue for many organizations for years. Network operators want their users to have access to locally relevant services. They want them presented in the right language. And they want content served from nearby for lower latency and potentially lower transit costs. But, when an IP address transfer occurs, updating a database of the address’ locations manually is time consuming and error prone.
So, the IETF created a simple protocol. The file format is CSV – so you can manage data in any spreadsheet or manually. Networks can control the information they publish about their geographic locations. Service providers can regularly check for updates.
IP address owners control where they publish data about their addresses. They control the granularity of the data, too. For instance, one can list a country, a state, or just a city. If a user splits his or her addresses between multiple locations, they can publish different location data for each part of a network.
How To Locate IP Address Data
There are three steps to publishing geographic feed information.
- Compile data in a CSV file
- Publish over HTTPS
- Link to the file from the RIR or NIR registry (whois) data
If you want the organizations pulling this data to regularly refresh it, configure your web server to send an “Expires” header. That way, the user will know to check back to see if the data has changed. This is important if your network moves around the world or if you need to move addresses between sites regularly.
One could publish very specific data by including a postal (ZIP) code in the file. RFC 8805, the document that describes the format, strongly cautions against providing data that risks the privacy of individuals. City level data meets the needs of most internet users and service providers.
RFC 9092 describes how to link to a file from the RIR or NIR whois data. RIPE NCC and some other registries have a special “geofeed:” field for this. ARIN does not, so you can link it from a comments field.
Another option is to look at the older “geoloc:” attribute available in the RIPE database and other RPSL-based registries. It works by listing the latitude and longitude for your network in decimal coordinates.
It is very widely used. There were over 35,000 “geoloc:” entries in the RIPE Database in April 2022. But it’s more complex to manage because you need a separate database entry for each location. That could mean a lot of database updates to manage. This, along with the other improvements, is why RFC 8805’s protocol was developed.
Manually Locate IP Data
Technology is changing to give network operators ways to communicate data in structured and automated ways. But automation is not always perfect. There remain important ways to locate IP data manually instead of using automated processes.
RFC 9092 is new. It was published in July 2021. Many of the shopping, streaming, and financial services sites used by consumers have adopted the new protocol. But not all have. The Brothers WISP is a great resource for consumer ISPs whose address space is rejected by local content distribution services, like video streaming or gaming platforms. They publish a regularly maintained list of databases that manage IP address to location mapping.
If that doesn’t work, asking on a NOG list can help. Other network operators who’ve solved similar problems will share their experience.