1
0
Fork 0
Go to file
Ambrose Chua 814d268d42
Create LICENSE
2018-09-26 22:40:49 +08:00
data Finish country.go 2018-03-23 10:43:27 +08:00
.gitignore Ignore archive backup files 2018-03-27 22:36:24 +08:00
LICENSE Create LICENSE 2018-09-26 22:40:49 +08:00
README.md Boxplot is implemented 2018-04-17 23:11:24 +08:00
boxplot.go Ugh 2018-04-17 23:08:25 +08:00
boxplot.xlsx Update poster and graph 2018-03-26 13:35:22 +08:00
compare.go JSON-based latency 2018-03-22 22:52:45 +08:00
country.go Update poster with latencies 2018-03-24 23:11:19 +08:00
exclude.txt Add IU to exclude.txt 2018-03-21 14:26:00 +08:00
json2csv.go Make country read map instead 2018-03-23 13:05:07 +08:00
latency.go Reduced sample size 2018-03-23 18:55:14 +08:00
poster.png Ugh 2018-04-17 23:08:25 +08:00
poster.svg Ugh 2018-04-17 23:08:25 +08:00
scan.conf Limitations in computing 2018-03-22 23:16:32 +08:00

README.md

sgp-internet-ping

A quick analysis of Internet latency from Singapore to the rest of the world.

poster

Scanning the Internet

To scan the IPv4 Internet, I used the tool masscan by security researcher Robert Graham. He has extensively made use of masscan in the security research he does. It provides latency measurements up to the millisecond.

WARNING: Only scan the Internet if your service provider approves of it. It can cause networking issues.

I wrote a configuration file to run masscan on the entire Internet with the included exclusion list, and scan the top 5 open ports according to speedguide.net. It is stored as scan.conf. I started the scan with:

masscan -c scan.conf

This produces the output file scan.bin. You might want to make use of shards to scan only a portion of the internet per file as scanning the entire internet will produce a huge file that cannot be parsed unless you have enough RAM available.

Counting latency

I need to reduce the data for the five ports per host into a single latency reading for each host.

But first, I had to convert the scan binary into JSON:

masscan --readscan scan.bin -oJ scan.json
go run latency.go -in scan.json -out latency.json

Categorising readings by country

To associate an IP address with a country, a geolocation lookup database must be used. I used two sources of geolocation databases; Maxmind's GeoLite2, and Webnet77's IPToCountry; to test the accuracy of either database.

Next, I wrote and used a Go script to group the scans by country:

go run country.go -in latency.json -db iptocountry -out country.json

Plotting the latency from Singapore by country

I will start with a simple plot of latency to every country from Singapore.

go run boxplot.go -in country.json -out boxplot.csv