YouTube2Text

How the TCP/IP Model Actually Works | CCNA Day 3 — Transcript

by Jeremy's IT Lab · 6,715 words · 420 segments · language en · Watch on YouTube

Full transcript

  1. 0:06Hi from Tokyo, Japan, and welcome to Jeremy's IT  Lab. This video is about the Internet Protocol
  2. 0:11Suite, often called TCP/IP, the family of  protocols that makes communication over the
  3. 0:17Internet and other networks possible. You've  probably heard of some of these protocols:
  4. 0:22IP, TCP, UDP, HTTP and so on. If you  haven't heard of them, no problem:
  5. 0:29we'll cover many of these  core protocols in this course.
  6. 0:32From this suite of protocols, we can build  what people usually call the TCP/IP model:
  7. 0:38a way of grouping protocols into layers based  on the job they do. In this video we’re going
  8. 0:43to build that model step by step and use it as  a simple map of “who does what” in a network.
  9. 0:48This is going to be one of the longest videos  in the course, but there actually isn’t a lot
  10. 0:52you have to memorize: we’re covering a big-picture  framework about how networks work. Later, when you
  11. 0:58learn about things like IP addressing, routing and  switching, TCP and UDP, and so on, you’ll be able
  12. 1:04to drop each new topic into this framework and see  where it fits and how it works with the others.
  13. 1:10There’s also a lot of history - and a bit  of argument - around different models,
  14. 1:14like the OSI model and various versions of the  TCP/IP model. In this lesson I’ll give you a
  15. 1:20practical way to think about layers that will  help you understand how networks actually operate.
  16. 1:25As you continue studying, you can add nuance  and explore the debates if you’re interested,
  17. 1:30but you don’t need to solve those issues today.
  18. 1:32So, relax, don’t worry about memorizing  every concept, and just focus on the big
  19. 1:37ideas and relationships between the  layers. We’ll revisit these concepts
  20. 1:41many times in later videos. Alright,  enough talking. let’s get started.
  21. 1:46Let’s begin with the importance  of protocols and standards.
  22. 1:50A protocol is a set of rules defining how data  should be communicated between devices over
  23. 1:55a network. Protocols are the languages that  computers use to communicate. Just as someone
  24. 2:00who only speaks Chinese can’t talk with someone  who only speaks English, computers that “speak”
  25. 2:06different protocols can’t exchange data. Since the  early days of computer networking, there have been
  26. 2:12several attempts to define the functions needed  for computers to communicate with each other.
  27. 2:17These protocols were often developed by a specific  vendor, such as IBM, to be used with their own
  28. 2:23products. With this proprietary approach, enabling  communications between different vendors’ products
  29. 2:28was difficult, if not impossible. For example,  if we have an Apple iMac and an IBM server,
  30. 2:35each using its own proprietary protocols,  the IBM server wouldn’t be able to understand
  31. 2:40a request from the iMac. I’m just using  modern devices here as a visual example,
  32. 2:46but this kind of problem was common in the  early days of networking. To solve this issue,
  33. 2:51today’s networks and the devices connected to  them use standard, vendor-neutral protocols and
  34. 2:56technologies. A standard is an agreed-upon  specification that describes how a protocol
  35. 3:02or technology should work. When devices follow  vendor-neutral standards, devices of all types can
  36. 3:09communicate with each other. For example, an Apple  MacBook can access a website hosted on a Linux web
  37. 3:15server. And a PC running Windows can send an  email that can be read on a smartphone running
  38. 3:20Android. As long as the devices follow the same  standards, they can work together on the network.
  39. 3:28How did TCP/IP come about? Let’s cover a bit of  history. Early work on the computer networks that
  40. 3:34would evolve into today’s Internet began in the  1960s, mainly in the US. The US Department of
  41. 3:40Defense’s ARPA, Advanced Research Projects Agency,  funded ARPANET. It came online in 1969 to connect
  42. 3:48mainframes at universities and labs around the  country. Here’s a map showing ARPANET in the
  43. 3:531970s, connecting locations mostly around the east  and west coasts of the country. ARPANET originally
  44. 4:00used a protocol called NCP, the Network Control  Program. There was no TCP/IP in the early days.
  45. 4:08In 1974, Vint Cerf and Bob Kahn, two of  the fathers of the modern Internet, began
  46. 4:14developing TCP, Transmission Control Program,  as an internetworking protocol. TCP went through
  47. 4:21a few revisions, and was later divided into two  protocols that are still used today: Transmission
  48. 4:26Control Protocol, TCP. Notice the name change from  “Program” to “Protocol”. And Internet Protocol,
  49. 4:33IP. Together, these two protocols form the  foundation of the protocol suite widely known
  50. 4:39as TCP/IP today. And the ARPANET fully switched to  use TCP/IP on January 1st, 1983. Over time, TCP/IP
  51. 4:50became dominant over other vendor-proprietary  solutions at the time because it was published
  52. 4:55as a set of open standards that any vendor could  implement, and it could run over many different
  53. 5:00types of networks. And here we are several  decades later, still learning about TCP/IP.
  54. 5:08That’s enough history. Now who actually defines  these standards? Most networking standards are
  55. 5:13created by independent standards organizations,  not by a single vendor. Engineers from many
  56. 5:19different companies participate in the process.  When it comes to networking, there are two
  57. 5:24organizations you should be aware of. The first  one is the IEEE, the Institute of Electrical and
  58. 5:30Electronics Engineers. I mentioned the IEEE in  the previous video when talking about Ethernet
  59. 5:35cables. The IEEE develops many of the technologies  we use on local area networks, such as Ethernet,
  60. 5:43which is defined in the 802.3 set of standards.  The IEEE also develops Wi-Fi, which is defined
  61. 5:50in the 802.11 standards. These standards include  physical specifications like Ethernet cable types,
  62. 5:57Wi-Fi radio frequency, and how to transmit signals  over the physical medium, whether a cable or a
  63. 6:03radio wave. But they also specify how to format  messages to send them to another device over the
  64. 6:09medium. Both are important topics that we’ll cover  in this course. The second standards group is the
  65. 6:16IETF, the Internet Engineering Task Force. The  IETF is an open community that defines many of
  66. 6:23the protocols used on the Internet. A few examples  are TCP, IP, UDP, HTTP, and DNS. If you don’t know
  67. 6:33these protocols yet, don’t worry: they’re all in  this course. The IETF publishes its standards in
  68. 6:39documents called RFCs, Requests for Comments, all  of which are freely available on the Internet.
  69. 6:46The IEEE and IETF create the standards, and then  vendors like Cisco implement them so that devices
  70. 6:53from different companies can work together. But  there are many different standards and protocols,
  71. 6:58each solving a different part of the overall  communication problem. To make sense of them,
  72. 7:03it helps to group their jobs into  layers, making a layered model.
  73. 7:09So let’s look at that layered model. Networks  do a lot of different jobs when they move data
  74. 7:14from one computer to another. Things like the  physical transmission of signals, local delivery
  75. 7:19of messages on a LAN, routing traffic between  networks, maintaining end-to-end conversations,
  76. 7:25and the applications themselves. A model lets us  group related jobs into layers. Each layer has a
  77. 7:33specific role, and each layer uses the services  of the layer below and provides services to the
  78. 7:38layer above. We’ll come back to this idea  later. Protocols live mostly at one layer.
  79. 7:45I say “mostly” because sometimes the lines are  blurred and it’s hard to categorize a protocol.
  80. 7:50Some examples of protocols that we’ll look at  later are IP, TCP, and HTTP. Together they form
  81. 7:58a “stack” of protocols that work as a team, often  called the network stack. Here’s an example of a
  82. 8:04protocol stack from RFC 791, which defines IP, the  Internet Protocol. It was published in 1981, but
  83. 8:12this is still the current standard we use today.  If you’re curious, do a Google search for RFC 791:
  84. 8:19as I said in the previous slide, RFCs are freely  available online, although they can be quite
  85. 8:24dense reading. You don’t need to read them for the  CCNA. We can divide this stack into a few layers
  86. 8:31like this. At the top, we have the application  layer, with protocols like Telnet, FTP, and TFTP.
  87. 8:39I won’t define these protocols now, but they’re  all covered in this course. Then below it, we
  88. 8:45have the Transport layer, with protocols like TCP  and UDP. Below that is the Internet layer. Here,
  89. 8:53“Internet” doesn’t just mean THE Internet, the  public Internet you’re probably using to watch
  90. 8:57this video. It refers to an internetwork,  multiple networks connected together. That’s
  91. 9:02the real job of this layer. This is where we  find IP, which has two versions in use today:
  92. 9:08IP version 4 and IP version 6, both important  CCNA topics. Finally, we have the Link layer,
  93. 9:16including local network protocols like  Ethernet and Wi-Fi. Each of these layers,
  94. 9:21and the protocols in them, plays a different  role in the network. This is the TCP/IP model,
  95. 9:27at least one version of it. The model is a  description, not a law. For example, different
  96. 9:33textbooks and courses use slightly different  models, some with 4 layers, some with 5 layers,
  97. 9:38and some with more. In this course I’ll use  a five-layer model that builds on this one.
  98. 9:46Before talking about networks specifically,  let’s use an analogy for this layered approach:
  99. 9:51sending a letter to a friend via the post. I  don’t use analogies like this often because
  100. 9:56they can cause misunderstandings if you take them  too seriously, but I think this one is helpful.
  101. 10:01On the left, you’re in your house. And on the  right, Bob and his wife are in their house,
  102. 10:06with a couple of post offices between, connected  by roads. You write a letter, which is addressed
  103. 10:12to Bob. You then put the letter in an envelope  addressed to Bob’s house. Bob’s house is a bit
  104. 10:18far from where you live, so instead of driving  directly to his house, you deliver the envelope
  105. 10:22in your car to post office A, like this. Notice  the three different destinations. Your car is
  106. 10:29going to post office A. The envelope inside your  car is going to Bob’s house. And the letter inside
  107. 10:35the envelope is going to Bob himself. Post office  A then moves the envelope to a truck and delivers
  108. 10:42it to post office B, like this. The truck’s  destination is post office B, but the envelope and
  109. 10:48letter inside keep their original destinations.  Then, post office B moves the envelope to a new
  110. 10:55truck and delivers it to Bob’s house, like this.  Once again, this truck has a different destination
  111. 11:00from the previous truck: Bob’s house. The envelope  and letter inside still have their original
  112. 11:06destinations. The envelope is now delivered to  Bob’s house, opened, and the letter addressed to
  113. 11:12Bob is read by him. So in this simple mail system,  different parts care about different things: the
  114. 11:18message itself, who should read it, which house  it goes to, and how it moves along the route.
  115. 11:25We can turn those roles into a layered model,  and then compare that model to how TCP/IP works.
  116. 11:32So, let’s build that model. Don’t worry about  remembering this model or the names of the layers:
  117. 11:37it’s just an analogy for now. At the top we  have a content layer, the text of the letter:
  118. 11:42what you actually want to say. I’ll call the next  layer the recipient layer: the “To: Bob” part,
  119. 11:49indicating who inside the house should read the  letter. Below that is the address layer, which
  120. 11:54is the destination address of the house where  that person lives. Next is the local delivery
  121. 12:00layer, which handles moving the envelope to the  next stop on the path using cars and trucks:
  122. 12:05from your house to post office A, then post  office B, then Bob’s house. With these four
  123. 12:11roles we already have a simple 4-layer model,  similar to the TCP/IP stack I showed before.
  124. 12:17But we can add one more layer at the  bottom. I’ll call it the infrastructure
  125. 12:22layer: the roads and other paths that  the vehicles travel on. But really,
  126. 12:26these bottom two layers are related and always  work together. If traveling over ground,
  127. 12:32local delivery uses a car or truck. If  traveling in the air, local delivery uses
  128. 12:37an airplane. If traveling by water, local  delivery uses a ship. And often the letter
  129. 12:43will travel over multiple kinds of paths in its  journey: ground, then air, then ground again,
  130. 12:49for example. You can either think of these  bottom two layers as one combined delivery layer,
  131. 12:54or split them into two layers. And that’s why some  networking models use 4 layers and some use 5.
  132. 13:03One of the benefits of a layered system like  this is how the layers work together, but
  133. 13:08remain separate. Each layer has its own job. They  work together to deliver the message, but each
  134. 13:14one focuses on its own task. The Content layer  focuses on the actual contents of the letter,
  135. 13:21and that doesn’t change throughout the journey.  The Recipient layer focuses on the individual
  136. 13:26person who should receive the letter, and also  remains the same from start to finish. Likewise,
  137. 13:32the Address layer focuses on the address of the  house or building to which the letter should be
  138. 13:36delivered, and that stays the same as well. The  Local Delivery layer focuses on getting the letter
  139. 13:43to the next stop in the route: post office A,  then post office B, and finally Bob’s house. The
  140. 13:50Infrastructure layer is the system of roads and  mail trucks that the delivery process relies on.
  141. 13:56What happens inside one layer doesn’t change the  job of the other layers. For example, changing the
  142. 14:02content of the letter doesn’t change the delivery  steps. And changing the delivery path doesn’t
  143. 14:07affect the letter itself. When you’re writing the  letter to Bob, you don’t have to think about how
  144. 14:12the postal service will go about delivering it. Of  course, that doesn’t mean the layers are entirely
  145. 14:18independent. For example, if you address the  letter to somewhere overseas, that will influence
  146. 14:23how it’s delivered. But that’s not your concern  as you write the letter. This separation of layers
  147. 14:30is true in our mail system model example, and  it’s true of networks as well. Now let’s replace
  148. 14:35letters with data and roads with networks, and  build the 5-layer TCP/IP model we’ll actually use.
  149. 14:44Here are the five layers of our mail system.  Let’s map them to the TCP/IP model. The Content
  150. 14:50layer is equivalent to the TCP/IP Application  layer. The Recipient layer maps to the Transport
  151. 14:56layer. The Address layer matches the Internet  layer. These are the same names I showed before
  152. 15:02for the TCP/IP model. But I’m going to use  a different name next. The Local Delivery
  153. 15:08layer matches what I’ll call the Local Network  layer. This is the layer used for delivering
  154. 15:13messages within a LAN, a local area network.  There are a few different names for this layer,
  155. 15:18but I’ll go with “Local Network”. And finally  the Infrastructure layer is equivalent to the
  156. 15:23Physical layer. At this point, these  names probably don’t mean much to you,
  157. 15:29so next we’ll see how they actually work in  a real network between a client and a server.
  158. 15:36Here is a simple network I’ll use to demonstrate.  You’ve seen these icons before. On the left,
  159. 15:41we have PC1, a client that will send a request  to SRV1, the server on the right. Between them
  160. 15:48are two routers, R1 and R2, and two switches: SW1  between PC1 and R1, and SW2 between R2 and SRV1.
  161. 15:58PC1 is running a web client application; in  other words, a web browser such as Chrome.
  162. 16:04SRV1 is running a couple of processes: a  web server and a file server. PC1’s user
  163. 16:11wants to access a web page hosted on SRV1, so  the web client on PC1, let’s say it’s Chrome,
  164. 16:17needs to send a request to the web server  on SRV1. That’s the role of the application
  165. 16:23layer: it includes protocols for communication  between application processes and is responsible
  166. 16:28for creating and interpreting the data. But  there’s a problem: there are multiple processes
  167. 16:34running on SRV1: a web server process and a  file server process, and possibly more. So,
  168. 16:41how can PC1 ensure that its request reaches  the correct process on SRV1? That’s the role
  169. 16:47of the Transport layer. Each process on SRV1  has an associated transport “port number”:
  170. 16:5480 for the web server and 21 for the file server.  Don’t worry about the exact numbers for now;
  171. 17:00that’s for later in the course. The important  point is that, to send the message to the web
  172. 17:05server, PC1 addresses it to port 80. Don’t  be confused by the name “port”; these aren’t
  173. 17:11physical ports like we looked at in the previous  lecture. Here, a port is just a number used to
  174. 17:17identify a process running on a host. The role  of the Transport layer is to provide end-to-end
  175. 17:23communication between application processes, such  as the web browser on PC1 and the web server on
  176. 17:29SRV1, using port numbers. But we still have a  problem: even if the message is addressed to
  177. 17:35the correct port on SRV1, we still have to make  sure the message reaches SRV1 in the first place.
  178. 17:42SRV1 has an IP address for that purpose. For  example, let’s say its IP address is 10.1.1.1.
  179. 17:50Again, don’t worry about the format of the address  itself yet; that’s a topic for another video. By
  180. 17:57addressing its message to SRV1’s IP address,  PC1 tells the routers in the path which host
  181. 18:02the message should be delivered to. That’s the  role of the Internet layer: it provides end-to-end
  182. 18:08communication between hosts, from the source host  to the destination host, using IP addresses and
  183. 18:14routers. When you think of the Internet layer,  think “IP addresses and routers.” And “host”,
  184. 18:20by the way, just means a device connected to  the network that can send and receive data,
  185. 18:25such as PC1 and SRV1. So, we’re getting close  to achieving our goal of getting PC1’s request
  186. 18:32to SRV1, but we’re not quite there yet. There are  several devices between PC1 and SRV1, and we need
  187. 18:39to make sure the message is properly passed along  between them. That’s the role of the Local Network
  188. 18:45layer. Using protocols at this layer, such as  Ethernet, each device sends the message to the
  189. 18:50next device on the local network: PC1 to R1 via  SW1,R1 forwards the message to R2. And finally,
  190. 19:00R2 forwards the message to SRV1 via SW2. The Local  Network layer provides hop-to-hop delivery within
  191. 19:07a local network using MAC addresses and switches.  I’ll explain the term “hop-to-hop” more in a bit,
  192. 19:14and MAC addresses are a topic for another video.  Looking at this diagram, you might wonder about
  193. 19:19the role of the switches; they connect devices in  a LAN and pass messages between them. We’ll look
  194. 19:26at how that works in detail in future  videos. Okay, and last but not least,
  195. 19:31we have the Physical layer: all of these cables  connecting the devices, and the transceivers on
  196. 19:36the devices that transmit and receive signals. The  Physical layer sends bits as electrical, optical,
  197. 19:43or radio signals over the physical medium.  Electrical signals over copper UTP cables,
  198. 19:49optical signals over fiber-optic cables, and  radio signals over wireless Wi-Fi connections.
  199. 19:57We’ve covered the role of each layer.  But now let’s go from the bottom up,
  200. 20:01from the Physical layer to the Application layer,  and look at a few more details. The Physical
  201. 20:07layer, also called “Layer 1”, is responsible  for sending and receiving bits as electrical,
  202. 20:12optical, or radio signals over the medium.  It defines things like cables, connectors,
  203. 20:18signal levels, and link speeds: all of the  physical aspects of communication. Examples
  204. 20:24include copper UTP and fiber-optic cables, Wi-Fi  radios and antennas, and network interface cards,
  205. 20:31also called NICs. Here are a few examples: UTP  ports and a cable on the left, fiber-optic in the
  206. 20:38middle, and an image of a NIC on the right. Each  network interface has a NIC like this inside of
  207. 20:44the device. The physical aspects of transmitting  data are very complex, involving a lot of
  208. 20:50electrical or optical engineering. Fortunately,  network engineers typically don’t have to know
  209. 20:56the low-level details of how it all works. So,  that’s the Physical layer: Layer 1 of our TCP/IP
  210. 21:02model. In some models this layer is combined  with the next layer, but I think it’s useful
  211. 21:07to differentiate between the physical concerns  like these and the logical aspects of Layer 2.
  212. 21:14Next, we have the Local Network layer, Layer  2. This layer provides hop-to-hop delivery of
  213. 21:20messages on a local network. So, what exactly  is a “hop”? A hop is one step along the path
  214. 21:27between two devices: from one router or host,  to the next router or host in the path. When PC1
  215. 21:34sends a message to SRV1, how many hops are there?  The first hop is from PC1 to R1. The second hop
  216. 21:42is from R1 to R2. And the third hop is from R2 to  SRV1, so three hops in total. Switches don’t count
  217. 21:50as hops: a switch just extends the local network,  allowing multiple devices to connect. To keep the
  218. 21:56diagram simple I only show one host connected to  each of the switches, but there could be many more
  219. 22:02connected, like this. The switch allows them all  to connect to the same local area network. We’ll
  220. 22:08look at switches and LANs in detail in later  videos, so don’t worry about them for now.
  221. 22:13Layer 2 uses MAC, Media Access Control, addresses  to identify interfaces. Each device connected to
  222. 22:21a LAN has a unique MAC address for that  specific interface. Since R1 and R2 have
  223. 22:27multiple interfaces connected to the network,  let’s add some simple interface labels. G1, for
  224. 22:34GigabitEthernet1, and G2, for GigabitEthernet2,  meaning these interfaces operate at a speed of 1
  225. 22:40gigabit per second. PC1 sends the message  to the MAC address of R1’s G1 interface,
  226. 22:47its NIC. That’s the interface that will receive  PC1’s message. R1 sends the message to the MAC
  227. 22:54address of R2’s G1 interface. And R2 sends  the message to the MAC address of SRV1’s
  228. 23:00interface. Once again, we’ll cover MAC addresses  in another video when we learn about switches.
  229. 23:06The key protocols at this layer that you should  know for the CCNA are Ethernet and Wi-Fi. Others
  230. 23:13exist, of course, but these are by far the  most commonly used Layer-2 protocols today.
  231. 23:20Next up we have the Internet layer, which  is Layer 3 of our model. This layer provides
  232. 23:25end-to-end delivery between hosts across multiple  networks. We call it “end-to-end” because it
  233. 23:31focuses on getting the message from the source  host all the way to the final destination host,
  234. 23:37instead of worrying about each individual  hop in the middle. Remember, “Internet”
  235. 23:42means “internetwork”, between networks. It uses  IP addresses to identify hosts in the network,
  236. 23:48kind of like a home address. In our example, SRV1  has the IP address 10.1.1.1. So when PC1 sends
  237. 23:57a message to SRV1, it addresses the message to  SRV1’s IP address. Routers operate mainly at this
  238. 24:05layer, using the message’s destination address to  forward the message toward its final destination
  239. 24:10host. There are a few protocols at this layer  that you’ll learn about for the CCNA: IP,
  240. 24:16both version 4 and version 6, and ICMP,  the Internet Control Message Protocol.
  241. 24:24Next is Layer 4, the Transport layer. This  layer provides end-to-end communication between
  242. 24:30application processes. And why is that needed?  Well, in our example, our server, SRV1, provides
  243. 24:37multiple services. It’s running a web server and  a file server, and perhaps other services. If SRV1
  244. 24:44receives a message, it needs a way to know which  of these services should receive the message.
  245. 24:49This can also be called “process-to-process”  or “service-to-service” communication. This
  246. 24:55layer uses port numbers to identify the processes  on each host, such as port 80 for the web server
  247. 25:01and port 21 for the file server. So, when the web  client on PC1 wants to send a request to the web
  248. 25:08server running on SRV1, it addresses the message  to port 80. And if PC1 wanted to access the file
  249. 25:15server instead, it would address its messages  to port 21. The Transport layer allows hosts
  250. 25:21to differentiate between these different streams  of data. Layer 4 runs mainly on the communicating
  251. 25:27hosts, PC1 and SRV1. Routers normally operate  based on IP, Layer 3, not on Transport-layer
  252. 25:35information. There are exceptions of course,  but that’s a topic for later in the course.
  253. 25:41Layer 4 is primarily a conversation between the  two communicating hosts. There are a few protocols
  254. 25:48used at this layer. The two most prominent are  UDP, User Datagram Protocol, and TCP, Transmission
  255. 25:55Control Protocol. They both offer some different  features, and we’ll cover them in this course.
  256. 26:03Finally, we have layer 5: the Application  layer. This is where network communications
  257. 26:09meet applications. Small side note:  this layer is usually called “Layer
  258. 26:147”. I’ll explain why later when we talk about  another model, the OSI model. The Application
  259. 26:20layer defines how application processes  format, send, and interpret data. So,
  260. 26:26when Chrome on PC1 sends a request  to the web server process on SRV1,
  261. 26:31it uses an Application-layer protocol such  as HTTP to format and send the message,
  262. 26:37and that same protocol tells the web server how  to interpret the message it receives. Protocols
  263. 26:43at this layer define message formats and rules  for specific tasks. Here are a few examples. For
  264. 26:50browsing web pages, we use HTTP, or more often  its secure version, HTTPS. For file transfers,
  265. 26:58we can use FTP, TFTP, or another similar  protocol. And email uses its own protocols, too.
  266. 27:06Don’t worry about the specific protocols or their  names at this point, right now we’re just talking
  267. 27:11big concepts. Network infrastructure devices  like routers and switches typically don’t care
  268. 27:18about Application-layer details. This is too  high-level for them. They just move messages
  269. 27:23across the network. Only the communicating  hosts, PC1 and SRV1 in this case, actually
  270. 27:30look at and interpret the Application-layer  data. Now that we’ve seen what each layer does,
  271. 27:36how does a single message actually include all of  this information at once? Let’s see how the layers
  272. 27:42combine into a stack and how data moves through  them using encapsulation and decapsulation.
  273. 27:49To show how encapsulation and decapsulation  work, let’s simplify the network, making it a
  274. 27:54direct connection between PC1 and SRV1. First,  the Application layer prepares the data to be
  275. 28:01sent over the network, for example an HTTP request  that Chrome on PC1 sends to a web server running
  276. 28:08on SRV1. As the message moves down the stack, each  layer encapsulates the data with a header that
  277. 28:16contains the information needed by that layer.  For example, the source and destination addresses:
  278. 28:22Layer 4 port numbers, layer 3 IP addresses, and  Layer 2 MAC addresses, among other information.
  279. 28:30So first, the Transport layer encapsulates  the data with its header, the Layer 4 header,
  280. 28:35with source and destination port numbers  and other information. Then the Internet
  281. 28:40layer adds its header with source and destination  IP addresses. Then, Layer 2 encapsulates the data
  282. 28:47with both a header and a trailer. The trailer  is used by the receiving device to check for
  283. 28:52transmission errors. We’ll look at this in  more detail in a later video about Ethernet.
  284. 28:58Finally, the Physical layer transmits the  bits as signals over the physical medium,
  285. 29:03which is an Ethernet cable in this case. I’m  showing the message in order from left to
  286. 29:08right here. So the Layer 2 header is transmitted  first, and Layer 2 trailer is transmitted last.
  287. 29:17So that was the encapsulation process, now let’s  look at decapsulation. The receiving device
  288. 29:23receives the message as a stream of bits at layer  1. Layer 1 simply passes those bits up to the next
  289. 29:29layer. Now it’s up to the other layers to  interpret those bits. The device examines the
  290. 29:35information in the Layer 2 header and trailer, and  then removes them. This is called “decapsulation”,
  291. 29:41or sometimes “de-encapsulation”. The decapsulation  process continues up the stack. So, Layer
  292. 29:483 examines and removes the Layer 3 header. Then  Layer 4 examines and removes the Layer 4 header,
  293. 29:55and the data is delivered to the Application  layer. Now the application processes the data and,
  294. 30:01if needed, generates a response that goes back  down the stack, and is then transmitted back to
  295. 30:06PC1. So, that’s the decapsulation process, which  is basically the encapsulation process in reverse.
  296. 30:15Each device has its own network stack.  A message from PC1 goes down its stack,
  297. 30:21crosses the wire, and then goes up SRV1’s  stack where the Application layer processes
  298. 30:25it. The response does the same thing in the  opposite direction. It goes down SRV1’s stack,
  299. 30:31is sent over the wire to PC1, and then goes  up PC1’s stack where the data is interpreted
  300. 30:36by the application. In a real network there are  switches, routers, and other devices between the
  301. 30:42hosts. That adds more steps to the delivery  process, just like the mail system example,
  302. 30:47where the letter is moved between cars and trucks.  But the overall flow is still the same: each
  303. 30:53host sends the message down its stack, across the  network, and up the other host’s stack. We’ll look
  304. 31:00at how those intermediate devices - the routers  and switches - handle messages in later videos.
  305. 31:07Now that we’ve seen how encapsulation and  decapsulation work, let’s look at what to call
  306. 31:12these messages. At each stage in the encapsulation  and decapsulation process, there is a name given
  307. 31:18to the message. The combination of data and a  Layer 4 header is called a segment when using TCP,
  308. 31:25or a datagram when using UDP. Remember that point:  TCP creates segments, and UDP creates datagrams.
  309. 31:33This difference has to do with how TCP and UDP  treat the data, but we don’t need those details
  310. 31:38yet. The combination of a segment or datagram and  a Layer 3 header is called a packet. “Packet” is
  311. 31:46the most common term we use when talking about  messages being sent over a network, but strictly
  312. 31:51speaking it refers to the message at this stage in  the process. Finally, the combination of a packet
  313. 31:57and a Layer 2 header and trailer is called  a frame. This is what is actually sent over
  314. 32:02the wire. You’ll never see a packet, segment,  or datagram travelling over the wire itself;
  315. 32:08they are always sent inside a frame. We can also  use alternative names to describe the message at
  316. 32:14each stage, using the term protocol data unit,  or PDU. A segment or datagram is a Layer 4 PDU,
  317. 32:21or L4PDU. A packet is a Layer 3 PDU, or L3PDU. And  a frame is a Layer 2 PDU, or L2PDU. Both names are
  318. 32:33common, so I recommend knowing both. And there’s  one more important term to learn. The contents
  319. 32:39of each PDU, that is everything encapsulated by  the layer’s header and trailer, are called the
  320. 32:44payload. So, at Layer 4 a segment or datagram’s  payload is the application data itself. At Layer
  321. 32:513, a packet’s payload is a segment or datagram,  including the Layer 4 header and the data. And at
  322. 32:58Layer 2, a frame’s payload is a packet, including  the Layer 3 and Layer 4 headers and the data. Just
  323. 33:05remember that the payload is what’s inside the  PDU, not including that layer’s header or trailer.
  324. 33:13Finally, let’s talk about how these layers  interact with each other. I’ve replaced the
  325. 33:17generic layer names with examples of common  protocols. Also note the distinction between
  326. 33:23Layer 2 Ethernet, which defines MAC addressing  and frames, and Ethernet at the physical layer,
  327. 33:29which defines the signaling and physical  media. Each layer in the stack provides a
  328. 33:34service to the layer above it, and is serviced by  the layer below it. This is called adjacent-layer
  329. 33:40interaction. For example, Layer 4 provides a  service to Layer 5 by delivering data to the
  330. 33:47correct application using port numbers. Layer  3 provides a service to Layer 4 by delivering
  331. 33:53segments and datagrams to the correct destination  host using IP addresses. Layer 2 provides a
  332. 34:00service to Layer 3 by delivering packets to  the next hop using MAC addresses. And Layer
  333. 34:061 provides a service to Layer 2 by sending and  receiving the frame’s bits as electrical, optical,
  334. 34:11or radio signals over the physical medium. Each  layer relies on the layer below it to do its job.
  335. 34:20There’s also a related concept. Each layer  communicates with the same layer on other devices,
  336. 34:26and this is called same-layer interaction.  For example, the Application layer on one host
  337. 34:31sends data to the Application layer on the other  host. A segment or datagram is addressed to the
  338. 34:37Layer 4 port number of the correct application  on the destination host. A packet is addressed
  339. 34:43to the Layer 3 IP address of the destination  host. A frame is addressed to the Layer 2 MAC
  340. 34:49address of the next hop. And signals sent  out of a physical port are received by a
  341. 34:54physical port on the connected device.  This layered cooperation - within each
  342. 34:59device and between devices - is what  makes network communication possible.
  343. 35:05Just like in our mail system example, the  separation of layers is key to how networks
  344. 35:10work. Each layer has its own job and provides a  specific service to the layers above. Because the
  345. 35:17layers are modular, we can swap protocols at one  layer without changing the others. For example,
  346. 35:23instead of a web page exchange using HTTP and  TCP, maybe it’s a file exchange using TFTP,
  347. 35:30Trivial File Transfer Protocol, over UDP.  The lower layers in the stack can use IP
  348. 35:36and Ethernet without worrying about  the details of what the upper layers
  349. 35:40are doing. And if instead of a wired Ethernet  connection it’s a wireless Wi-Fi connection,
  350. 35:46Layers 1 and 2 can change to Wi-Fi without  affecting the upper layers. As long as each
  351. 35:51layer keeps its “contract” with the layers above  and below, we can improve or replace protocols at
  352. 35:57different layers without redesigning everything.  That flexibility is one of the main benefits of a
  353. 36:02layered model. Now that we’ve built  this 5-layer TCP/IP model, let’s see
  354. 36:08how it compares to other models you’ll see in  other courses and books, like the OSI model.
  355. 36:15You might have heard of the OSI model  before. If you’ve studied IT before,
  356. 36:19you almost certainly have. As I said at the  beginning of this video, TCP/IP development
  357. 36:24started in the 1970s, with work on ARPANET and  the early TCP/IP specifications. But in the late
  358. 36:311970s and 1980s, the International Organization  for Standardization, the ISO, designed a 7-layer
  359. 36:39model called OSI, Open Systems Interconnection,  and a matching protocol suite. The goal was to
  360. 36:45create international, vendor-neutral networking  standards that could unify existing proprietary
  361. 36:50stacks and potentially replace TCP/IP as the  vendor-neutral choice. Here is that model,
  362. 36:56with seven layers from top to bottom: Application,  Presentation, Session, Transport, Network, Data
  363. 37:04Link, and Physical. Governments, including the  US, promoted OSI as the preferred or recommended
  364. 37:10stack for new deployments. And for a while many  people thought that OSI was the future. But OSI
  365. 37:17protocols ended up being developed too late and  were too complex, and they never gained the same
  366. 37:22level of deployment as TCP/IP. I wasn’t around  at the time, but my understanding is that this
  367. 37:28was largely due to the bureaucratic nature of  the approach to developing OSI and its protocol
  368. 37:33stack. The process was very top-down: committees  designed the protocols in detail, and vendors were
  369. 37:40expected to implement them exactly as specified.  TCP/IP used a more bottom-up approach. In the end,
  370. 37:47TCP/IP won in the real world, although some  OSI technologies are still used. Today,
  371. 37:54almost all networks use the TCP/IP protocol stack,  but the 7-layer OSI model survives as a reference
  372. 38:00and teaching model, and as a common way to talk  about layers. Actually, most networking resources
  373. 38:06use a 5-layer model like the one I covered in this  video, but with names borrowed from the OSI model.
  374. 38:12Here is that 5-layer model. I foreshadowed this  earlier in the video, but this is why the TCP/IP
  375. 38:19Application layer is often called Layer 7: because  the Application layer is Layer 7 of the OSI model.
  376. 38:26I’ve also highlighted the two layer names that  are different from the model I introduced:
  377. 38:30Layer 3 is called the Network layer, and  Layer 2 is called the Data Link layer.
  378. 38:37And to make things even more confusing, here’s  a selection from Wikipedia of different models
  379. 38:42proposed by various authors. Here we have the  four-layer TCP/IP model I showed at the beginning
  380. 38:48of this video. Here is the seven-layer OSI model.  And the adapted five-layer model I just showed in
  381. 38:55the previous slide. When you see all of these  variations, you might wonder which model and
  382. 39:01which names you should actually learn. Of course,  I recommend the five-layer model I presented in
  383. 39:06this video, because I think its names best match  the job of each layer. But this five-layer model
  384. 39:12shown here is probably the most common in books  and other resources. The only differences from my
  385. 39:18model are that Layer 3 is called the Network  layer and Layer 2 is called the Data Link
  386. 39:23layer. In the end, it’s not that important:  in practice people usually just refer to
  387. 39:28“Layer 2” and “Layer 3”, and you won’t be  quizzed about layer names on the CCNA exam.
  388. 39:35Before wrapping up, let’s review the key  concepts from this video. I won’t explain
  389. 39:40everything again here; I’ll just point out what  you should focus on as you review. The first is,
  390. 39:45of course, the TCP/IP model itself. You should  know the general purpose of each of these
  391. 39:50layers. I also recommend knowing these more  commonly used names borrowed from the OSI model.
  392. 39:57It’s also important to understand the  encapsulation and decapsulation processes.
  393. 40:02In encapsulation, the sending  host adds headers, and a trailer,
  394. 40:05to the data to prepare it for transmission  over the physical medium. In decapsulation,
  395. 40:10the receiving host removes the headers and trailer  layer by layer until it gets to the data inside.
  396. 40:17You should also know the names of the different  PDUs, protocol data units. The Layer 4 PDU is a
  397. 40:23segment when using TCP and a datagram when using  UDP. The Layer 3 PDU is called a packet. And the
  398. 40:30Layer 2 PDU is called a frame; the frame is what  is actually transmitted over the physical medium.
  399. 40:36And finally, you should understand adjacent-layer  interaction and same-layer interaction. These
  400. 40:42concepts describe how the different layers  work together within each host and with
  401. 40:45their counterparts on other devices to achieve  communication between applications over a network.
  402. 40:52That’s all for this video on the TCP/IP model. By  now you should have a mental picture of the five
  403. 40:58layers, what each one is responsible for, and  how they work together using encapsulation and
  404. 41:03decapsulation. You don’t need to remember every  example or every historical detail; the important
  405. 41:08thing is that you know the layers, their general  roles, and the idea of PDUs and layer interaction.
  406. 41:14We’ll keep coming back to this model throughout  the course. You’ll hear the terms “Layer 1”,
  407. 41:19“Layer 2”, “Layer 3”, and so on many times.  As we dive into topics like Ethernet,
  408. 41:25IP addressing, TCP, and routing, you’ll be  able to place each new concept at the right
  409. 41:30layer and see how it fits into  the bigger picture. Just remember,
  410. 41:33this is a model, not a law. Real protocols  don’t always fit neatly into a single layer,
  411. 41:38and that’s okay. The model is just a tool to help  you think about what’s happening in the network.
  412. 41:43If you’d like a structured companion to  these videos, I’ve also written two books:
  413. 41:47Acing the CCNA Exam Volume 1 and Volume 2. They  go into more detail than I can fit in the videos,
  414. 41:53and include hundreds of diagrams and practice  questions. I honestly think they’re my best
  415. 41:58work when it comes to teaching the CCNA. If  you’re interested, you can find them on Amazon,
  416. 42:03or use the links in the description to get them  directly from the publisher. Thanks for watching.
  417. 42:08Before we wrap up, I want to say a quick thank  you to the channel members whose names you see
  418. 42:12on screen. Your monthly support helps me keep  making these videos and keep this content free
  419. 42:17for everyone on YouTube. I really appreciate  it: thank you for your support. If the video
  420. 42:22was helpful and you want to support me, click  the join button under the video. Thanks again.

About this transcript

This page contains the full transcript of How the TCP/IP Model Actually Works | CCNA Day 3 by Jeremy's IT Lab, generated from the public captions YouTube serves with the video. The transcript has 6,715 words across 420 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.