---
# System prepended metadata

title: 已具資料統整(計算機網路)
tags: [ecloudvalley]

---

#  計算機網路

## 資安相關名詞

* botnet
* virus
* worm
* DDos
* IP spooting
* spyware
* packet sniffing (筆記手誤)

![image](https://hackmd.io/_uploads/ByxM-guaa.png)

![image](https://hackmd.io/_uploads/H1nf-euTT.png)

## 網路基本概念

* cookies
* IMAP v.s. POP3
* DNS(Domian name system)
* tracked, torrent
* DNS poisoning attack
* DNS provider
* web cache
* condition GET
* persistent HTTP

![image](https://hackmd.io/_uploads/SkYFbedpT.png)

![image](https://hackmd.io/_uploads/SyVjbgO6p.png)

![image](https://hackmd.io/_uploads/BkM2bgda6.png)

![image](https://hackmd.io/_uploads/ByxpZgupT.png)

### DNS的問題: 前身
假設一個DNS包含所有映射的DNS，會有四項問題
* 1. Single point of failure
* 2. Traffic volume
* 3. Distant centralized database
* 4. Maintenance

![image](https://hackmd.io/_uploads/S1t6Wl_6T.png)

解決方法 ---> Hierarchical database(筆記手誤)

![image](https://hackmd.io/_uploads/HyVkMld6a.png)

相關名詞

* Authoritire DNS Server
* Local DNS server



![image](https://hackmd.io/_uploads/SyIlfeuap.png)

* recursive query
* iterative query

![image](https://hackmd.io/_uploads/HyIzGguT6.png)

![image](https://hackmd.io/_uploads/SJQXMxuTp.png)

* DNS Caching

![image](https://hackmd.io/_uploads/S1gYXldpT.png)

* DNS RR format

![image](https://hackmd.io/_uploads/rJ5Kmgu6a.png)

* Attack DNS
    * DDOS
    * bombard TLD Server

![image](https://hackmd.io/_uploads/SkB2Xx_aT.png)

### TCP觀念
* 1. reliable
* 2. flow control
* 3. congestion control
* 4. In transport layer

### SSL加密
* 1. provide TCP encrypted connection
* 2. In application layer

### SMTP(Simple Mail Transfer protocol)
* 1. hand shaking
* 2. transfer msg
* 3. closure

![image](https://hackmd.io/_uploads/SyZ6Xe_TT.png)

![image](https://hackmd.io/_uploads/Bka67lO6T.png)


### Transport & Network layer
* UDP
* TCP

![image](https://hackmd.io/_uploads/rJZfqxdpa.png)

* Go back-N

![image](https://hackmd.io/_uploads/SJyD5euTT.png)

![image](https://hackmd.io/_uploads/BJv-jguTa.png)

* Select repeat

![image](https://hackmd.io/_uploads/HJGF5ldp6.png)

![image](https://hackmd.io/_uploads/H1nHilOap.png)

## TCP

### TCP segment structure

![image](https://hackmd.io/_uploads/H1W_sxuTp.png)

![image](https://hackmd.io/_uploads/B1cYje_pT.png)

### TCP retransmission scenarios
* 1. Lost ACK
* 2. Premature timeout
* 3. Commulative ACK

![image](https://hackmd.io/_uploads/r1eaol_Ta.png)

* TCP fast retransmit

![image](https://hackmd.io/_uploads/SkJ9hx_66.png)

![image](https://hackmd.io/_uploads/SJf3nld6a.png)

* Three-way handshake

![image](https://hackmd.io/_uploads/Sk_0hgu6T.png)


* Congestion Control
* 1. AIMD --> Slow start問題

![image](https://hackmd.io/_uploads/HJpwpe_6p.png)

![image](https://hackmd.io/_uploads/rJaY6ld6p.png)


![image](https://hackmd.io/_uploads/SkO56l_pp.png)

* TCP fair


![image](https://hackmd.io/_uploads/Bk4hal_pT.png)

* forwarding
* routing

![image](https://hackmd.io/_uploads/Bku66e_TT.png)

* Data plane
* Control plane

![image](https://hackmd.io/_uploads/S1fl0lOpp.png)

* Longest prefix matching(LPM)

![image](https://hackmd.io/_uploads/By5NRl_6T.png)

![image](https://hackmd.io/_uploads/r1gPCe_aT.png)


### 網路連結方式

1. Switch
2. Bus
3. Crossbar


![image](https://hackmd.io/_uploads/S1mc0eda6.png)

![image](https://hackmd.io/_uploads/BJSiRlO6a.png)

![image](https://hackmd.io/_uploads/H1_hReOaa.png)

### HOL (Hand of the line blocking)問題與排排程機制

* 問題

![image](https://hackmd.io/_uploads/S1uZ1Wd6p.png)

![image](https://hackmd.io/_uploads/rJ841bOpT.png)

* 解法
* 1. FIFO
* 2. Priority
* 3. RR
* 4. WFQ(Weighted Fair Queing)

![image](https://hackmd.io/_uploads/B1idkWuap.png)

![image](https://hackmd.io/_uploads/ByIj1Zu66.png)

![image](https://hackmd.io/_uploads/B132kZua6.png)


### ICMP protocol

![image](https://hackmd.io/_uploads/B1xfebOa6.png)

* network link layer

![image](https://hackmd.io/_uploads/ByTox-Opp.png)

### IP Addressing 方法

![image](https://hackmd.io/_uploads/rkqJZZupp.png)

*　Subnet Group

![image](https://hackmd.io/_uploads/r1yS-Wup6.png)

* CIDR

![image](https://hackmd.io/_uploads/r1aDWZu6p.png)

* IP 取得方式
* 1. 手動
* 2. 自動(DHCP)

![image](https://hackmd.io/_uploads/SkxoWb_T6.png)

![image](https://hackmd.io/_uploads/B1Tab-O6p.png)

![image](https://hackmd.io/_uploads/ry7Cb-Oap.png)

### NAT(Networling Addressing Translation)

![image](https://hackmd.io/_uploads/Syr1GW_aa.png)

### Routing ALGO分類
1. 根據router知道全域 & 區域資料
    * Global: **Link State ALGO**
        * Broadcast產生Forwading Table
        * Dijkastra's algo
        * 缺點(特色): 容易震盪(Oscillation Possible)
    * Decentralized: **Distance vector algo**
        * 鄰近節點找最短路徑
        * Bellman Ford algo
        * 缺點(特色): Bad news travels slow(count to infinity問題)
2. 根據更新速度
    * Static
    * Dynamic
![image](https://hackmd.io/_uploads/r1eBzZO6a.png)


![image](https://hackmd.io/_uploads/ByJIz-_ap.png)


![image](https://hackmd.io/_uploads/BJdUMWd66.png)

* 兩種協定比較

![image](https://hackmd.io/_uploads/SyuKNbOaT.png)

### Internet approach
* 1. Intra AS (AS 內部)
    * 1. RIP(Routing Information Protocol)
    * 2. OSPF(Open Shortest Path First)
    * 3. IGRP(Interier Gateway Routing Protocol)

* 2. Inter AS (AS 間): 只有 BGP(Border Gateway Protocol)
    * eBGP(egress)
    * iBGP(ingress)

![image](https://hackmd.io/_uploads/ryZ6EZ_6a.png)


![image](https://hackmd.io/_uploads/HkNAV-O6p.png)

* OSPF

![image](https://hackmd.io/_uploads/B111_b_pp.png)


![image](https://hackmd.io/_uploads/BJCeuZ_ap.png)

* ICMP


![image](https://hackmd.io/_uploads/BJKmO-uTT.png)

* SNMP

![image](https://hackmd.io/_uploads/Hyx4Obd6p.png)

### Link layer
* Link
    * 1. wired link
    * 2. wireless
    * 3. LANS

![image](https://hackmd.io/_uploads/S1bKObdap.png)
![image](https://hackmd.io/_uploads/BkSquWupp.png)

* Link layer serice
    * flow control
    * error detection
    * error correction
    * half-duplex, full-duplex

![image](https://hackmd.io/_uploads/B16ndWu6a.png)

* Error Detection
    * 1. Parity checking(Odd/Even)
    * 2. CRC(Cyclic Redundancy Check)

![image](https://hackmd.io/_uploads/rkwSFZdpp.png)

![image](https://hackmd.io/_uploads/rJbutZdaT.png)

![image](https://hackmd.io/_uploads/rkXFt-u6p.png)

![image](https://hackmd.io/_uploads/r1H5FZu66.png)

### Multuple Access & MAC

| Multiple Access | Protocol 理想四要件判斷 |
| -------- | -------- |
| ![image](https://hackmd.io/_uploads/rkvZ5Zuap.png)| ![image](https://hackmd.io/_uploads/B1eMqZOTp.png) |


* MAC Protocol分類
    * 1. Channel Partitioning(筆記手誤)
        * TDMA(Time Division Multiple Access)
        * FDMA(Frequency Division Multiple Access)
    * 2. Random Access
        * Slotted ALOHA
        * Pure(unslotted) ALOHA
        * **CSMA**(Carrier Sense Multiple Access)
        * CSMA/CD
        * CSMA/CA
    3. Taking turns
![image](https://hackmd.io/_uploads/ByeKR5W_6a.png)


![image](https://hackmd.io/_uploads/B1lbsWdaT.png)

![image](https://hackmd.io/_uploads/BJhWobuTT.png)

![image](https://hackmd.io/_uploads/HkWms-dTa.png)

![image](https://hackmd.io/_uploads/S1VBi-_pp.png)

![image](https://hackmd.io/_uploads/rkJT1XOpp.png)

![image](https://hackmd.io/_uploads/HytRkXdap.png)

![image](https://hackmd.io/_uploads/rJvklQO66.png)


![image](https://hackmd.io/_uploads/SkPEeXu6a.png)

### ARP

![image](https://hackmd.io/_uploads/H1COgQO66.png)

![image](https://hackmd.io/_uploads/SkDseX_Tp.png)


![image](https://hackmd.io/_uploads/ryP2l7uTp.png)

### Ethernet


![image](https://hackmd.io/_uploads/HJKClmda6.png)


![image](https://hackmd.io/_uploads/Byt1bQ_pa.png)


![image](https://hackmd.io/_uploads/HyeeWXdTp.png)


![image](https://hackmd.io/_uploads/Hy_g-Xup6.png)
