# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET 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?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
