2016年10月14日 星期五

The difference between maxmind geoip and cloudflare geoip: country code level

Cloudflare provide free CF-IPCountry header, but we found a tweet said cloudflare's accuracy is not good enough at 2014.

We logged ip and cloudflare country code, then made a simple script to check the difference.

Dates of Cloudflare country code: first half of October, 2016
Maxmind geoip 2 country database: Oct 11, 2016


IPV4

All IPs: 560079
  • cloudflare missed: 423
  • maxmind missed: 27
  • both missed: 667
  • diff: 367
  • matched: 558595
matched / all = 99.735%
If we used both database: 
(cloudflare missed + maxmind missed + matched) / all = 99.8154%


IPV6

All IPs: 41456
  • cloudflare missed: 5
  • maxmind missed: 0
  • both missed: 0
  • diff: 58
  • matched: 41393
matched / all = 99.848%
If we used both database to complement country code: 
(cloudflare missed + maxmind missed + matched) / all = 99.8601%

Cloudflare didn't cllaimed the accuracy, but official Maxmind claimed accuracy is 99.8%