> For the complete documentation index, see [llms.txt](https://sliu583.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sliu583.gitbook.io/blog/networking/index/computer-networking-a-top-down-approach/stanford-cs144/chapter-1/1.2-the-4-layer-internet-model.md).

# 1.2 The 4-Layer Internet Model

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgWmJBjv0e_Hp6P18bc%2F-MgWoY17XRR5j1NkbxWX%2Fimage.png?alt=media\&token=ddc87957-a846-4ec9-a416-a8427336c4cf)

* Internet: end-hosts, link, and routers&#x20;
  * Data delivered hop-by-hop over each link in turn&#x20;
    * In packet: data, header (from, to)&#x20;
* **Link layer**: carry data over one link at a time&#x20;
  * E.x. ethernet, WiFi&#x20;
* **Network layer**: deliver packets end-to-end across the Internet from the source to the destination&#x20;
  * Network layer packets: datagrams&#x20;
  * Hands datagrams to the Link Layer, telling it to send the datagram over the first link&#x20;
    * Link layer provides service to the network layer&#x20;
  * Special&#x20;
    * Must use the Internet Protocol (IP)&#x20;
      * IP makes a best-effort attempt to deliver datagrams to the other end, but no promises&#x20;
      * IP datagrams can get lost, can be delivered out of order, and can be corrupted. No guarantees&#x20;

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgWmJBjv0e_Hp6P18bc%2F-MgWprS0hgRFunJmsAXR%2Fimage.png?alt=media\&token=fc1a6047-4c12-4e88-ba44-abc902a5ae6a)

* **Transport Layer**&#x20;
  * TCP: transmission Control Protocol&#x20;
    * Ensure orders
    * Provides service to application that guarantees *correct, in-order* delivery of the data running on top of the network layers&#x20;
  * UDP: user datagram protocol&#x20;
    * No delivery guarantees&#x20;
* **Application Layer**&#x20;
  * Typically, Bi-directional, reliable byte stream&#x20;

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgWmJBjv0e_Hp6P18bc%2F-MgWrPDFl2q8b-WrL2gG%2Fimage.png?alt=media\&token=0718cf9e-f3a0-4a10-8370-ed892f9d8f40)

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgWmJBjv0e_Hp6P18bc%2F-MgWrjZ6yk0x54Y85dS6%2Fimage.png?alt=media\&token=c7713740-740c-402b-bd72-1b590d162dbf)

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgWmJBjv0e_Hp6P18bc%2F-MgWrwBHYbMlK00vvFv-%2Fimage.png?alt=media\&token=07ca41a6-367b-4264-9977-b08dc5a0dedf)

![](https://2097630930-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVORxAomcgtzVVUqmws%2F-MgWs32E39TBALg3W0Y-%2F-MgWsCGymZuI-RDslzKW%2Fimage.png?alt=media\&token=0c3672eb-e2d9-4754-9786-1275eedf2129)

* Numbering system:&#x20;
  * Network layer: layer 3&#x20;
  * Ethernet: layer 2&#x20;
  * Application: layer 7
