Chapter 10 - Internet Routing
The United States Department of Defense was most concerned about the second point. They put together a task force under ARPA (Advanced Research Projects Agency) to develop a new kind of network that was highly redundant, because the US government was worried that as computer networks developed to be increasingly important to national security, foreign actors were going to make strategic attacks with traditional and nuclear weaponry that would cripple national communications.
Now, ARPA claims this was not the case, but it's such a compelling story and the government regularly lies about their intentions so who knows:
According to Charles Herzfeld, ARPA Director (1965-1967):
The ARPANET was not started to create a Command and Control System that would survive a nuclear attack, as many now claim. To build such a system was, clearly, a major military need, but it was not ARPA's mission to do this; in fact, we would have been severely criticized had we tried. Rather, the ARPANET came out of our frustration that there were only a limited number of large, powerful research computers in the country, and that many research investigators, who should have access to them, were geographically separated from them.
So out of all these factors, ARPANET was developed and later rebranded into Internet. The "Network of Networks".
The Internet works by creating a new message format for computers to talk to each other, that contained enough information for those messages to not just get sent across local Ethernet networks, but also make their way across networks without utilizing bridging.
Instead, Internet Protocol introduces the idea of routing. Unlike Ethernet where messages have one single defined path through a series of switches, and loops cause major network-crashing violations, Internet Protocol relies on these redundant connections and encourages multiple redundant paths.
Under Internet Protocol, dedicated computers called Routers keep a list of other routers, and a list of what IP address ranges those routers can deliver messages to, and how expensive it would be to utilize that link. Expense here is somewhat arbitrary, but for Internet Protocol specifically we tend to look at expense in terms of milliseconds until delivery (like ping latency).
Imagine three routers all attached together. Not in a star network, but in a triangular network.
Here, node A would keep a list of routes to C. It would know that it can reach C by link 2. But it would also know that it can reach C by link 3. It chooses link 2 by default because it knows that link 3 takes longer to reach C because it has to pass through B.
Each node here advertises a list of networks it is responsible for. So node A could advertise it is responsible for all addresses starting with the 7 bits 1010101 or 5 bits 11111. Node C could advertise it's responsible for addresses starting with the 8 bits 11101110.
So whenever node A would want to send a message to, for example, Internet Protocol address 11101110.11010101.01010110.10101110 it can check its list to see that node C is responsible for addresses that start the way this one does, and that both links 2 and 3 can reach C but link 2 is the least expensive to use.
The core set of routers on the Internet, that Internet Service Providers hook into, build these lists by using path finding algorithms that are a lot like the ones used in video games. Just like in a video game where too many path finding elements can slow things down, on the Internet only so many routers are actually a part of this core network. We can't hook all the routers in the world in directly or else we end up with scaling issues like with Ethernet. So we treat the few routers very specially. Each ISP typically has just a couple, called Border Gateways since they form a border around each ISP's network and serve as a gateway between networks.
The networks inside border gateways are called Autonomous Systems, because they operate independently with respect to whatever address prefixes they advertise responsibility for. Traffic destined for addresses within the AS never leave the AS or get routed to another AS. There are about a hundred thousand Autonomous Systems currently in operation as the Internet has grown over time, each one advertising the network address prefixes it's responsible for.
Among the Border Gateways, path finding algorithms form all these destination lists and route expense lists automatically so that as the network changes because of outages, the lists can update in real time. These path finding algorithms are implemented by something called Border Gateway Protocol (BGP). BGP is complicated in operation, so it's best to just accept that it works and look the other way.
Here we have a sample Internet that contains only four Internet Service Providers, and only two computers. One is your computer, one is my computer. You're on an Ethernet network with a modem somewhere on the Ethernet network. My PC is attached directly to a modem over Serial. Both of these were relatively common configurations to use Dial-Up Internet with an ISP like AOL (America Online).
Let's say you want to send me something across "The Internet" where everything is set up as pictured here. You would wiggle the voltages on the Ethernet cable coming out of your PC's network card to represent bits in roughly this pattern. The Ethernet frame format is legit, but I fudged the format of the Internet Protocol packet a little because real IP packets have a bunch of extra bits of data that aren't really needed to explain the concepts
// Ethernet synchronization preamble
10101010 10101010 10101010 10101010 10101010 10101010 10101010 101010
11 // Ethernet message begin
// Source MAC (Alisa's Computer, 10:20:30:40:50:60)
00010000 00100000 00110000 01000000 01010000 01100000
// 1 0: 2 0: 3 0: 4 0: 5 0: 6 0
// Destination MAC (ISP Gateway's MAC, 11:22:33:44:55:66)
00010001 00100010 00110011 01000100 01010101 01100110
// 1 1: 2 2: 3 3: 4 4: 5 5: 6 6
// Length of data (0x0012 / 18 bytes)
00000000 00010010
// --- Ethernet Data Begin ---
// Contains an Internet Protocol message ("a packet")
// Source Address (Alisa's IP Address)
00001111 00010111 00101100 00000001
// 15. 23. 44. 1
// Destination Address (g's IP Address)
00010010 00101011 01000000 00000001
// 18. 43. 64. 1
// Protocol Type: User Datagram Protocol (17 aka 0x11)
00000000 00010001
// Source Port (14459 - usually chosen at random)
00111000 01111011
// Destination Port (23 - common for "telnet" service)
00000000 00010111
// Data Length (2)
00000000 00000010
// UDP Data Hash
01101010 11011001
// Data ("hi")
01101000 01101001
// h i
// --- Ethernet Data End ---
// Ethernet frame data hash
10010101 00100110
Aaaaanyways, the point here is that we're layering protocols to allow a message to traverse multiple network types and go from Internet-connected device Alisa's PC to Internet-connected device g's PC
We've stuffed an Internet Protocol packet inside an Ethernet Frame.
With this layering, we've now achieved the bottom 3 parts of the OSI networking model. Posting another OSI Model chart to refer to: