The IP Geolocation HTTP Client Hint
Apple Inc.
One Apple Park Way
Cupertino, California 95014
United States of America
tpauly@apple.com
Google LLC
dschinazi.ietf@gmail.com
Internet-Draft
This documents defines an HTTP Client Hint that allows a client to share information
about its IP Geolocation. This helps ensure that servers have information about location
that is consistent with what a client expects and what other servers use.
Discussion Venues
Source for this draft and an issue tracker can be found at
.
Introduction
HTTP Client Hints defines a convention for HTTP headers
to communicate optional information from clients to servers as hints. This can be done
conditionally based on if a server claims supports for a particular hint.
This document defines a client hint that can be used to send a IP geolocation entry that
maps to the client's IP address. This location can be used to influence server behavior,
such as by causing the server to return responses relevant to the client's location.
The format of the IP geolocation entry is the same as that defined for IP geolocation
feeds in .
This header is intended to be used to provide rough geolocation hints to servers that do
not already have accurate or authoritative mappings for the IP addresses of clients. This
can be particularly useful for cases where IP geolocation mappings have changed recently,
or a client is using a VPN or proxy that may not be commonly recognized by servers.
The mechanism for how a client learns the IP geolocation mapping to send is beyond the
scope of this document. defines some mechanisms for discovery, but clients
can also have other mechanisms (such as coordinating with a VPN or proxy that is assigning
the client a tunnelled or proxied address) to learn what hint to sent.
Requirements
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14 when, and only when, they
appear in all capitals, as shown here.
IP Geo Header
The "Sec-CH-IP-Geo" is an Item Structured Field .
The field's value is a String. The string uses the format defined in
Section 2.1.1 of , with the IP Prefix element
removed. Thus, this contains a comma-separated list of Alpha2code, Region, and
City. The value SHOULD NOT contain a Postal Code.
For example, the header for an entry "192.0.2.5,US,US-AL,Alabaster" would be:
This field also defines a parameter, "feed", that contains the URI of the
IP geolocation feed that is authoritative for this entry. For example:
Servers that can provide different content based on Geohash hints SHOULD include
the headers in their "Accept-CH" list.
Servers also SHOULD indicate for any cacheable content if the IP geo hints will influence
the cached content, using the "Vary" header.
Server Behavior
Upon receiving a IP Geolocation Client Hint, a server can use the information to influence
its behavior in various ways, such as determining the content of HTTP responses.
Many servers have existing IP geolocation feeds that they use to identify client locations.
Servers can choose to use the hint value in one of several ways:
- Use the client hint information instead of consulting another geolocation feed.
- Check the value of the "feed" parameter on the header and determine if it is a trusted feed.
If this feed is trusted, but is not the default feed used by the server, the server
can choose to prefer the feed indicated by the client.
- Check the value of the "feed" parameter on the header and fetch a copy of the feed
to verify the mapping, if a copy of the feed has not been fetched recently.
- If the feed indicated in the "feed" parameter is unknown or untrusted, but starts
becoming common, the server can flag this feed as one to be manually checked and
added, if appropriate. This allows servers to automatically discover when new
feeds and services are brought up..
If the server is acting as a forward proxy, such as a CONNECT proxy, it can use the hint
to determine an appropriate geo-mapped IP address to use for outbound connections, or a
client subnet to present in the EDNS0 Client Subnet extension for DNS queries
.
Security Considerations
The use of the IP Geolocation Client Hint MUST use the Sec- header prefix as recommended
in .
Servers MUST NOT use IP Geolocation Client Hints for making security or access-control decisions,
as the value can be spoofed by a client. The hint is intended only for use in optimizing behavior.
The value contained in this hint SHOULD be based only on a IP Geolocation feed value for
an IP address the client is already presenting to a server. In order to avoid disclosing
any private information, this value MUST not be based on geolocation of the client determined
by other means, such as physical latitude and longitude coordinates.
IANA Considerations
HTTP Headers
This document registers the "Sec-CH-IP-Geo" header in the
"Permanent Message Header Field Names" registry
<>.
References
Normative References
HTTP Client Hints
HTTP defines proactive content negotiation to allow servers to select the appropriate response for a given request, based upon the user agent's characteristics, as expressed in request headers. In practice, user agents are often unwilling to send those request headers, because it is not clear whether they will be used, and sending them impacts both performance and privacy.
This document defines an Accept-CH response header that servers can use to advertise their use of request headers for proactive content negotiation, along with a set of guidelines for the creation of such headers, colloquially known as "Client Hints."
A Format for Self-Published IP Geolocation Feeds
This document records a format whereby a network operator can publish a mapping of IP address prefixes to simplified geolocation information, colloquially termed a "geolocation feed". Interested parties can poll and parse these feeds to update or merge with other geolocation data sources and procedures. This format intentionally only allows specifying coarse-level location.
Some technical organizations operating networks that move from one conference location to the next have already experimentally published small geolocation feeds.
This document describes a currently deployed format. At least one consumer (Google) has incorporated these feeds into a geolocation data pipeline, and a significant number of ISPs are using it to inform them where their prefixes should be geolocated.
Key words for use in RFCs to Indicate Requirement Levels
In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.
Structured Field Values for HTTP
This document describes a set of data types and associated algorithms that are intended to make it easier and safer to define and handle HTTP header and trailer fields, known as "Structured Fields", "Structured Headers", or "Structured Trailers". It is intended for use by specifications of new HTTP fields that wish to use a common syntax that is more restrictive than traditional HTTP field values.
Informative References
Finding and Using Geofeed Data
This document specifies how to augment the Routing Policy Specification Language inetnum: class to refer specifically to geofeed data comma-separated values (CSV) files and describes an optional scheme that uses the Routing Public Key Infrastructure to authenticate the geofeed data CSV files.
Extension Mechanisms for DNS (EDNS(0))
The Domain Name System's wire protocol includes a number of fixed fields whose range has been or soon will be exhausted and does not allow requestors to advertise their capabilities to responders. This document describes backward-compatible mechanisms for allowing the protocol to grow.
This document updates the Extension Mechanisms for DNS (EDNS(0)) specification (and obsoletes RFC 2671) based on feedback from deployment experience in several implementations. It also obsoletes RFC 2673 ("Binary Labels in the Domain Name System") and adds considerations on the use of extended labels in the DNS.
Client Subnet in DNS Queries
This document describes an Extension Mechanisms for DNS (EDNS0) option that is in active use to carry information about the network that originated a DNS query and the network for which the subsequent response can be cached. Since it has some known operational and privacy shortcomings, a revision will be worked through the IETF for improvement.