swyxio / swyxdotio

This is the repo for swyx's blog - Blog content is created in github issues, then posted on swyx.io as blog pages! Comment/watch to follow along my blog within GitHub
https://swyx.io
MIT License
336 stars 45 forks source link

Networking Essentials: Router Design #259

Closed swyxio closed 2 years ago

swyxio commented 2 years ago

source: devto devToUrl: "https://dev.to/swyx/networking-essentials-router-design-ahc" devToReactions: 18 devToReadingTime: 3 devToPublishedAt: "2018-09-26T03:33:05.762Z" devToViewsCount: 212 title: "Networking Essentials: Router Design" published: true description: A small detour into Router Hardware! tags: Networking

This is the fifth in a series of class notes as I go through the free Udacity Computer Networking Basics course.

Let's make a router!

Basic Router Architecture

Here is the basic job of a Router:

  1. Receive packet
  2. Look at header to determine destination
  3. Look up forwarding table to determine output interface
  4. Modify header (e.g. Decrementing TTL - Time to Live field and updating header checksum)
  5. Send packet to output interface

All this is done through a single Line Card, each of which has: a lookup table, ability to modify headers, and a buffer for packets coming in and out of the card. A router connects a bunch of Line Cards via an Interconnection Fabric.

Two things of note:

Maximal Matching in Crossbar Switching Algorithm

Maximal matching between N inputs and N outputs means:

Head of line blocking is where there are a lot of packets destined for the same output ahead of another packet that ought to be sent to a different output (and therefore shouldn't wait for the others to clear). The solution is Virtual Output Queues where we establish one queue per output port.

Scheduling and Fairness

Crossbar switching involves scheduling - the two goals here are:

Max-min fairness can be achieved by:

Next in our series

Hopefully this has been a good high level overview of Routing protocols and BGP. I am planning more primers and would love your feedback and questions on: