CCNetwork
===
RoyChao @2021
- **DSL ( Digital Subscriber Line )**
- 用電話線未使用的頻段,傳送數據
- 人:300~3.4K Hz
- 數據: 200k~800k Hz
- DSL
- ADSL: 非對稱(下載速度>上傳)
- SDSL:
- VDSL: 比ADSL快很多,但是距離電信供應商距離要很近(<300m)
- **Cable Network**
- 用 不同頻率 分頻道
- **HFC**(Hybrid Fiber Coax)
- 混合光纖銅軸網路
- 直接連上 ISP router
> ### transmission rate = bandwidth = bits per second
> = 每秒多少bits
- **Ethernet**
- 連上 ISP( Internet Service provider )
- Ethernet switch
- 用戶透過Ethernet switch連線到ISP, 藉此連到網路
- 傳送封包: Packets
- **Delay:**
- **Processing Delay**
- 經過 Router 時 **Router Decision** 過程中所耗的時間
- Router Decision: **Routing** and **Forwarding**
- (Router判斷要把你送到哪)
- **Queuing Delay**
- 離開 Router 時在 Output Queue 排隊的時間
- (Router判斷完你該去哪後,把你送去該出口排隊離開)
- **Transmission Delay**
- 從 Outout Queue 要出去時,要依照網路頻寬的速度來送出
- Ex. 100Mbps Bandwidth 送出 1500bits 的 packet:
- Transmission Delay: 1500 bits / 100Mbps = 15 ns
- **Propagation Delay**
- 終於到網路線上了,在網路線上跑的速度的延遲
- 銅線 coax: 2 * 10^8 公尺/每秒
- 光纖 fiber:3 * 10^8 公尺/每秒
- Ex. 光纖傳 10km:
- 10(km) / 3*10^8 (m/s) = 33.36ns
- **Physical media**
- coax: 銅線
- 可以同條銅線不同頻道(頻率不同)
- fiber: 光纖
- 一條光纖一個頻道
-
- **Switch**:
- **Circuit Switching** 電路交換
- 建立連線-佔用通道-開始傳送資料
- **FDM**: 用頻率 分出不同頻道
- **TDM**: 用時間 分出不同頻道(頻道輪流傳送資訊)

- **Packet Switching** 封包交換
- 將資料分割成Packet,透過不同路徑(不同router)將資料傳輸到目的地。
- Global ISP
- region ISP
- regional net
- routers
- Between global ISP: **IXP**(Internet exchange point)
- same level with global ISP: **Content Provider Network**
- ex. **Google**

- **Circuit Switching** vs **Packet Switching**
- 在相同硬體下,Packet Switching 可以服務較多使用者。
- terms
- protocols : 協議
- traceroute program : 計算ping
- 傳過去router再傳回來 時間 / 2
- Packet loss
- **Goodput**
- 只有有用的資訊才計算。每一秒接收到的有用bit資訊量
- **Throughput**
- 不管是不是正確/有用的資訊,每一秒接收端收到的bit資訊量
- 
- routers vs swithces

- transmission rate 傳輸速率: **bandwidth**
- **bandwidth**: **bits per second**
- instantaneous: transmission rate at the moment
- average: transmission rate on average
- **OSI Model**
```
### 第1層 實體層( Physical Layer )
實體層(Physical Layer),處理硬體與網路之間的互通。
- 針腳、電壓、網卡、主機介面卡、集線器、網路纜線規範等等...
- 傳送"資料框(Data Frame)"
### 第2層 資料連結層( Data Link Layer )
資料連結層(Data Link Layer),網址搜尋、偵錯和改錯。
若將資料添加**表頭(DLH)**與**表尾(DLT)**,將形成**資訊框(Data Frame)**
- 數據連結串列頭(DLH): 實體位置、錯誤偵測、改錯
- 數據連結串列尾(DLT): 指示數據包結尾的字串
- 乙太網路
- 無線區域網路(Wi-Fi)
- 通用分組無線服務(GPRS)
### 第3層 網路層( Network Layer )
網路層(Network Layer),決定資料傳輸的路徑選擇(與轉寄)
將"**網路表頭(NH)**"加入,則成為"**封包**"
- 網路表頭(NH)
- 網際網路協定(IP)
### 第4層 傳輸層( Transport Layer )
傳輸層(Transport Layer),紀錄所使用的協定
把"**傳輸表頭(TH)**"加入,形成**數據包**
- 傳輸控制協定(TCP)
- 用戶數據包協議(UDP: User Datagram Protocol)
- SSL -> TLS
### 第5層 會議層( Session Layer )
會議層(Session Layer),維護電腦網路中兩台電腦之間的通訊協定
### 第6層 表現層( Presentation Layer )
表現層(Presentation Layer),把數據轉換為接收者的系統傳輸格式
### 第7層 應用層( Application Layer )
應用層(Application Layer),應用軟體直接使用的設計介面,以與另一個軟體聯絡
- HTTP
- HTTPS
- FTP
- Teinet
- SSH
- SFTP ( SSH + FTP )
- SMTP
- POP3
```
- Peer-to-Peer ( **P2P** )
- Client as well as Server
- Routing Protocols:
- Dijkstra's Algorithm (LS)
- Bellman-Ford Algorithm (DV)
- AS: Autonomous System
- Inter-AS
- Deal with region
- common portocols:
- BGP: Border Gateway Protocol
- eBGP
- Edge between AS1, AS2...
- iBGP
- Edge inside AS1
- Gateway Router:
- Edge connect AS1 to AS2 ...
- has both eBGP and iBGP
- BGP messenges:
- OPEN
- UPDATE
- KEEPALIVE
- NOTIFICATION
- Intra-AS
- Connect between regions
- common portocols:
- RIP
- OSPF: Open Shortest Path First
- IGRP
- Intra-AS vs Inter-AS
- Intra-AS: focus on performance
- Inter-AS: focus on policy
- SDN: Software defined networking
-
Practices:
---
