from Hacker News

Show HN: How did your computer reach my server?

by archmaster on 12/5/23, 2:56 PM with 137 comments

  • by archmaster on 12/5/23, 3:10 PM

    Hi! I'm Lexi. I'm 17, and one of the things I'm interested in right now is gaining a deeper understanding of how computers work and showing that in new ways.

    A few months ago I published https://cpu.land (discussion: https://news.ycombinator.com/item?id=37062422). After cpu.land, I felt a lot of pressure to make another Big Giant Thing but didn't really have anything compelling. So I just hacked away on personal projects and, through some coincidental learning on how the Internet works, ended up hacking together a traceroute program that could live stream to a website from scratch!

    I realized I had never seen this sort of thing on the web before, and it was actually a kind of cool and novel way of visualizing the structure of the Internet, so I polished it up and built a pretty site around it. In the process, I learned some really interesting things about how BGP and the structure of The Internet, so I melted the traceroute tool with an article sharing that knowledge.

    I'm still hacking on this and I'm sure my code will manage to break somehow, so please let me know if you have any suggestions! :)

    (Side note: why Rust? I don’t think programming language choice matters that much, but I wanted to quickly write a very dependable low-level program, and I really like Rust’s error handling primitives. Why do you care about this?)

  • by quantum5 on 12/5/23, 8:40 PM

    > BGP is the protocol that gives the Internet its shape, and you can’t directly speak it yourself.

    It's actually surprisingly easy to get an ASN for yourself and speak BGP. If you find building something like this tool interesting, you should give it a try. I wrote an introduction of sorts earlier (https://qt.ax/asn) if that interests you.

  • by supermatt on 12/5/23, 4:19 PM

    This is "how your server reaches my computer but reversed" rather than "how my computer reaches your server". The routing in each direction will most likely be very different.
  • by nullindividual on 12/5/23, 4:21 PM

    Here's a paper you might be interested in with regards to how traceroute works. One thing that many (non-network) folks miss is that traceroute is not necessarily symmetrical -- the return path may differ.

    https://archive.nanog.org/sites/default/files/traceroute-201...

  • by denton-scratch on 12/5/23, 8:24 PM

    > WHOIS is actually an... interesting protocol to make a parser for.

    It's actually impossible. Responses are essentially free-form (if the server responds at all). I tried my hand at this; you can make an ad-hoc "parser" that works for 90% of addresses/domains (or you could, ten years ago when I tried). But the remainder are intractable.

    Nowadays it's much worse; nearly everything is hidden behind privacy shields, which purport to protect PII. But WHOIS records aren't supposed to contain personal information; they're supposed to contain contact information for network operators.

    This is ICANN's doing, I'm afraid. ICANN had a rule that networks should provide public WHOIS servers. They never enforced the rule, and now they've scrapped it.

  • by magnat on 12/5/23, 5:34 PM

    You can go one step further and instead of separate ICMP ECHO trace, use existing HTTP TCP connection between client's browser and your web server. That way you can traverse client-side NAT and/or stateful firewall.
  • by ibejoeb on 12/5/23, 4:05 PM

  • by c0pium on 12/5/23, 4:14 PM

    You might be interested to know that many times, packets in a TCP session take asymmetric routes across the internet. In my experience, the most common reasons for this are business rules related to cost and human error.

    If you think about how IP works, you’ll see that this doesn’t particularly matter but that it can make understanding the routing more difficult.

  • by monkeyjoe on 12/5/23, 3:21 PM

    On my device, there are no intermediate steps shown between my device and the server. Just FYI.
  • by Hasz on 12/5/23, 5:16 PM

    I think it's also worth mentioning mtr, which is what I use much more frequently than traceroute. It can help diagnose intermittent packet loss, and gives you an averaged sense of how things flow.

    This article from APNIC explains more about mtr and how to read it (plus some interesting details about how MPLS can obscure true paths)

    https://blog.apnic.net/2022/03/28/how-to-properly-interpret-....

    Also worth noting: It's also sometimes useful to trace with UDP, and many routers will drop ICMP selectively under strain.

    Nice article, and excellent presentation!

  • by at0mic22 on 12/5/23, 8:53 PM

    As it was mentioned above, you are not measuring connection from the client to the server, but from the server to the client. It can be a completely different route, and internal routing behind the IP is hidden. You should try 0trace to get the real route
  • by jcrawfordor on 12/6/23, 1:25 AM

    Very cool way to present this. Obviously there's a lot of legwork here, but for major ISPs you could probably use some heuristics to give a little more detail on internal network structure. Comcast, for example, has their core network under ibone.comcast.net, but their HFC infrastructure directly under comcast.net. So you can tell when traffic makes the jump from their HFC consumer ISP network to their backbone. At one point I had some notes on patterns like this for a number of the majors but I think I've lost it. :(
  • by averageRoyalty on 12/6/23, 12:09 PM

    > My claim that this website’s traceroute was the path your packets took to reach my server was a bit of a white lie. To calculate that, I would’ve had to be able to run a traceroute to my server from your computer. Instead, I ran the traceroute from my server to your computer and just reversed it. That’s also why the traceroute at the top seemingly loads in reverse order.

    I was wondering if we'd address this. That was my first thought - how can you do this without initiating ICMP from my side?

    > Does running a “reverse traceroute” sacrifice accuracy? A little, actually.

    > As I said when describing Internet routing, each device a packet traverses makes a decision about where to send the packet next until it reaches its final destination. If you send a packet in the other direction, the devices might make different routing decisions… and if one device makes one different decision, the rest of the path will certainly be different.

    > This reverse traceroute is still helpful. The paths will be roughly the same, likely differing only in terms of which specific routers see your packet.

    Sure... But it's pretty common for multi pathed AS' to traverse in all sorts of different ways. My experience (non residential) is that more often than not, the trace and reverse trace were different. Your upstreams and my upstreams have very different commercial agreements, and both peer and transit in multiple places.

    Still cool though, well done!

  • by mikewarot on 12/5/23, 6:11 PM

    SQUIRREL!!!

    How did you manage to tilt the section header text? I've not seen that done before.

  • by collsni on 12/6/23, 4:34 AM

    Akami blocks the return trace which is no fun. But regarless a cool project.

    9 a23-203-147-39.deploy.static.akamaitechnologies.com (23.203.147.39) 36.707 ms 36.783 ms 40.110 ms 10 * * * 11 * * * 12 * * * 13 * * * 14 * * * 15 * * * 16 * * * 17 * * * 18 * * * 19 * * * 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * *

  • by sgjohnson on 12/6/23, 1:19 PM

    IPv6 support would be great for this. I run my own AS (AS200676) and one of my prefixes is actually announced at my home. I'm really curious as to what would the auto-generated green text say about that route.

    I announce only IPv6, because I don't currently have access to any v4 blocks, they are expensive and I have little need for one.

  • by kazinator on 12/5/23, 7:23 PM

    There should be a traceroute protocol whereby a "specially marked packet" is understood to be traceroute, and generates an ICMP response even though its TTL is still positive. The ICMP response will carry the observed TTL value.

    Then one packet will get all the echoes in one go instead of having to send a tirade of packets with increasing TTL values.

  • by zharknado on 12/6/23, 2:09 AM

    Great write up, thank you for making this! From a learning design perspective, the blend of static and dynamic prose based on my own packet’s journey was super cool, not something I’ve seen done quite that way before.

    Makes me imagine an online programming textbook that could to walk you through what your own custom code is doing. Very cool!

  • by noort on 12/5/23, 3:34 PM

    Doesn't work at all with Enhanced Tracking Protection enabled in Firefox, and times out when it is disabled.

    I guess it's supposed to do something like this: https://dnschecker.org/online-traceroute.php

  • by netfortius on 12/5/23, 7:33 PM

  • by keep_reading on 12/7/23, 1:46 PM

    There's no possible way to guarantee that traceroute is accurate. The same route is not taken both directions.

    A Practical Guide to (Correctly) Troubleshooting with Traceroute by Richard A Steenbergen explains it well

  • by luckman212 on 12/5/23, 11:57 PM

    > "Hi! I'm Lexi. I'm 17..."

    Holy shit. This girl's going places. I just skimmed https://kognise.dev and saw that in addition to the deep understanding of TCP/IP and all 7 layers of the OSI model she appears to posses, she also does front- and back-end development, embedded hardware, mobile apps, and compilers. She also rock climbs, can pilot a Cessna (all by herself), build robots, plays (and composes music for) the cello (since she was 5 years old apparently).

    Do I need to keep going? This is nothing short of incredible. If I did 1/10 of the things this kid's already done by the time I kick the bucket I would have lived a full life.

  • by Kinrany on 12/5/23, 8:15 PM

    Do the h3 heading tags look like they're tilted a little bit? CSS/font trickery? Just me?
  • by senectus1 on 12/5/23, 11:24 PM

    Note, I geo-block IP's not from Australia for my home network. This is why it failed for me.
  • by aizyuval on 12/6/23, 8:11 AM

    I might not now an y better, but this implementation seems so cool.

    Can I trace the location of an AS?

  • by deadbabe on 12/6/23, 1:41 AM

    You can even use traceroute to send short hidden messages! :D
  • by spondylosaurus on 12/6/23, 7:02 AM

    Love the looooong furret in your header image! :D
  • by elwebmaster on 12/5/23, 11:47 PM

    It would be cool to add a map of the hops.