Better HN
topnewbestaskshowjobs
Log inSign up

bswinnerton

305 karma · joined Aug 9, 2012 (14y ago) · 47 submissions

[ my public key: https://keybase.io/bswinnerton; my proof: https://keybase.io/bswinnerton/sigs/TivfoG3vmaFSvelMY7-IHyyuG24Q52tmZsa2819GbK4 ]
Submissions

1.

Help Me with Money(helpmewith.money ↗)

4 points · by bswinnerton · 2y ago · 2 comments

2.

Upgrading GitHub.com to MySQL 8.0(github.blog ↗)

38 points · by bswinnerton · 2y ago · 12 comments

comment 2y ago · link · parent

Here's a simpler alternative with IP Guide that doesn't require a CLI:

  curl -sL ip.guide/AS19551 | jq .routes

comment 3y ago · link · parent

I'd also suggest filing a correction with MaxMind, which is where most modern geolocation data is derived: https://www.maxmind.com/en/geoip-location-correction.

comment 3y ago · link · parent

Great idea. This is rolling out right now.

comment 3y ago · link · parent

It's not available from the API, but there is a "last updated" date when you view it in a browser. It's at most 8 hours old.

comment 3y ago · link · parent

For the backend, it's written in Rust using a few key crates: axum for the api, bgpkit-parser for parsing the MRT data, and reqwest for fetching data at boot.

The site is hosted on Neptune Networks, another side project of mine for people to learn and experiment with BGP.

comment 3y ago · link · parent

You'll have to follow the redirects since the site doesn't support HTTP, but just shipped pretty-printing.

comment 3y ago · link · parent

No rate limits or auth for requests, but as mentioned below the api starts to load shed at 2k concurrent requests.

comment 3y ago · link · parent

> Will this be open-sourced?

I don't think there's a strong reason to keep it closed-source.

> Were you already comfortable in Rust or is there a reason you selected Rust for this project?

This was a big learning opportunity for me to learn Rust. I had done two small projects in Rust before this one.

> How often are RIPE info and MaxMind data updated these days?

The MRT dumps where it gets its BGP data are updated every 8 hours, and MaxMind appears to be updated twice a week.

comment 3y ago · link · parent

The country code is the last portion of the networks CSV:

  $ curl -sL ip.guide/bulk/networks.csv | head -n 2
  prefix,asn,organization,country
  1.0.0.0/24,13335,"Cloudflare, Inc.",US

comment 3y ago · link · parent

IP Guide is also using MaxMind, I'm not familiar with many other data sources for that kind of data. Are you seeing discrepancies?

No rate limits or auth for requests, but as mentioned below the api starts to load shed at 2k concurrent requests.

comment 3y ago · link · parent

Yeah, if you click on "bulk data" you'll see the two statically hosted CSVs for ASN and IP data. What else would you find useful in those datasets? It's quite easy to expand on them.

comment 3y ago · link · parent

Oh cool! Is this a fork of ifconfig.co?

comment 3y ago · link · parent

Yes! Quite easily, but it requires thinking through the right API design. I'll see if I can work this in this weekend.

comment 3y ago · link · parent

Great feedback, I'll add a little more to the site to describe how it all works. Until then...

At a 30,000ft view, the site works by building an in-memory routing table at boot time that has an entry for every route on the internet and which ASN (autonomous system number) announces it. From there, it stitches together data on the organization that the ASN belongs to, and geolocation data, and then exposes it in the API/UI. Under the hood it's using a treebitmap[1] data structure, which means that it can do _very_ fast lookups when given a particular ip address or ip address range.

Zooming in a little more, the main data source is MRT dumps from the RIPE RIS project[2]. There are a number of routers that RIPE (one of the 5 regional internet registries that hand out ASNs and IPs) that rely on network operators to share their view of every route on the internet. These routers are probably some of the most well-connected routers in the world. For the purposes of this service, MRT dumps are effectively a point-in-time snapshot of the routing table of that router. IP Guide parses that file, rebuilds it in memory, and attaches other relevant data to each IP range (also known as a "prefix").

This allows the service to stay fast and stateless, which was one of the main things I was trying to optimize for when building it.

[1]: https://blog.apnic.net/2021/06/04/storing-and-retrieving-ip-... [2]: https://ris.ripe.net/docs/10_routecollectors.html

comment 3y ago · link · parent

> Having a simple paragraph about RIPE, BGP and ARIN would be helpful (at least for me).

That's a great idea. I'll add a tooltip over some of the less obvious fields describing what they are.

> Is there any way at all to do this for IPv6?

Indeed! It's supported natively, so if you have an IPv6 address you should see it automatically. Here's an example <https://ip.guide/2600::>

> If the IP is associated with hostnames that would be nice to know.

I dig that idea, I'll have to think of the best way to pull that data while keeping the app stateless and fast.

comment 3y ago · link · parent

I do that every. single. time.

comment 3y ago · link · parent

Go for it! There's no formal rate limiting or auth, but it does start to load shed at 2k concurrent requests. It's stateless, so it's very easy to scale horizontally after that.

LoginLlama looks super helpful, what else would you like to see from IP Guide to help? Would a boolean attribute on whether or not the IP is a known tor exit node be helpful?

20.

Show HN: IP Guide – Info on IP addresses, Networks, and ASNs(ip.guide ↗)

363 points · by bswinnerton · 3y ago · 99 comments

comment 3y ago · link · parent

Repository contents aren’t “sent” to China, companies like Tencent specify the shape of tokens to GitHub and GitHub does the scanning and then notifies Tencent to revoke the token if one is found.

comment 4y ago · link · parent

These are known as GitHub apps and were designed to address this problem. https://docs.github.com/en/developers/apps/getting-started-w...

comment 4y ago · link · parent

https://docs.github.com/en/developers/apps/getting-started-w...

comment 5y ago · link · parent

It can be relatively inexpensive, depending on which RIR you’re using. There are providers like [Neptune Networks](https://neptunenetworks.org/) or [Vultr](https://www.vultr.com/) that you can peer with from a VPS so you don’t need to get “proper” IP transit in a datacenter.

25.

Hunting down the stuck BGP routes(blog.benjojo.co.uk ↗)

222 points · by bswinnerton · 5y ago · 32 comments

26.

BIRD’s Journey to Threads(en.blog.nic.cz ↗)

2 points · by bswinnerton · 5y ago · discuss

comment 5y ago · link · parent

Before every deploy your branch has master merged into it. There’s some clever work by Hubot while you’re in line to deploy to create a version of your branch that has the potential new master / main branch. If conflicts arise you fix them before it’s your turn to deploy.

comment 5y ago · link · parent

This is known as “GitHub Flow” (https://guides.github.com/introduction/flow/). I was pretty surprised by it when I first joined GitHub but I’ve grown to love it. It makes rolling back changes much faster than having to open up a revert branch, get it approved, and deploy it. When something goes sideways, just deploy master / main, which is meant to always be in a safe state.

comment 5y ago · link · parent

Not on that page, no, but you could easily fetch this information via the GraphQL API.

comment 5y ago · link · parent

Oh sorry, I should have clarified it’s GraphQL “under the hood” (backend). Most of GitHub is a Rails app, and in the case of the commits page, the controller makes a GraphQL query, and then takes the results and injects it into the view, all server side. The original idea was that if GitHub was using its own GraphQL API to build its pages, our users would have the exact same access as GitHub engineers.
12