---
# System prepended metadata

title: 1 Introduction to TCP/IP
tags: [CCNA]

---

# 1 Introduction to TCP/IP
###### tags: `CCNA`

### TCP IP / OSI 7 layer 架構圖


**Internet layer** 主要是在處理封包在多個網路中的routing
**Host to Host layer** 主要隔離了上層的應用服務，使用相對應的Port做資料傳送


### Same-Layer and Adjacent-Layer Interactions

![](https://i.imgur.com/n4nmBop.png)


### Data Encapsulation TCP/IP:

![](https://i.imgur.com/oGEyR2b.png)

### Basic Routing Example
![](https://i.imgur.com/LGxA1Z4.png)

### Names of TCP/IP Messages
![](https://i.imgur.com/Libbh97.png)

### OSI model compare to Two TCP/IP model
![](https://i.imgur.com/RBpZmke.png)




### Host to Host Layer TCP and UDP
#### TCP
- connection-oriented的通訊
:::info
代表它會確認封包有沒有收到
:::
- flow control
- 缺點會佔頻寬，但對上層的設計有一些幫助，上層就不用再設計一個去確保封包有沒有遺失的功能

### about packet information
- header length 20 加上option 做多24byte
- #附上header 的format圖片
- source port
- destination port 
- flag 用來表示 是建立 終結 或rest 等
- 某些應用會有固定使用的port，剩下1023以下的port目前都reserve



**TCP運作**
- segment
- 依序編號
- 到目的端的TCP 重新將資料組成正確的順序
- 會有handshake建立連線
- 會發ack來告知我有收到，以及我下筆需要的sqe number


#### UDP
- 不會做封包有沒有收到的確認，因此也比較不會站頻寬



問題1:question: 
- Network address
- node address
ex: **172.16**.30.56
**Network address** 應該是這個IP的網段的意思?
**node address** 應該是host IP?

問題2:question: 
- 有效的host address
ex: **10.10.10**.1 
10.10.10.0 ~ 10.10.10.255 ? P.2-41
第一個跟最後一個也算有效位址嗎?
應該是 10.10.10.1 ~ 10.10.10.254才算?

