YouTube2Text

4.2 What's inside a router? Part 1. — Transcript

by JimKurose · 2,366 words · 359 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:09having over viewed the network layers
  3. 0:12data and control planes and
  4. 0:14understanding the difference between
  5. 0:16routing and forwarding we're ready to
  6. 0:18now dive down deeply into the forwarding
  7. 0:21function in the network layer that is
  8. 0:23how our packets move from a routers
  9. 0:25input port to the appropriate output
  10. 0:28port and there's going to be a lot of
  11. 0:30ground to cover here and so we're going
  12. 0:31to do this in two parts in the first
  13. 0:33part we're going to look at a generic
  14. 0:35router architecture to look at the input
  15. 0:37ports the output ports and the switching
  16. 0:40fabric for moving data grams from input
  17. 0:42to output in the second part we're gonna
  18. 0:45dive down deeply into the issues of
  19. 0:47packet scheduling and packet buffering
  20. 0:50tremendously important topics so it's a
  21. 0:53lot to cover here so let's get started
  22. 0:55the figure that will be developing here
  23. 0:57shows the major components of router
  24. 0:59architecture let's start with the input
  25. 1:02and output ports this is where the
  26. 1:04physical and the link layers are
  27. 1:05implemented the link layer and physical
  28. 1:08layer might be wired Ethernet optical
  29. 1:10fiber or some kind of wireless
  30. 1:12technology and of course keep parts of
  31. 1:14the network layer are also implemented
  32. 1:17in the input and output ports the number
  33. 1:20of ports in a router can vary from very
  34. 1:22small say half a dozen in a home router
  35. 1:24to many hundreds of interfaces ports in
  36. 1:27a backbone router each operating at many
  37. 1:29gigabits per second packets are moved
  38. 1:32from the input ports to the output ports
  39. 1:34under router control through a switching
  40. 1:36fabric and this really is the heart of a
  41. 1:39router this is the place to which all
  42. 1:40packets must pass and as we'll see it's
  43. 1:43really a network within a network router
  44. 1:45a router also has a routing processor
  45. 1:48often just a regular CPU that performs
  46. 1:52control plane functions controls the
  47. 1:53switch fabric and installs forwarding
  48. 1:56tables at the input ports as shown here
  49. 1:58on this diagram we can also pretty
  50. 2:01clearly distinguish the router
  51. 2:03components that belong to the data plane
  52. 2:05that operate at high speed and are
  53. 2:07implemented in hardware in the control
  54. 2:09plane which is implemented in software
  55. 2:11and running it's slower timescales
  56. 2:16let's now zoom in on the input port and
  57. 2:19starting from the left let's see what we
  58. 2:20see here shown in green here we see a
  59. 2:23line termination function this is really
  60. 2:25the physical layer it's responsible for
  61. 2:27receiving the bit level transmissions
  62. 2:29over the physical medium whether it be
  63. 2:31copper fiber or Wireless then there's
  64. 2:34the link layer function shown in blue
  65. 2:36here where bits are assembled into link
  66. 2:38layer frames like the Ethernet frames
  67. 2:40that will study later and finally shown
  68. 2:43in red here there's the network layer
  69. 2:45functions at the input port PACA queues
  70. 2:48may form here we'll cover that shortly
  71. 2:50but for now the thing to remember is
  72. 2:52that the most critical network layer
  73. 2:54function performed at the input port is
  74. 2:56the lookup and forwarding function
  75. 2:59determining the appropriate output port
  76. 3:01to which the arriving packet will be
  77. 3:03forwarded through the switching fabric
  78. 3:05this lookup and forwarding is a type of
  79. 3:08match plus action behavior in
  80. 3:11traditional routers the destination
  81. 3:13address in the packets header that is
  82. 3:16the IP address of the destination host
  83. 3:18is going to determine the appropriate
  84. 3:20output port to which the packet will be
  85. 3:23forwarded or directed through the
  86. 3:25switching fabric and we'll take a look
  87. 3:27at that in just a second a little bit
  88. 3:29after that we'll take a look at
  89. 3:30generalized forwarding where the
  90. 3:32appropriate output port is determined or
  91. 3:34can be determined by many fields in the
  92. 3:37network layer header the link layer
  93. 3:38frame header or the transport layer
  94. 3:40segment header for example it's possible
  95. 3:43under generalized forwarding for packets
  96. 3:45a containing TCP segments bound for a
  97. 3:48particular destination and say coming
  98. 3:50from a particular source host to be
  99. 3:53directed to one output port but have
  100. 3:55packets say containing UDP segments from
  101. 3:57that source IP address to be directed to
  102. 4:00a different output port or maybe not to
  103. 4:02be forwarded at all but we're getting
  104. 4:05ahead of ourselves here so let's get
  105. 4:07started with destination based
  106. 4:08forwarding what you see here is a simple
  107. 4:12example of a forwarding table and when
  108. 4:14we think about forwarding tables the
  109. 4:16first thing to consider is well there
  110. 4:18are 2 to the 32 almost 4 billion
  111. 4:21possible destination addresses
  112. 4:24we certainly don't want a routing table
  113. 4:26entry for each possible destination
  114. 4:28address so it probably won't surprise
  115. 4:30you that routing table entries are often
  116. 4:33aggregated into ranges as we see here in
  117. 4:36this particular example any packet with
  118. 4:39a destination address in this first
  119. 4:41range of destination addresses goes to
  120. 4:44output port or interfaces zero packets
  121. 4:47with a destination address and the
  122. 4:49second address range going to interface
  123. 4:51one and in this third address range
  124. 4:53going to interface two and otherwise the
  125. 4:56default outgoing interface is going to
  126. 4:58be interface three in this example well
  127. 5:02this all works out pretty nicely and
  128. 5:04looks pretty simple but of course the
  129. 5:06devil is in the details as the saying
  130. 5:08goes what happens for example when say
  131. 5:11packets with a destination address and
  132. 5:13some subset of addresses in this first
  133. 5:16range should go to interface three
  134. 5:18rather than interface zero well of
  135. 5:22course we could split the first address
  136. 5:24range into multiple pieces and then add
  137. 5:27in this new sub range with its new
  138. 5:29destination output port but it turns out
  139. 5:32there's a much more simple and more
  140. 5:34elegant way to do this and this is known
  141. 5:36as longest prefix matching well longest
  142. 5:41prefix matching is relatively simple
  143. 5:43instead of using explicit ranges to
  144. 5:46perform matching as we saw in the
  145. 5:48previous slide we want to work with
  146. 5:50address prefixes as shown here here
  147. 5:53we've got a table with four entries the
  148. 5:55link to the first prefix here is 21 bits
  149. 5:571 1 0 0 1 0 0 0 0 0 0 1 0 1 1 1 0 0 0 1
  150. 6:060 that's 21 bits the length of the
  151. 6:08second prefix is 24 bits so it's a
  152. 6:11longer prefix and the third prefix also
  153. 6:14has 21 bits the stars at the right
  154. 6:17they represent wildcards or sort of
  155. 6:19don't care bits they're not part of the
  156. 6:22prefix they represent the bits in the
  157. 6:24address range if you will and so you can
  158. 6:26see here that address ranges and
  159. 6:28prefixes really are the same things but
  160. 6:30as we'll see it's a lot easier to work
  161. 6:33with address prefixes rather than
  162. 6:35address ranges
  163. 6:36and the longest prefix matching rule
  164. 6:38works as follows for a 32 bit IP address
  165. 6:42to match a prefix all the leftmost bits
  166. 6:45each and every one of that address must
  167. 6:48match the ones and zeros in the prefix
  168. 6:51and among all of the prefixes that match
  169. 6:54we want to find the longest one the
  170. 6:56longest prefix match is sometimes also
  171. 6:58called the most specific match since the
  172. 7:01largest number of leftmost address bits
  173. 7:03are going to be matched take a look at
  174. 7:05the addresses here at the bottom can you
  175. 7:08figure out the prefixes to which they
  176. 7:10match under the longest prefix matching
  177. 7:12rule why don't you pause and think about
  178. 7:15that well the first example here only
  179. 7:19matches the prefix in the first row of
  180. 7:21the table so that's easy the second
  181. 7:23address those more interesting it's 21
  182. 7:26leftmost bits match this third table
  183. 7:28entry but its first 24 bits that's the
  184. 7:31second table entry the longest prefix
  185. 7:34matches thus the second table entry and
  186. 7:36a packet with this address would be
  187. 7:38forwarded to interface one associated
  188. 7:41with the second table injury rather than
  189. 7:43to interface two if you understand these
  190. 7:46examples you've definitely got the
  191. 7:48longest prefix matching rule down we'll
  192. 7:52see shortly that longest prefix matching
  193. 7:54dovetails really nicely and very
  194. 7:56naturally with Network addressing well
  195. 7:59as we mentioned earlier this match plus
  196. 8:02action is usually carried out in
  197. 8:03hardware the matching is often done
  198. 8:06using what are called ternary content
  199. 8:08addressable memories T Kam's where
  200. 8:11address is presented to the T cam and
  201. 8:13the matching values returned in one
  202. 8:15clock cycle regardless of table size T
  203. 8:18Cam's thus result in really really fast
  204. 8:20look ups once a packets appropriate
  205. 8:24output port has been determined by
  206. 8:26longest prefix matching the packets
  207. 8:28ready to be forwarded into the switching
  208. 8:30fabric let's take a look at what happens
  209. 8:32inside that switching fabric the
  210. 8:34switching fabric is at the very heart of
  211. 8:37a router it's job is to transfer a
  212. 8:39packet from the input side of the
  213. 8:41switching fabric to the output side of
  214. 8:43the switching fabric that is to move a
  215. 8:45packet from the input port to the output
  216. 8:48port that's been determined by the
  217. 8:49longest
  218. 8:50prefix match one of the most important
  219. 8:53characteristics of the switching fabric
  220. 8:54is its switching rate that is the
  221. 8:57maximum rate at which packets can be
  222. 8:59moved from an input port to an output
  223. 9:02port if there are n inputs with incoming
  224. 9:05rate R and the switch has a switching
  225. 9:07rate of n times R then all of the
  226. 9:09packets that arrive in some unit of time
  227. 9:11can be switched in their output ports
  228. 9:14during that much time in this case
  229. 9:16packets won't experience much of a
  230. 9:18significant weight on the input side of
  231. 9:20the switch this is known as a
  232. 9:22non-blocking switch but high speed non
  233. 9:25blocking switches are more expensive
  234. 9:27than switches that might say only
  235. 9:28occasionally block packets and force
  236. 9:30them to wait at the inputs and so not
  237. 9:33all routers have non-blocking switch
  238. 9:35fabrics if there's blocking then packets
  239. 9:38are going to have to wait their turn to
  240. 9:40be transferred through the switch fabric
  241. 9:42in these red boxes here on the input
  242. 9:44side of the switch fabric and this is
  243. 9:46known as input port queuing now the
  244. 9:49topic of how to build high speed
  245. 9:51efficient economical switching fabrics
  246. 9:54is itself a field study actually there
  247. 9:56are entire courses dedicated to this
  248. 9:58topic and so you might want to take one
  249. 10:00if you find this interesting so here
  250. 10:02we're only going to touch very lightly
  251. 10:04on this topic as shown here we can
  252. 10:08broadly identify three approaches
  253. 10:10towards switching switching via memory
  254. 10:12switching via bus and switching via an
  255. 10:16interconnection network and it's really
  256. 10:18this latter approach that's probably the
  257. 10:20most widely adopted in practice well way
  258. 10:23back in the day that's to say in the
  259. 10:251970s and 1980s the first routers were
  260. 10:28really pretty much traditional computers
  261. 10:31with switching between input and output
  262. 10:33ports being done under direct control of
  263. 10:36a CPU which you could sort of think of
  264. 10:38as a routing processor input and output
  265. 10:41ports functioned as traditional IO
  266. 10:43devices in a traditional operating
  267. 10:45system an input port with an arriving
  268. 10:48packet would signal the CPU via an
  269. 10:50interrupt the packet could then be
  270. 10:52copied from the input port buffers into
  271. 10:54processor memory the CPU would then use
  272. 10:57the destination address to look up the
  273. 10:59appropriate output port
  274. 11:01the output device in the forwarding
  275. 11:03table and then write that packets
  276. 11:05contents into the output devices buffers
  277. 11:08and so in many ways you can see the
  278. 11:10network ports were really just another
  279. 11:12type of i/o device rather than moving a
  280. 11:15packet from an input port to memory and
  281. 11:18then from memory to an output port
  282. 11:20switching via bus skips that
  283. 11:22intermediate transfer to memory and
  284. 11:25allows an input port to write the packet
  285. 11:27directly into the output port buffers
  286. 11:30this means a packet only has to cross
  287. 11:32the bus or the backplane once rather
  288. 11:34than twice and in this case the
  289. 11:37switching speed is limited to be the bus
  290. 11:39bandwidth the third type of switching
  291. 11:41fabric are interconnection networks and
  292. 11:43really these are the most interesting
  293. 11:45interconnection fabrics and routers
  294. 11:47share a lot in common with
  295. 11:49interconnection networks that have been
  296. 11:50used for decades to connect processors
  297. 11:53together in multiprocessor computing
  298. 11:55systems there are crossbar switches that
  299. 11:58directly connect in inputs and outputs
  300. 12:01through N squared interconnection points
  301. 12:04but more typically when connecting n
  302. 12:06inputs to n outputs multistage switching
  303. 12:09networks know generally as clost
  304. 12:11networks are used these multistage
  305. 12:14switching networks are made up by
  306. 12:16interconnecting smaller sized switch
  307. 12:19elements both serially that is in
  308. 12:21multiple linear stages and in parallel
  309. 12:24across a given stage in the example
  310. 12:26shown here and 8x8 switching network is
  311. 12:29made up of four four by four and four
  312. 12:32two by two smaller switches will seek
  313. 12:35lost networks again when we learn about
  314. 12:37how hosts are interconnected in data
  315. 12:39center networks because these switching
  316. 12:41fabrics have parallel paths from their
  317. 12:43input side to their output side we want
  318. 12:46to be able to leverage these paths in
  319. 12:48parallel and so it's common with these
  320. 12:50switching fabrics to divide a single
  321. 12:52data graham into multiple smaller fixed
  322. 12:55length units sometimes called cells and
  323. 12:57to switch these cells along parallel
  324. 13:00paths from the input to the output side
  325. 13:03of the switching fabric the original
  326. 13:05Datagram is then reassembled from those
  327. 13:07component cells that it was divided into
  328. 13:10at the output port after all the data
  329. 13:12grams pieces of a
  330. 13:16well so far we've thought of a switching
  331. 13:19fabric really is a single entity but as
  332. 13:22we just saw with interconnection
  333. 13:23networks parallelism can be exploited to
  334. 13:26build high-performance switches and this
  335. 13:29idea can be generalized to taking
  336. 13:30multiple switching fabric planes and
  337. 13:33using them in parallel as shown here in
  338. 13:36this diagram here is actually a
  339. 13:38schematic of Cisco's carrier routing
  340. 13:40system and has a basic unit with eight
  341. 13:42parallel switching planes each of which
  342. 13:45internally has a three-stage
  343. 13:47interconnection network as you can see
  344. 13:49by exploiting parallelism hundreds of
  345. 13:52terabytes of switching capacity can be
  346. 13:54achieved within a single router so that
  347. 13:58wraps up our first of two parts on
  348. 14:00what's inside a router we took a look a
  349. 14:02broad-brush view of what a router
  350. 14:04architecture looks like we saw the input
  351. 14:06ports switching fabrics and output ports
  352. 14:09and we looked at addressing in some
  353. 14:11detail what we're going to do next is
  354. 14:13we're going to dive down deep into the
  355. 14:15output ports in particular and take a
  356. 14:17look at packet buffering and packet
  357. 14:19scheduling
  358. 14:21[Music]
  359. 14:34[Music]

About this transcript

This page contains the full transcript of 4.2 What's inside a router? Part 1. by JimKurose, generated from the public captions YouTube serves with the video. The transcript has 2,366 words across 359 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.