Introduction
Having left their dialogue on internet routing from the previous day unfinished, Glaucon returns to the agora, refreshed from his night’s sleep, although he finds his teacher is absent for the time being. When Socrates does arrive, the lesson resumes directly, and Socrates’ examples for demonstrating the concepts of routing become both more concrete and more modern.
Dramatis personae
In order of appearance:
- Glaucon: A Cretin visitor to the agora, with grand ideals of freedom and minimalism in computing, and by now a regular and eager student of Socrates
- Thrasymachus: An Ithacan regular
- Pyrrhus: An eccentric Epirote who first visited the agora around the same time as Glaucon
- Adeimantus: A Cretin regular
- Socrates: Famed philosopher-engineer of Athens
- Cephalus: Another Cretin regular
Prelude
A new day has dawned on the agora. Glaucon is speaking with Thrasymachus about some stickers he was planning to order from an online vendor, depicting the titular character from Sailor Moon holding a floppy disk and warning that she does not know how to use a computer. Thrasymachus is weary from some long nights working on mail servers with the Corinthians.
Glaucon: hellovoid.online said they’re waiting for the new order of stickers
Thrasymachus: They must be popular
Glaucon: oh I’ve seen them around for a while so I’m not surprised
Thrasymachus: I have a few other stickers, one says sysadmin, because even developers need heroes
Thrasymachus: Most of the rest of them are just specific tech, like a Vim sticker etc
Glaucon: >Vim
Thrasymachus: Oh don’t start
Thrasymachus: I’m tired
Glaucon: lol
Best of a bad bunch
Glaucon has not been speaking for long before he resumes his crusade for perfection in his computing environment—although, this time around, his intentions seem somewhat simpler. However, Socrates has not yet arrived, so he must resort to Pyrrhus and Adeimantus for feedback.
Glaucon: I’m thinking about reinstalling Windows 98SE on my machine so I can play Counter-Strike 1.6 and Rainbow Six and Tom Clancy’s Ghost Recon
Pyrrhus: Use Wine™ 1
Glaucon: I usually avoid such things
Glaucon: but for such old games it might work just fine
Adeimantus: yeah, he can’t stand using useful software
Pyrrhus: Install Windows 2000 then
Pyrrhus: Unironically the least sucky Windows
Thrasymachus: Weird
Thrasymachus: I just agreed with Pyrrhus about something
Thrasymachus: Am I dying?
Pyrrhus: No, it’s only because Windows 2000 was actually made with standards i.e. POSIX 2
Glaucon: >want to play old games
Glaucon: >the only proper use for 98SE
Glaucon: >just use 2000
Glaucon: ?
Pyrrhus: Windows 98SE crashes hard. Windows 2000 has pretty much the same compatibility and doesn’t crash so often.
Glaucon: crashes hard from what?
Pyrrhus: Existing
Glaucon: playing one game that was made for it?
Glaucon: Where does this info come from?
Pyrrhus: Memes?
Glaucon: Sometimes I swear you just make stuff up
Glaucon: and it’s honestly annoying, everyone else here thinks I’m retarded and says so, and yet you annoy me way more with your suggestions than they do
Glaucon: stop telling me what to use dude, Jesus
Pyrrhus: I was just suggesting, not demanding that you use Windows 2000.
Pyrrhus: I recommended WINE and 2000 over 98, I did not tell you to use them.
Glaucon: I recommend not recommending me things
Adeimantus: too late
Glaucon’s annoyed tirade against Pyrrhus is interrupted by the arrival of Socrates.
Socrates: we never spoke more about BGP
Glaucon: yes
Glaucon: alright let me make a coffee
Glaucon: to prepare myself
Lord of the routes
Glaucon: Socrates, all right, I have my caffeine, let’s do this
Glaucon: So to recap: 3
Glaucon: a BBS is just software on a server/computer somewhere that you connect to, FidoNet is a network of BBSes, Usenet is a network that uses the NNTP news protocol, email is files sent using the SNTP protocol, and a router is any computer/device that routes IP traffic, is that all correct?
Socrates: SMTP, but sure
Glaucon: I was close
Socrates: strictly, routers are about interconnecting networks—they route between networks
Socrates: there are other devices like switches that move IP traffic around inside of networks
Glaucon: You mean different networks?
Socrates: yes, different networks
Glaucon: Ahh, that explains a lot
Socrates: example-network-diagram.png
Glaucon: And the blue circles in this image are routers?
Socrates: yes
Socrates: so see how each network/AS has a number and an IP prefix
Socrates: the blue network at the top is ASN894 and announces 71.19.19.0/24
Glaucon: AS?
Socrates: Autonomous System
, which is just a legacy term for network
Glaucon: some lines are filled and one is dotted, what’s that mean?
Glaucon: I’m still trying to orient myself in this image
Socrates: the dotted line is just an unused link, we’ll get to that soon
Working outward
Socrates: let’s look at the yellow network for now
Socrates: the router in the yellow network says to its peers I am
71.19.88.250
, I represent 71.19.88.128/25
Socrates: it only has one peer, the router at 12.99.1.1
, which is the router for ASN 999
Glaucon: So it’s saying its address as the router, and the addresses it represents?
Socrates: yes
Glaucon: a peer is a single node you’re connected to?
Socrates: another router you’re connected to, yes
Socrates: in this instance, it’s someone’s PC running router software—but it’s only talking to 12.99.1.1
, which is a hardware router—that is, just a specialized computing appliance that only runs routing software
Glaucon: Right, any computer could be used as a router
Socrates: but now the pink router knows: if I ever get a packet that matches
71.19.88.128/25
, I forward it on out the network port connected to the yellow network router at 71.19.88.250
Socrates: the pink router replies, essentially saying I can reach or forward to the rest of the inter-network network
Socrates: so the yellow router knows it can reach the pink, green, blue, and red networks announced on the left port of the router at the pink network
Socrates: the basic trick is that for each link, the entire network is represented: one half on one end, and the other half on the other end
Socrates: so, does the negotiation between yellow and pink make sense?
Glaucon: I’m trying to register it
Socrates: think about standing hand in hand in a line of friends
Socrates: on your left hand will be one half of your friends
Socrates: on the right hand will be the other half
Socrates: you’re the router between them
Glaucon: Right
Glaucon: And the routers you’re connected to tell you who they’re connected to
Socrates: yeah
Glaucon: and when you get a packet, you pass it on to the router that represents that address, and if it handles that computer directly it sends it directly—and if not, it sends it on
Glaucon: like the Pony Express
Glaucon: I understood that basic part, at least
Glaucon: I thought it was something more
Socrates: OK, so lets say we’re 71.19.88.201
, in the yellow network, top left
Socrates: we want to send a packet to 12.99.2.1
, the computer in the pink network, top left again
Socrates: the packet goes to our router
Socrates: the router says: what interface has announced an IP prefix that matches
12.99.2.1
?
Socrates: it looks at the peers it has, in this case pink, and looks to see if there is a matching prefix announced there
Glaucon: interface
in this instance meaning router
?
Socrates: interface
meaning a network port
Socrates: routing is very physical
Socrates: it’s about sending packets down the right wires to get it to the computer it needs to be
Socrates: in the analogy, your left and right hands are interfaces of the router Glaucon
Glaucon: Right
Socrates: so the yellow router has 1 interface
Socrates: and 1 peer
Glaucon: So when it finds an interface that has announced an IP prefix, the pink router, it sends the packet to the pink router?
Socrates: and it knows that the peer on that interface has announced a bunch of prefixes, but you can see the bottom prefix is there on the left interface of the pink router
Socrates: so the yellow router knows the matching prefix for
12.99.2.1
is towards the pink router
Socrates: sends the packet that way
Socrates: and its job is done
Glaucon: Right
Glaucon: And most routers are connected to only a few interfaces, I’m guessing?
Socrates: it varies
Glaucon: like my router in my house is connected to only so many interfaces, I’m guessing
Socrates: the router in your house isn’t a real
router but we’ll talk about that later
Glaucon: and the ISP has its own interface somewhere that routes traffic towards a lot more interfaces
Glaucon: alright, that’s fair
Socrates: lets keep our heads up at the inter-university level just now
Socrates: (I mean, it is a real router but it does so in different ways related to how ISPs have run out of IPs, etc, and it’s all very messy)
Socrates: (it doesn’t use BGP either since it doesn’t do any kind of complex routing either)
Socrates: so
Socrates: happy with the discussion between the yellow network and the pink network?
Glaucon: Yes, now that you’ve explained we’re only talking about inter-university, it all makes much more sense now
Socrates: OK
Glaucon: I was imagining some of those routers as home routers, so this simplifies it a lot
The ol’ route-and-switch
Socrates: lets talk about pink to green
Socrates: so pink has three interfaces here
Glaucon: Now, both pink and green have the router
Glaucon: the blue circle
Socrates: yellow has a router as well
Socrates: just it’s not a hardware router
Glaucon: and a blue square, what’s that?
Socrates: the blue square is a switch
Socrates: it basically just moves packets around inside a network
Socrates: it doesn’t do any complex thinking
Socrates: the inside of the networks is irrelevant, but I’ve added a bunch of different looking networks to show that really it can be anything: we’re only interested in the links that move across the borders of networks
Glaucon: So, it routes traffic within a single network, is that it?
Glaucon: As opposed to a router which routes traffic between networks, is that the distinction?
Socrates: switches are basically interface multipliers
Socrates: you want a router to be as fast and as simple as possible
Glaucon: So with the switch, the router sends the file to the switch, and the switch simply figures out which computer is the right destination?
Glaucon: taking some of the load off of the router?
Socrates: for the sake of simplification: a switch is a bunch of interfaces/Ethernet ports
Socrates: any packet that arrives on any interface is copied to every port out
Socrates: look at 12.99.3.1
Socrates: it only has 1 interface/port
Socrates: so to talk to other computers, it sends a packet to the switch which duplicates it and sends it to all the other computers connected
Socrates: in this way, a computer with only one port can speak to many other computers without having to be re-plugged all the time
Glaucon: Right, that was my second guess
Socrates: but it’s not important other than for interest here
Glaucon: so a switch is even simpler, it receives a packet, and duplicates it to every computer, and if that computer is the right address, it’ll accept the packet?
Socrates: yes, computers do not generally accept packets that do not have their IP
Glaucon: So the switch is an extremely dumb
piece of hardware/software then
Glaucon: dumb as in dumb terminal
Abandon all hope, ye who traverse here
Socrates: let’s define a router:
Socrates: a router is a device with n interfaces
Socrates: interface 0 connects to its own network
Socrates: interfaces 1..n connect to other networks, and internally are marked with which prefixes are available via that interface
Glaucon: n interfaces? the n being a variable or?
Socrates: yes, a variable
Socrates: so you could have a router with 2 ports: one that goes to a peer, and one that goes to the internal network
Socrates: let’s look at pink
Socrates: the pink router has 4 interfaces:
Socrates: * interface 1 connects to the yellow network
Socrates: * interface 2 connects to 12.99.2.1
Socrates: * interface 3 connects to a switch (which is connected to the other computers)
Socrates: * interface 4 connects to the green network
Socrates: see how we’ve taken a four-port router and been able to connect it to six machines, two of which (yellow and green) are routers for other networks?
Glaucon: Yes
Glaucon: I do actually
Socrates: OK
Socrates: so, interface really does mean port, you’re already familiar with this, we’re just giving it a different name now
Socrates: but for the purpose of routing, we can pretend that pink router only has three
Socrates: one (set of) interface that goes towards the internal network
Socrates: and two interfaces which peer with other routers
Socrates: so let’s talk about the peering connection between pink and green
Glaucon: right right
Glaucon: I’m caught up
Socrates: the pink router already knows I represent my own network,
12.99.0.0/16
Socrates: I also can forward packets to
71.19.88.128/25
out my left interface
Socrates: with this in mind, it connects to whatever is out its right interface towards green and says:
Socrates: I am
12.99.1.1
, and I represent 12.99.0.0/16
(ASN999). I can also forward packets for 71.19.88.128/25
(ASN1)
Socrates: so the green router now knows that if it ever receives a packet for either of those prefixes, it should send it that way
Socrates: when green sends a matching packet left, it will first arrive at pink
Socrates: pink will then look to see if it matches its own network: if it does, it will send it down the internal network interface
Socrates: if it does not, it looks to see if it matches any of the other prefixes it knows, such as the prefix for yellow
Socrates: if it matches yellow, it will send the packet left again, where the router at yellow will check that it matches, and if it does, will send it to the internal network
Glaucon: yes
Glaucon: I understand how a postal network works
Glaucon: I thought we were going more specific
Socrates: this really is how it works
Socrates: the entire internet is just routers promising they can see other networks on their peers’ behalf
A network of your peers
Glaucon: Okay, then what is BGP?
Socrates: BGP is the protocol they speak to promise that
Socrates: I am
12.99.1.1
, and I represent 12.99.0.0/16
(ASN999). I also can forward packets for 71.19.88.128/25
(ASN1)
Socrates: this is what BGP says
Socrates: look at green, though: it has three peers, and as a result has to send a complicated set of prefixes out of each interface
Glaucon: it’ll say to each router, that it can forward packets to the other two, as well as the two interfaces on its own internal network, yes?
Glaucon: a bit of a mouthful
Socrates: not just the networks it’s connected on the other two
Socrates: but also the networks the other two are themselves connected to
Socrates: so look at red, but go down the link towards green
Socrates: the green side says I can connect to yellow and pink, and myself, and blue
Glaucon: Right
Socrates: (the bottom red at the right hand interface of green is a mistake: green shouldn’t announce that it can reach red, to red)
Socrates: but tbh we’ve now just discovered why the internet is a miracle that it works
Socrates: BGP has no provision for verification or security
Socrates: red could say very loudly I CAN REACH YELLOW!
Socrates: at which point green might say OK, the best way to get to yellow is via red
Socrates: and now red can spy on every message that was intended for yellow
Socrates: the way this is mostly done is because every ASN has a legal owner, and generally you actually know the people you directly peer with
Socrates: you’ve run a cable to them, and promised each other to peer between
Socrates: ISPs tend to have routers all in the same building, known as points of presence where they agree to exchange traffic with each other
Socrates: here’s an example of one such organization holding a peering building: https://ixleeds.net/members.shtml
Socrates: JISC, ASN786 is the UK’s national academic network
Socrates: they probably connect to a lot of those other networks in Leeds
Socrates: Hurricane Electric at the bottom, for example, is a big backbone provider for things like fast transit across the oceans
Socrates: Akamai are a CDN who provide distribution for things like YouTube
Socrates: here is the information for ASN786 (JISC): https://peeringdb.com/net?asn=786
Socrates: you can see that JISC holds 400 IPv4 prefixes and 20 IPv6 prefixes, which generally route out to the few hundred universities, colleges, and research institutions in the UK
Socrates: you can see the rules and details for peering with them here: https://community.jisc.ac.uk/groups/janet-peering-policy
There is a long silence. At long last, it seems that Glaucon’s curiosity has been sated—or perhaps simply overwhelmed—and he says nothing further for the rest of the evening.
Epilogue
The lull in the conversation prompts an observing Pyrrhus to raise a challenge to one of Socrates’ teachings.
Pyrrhus: There’s a difference between a switch and a multiplier 4
Socrates: yes
Socrates: I know it’s not a hub
Socrates: but I didn’t want to get into the concept of switch interface learning
Socrates: to do that we then have to talk about mac addresses, etc
Socrates: and tbh that was unrelated to the discussion at hand
Pyrrhus: The switch just ties a IP to a MAC address and then will send a packet destined for a IP to the right MAC address. Or the other way round.
Socrates: yes
Socrates: but then we get into discussions for thins like ARP
Socrates: and I didn’t fancy that when we’re balls-deep in BGP
The Cretin Cephalus also takes an interest.
Cephalus: a layer two switching bridge has to use ARP to figure out who has what IP address, to send packets to the right port
Socrates: I once saw Who has
fly by on Wireshark 5127.0.1.1
Socrates: which had me creased
Cephalus: oh my god
Cephalus: lmao
Cephalus: aaaaaaaaaaaaaaaaaaaaaaaaa
Socrates: I have no idea what must have been so fucked as to ask that 6
Socrates: closed my eyes and moved on
Cephalus: who gets to go to computer prison
Cephalus: don’t drop your soap… I’ll help you ;)
-
Wine Is Not an Emulator, a software compatibility layer that allows some Windows applications to run on GNU/Linux, *BSD, and other POSIX-fearing operating systems. ↩
-
Pyrrhus is alluding to Interix, a POSIX-conforming UNIX subsystem that was available for Windows NT. ↩
-
Socrates’ simplified explanation asserted that a switch repeats traffic it receives down all its ports, multiplying the data. This is in fact what a simpler device called a hub does, and is what Pyrrhus means here. Switching technology is so commonplace now that hubs are rare outside of legacy networks. ↩
-
Wireshark is a free and open-source packet analyzer for decoding network packets of various kinds, often used for diagnosis of network issues or for reverse engineering. ↩
-
Per RFC 3330, any IPv4 address in the range
127.0.0.0/8
—that is, any address with the first of its four octets being127
—is a local address, and should always return directly to the same host that sent it, generally without crossing any network links. Seeing such an address appear in network traffic is unusual and almost certainly wrong. ↩