YouTube2Text

Network Layer — Transcript

by Internet and Web Technologies · 3,098 words · 607 segments · language en · Watch on YouTube

Full transcript

  1. 0:00the network layer provides support for
  2. 0:03internetwork communication it
  3. 0:05facilitates packet forwarding and
  4. 0:07routing
  5. 0:07between devices on separate networks and
  6. 0:10enables end-to-end communication
  7. 0:13our discussion of the network layer will
  8. 0:15be split into two parts
  9. 0:16in this first lecture we will discuss
  10. 0:18the architecture of the internet
  11. 0:20how routers work the internet protocol
  12. 0:24and the structure of the ip packet
  13. 0:27in the following lecture we'll look into
  14. 0:29the various routing protocols which
  15. 0:31dictate the rules
  16. 0:32that routers and autonomous systems
  17. 0:34follow on how to forward packets such
  18. 0:36that they reach their final destination
  19. 0:38as efficiently as possible we will talk
  20. 0:41about
  21. 0:42shortest path algorithms like dijkstra
  22. 0:44and bellman ford
  23. 0:46and how they are used to route traffic
  24. 0:47on the internet
  25. 0:50the consequence of doing lectures in
  26. 0:51this order is that during this first
  27. 0:53lecture
  28. 0:54you have to assume that each router
  29. 0:56knows the best path to forward packets
  30. 0:58to
  31. 0:58and that this entire process is
  32. 1:00efficient
  33. 1:01more concisely if we are sending a
  34. 1:03message over the internet
  35. 1:04from computer a to b at each router we
  36. 1:08can use an oracle
  37. 1:09to determine which router will be the
  38. 1:11next hop
  39. 1:12the details about this oracle algorithm
  40. 1:14will be revealed in the next lecture
  41. 1:16as well as its runtime complexities
  42. 1:20a local area network or lan is a
  43. 1:23grouping of computers that are
  44. 1:24interconnected within a single physical
  45. 1:27network
  46. 1:28typically devices on a lan can easily
  47. 1:32communicate with each other
  48. 1:33but require special configuration in
  49. 1:35order to communicate with devices
  50. 1:37outside the local network networks
  51. 1:40are separated by routers a single
  52. 1:43network may have multiple routers
  53. 1:46each acting as a gateway between other
  54. 1:48networks
  55. 1:50if the topology of multiple connected
  56. 1:52networks is known beforehand
  57. 1:54and we have the mac addresses of all
  58. 1:56intermediate nodes
  59. 1:58this can be done solely through the
  60. 2:00datalink layer through the use of
  61. 2:01network bridges
  62. 2:03which are devices that connect two or
  63. 2:04more lands
  64. 2:07even with routers in play if we control
  65. 2:09the entire network
  66. 2:11we can communicate using just the data
  67. 2:13link layer
  68. 2:16when using the internet though we need
  69. 2:18to be able to communicate with networks
  70. 2:19that we don't own and are
  71. 2:22connected to routers that we have no
  72. 2:24control over
  73. 2:26the network layer facilitates delivery
  74. 2:28of these messages
  75. 2:30by getting us closer and closer to the
  76. 2:32final destination
  77. 2:33one hop at a time ipv4
  78. 2:37a network layer protocol facilitates
  79. 2:39communications between networks
  80. 2:41that are not known beforehand
  81. 2:45the most widely used protocol on the
  82. 2:47network layer is the internet protocol
  83. 2:50abbreviated ip it has two versions
  84. 2:54ipv4 and ipv6
  85. 2:58other protocols like icmp also exists
  86. 3:02but it's mainly used for error reporting
  87. 3:04purposes and its header is largely the
  88. 3:06same as the ip datagram
  89. 3:08with a few additional fields before your
  90. 3:11computer sends a message off to the
  91. 3:13internet
  92. 3:13it attaches an ip header to it this
  93. 3:16header for the most part stays the same
  94. 3:18at each hop along the path
  95. 3:20certain values like ttl are decreased
  96. 3:23but the address fields are maintained
  97. 3:25this is in contrast to data link layer
  98. 3:27protocols like ethernet
  99. 3:29and 802.11 where the frame headers are
  100. 3:32removed at each hop
  101. 3:34the ip header contains multiple fields
  102. 3:36the most important of which
  103. 3:38is the source and destination address
  104. 3:41addressing in ipv4 is done with ip
  105. 3:44addresses
  106. 3:45each device connected to the internet is
  107. 3:48identified by this
  108. 3:50these ip addresses are leased to
  109. 3:52individuals by internet service
  110. 3:54providers
  111. 3:55or isps your monthly internet bill
  112. 3:57includes payment for a temporary lease
  113. 4:00of an ip address from your isp's pool of
  114. 4:03available addresses
  115. 4:05you are not guaranteed the same ip
  116. 4:06address each time unless you pay for
  117. 4:08business class internet
  118. 4:10that includes a static ip
  119. 4:13ip addresses are a 32-bit number
  120. 4:15composed of four octets
  121. 4:17each octet is typically represented as a
  122. 4:20number from 0 to 255
  123. 4:22separated by dots for example
  124. 4:26172.6
  125. 4:31this format is called dotted decimal
  126. 4:34notation
  127. 4:36due to ip addresses being a 32-bit
  128. 4:38number
  129. 4:39there is an upper limit of 2 to the 32
  130. 4:42or roughly 4.2 billion addresses
  131. 4:45while enormous at the time of the
  132. 4:46internet's creation
  133. 4:48the wide adoption of it has caused these
  134. 4:51numbers to quickly deplete
  135. 4:53by january 2020 all ipv4 addresses
  136. 4:56have been allocated between various isps
  137. 4:59around the world
  138. 5:01this problem is called the ipv4 address
  139. 5:04exhaustion problem
  140. 5:07ip addresses are composed of two parts a
  141. 5:10network portion
  142. 5:11and a host portion the bits of an ip
  143. 5:14address
  144. 5:15designated for the network portion
  145. 5:18uniquely identifies the network
  146. 5:20while the host portion allows all
  147. 5:22devices on the network to share the same
  148. 5:24prefix
  149. 5:26by decreasing the size of the network
  150. 5:28portion you allocate more devices
  151. 5:30to a single host allowing them to have
  152. 5:33more
  153. 5:33connected devices
  154. 5:36by decreasing the number of bits in the
  155. 5:38networking portion
  156. 5:40you allocate more bits for the host
  157. 5:43components
  158. 5:44allowing a single network to have more
  159. 5:47devices
  160. 5:49the drawback to this is that you have
  161. 5:51fewer unique networks
  162. 5:53which exacerbates the ipv4 exhaustion
  163. 5:56problem
  164. 5:57especially if these hosts remain unused
  165. 6:00this next section is historical so we
  166. 6:02don't really use this nowadays
  167. 6:04but it helps us understand the ipe v4
  168. 6:07exhaustion problem better
  169. 6:09originally these network addresses were
  170. 6:11divided into network hosts
  171. 6:13at every eight bits or one octet
  172. 6:16creating three classes of addresses
  173. 6:19class a networks
  174. 6:20identified with a first octet in the
  175. 6:23range of 0 to 126
  176. 6:26had one octet for its network portion
  177. 6:29and 3 octets for the host portion
  178. 6:31this allowed for 2 to 24 minus 2
  179. 6:34or roughly 16 million devices per
  180. 6:37network
  181. 6:38class b addresses identified with the
  182. 6:41first octet
  183. 6:42in the range 128 to 191
  184. 6:48had two octets for the network portion
  185. 6:51and two octets for the hosts
  186. 6:54this allowed for 2 to the 16th minus 2
  187. 6:58or 65 534 devices per network
  188. 7:04finally we have class c addresses which
  189. 7:06are identified with
  190. 7:08the first octet in the range 192-223
  191. 7:14these had three octets for the network
  192. 7:16portion and one octet
  193. 7:18for the host this allowed for 2 to the 8
  194. 7:21minus 2 or 254 hosts
  195. 7:26the drawback to this classful system was
  196. 7:28because there were only three rigid
  197. 7:29sizes of ip address blocks
  198. 7:32small companies could outgrow their
  199. 7:33allocated class c address
  200. 7:35and their only option would be to either
  201. 7:37get another classy address
  202. 7:39and combine the two but this would
  203. 7:41create two separate ranges of ip
  204. 7:43addresses for a single organization
  205. 7:46their other option was to upgrade to a
  206. 7:48class b address
  207. 7:50giving them 256 times as much addressing
  208. 7:53space as they previously had
  209. 7:56this could also happen to organizations
  210. 7:58that outgrew their class b address
  211. 8:00but with the added complication that
  212. 8:03there could only ever exist
  213. 8:05126 class a addresses in modern
  214. 8:08applications
  215. 8:09we use classlist interdomain routing or
  216. 8:12cider
  217. 8:14insider instead of an entire octet of 8
  218. 8:17bits
  219. 8:17being changed at once a single bit is
  220. 8:20moved from the network to the hosts
  221. 8:23when using cidr ip addresses have two
  222. 8:26forms
  223. 8:27one to identify the network called the
  224. 8:29citer address
  225. 8:31this includes a network portion a host
  226. 8:33portion
  227. 8:34and a subnet identifier for example
  228. 8:3864.60
  229. 8:44the number after the slash represents
  230. 8:46the subnet identifier
  231. 8:48and specifies the number of bits that
  232. 8:51will be used for the
  233. 8:52network portion
  234. 8:56in this example 20 bits will be
  235. 8:58allocated for the network
  236. 9:01and the remaining 12 bits are used for
  237. 9:03hosts
  238. 9:05this network can have up to two to the
  239. 9:0712
  240. 9:08minus two hosts there are two reserved
  241. 9:11addresses for each network
  242. 9:14the host address of all zeros is
  243. 9:16reserved to identify the network itself
  244. 9:18the host address with all ones is
  245. 9:20reserved as a broadcast
  246. 9:22address there is also an ip address
  247. 9:25for individual hosts the key difference
  248. 9:29is the lack of a subnet identifier
  249. 9:32when sending messages to individual
  250. 9:35machines
  251. 9:36we do not care about how the ip
  252. 9:38addresses are allocated
  253. 9:40all we care about is that each address
  254. 9:43is unique
  255. 9:45so ip addresses are used to identify
  256. 9:48individual machines while cider
  257. 9:51addresses
  258. 9:52represent ranges of ip and are used to
  259. 9:55identify entire networks
  260. 9:57so ip addresses represent individual
  261. 10:00machines
  262. 10:02while cider addresses represent ranges
  263. 10:05of ip addresses and are used to identify
  264. 10:08entire networks slider fixes the
  265. 10:11allocation problem
  266. 10:12of classful domain routing networks
  267. 10:15looking to add more hosts
  268. 10:17could exchange their existing site
  269. 10:19address for an
  270. 10:20available address with one bit shifted
  271. 10:22over
  272. 10:24as an example a network could return
  273. 10:27its siter address 64.64.0.0.20.
  274. 10:32in exchange for the siter address
  275. 10:3680.80.0.0.19
  276. 10:38because the network portion has been
  277. 10:40reduced by a single bit
  278. 10:42this network can have twice as many
  279. 10:44hosts while ensuring all devices on the
  280. 10:46network share the same network prefix
  281. 10:49the protocol data unit of ipv4
  282. 10:52is the ipv4 packet also called the ipv4
  283. 10:56datagram
  284. 10:58this header wraps our payload and gets
  285. 11:01re-wrapped with a datalink layer header
  286. 11:03before being transmitted
  287. 11:06the first four bits represents the
  288. 11:09version
  289. 11:10and determines which version of ip this
  290. 11:12packet is using
  291. 11:14the field after that is the internet
  292. 11:16header length
  293. 11:18the size of the ip header is variable
  294. 11:22because of the options fields
  295. 11:26there is a minimum header size of 20
  296. 11:27bytes which is also the most common
  297. 11:29header size
  298. 11:31we can derive that value by noticing
  299. 11:34that
  300. 11:34in this diagram each row is 32 bits
  301. 11:38or 4 bytes in length and that there are
  302. 11:42five rows not including the options
  303. 11:44fields
  304. 11:46the next field type of service specifies
  305. 11:48data about
  306. 11:49quality of service technologies the
  307. 11:52field after that
  308. 11:52total length specifies the length of the
  309. 11:55entire packets
  310. 11:56the maximum size of a ip packet is 65
  311. 12:00535 bytes the next row
  312. 12:04deals with the fragmentation of packets
  313. 12:06should a particular packet
  314. 12:08exceed the maximum transmission units or
  315. 12:10mtu of a link
  316. 12:12that packet will need to be fragmented
  317. 12:14before it is sent off
  318. 12:16packets are reassembled at their final
  319. 12:18destination
  320. 12:19the identification field which is a 16
  321. 12:22bit fields
  322. 12:23is used to collect and group together
  323. 12:27fragmented messages when ipmessages are
  324. 12:30fragmented
  325. 12:31this field is used to identify which
  326. 12:34fragments
  327. 12:35belong to the same original message
  328. 12:38there are three flags that follow the
  329. 12:41first bit
  330. 12:42is a reserved flag and is always zero
  331. 12:45the second bit is the don't fragment bit
  332. 12:48and indicates if a datagram is allowed
  333. 12:50to be fragmented
  334. 12:52the last bit is the more fragments
  335. 12:56flag and indicates if there are more
  336. 12:58fragments
  337. 13:00the next field the fragment offsets is a
  338. 13:0313-bit field
  339. 13:05used to help sequence packets that are
  340. 13:07fragmented
  341. 13:09and it does so by indicating to the
  342. 13:11recipient's device
  343. 13:13where in the overall message each
  344. 13:15particular fragment should be placed
  345. 13:18moving on to the next row the first
  346. 13:21field that we will talk about
  347. 13:22is the time to live or ttl
  348. 13:25this is a 8-bit field and it represents
  349. 13:28how many router hops
  350. 13:30a datagram can traverse before it's
  351. 13:32discarded
  352. 13:34we discard long-lived messages on the
  353. 13:36network
  354. 13:37to prevent loops when there is a
  355. 13:40misconfigured
  356. 13:41or malicious router without the ttl
  357. 13:44it is possible for a misconfigured
  358. 13:46router to cause a packet to stay on the
  359. 13:48wire forever
  360. 13:49forwarding messages such that it
  361. 13:50eventually comes back to itself
  362. 13:52the ttl decrements after each hop and
  363. 13:55when they hit 0
  364. 13:57the packet is dropped the default ttl
  365. 14:00is 64 hops next the protocol
  366. 14:04is a 8-bit field used to determine the
  367. 14:07transport layer protocol
  368. 14:08use one layer above the next field is
  369. 14:11the header checksum
  370. 14:13which is a lesser use 16-bit field
  371. 14:16used for data integrity the checksum is
  372. 14:20not really used
  373. 14:21because both major datalink layer
  374. 14:23protocols
  375. 14:24ethernet and 802.11 provide
  376. 14:28data integrity using the frame check
  377. 14:31sequence
  378. 14:32if we look at the ipv6 header field in
  379. 14:35fact
  380. 14:35we will see no checksum fields and in
  381. 14:38fact there is no
  382. 14:39data integrity field instead that task
  383. 14:42is offloaded to the data link layer
  384. 14:45when a router receives an ipa packet
  385. 14:47first we'll see if the incoming package
  386. 14:49destination address
  387. 14:50is for a host on its own network and if
  388. 14:52it is the router makes the final
  389. 14:54delivery
  390. 14:55otherwise if the destination address
  391. 14:58matches a network cider range in the
  392. 15:00routing table
  393. 15:01it will forward the message to the next
  394. 15:03router out on a specified interface
  395. 15:06we will go into the details of how the
  396. 15:08routing table is populated with entries
  397. 15:10in our next lecture all routers are
  398. 15:13configured with a special catch-all
  399. 15:15entry called the default gateway
  400. 15:17typically your isp which is an ip
  401. 15:20address to forward messages to
  402. 15:21in the event that no other forwarding
  403. 15:23rules apply
  404. 15:25so let's look at a sample exchange
  405. 15:26between two hosts
  406. 15:28host one and host two when arriving on
  407. 15:31the router
  408. 15:32the packet will have its ttl field
  409. 15:34decreased by one
  410. 15:36and the entire packet will be dropped if
  411. 15:38the ttl field hits zero
  412. 15:41then the router looks up the next hop in
  413. 15:44its own routing table
  414. 15:46and performs fragmentation if required
  415. 15:49before sending the data
  416. 15:51to the next hop out on a specified
  417. 15:54interface these individual hops
  418. 15:57are chained together until we reach the
  419. 16:00final destination
  420. 16:02routers are considered network layer
  421. 16:04hardware
  422. 16:05because they inspect the destination ip
  423. 16:08address in each packet
  424. 16:09before making a decision on what
  425. 16:12interface
  426. 16:13to forward the packet to there are
  427. 16:15several ip ranges
  428. 16:17that are not to be allocated to any
  429. 16:18entity
  430. 16:20these addresses are meant only to be
  431. 16:23used locally
  432. 16:25traffic using these reserved ip ranges
  433. 16:27never leaves the network
  434. 16:30there are many reserved ip ranges but
  435. 16:32for this course
  436. 16:33we only care about three 127.0.0.08
  437. 16:38block
  438. 16:41this is used for the loopback address
  439. 16:44which is when a host wants to send a
  440. 16:47message
  441. 16:48to itself it is used quite often
  442. 16:51in net code development as the operating
  443. 16:54system
  444. 16:54will simulate the requests without
  445. 16:57needing any actual hardware
  446. 16:59the siter address
  447. 17:02slash 192.0.0.0.24 is used for
  448. 17:06a local area network it can support up
  449. 17:08to 256 devices
  450. 17:11if this is not enough you can also use
  451. 17:13the 10.0.0.0.8 range but we won't be
  452. 17:18discussing that
  453. 17:20finally the range 224.0.0.0.4
  454. 17:27is used for ip multicast
  455. 17:30ip multicasting uses a one-to-many
  456. 17:33association where datagrams are routed
  457. 17:35simultaneously
  458. 17:37in a single transmission to multiple
  459. 17:38recipients
  460. 17:40a server only needs to send the message
  461. 17:42once
  462. 17:43and machines will listen in on a
  463. 17:45specified ip
  464. 17:47ip multicasting uses a one to many
  465. 17:49association
  466. 17:50where datagrams are routed
  467. 17:51simultaneously in a single transmission
  468. 17:54to multiple recipients a server only
  469. 17:57needs to send the message
  470. 17:58once and all configured machines
  471. 18:01will listen in on the specified ip
  472. 18:04video surveillance systems are probably
  473. 18:06the most common usage
  474. 18:08with many closed circuit tvs
  475. 18:10broadcasting on specific ip addresses
  476. 18:13that you can navigate your browser to
  477. 18:15and watch
  478. 18:17because these are local ip addresses
  479. 18:19multicast traffic
  480. 18:20will never leave your network other
  481. 18:23usages
  482. 18:23include pc hosting and software updates
  483. 18:26voiceover ip video monitoring and
  484. 18:29conference calls
  485. 18:31your home network can have up to 256
  486. 18:34devices
  487. 18:35in the address block 192.0.0.0.8.
  488. 18:40when a device connects to your home
  489. 18:41network it has temporarily
  490. 18:43allocated one of these addresses through
  491. 18:45a process called dhcp
  492. 18:48the dynamic host configuration protocol
  493. 18:51is used to
  494. 18:52temporarily assign a local ip address
  495. 18:55to a newly connected device
  496. 18:59the dhcp protocol has four stages
  497. 19:02dhcp discover where a newly connected
  498. 19:05device
  499. 19:06sends a discovery request that is
  500. 19:08broadcasted on the entire network
  501. 19:10and includes the device's mac address
  502. 19:13dhcp
  503. 19:14offer all dhp servers who receive a
  504. 19:17request
  505. 19:18and have an available ip address offered
  506. 19:20to lease the ip address to the newly
  507. 19:22connected device
  508. 19:24dhcp requests the newly connected device
  509. 19:28sends a request to the server of the
  510. 19:29first response they receive
  511. 19:32when receiving multiple offers it
  512. 19:34assumes that the first offer
  513. 19:36has the least latency dhcp
  514. 19:39acknowledgement
  515. 19:40upon receiving dhcp requests the server
  516. 19:44creates a record of it in the dhcp table
  517. 19:48to keep track of which local ip
  518. 19:50addresses are currently in use
  519. 19:53then it sends an acknowledgement which
  520. 19:55includes additional information
  521. 19:57like expiration ipaddresses assigned
  522. 20:01with the dhcp
  523. 20:02protocol are designated to be dynamic
  524. 20:04ips
  525. 20:06dynamic ips revert back to the dhcp
  526. 20:08server
  527. 20:09once they are expired
  528. 20:13they are useful for devices that don't
  529. 20:15need to communicate with other local
  530. 20:17devices
  531. 20:18like desktops and laptops
  532. 20:21we can also go to the router settings to
  533. 20:23configure a static ip address
  534. 20:25unlike dhcp static ip addressing does
  535. 20:28not expire unless revoked
  536. 20:30they are useful for devices that others
  537. 20:33may want to connect to
  538. 20:34like a network printer this is because
  539. 20:36dhcp will automatically assign any newly
  540. 20:39connected device
  541. 20:40an ip address from its available pool if
  542. 20:43a lease expires
  543. 20:44or we lose power there is no guarantee
  544. 20:47that the devices when they reconnect
  545. 20:49will get the same ip address
  546. 20:52when using a network printer we are
  547. 20:54sending a print job to an ip address
  548. 20:57should the ip address of that printer
  549. 20:59change because dhcp gave it a new one we
  550. 21:02may wind up sending our print jobs to
  551. 21:03the wrong location
  552. 21:05ip addresses belong to the network not
  553. 21:08the devices attached to those networks
  554. 21:11these devices lease an ip address using
  555. 21:13the dhcp protocol this is in contrast to
  556. 21:17the mac address
  557. 21:18which stays the same regardless of where
  558. 21:21you are connected to
  559. 21:24each computer connected to a network is
  560. 21:26least a local ip address
  561. 21:28this address is unique to the network
  562. 21:31but
  563. 21:31can be reused outside the network as it
  564. 21:34is a reserved
  565. 21:35address which will never leave the local
  566. 21:37network
  567. 21:38finally we'll discuss the address
  568. 21:40resolution protocol
  569. 21:41or arp arp
  570. 21:44is a data link layer protocol used to
  571. 21:47map a known ipv4 address
  572. 21:50to an unknown mac address it cannot be
  573. 21:53used
  574. 21:53outside of local networks it is used
  575. 21:56predominantly to
  576. 21:58find a mac address given a ip address
  577. 22:03all network devices will keep an arp
  578. 22:06table
  579. 22:06a list of ip addresses and known mac
  580. 22:08addresses associated with each device
  581. 22:11arp table entries expire after a short
  582. 22:14period of time
  583. 22:15to ensure network changes are accounted
  584. 22:16for
  585. 22:18in a windows machine you can look at
  586. 22:20your arp table
  587. 22:21by typing in to a command prompt arp
  588. 22:25a if a router receives a
  589. 22:28unknown ip address it will broadcast an
  590. 22:32arp
  591. 22:32request out on the entire network
  592. 22:36the device that owns that ip address
  593. 22:39will respond back with its mac address
  594. 22:42after which the router will update its
  595. 22:46arp table before forwarding the
  596. 22:49request in this lecture there was a key
  597. 22:52assumption that we made
  598. 22:54that our routers already knew the best
  599. 22:56path
  600. 22:57to get our message delivered in our next
  601. 22:59lecture
  602. 23:00we'll discuss routing protocols which
  603. 23:02populate our router's memory
  604. 23:04called a routing table with cider
  605. 23:06addresses
  606. 23:07and how it keeps those records up to
  607. 23:09date with a constantly changing internet

About this transcript

This page contains the full transcript of Network Layer by Internet and Web Technologies, generated from the public captions YouTube serves with the video. The transcript has 3,098 words across 607 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 choose a caption track available on the video.

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, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.