Network Layer — Transcript
Full transcript
- 0:00the network layer provides support for
- 0:03internetwork communication it
- 0:05facilitates packet forwarding and
- 0:07routing
- 0:07between devices on separate networks and
- 0:10enables end-to-end communication
- 0:13our discussion of the network layer will
- 0:15be split into two parts
- 0:16in this first lecture we will discuss
- 0:18the architecture of the internet
- 0:20how routers work the internet protocol
- 0:24and the structure of the ip packet
- 0:27in the following lecture we'll look into
- 0:29the various routing protocols which
- 0:31dictate the rules
- 0:32that routers and autonomous systems
- 0:34follow on how to forward packets such
- 0:36that they reach their final destination
- 0:38as efficiently as possible we will talk
- 0:41about
- 0:42shortest path algorithms like dijkstra
- 0:44and bellman ford
- 0:46and how they are used to route traffic
- 0:47on the internet
- 0:50the consequence of doing lectures in
- 0:51this order is that during this first
- 0:53lecture
- 0:54you have to assume that each router
- 0:56knows the best path to forward packets
- 0:58to
- 0:58and that this entire process is
- 1:00efficient
- 1:01more concisely if we are sending a
- 1:03message over the internet
- 1:04from computer a to b at each router we
- 1:08can use an oracle
- 1:09to determine which router will be the
- 1:11next hop
- 1:12the details about this oracle algorithm
- 1:14will be revealed in the next lecture
- 1:16as well as its runtime complexities
- 1:20a local area network or lan is a
- 1:23grouping of computers that are
- 1:24interconnected within a single physical
- 1:27network
- 1:28typically devices on a lan can easily
- 1:32communicate with each other
- 1:33but require special configuration in
- 1:35order to communicate with devices
- 1:37outside the local network networks
- 1:40are separated by routers a single
- 1:43network may have multiple routers
- 1:46each acting as a gateway between other
- 1:48networks
- 1:50if the topology of multiple connected
- 1:52networks is known beforehand
- 1:54and we have the mac addresses of all
- 1:56intermediate nodes
- 1:58this can be done solely through the
- 2:00datalink layer through the use of
- 2:01network bridges
- 2:03which are devices that connect two or
- 2:04more lands
- 2:07even with routers in play if we control
- 2:09the entire network
- 2:11we can communicate using just the data
- 2:13link layer
- 2:16when using the internet though we need
- 2:18to be able to communicate with networks
- 2:19that we don't own and are
- 2:22connected to routers that we have no
- 2:24control over
- 2:26the network layer facilitates delivery
- 2:28of these messages
- 2:30by getting us closer and closer to the
- 2:32final destination
- 2:33one hop at a time ipv4
- 2:37a network layer protocol facilitates
- 2:39communications between networks
- 2:41that are not known beforehand
- 2:45the most widely used protocol on the
- 2:47network layer is the internet protocol
- 2:50abbreviated ip it has two versions
- 2:54ipv4 and ipv6
- 2:58other protocols like icmp also exists
- 3:02but it's mainly used for error reporting
- 3:04purposes and its header is largely the
- 3:06same as the ip datagram
- 3:08with a few additional fields before your
- 3:11computer sends a message off to the
- 3:13internet
- 3:13it attaches an ip header to it this
- 3:16header for the most part stays the same
- 3:18at each hop along the path
- 3:20certain values like ttl are decreased
- 3:23but the address fields are maintained
- 3:25this is in contrast to data link layer
- 3:27protocols like ethernet
- 3:29and 802.11 where the frame headers are
- 3:32removed at each hop
- 3:34the ip header contains multiple fields
- 3:36the most important of which
- 3:38is the source and destination address
- 3:41addressing in ipv4 is done with ip
- 3:44addresses
- 3:45each device connected to the internet is
- 3:48identified by this
- 3:50these ip addresses are leased to
- 3:52individuals by internet service
- 3:54providers
- 3:55or isps your monthly internet bill
- 3:57includes payment for a temporary lease
- 4:00of an ip address from your isp's pool of
- 4:03available addresses
- 4:05you are not guaranteed the same ip
- 4:06address each time unless you pay for
- 4:08business class internet
- 4:10that includes a static ip
- 4:13ip addresses are a 32-bit number
- 4:15composed of four octets
- 4:17each octet is typically represented as a
- 4:20number from 0 to 255
- 4:22separated by dots for example
- 4:26172.6
- 4:31this format is called dotted decimal
- 4:34notation
- 4:36due to ip addresses being a 32-bit
- 4:38number
- 4:39there is an upper limit of 2 to the 32
- 4:42or roughly 4.2 billion addresses
- 4:45while enormous at the time of the
- 4:46internet's creation
- 4:48the wide adoption of it has caused these
- 4:51numbers to quickly deplete
- 4:53by january 2020 all ipv4 addresses
- 4:56have been allocated between various isps
- 4:59around the world
- 5:01this problem is called the ipv4 address
- 5:04exhaustion problem
- 5:07ip addresses are composed of two parts a
- 5:10network portion
- 5:11and a host portion the bits of an ip
- 5:14address
- 5:15designated for the network portion
- 5:18uniquely identifies the network
- 5:20while the host portion allows all
- 5:22devices on the network to share the same
- 5:24prefix
- 5:26by decreasing the size of the network
- 5:28portion you allocate more devices
- 5:30to a single host allowing them to have
- 5:33more
- 5:33connected devices
- 5:36by decreasing the number of bits in the
- 5:38networking portion
- 5:40you allocate more bits for the host
- 5:43components
- 5:44allowing a single network to have more
- 5:47devices
- 5:49the drawback to this is that you have
- 5:51fewer unique networks
- 5:53which exacerbates the ipv4 exhaustion
- 5:56problem
- 5:57especially if these hosts remain unused
- 6:00this next section is historical so we
- 6:02don't really use this nowadays
- 6:04but it helps us understand the ipe v4
- 6:07exhaustion problem better
- 6:09originally these network addresses were
- 6:11divided into network hosts
- 6:13at every eight bits or one octet
- 6:16creating three classes of addresses
- 6:19class a networks
- 6:20identified with a first octet in the
- 6:23range of 0 to 126
- 6:26had one octet for its network portion
- 6:29and 3 octets for the host portion
- 6:31this allowed for 2 to 24 minus 2
- 6:34or roughly 16 million devices per
- 6:37network
- 6:38class b addresses identified with the
- 6:41first octet
- 6:42in the range 128 to 191
- 6:48had two octets for the network portion
- 6:51and two octets for the hosts
- 6:54this allowed for 2 to the 16th minus 2
- 6:58or 65 534 devices per network
- 7:04finally we have class c addresses which
- 7:06are identified with
- 7:08the first octet in the range 192-223
- 7:14these had three octets for the network
- 7:16portion and one octet
- 7:18for the host this allowed for 2 to the 8
- 7:21minus 2 or 254 hosts
- 7:26the drawback to this classful system was
- 7:28because there were only three rigid
- 7:29sizes of ip address blocks
- 7:32small companies could outgrow their
- 7:33allocated class c address
- 7:35and their only option would be to either
- 7:37get another classy address
- 7:39and combine the two but this would
- 7:41create two separate ranges of ip
- 7:43addresses for a single organization
- 7:46their other option was to upgrade to a
- 7:48class b address
- 7:50giving them 256 times as much addressing
- 7:53space as they previously had
- 7:56this could also happen to organizations
- 7:58that outgrew their class b address
- 8:00but with the added complication that
- 8:03there could only ever exist
- 8:05126 class a addresses in modern
- 8:08applications
- 8:09we use classlist interdomain routing or
- 8:12cider
- 8:14insider instead of an entire octet of 8
- 8:17bits
- 8:17being changed at once a single bit is
- 8:20moved from the network to the hosts
- 8:23when using cidr ip addresses have two
- 8:26forms
- 8:27one to identify the network called the
- 8:29citer address
- 8:31this includes a network portion a host
- 8:33portion
- 8:34and a subnet identifier for example
- 8:3864.60
- 8:44the number after the slash represents
- 8:46the subnet identifier
- 8:48and specifies the number of bits that
- 8:51will be used for the
- 8:52network portion
- 8:56in this example 20 bits will be
- 8:58allocated for the network
- 9:01and the remaining 12 bits are used for
- 9:03hosts
- 9:05this network can have up to two to the
- 9:0712
- 9:08minus two hosts there are two reserved
- 9:11addresses for each network
- 9:14the host address of all zeros is
- 9:16reserved to identify the network itself
- 9:18the host address with all ones is
- 9:20reserved as a broadcast
- 9:22address there is also an ip address
- 9:25for individual hosts the key difference
- 9:29is the lack of a subnet identifier
- 9:32when sending messages to individual
- 9:35machines
- 9:36we do not care about how the ip
- 9:38addresses are allocated
- 9:40all we care about is that each address
- 9:43is unique
- 9:45so ip addresses are used to identify
- 9:48individual machines while cider
- 9:51addresses
- 9:52represent ranges of ip and are used to
- 9:55identify entire networks
- 9:57so ip addresses represent individual
- 10:00machines
- 10:02while cider addresses represent ranges
- 10:05of ip addresses and are used to identify
- 10:08entire networks slider fixes the
- 10:11allocation problem
- 10:12of classful domain routing networks
- 10:15looking to add more hosts
- 10:17could exchange their existing site
- 10:19address for an
- 10:20available address with one bit shifted
- 10:22over
- 10:24as an example a network could return
- 10:27its siter address 64.64.0.0.20.
- 10:32in exchange for the siter address
- 10:3680.80.0.0.19
- 10:38because the network portion has been
- 10:40reduced by a single bit
- 10:42this network can have twice as many
- 10:44hosts while ensuring all devices on the
- 10:46network share the same network prefix
- 10:49the protocol data unit of ipv4
- 10:52is the ipv4 packet also called the ipv4
- 10:56datagram
- 10:58this header wraps our payload and gets
- 11:01re-wrapped with a datalink layer header
- 11:03before being transmitted
- 11:06the first four bits represents the
- 11:09version
- 11:10and determines which version of ip this
- 11:12packet is using
- 11:14the field after that is the internet
- 11:16header length
- 11:18the size of the ip header is variable
- 11:22because of the options fields
- 11:26there is a minimum header size of 20
- 11:27bytes which is also the most common
- 11:29header size
- 11:31we can derive that value by noticing
- 11:34that
- 11:34in this diagram each row is 32 bits
- 11:38or 4 bytes in length and that there are
- 11:42five rows not including the options
- 11:44fields
- 11:46the next field type of service specifies
- 11:48data about
- 11:49quality of service technologies the
- 11:52field after that
- 11:52total length specifies the length of the
- 11:55entire packets
- 11:56the maximum size of a ip packet is 65
- 12:00535 bytes the next row
- 12:04deals with the fragmentation of packets
- 12:06should a particular packet
- 12:08exceed the maximum transmission units or
- 12:10mtu of a link
- 12:12that packet will need to be fragmented
- 12:14before it is sent off
- 12:16packets are reassembled at their final
- 12:18destination
- 12:19the identification field which is a 16
- 12:22bit fields
- 12:23is used to collect and group together
- 12:27fragmented messages when ipmessages are
- 12:30fragmented
- 12:31this field is used to identify which
- 12:34fragments
- 12:35belong to the same original message
- 12:38there are three flags that follow the
- 12:41first bit
- 12:42is a reserved flag and is always zero
- 12:45the second bit is the don't fragment bit
- 12:48and indicates if a datagram is allowed
- 12:50to be fragmented
- 12:52the last bit is the more fragments
- 12:56flag and indicates if there are more
- 12:58fragments
- 13:00the next field the fragment offsets is a
- 13:0313-bit field
- 13:05used to help sequence packets that are
- 13:07fragmented
- 13:09and it does so by indicating to the
- 13:11recipient's device
- 13:13where in the overall message each
- 13:15particular fragment should be placed
- 13:18moving on to the next row the first
- 13:21field that we will talk about
- 13:22is the time to live or ttl
- 13:25this is a 8-bit field and it represents
- 13:28how many router hops
- 13:30a datagram can traverse before it's
- 13:32discarded
- 13:34we discard long-lived messages on the
- 13:36network
- 13:37to prevent loops when there is a
- 13:40misconfigured
- 13:41or malicious router without the ttl
- 13:44it is possible for a misconfigured
- 13:46router to cause a packet to stay on the
- 13:48wire forever
- 13:49forwarding messages such that it
- 13:50eventually comes back to itself
- 13:52the ttl decrements after each hop and
- 13:55when they hit 0
- 13:57the packet is dropped the default ttl
- 14:00is 64 hops next the protocol
- 14:04is a 8-bit field used to determine the
- 14:07transport layer protocol
- 14:08use one layer above the next field is
- 14:11the header checksum
- 14:13which is a lesser use 16-bit field
- 14:16used for data integrity the checksum is
- 14:20not really used
- 14:21because both major datalink layer
- 14:23protocols
- 14:24ethernet and 802.11 provide
- 14:28data integrity using the frame check
- 14:31sequence
- 14:32if we look at the ipv6 header field in
- 14:35fact
- 14:35we will see no checksum fields and in
- 14:38fact there is no
- 14:39data integrity field instead that task
- 14:42is offloaded to the data link layer
- 14:45when a router receives an ipa packet
- 14:47first we'll see if the incoming package
- 14:49destination address
- 14:50is for a host on its own network and if
- 14:52it is the router makes the final
- 14:54delivery
- 14:55otherwise if the destination address
- 14:58matches a network cider range in the
- 15:00routing table
- 15:01it will forward the message to the next
- 15:03router out on a specified interface
- 15:06we will go into the details of how the
- 15:08routing table is populated with entries
- 15:10in our next lecture all routers are
- 15:13configured with a special catch-all
- 15:15entry called the default gateway
- 15:17typically your isp which is an ip
- 15:20address to forward messages to
- 15:21in the event that no other forwarding
- 15:23rules apply
- 15:25so let's look at a sample exchange
- 15:26between two hosts
- 15:28host one and host two when arriving on
- 15:31the router
- 15:32the packet will have its ttl field
- 15:34decreased by one
- 15:36and the entire packet will be dropped if
- 15:38the ttl field hits zero
- 15:41then the router looks up the next hop in
- 15:44its own routing table
- 15:46and performs fragmentation if required
- 15:49before sending the data
- 15:51to the next hop out on a specified
- 15:54interface these individual hops
- 15:57are chained together until we reach the
- 16:00final destination
- 16:02routers are considered network layer
- 16:04hardware
- 16:05because they inspect the destination ip
- 16:08address in each packet
- 16:09before making a decision on what
- 16:12interface
- 16:13to forward the packet to there are
- 16:15several ip ranges
- 16:17that are not to be allocated to any
- 16:18entity
- 16:20these addresses are meant only to be
- 16:23used locally
- 16:25traffic using these reserved ip ranges
- 16:27never leaves the network
- 16:30there are many reserved ip ranges but
- 16:32for this course
- 16:33we only care about three 127.0.0.08
- 16:38block
- 16:41this is used for the loopback address
- 16:44which is when a host wants to send a
- 16:47message
- 16:48to itself it is used quite often
- 16:51in net code development as the operating
- 16:54system
- 16:54will simulate the requests without
- 16:57needing any actual hardware
- 16:59the siter address
- 17:02slash 192.0.0.0.24 is used for
- 17:06a local area network it can support up
- 17:08to 256 devices
- 17:11if this is not enough you can also use
- 17:13the 10.0.0.0.8 range but we won't be
- 17:18discussing that
- 17:20finally the range 224.0.0.0.4
- 17:27is used for ip multicast
- 17:30ip multicasting uses a one-to-many
- 17:33association where datagrams are routed
- 17:35simultaneously
- 17:37in a single transmission to multiple
- 17:38recipients
- 17:40a server only needs to send the message
- 17:42once
- 17:43and machines will listen in on a
- 17:45specified ip
- 17:47ip multicasting uses a one to many
- 17:49association
- 17:50where datagrams are routed
- 17:51simultaneously in a single transmission
- 17:54to multiple recipients a server only
- 17:57needs to send the message
- 17:58once and all configured machines
- 18:01will listen in on the specified ip
- 18:04video surveillance systems are probably
- 18:06the most common usage
- 18:08with many closed circuit tvs
- 18:10broadcasting on specific ip addresses
- 18:13that you can navigate your browser to
- 18:15and watch
- 18:17because these are local ip addresses
- 18:19multicast traffic
- 18:20will never leave your network other
- 18:23usages
- 18:23include pc hosting and software updates
- 18:26voiceover ip video monitoring and
- 18:29conference calls
- 18:31your home network can have up to 256
- 18:34devices
- 18:35in the address block 192.0.0.0.8.
- 18:40when a device connects to your home
- 18:41network it has temporarily
- 18:43allocated one of these addresses through
- 18:45a process called dhcp
- 18:48the dynamic host configuration protocol
- 18:51is used to
- 18:52temporarily assign a local ip address
- 18:55to a newly connected device
- 18:59the dhcp protocol has four stages
- 19:02dhcp discover where a newly connected
- 19:05device
- 19:06sends a discovery request that is
- 19:08broadcasted on the entire network
- 19:10and includes the device's mac address
- 19:13dhcp
- 19:14offer all dhp servers who receive a
- 19:17request
- 19:18and have an available ip address offered
- 19:20to lease the ip address to the newly
- 19:22connected device
- 19:24dhcp requests the newly connected device
- 19:28sends a request to the server of the
- 19:29first response they receive
- 19:32when receiving multiple offers it
- 19:34assumes that the first offer
- 19:36has the least latency dhcp
- 19:39acknowledgement
- 19:40upon receiving dhcp requests the server
- 19:44creates a record of it in the dhcp table
- 19:48to keep track of which local ip
- 19:50addresses are currently in use
- 19:53then it sends an acknowledgement which
- 19:55includes additional information
- 19:57like expiration ipaddresses assigned
- 20:01with the dhcp
- 20:02protocol are designated to be dynamic
- 20:04ips
- 20:06dynamic ips revert back to the dhcp
- 20:08server
- 20:09once they are expired
- 20:13they are useful for devices that don't
- 20:15need to communicate with other local
- 20:17devices
- 20:18like desktops and laptops
- 20:21we can also go to the router settings to
- 20:23configure a static ip address
- 20:25unlike dhcp static ip addressing does
- 20:28not expire unless revoked
- 20:30they are useful for devices that others
- 20:33may want to connect to
- 20:34like a network printer this is because
- 20:36dhcp will automatically assign any newly
- 20:39connected device
- 20:40an ip address from its available pool if
- 20:43a lease expires
- 20:44or we lose power there is no guarantee
- 20:47that the devices when they reconnect
- 20:49will get the same ip address
- 20:52when using a network printer we are
- 20:54sending a print job to an ip address
- 20:57should the ip address of that printer
- 20:59change because dhcp gave it a new one we
- 21:02may wind up sending our print jobs to
- 21:03the wrong location
- 21:05ip addresses belong to the network not
- 21:08the devices attached to those networks
- 21:11these devices lease an ip address using
- 21:13the dhcp protocol this is in contrast to
- 21:17the mac address
- 21:18which stays the same regardless of where
- 21:21you are connected to
- 21:24each computer connected to a network is
- 21:26least a local ip address
- 21:28this address is unique to the network
- 21:31but
- 21:31can be reused outside the network as it
- 21:34is a reserved
- 21:35address which will never leave the local
- 21:37network
- 21:38finally we'll discuss the address
- 21:40resolution protocol
- 21:41or arp arp
- 21:44is a data link layer protocol used to
- 21:47map a known ipv4 address
- 21:50to an unknown mac address it cannot be
- 21:53used
- 21:53outside of local networks it is used
- 21:56predominantly to
- 21:58find a mac address given a ip address
- 22:03all network devices will keep an arp
- 22:06table
- 22:06a list of ip addresses and known mac
- 22:08addresses associated with each device
- 22:11arp table entries expire after a short
- 22:14period of time
- 22:15to ensure network changes are accounted
- 22:16for
- 22:18in a windows machine you can look at
- 22:20your arp table
- 22:21by typing in to a command prompt arp
- 22:25a if a router receives a
- 22:28unknown ip address it will broadcast an
- 22:32arp
- 22:32request out on the entire network
- 22:36the device that owns that ip address
- 22:39will respond back with its mac address
- 22:42after which the router will update its
- 22:46arp table before forwarding the
- 22:49request in this lecture there was a key
- 22:52assumption that we made
- 22:54that our routers already knew the best
- 22:56path
- 22:57to get our message delivered in our next
- 22:59lecture
- 23:00we'll discuss routing protocols which
- 23:02populate our router's memory
- 23:04called a routing table with cider
- 23:06addresses
- 23:07and how it keeps those records up to
- 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.