[Geopriv] Experiment report: Geopriv at APRICOT 2010

Richard Barnes <rbarnes@bbn.com> Wed, 24 March 2010 18:32 UTC

Return-Path: <rbarnes@bbn.com>
X-Original-To: geopriv@core3.amsl.com
Delivered-To: geopriv@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 231083A6D4F for <geopriv@core3.amsl.com>; Wed, 24 Mar 2010 11:32:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.32
X-Spam-Level: *
X-Spam-Status: No, score=1.32 tagged_above=-999 required=5 tests=[AWL=0.189, BAYES_50=0.001, DNS_FROM_OPENWHOIS=1.13]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sZjuPJg1bggk for <geopriv@core3.amsl.com>; Wed, 24 Mar 2010 11:32:36 -0700 (PDT)
Received: from smtp.bbn.com (smtp.bbn.com [128.33.1.81]) by core3.amsl.com (Postfix) with ESMTP id 6EF273A6C4F for <geopriv@ietf.org>; Wed, 24 Mar 2010 11:32:36 -0700 (PDT)
Received: from [128.89.254.47] (port=56437 helo=[130.129.24.118]) by smtp.bbn.com with esmtp (Exim 4.71 (FreeBSD)) (envelope-from <rbarnes@bbn.com>) id 1NuVNw-000PIR-8U for geopriv@ietf.org; Wed, 24 Mar 2010 14:32:56 -0400
Message-Id: <5CB97E2D-20F6-47E3-BCD1-4D2F16262005@bbn.com>
From: Richard Barnes <rbarnes@bbn.com>
To: geopriv@ietf.org
Content-Type: text/plain; charset="US-ASCII"; format="flowed"; delsp="yes"
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
Date: Wed, 24 Mar 2010 11:32:55 -0700
X-Mailer: Apple Mail (2.936)
Subject: [Geopriv] Experiment report: Geopriv at APRICOT 2010
X-BeenThere: geopriv@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Geographic Location/Privacy <geopriv.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/geopriv>, <mailto:geopriv-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/geopriv>
List-Post: <mailto:geopriv@ietf.org>
List-Help: <mailto:geopriv-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/geopriv>, <mailto:geopriv-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Mar 2010 18:32:38 -0000

=== Executive Summary ===
At the APRICOT meeting in early March, we deployed LIS discovery  
records in the reverse-DNS tree and demonstrated a basic HELD client  
that supported discovery.   Doing all the coding myself (and borrowing  
some code from Martin Thomson), I was able to put this together in a  
couple of days' time.  In particular, because I wrote the LIS and the  
client was written by Martin, this shows two independent,  
interoperable implementations of HELD.

Slides: <http://meetings.apnic.net/__data/assets/pdf_file/0018/19008/New-Technology-Session_01_IP-Geolocation-and-Location-Based-Services-_Richard-Barnes.pdf 
 >

Code: <http://geopriv.dreamhosters.com/apnic/apnic-geopriv-demo.tar.gz>

Live demo LIS: <http://geopriv.dreamhosters.com/apnic/provision/entry.php 
 >

Live HELD client: <http://geopriv.dreamhosters.com/apnic/view/pidflo.html 
 >


=== Setup ===

I gave a presentation on GEOPRIV at APRICOT in early March, and to  
demonstrate some of the key concepts in GEOPRIV, I worked with the  
conference organizers to HELD-enable the conference network.  The  
experiment system had four basic components:

1. The LIS: I wrote a small perl CGI script that implements a HELD  
server interface to provide location from two sources:
1.1. A database of provisioned prefix-to-location mappings
1.1. The MaxMind GeoLite City database (if not found in DB)
This server only supports location configuration and dereference.  If  
a query comes with a given query parameter, it is handled as a deref  
request and location is pulled from a cache; otherwise location is  
determined based on the source IP address of the request.  In  
particular, it does not support third-party queries.

2. The Reverse DNS Tree: The meeting network was numbered out of a  
169.223.32.0/22, so we just provisioned a LIS-Discovery NAPTR record  
for each corresponding record under 223.169.in-addr.arpa.  The zone  
file with just those records was around 220KB, and the name server was  
running a recent version of BIND 9.

3. The PHP LIS Discovery Service: In order to simplify the  
implementation of a HELD client, we exploited the nice DNS interface  
in PHP to do proxied LIS discovery.  A query to this PHP script will  
return the LIS URI for the source IP address if a NAPTR record is  
present in the reverse DNS for that IP address (no tree climbing);  
otherwise the response will be empty.

4. The AJAX HELD Client: I extended Martin Thomson's online HELD  
client  / PIDF-LO viewer to use the above PHP LIS discovery service.   
This led to a simple, web-based client with
4.1. A button to trigger LIS discovery
4.2. A button to send the HELD query
4.3. A Google Maps display of the returned location

The demo in the meeting proceeded in three steps: First, we did an  
initial HELD discovery and query, showing the location that MaxMind  
had for the meeting network -- not in Kuala Lumpur, the meeting site,  
but in Manila, the location of the last APRICOT meeting.  Second, we  
opened the provisioning page and provisioned geodetic and civic  
location values for the meeting venue (the KL Convention Center).   
Third, we went back to the HELD client and showed that the client was  
able to discover, receive, interpret, and display the location  
information.

=== Results ===

Basically, everything pretty much worked, and wasn't too hard to code  
up:
LIS: 687 lines of Perl
Discovery proxy: 22 lines of PHP
HELD Client: 2113 lines of Javascript
For the HELD Client, all but 16 were due to Martin Thomson (these 16  
lines just sent an AJAX request to the discovery service and stored  
the result).  So since I wrote the LIS, I think this count as  
independent, interoperable implementations.

draft-ietf-geopriv-http-location-delivery
Obviously, XML parsing is kind of a pain, but Perl provided a very  
workable parser.  The most subtle logic ended up being around deciding  
which location types to return -- basically taking the intersection  
between what was available from the location sources and what was  
allowed by "locationType" and "exact".  The LIS completely ignores the  
"responseTime" attribute.

draft-ietf-geopriv-lis-discovery
It was really trivial just to copy the example NAPTR records from the  
draft and customize them with my LIS URI.  Parsing the records in PHP  
was easy because of the constrained format from RFC 4848.

draft-thomson-geopriv-res-gw-lis-discovery
As we can see, provisioning a fairly modest-sized network (/22)  
entailed a zone file of non-trivial size (>200KB), so it looks like  
this direct approach probably doesn't scale.  Dynamically-generated  
DNS mechanisms would probably be better-suited, but the one approach  
we looked at (the BIND $GENERATE statement) did not support generation  
of NAPTR records.  For some reason, one of the secondary name servers  
(which was running on BSD) would not load the zone file, but the  
primary did; we did not investigate this issue further.