# TCP/IP model

This is a special case OSI model, because it contains less levels.

## Application

## Transport

This is basically OSI Transport, Session and a bit of Application layers.

* Connection oriented protocols: TCP
  \*

  ```
  <figure><img src="https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2Fl7njKUaSxSitTdPDtq8h%2FScreenshot%202023-10-11%20at%2009.19.38.png?alt=media&#x26;token=b707fceb-2e55-4de0-8877-a72db302f2d0" alt=""><figcaption></figcaption></figure>
  ```
* Connectionless protocols: UDP (DNS and DHCP use UDP)

<figure><img src="https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2FGQ7mWfdqTgLGl4GCi1Eg%2FScreenshot%202023-09-26%20at%2009.15.28.png?alt=media&#x26;token=82c81932-e3f4-4078-b59b-ebdeb1bd05e1" alt=""><figcaption><p>TCP segment</p></figcaption></figure>

<figure><img src="https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2F5zDbZJQtCurVAejnai4Y%2FScreenshot%202023-09-26%20at%2009.19.50.png?alt=media&#x26;token=40ec68fb-21eb-42fc-a946-708230cfb136" alt=""><figcaption><p>UDP datagram</p></figcaption></figure>

Data comes from Application layer => Transport layer breaks the data into chunks, adds info about ports, checksums (creates TCP segment) => hand TCP segment to Internet layer, which creates IP packet out of it.

`netstat -n` to check sessions

## Internet

"IP packet layer". Any device or protocol which deal with IP packets:&#x20;

* getting IP packet to its destination
* create IP packet

Protocols on this layer:

* IPv4
* IPv6
* ICMP

## Link/Network interface

Actually joins layers 1 and 2 from OSI.

Cabling, physical address, NICs, switches.

Ethernet Frames are used on this level (PDU - protocol data unit).

{% hint style="info" %}
How ComputerA will realise MAC address of ComputerB?&#x20;

ComputerA will send a ARP request to FF-FF-FF-FF-FF-FF MAC address (universal broadcast MAC address) and then ComputerB will send ARP reply. After this ComputerA will send Ethernet frames.

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2FKtGY7Vc3ClyOawMtMeph%2FScreenshot%202023-10-11%20at%2009.31.28.png?alt=media\&token=8b737650-f237-4e31-871e-c03841875300)
{% endhint %}

<figure><img src="https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2FQw2z3ty68OzTKhO8MEqX%2FScreenshot%202023-10-11%20at%2009.26.15.png?alt=media&#x26;token=d1d10138-0ab6-4eb9-a95b-b1f67b367724" alt=""><figcaption></figcaption></figure>

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2Fi13N4bGOIYEImcRobhvG%2FScreenshot%202023-09-26%20at%2009.31.26.png?alt=media\&token=d2abdc58-c2b3-4955-bce0-c8ecdccb3180)<img src="https://415484505-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LxtoAXZwwOc4XGto8vb%2Fuploads%2Fo771pbJ9ErA5oVmDQDqC%2FScreenshot%202023-09-26%20at%2009.32.18.png?alt=media&#x26;token=e76659f4-19a8-4d52-9a8b-0e1d9565621f" alt="" data-size="original">
