> 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

![](/files/-MgWoY17XRR5j1NkbxWX)

* 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;

![](/files/-MgWprS0hgRFunJmsAXR)

* **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;

![](/files/-MgWrPDFl2q8b-WrL2gG)

![](/files/-MgWrjZ6yk0x54Y85dS6)

![](/files/-MgWrwBHYbMlK00vvFv-)

![](/files/-MgWsCGymZuI-RDslzKW)

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