{"id":17649009,"url":"https://github.com/serverwentdown/sgp-internet-ping","last_synced_at":"2025-03-30T07:42:56.726Z","repository":{"id":95380000,"uuid":"125885374","full_name":"serverwentdown/sgp-internet-ping","owner":"serverwentdown","description":"A quick analysis of Internet latency form Singapore to the rest of the world","archived":false,"fork":false,"pushed_at":"2018-09-26T14:40:49.000Z","size":11545,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-05T09:53:49.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverwentdown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-19T16:07:47.000Z","updated_at":"2018-09-26T14:40:51.000Z","dependencies_parsed_at":"2023-03-06T16:00:39.158Z","dependency_job_id":null,"html_url":"https://github.com/serverwentdown/sgp-internet-ping","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverwentdown%2Fsgp-internet-ping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverwentdown%2Fsgp-internet-ping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverwentdown%2Fsgp-internet-ping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverwentdown%2Fsgp-internet-ping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverwentdown","download_url":"https://codeload.github.com/serverwentdown/sgp-internet-ping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246290581,"owners_count":20753724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T11:23:18.104Z","updated_at":"2025-03-30T07:42:56.708Z","avatar_url":"https://github.com/serverwentdown.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003e\n    sgp-internet-ping\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    A quick analysis of Internet latency from Singapore to the rest of the world.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"poster.png\" alt=\"poster\"\u003e\n\u003c/p\u003e\n\n## Scanning the Internet\n\nTo scan the IPv4 Internet, I used the tool [`masscan`](https://github.com/robertdavidgraham/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. \n\n\u003e WARNING: Only scan the Internet if your service provider approves of it. It can cause networking issues.\n\nI 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](https://www.speedguide.net/ports_common.php). It is stored as `scan.conf`. I started the scan with: \n\n```\nmasscan -c scan.conf\n```\n\nThis 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. \n\n## Counting latency\n\nI need to reduce the data for the five ports per host into a single latency reading for each host.\n\nBut first, I had to convert the scan binary into JSON:\n\n```\nmasscan --readscan scan.bin -oJ scan.json\ngo run latency.go -in scan.json -out latency.json\n```\n\n## Categorising readings by country\n\nTo 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. \n\nNext, I wrote and used a Go script to group the scans by country:\n\n```\ngo run country.go -in latency.json -db iptocountry -out country.json\n```\n\n## Plotting the latency from Singapore by country\n\nI will start with a simple plot of latency to every country from Singapore. \n\n```\ngo run boxplot.go -in country.json -out boxplot.csv\n```\n\n## \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverwentdown%2Fsgp-internet-ping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverwentdown%2Fsgp-internet-ping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverwentdown%2Fsgp-internet-ping/lists"}