2026 年 04 月 28 日
CH4 — 網路協定
📋 大綱
1🔗 為什麼需要網路協定 — 相容相通的標準
2🔗 常見的國際性標準機構 — ISO/IEEE/IETF 等
3🔗 OSI 參考模式總覽 — 七層架構
4🔗 實體層(Physical Layer, L1)
5🔗 資料連結層(Data Link Layer, L2)
6🔗 網路層(Network Layer, L3)
7🔗 傳輸層(Transport Layer, L4)
8🔗 會議層(Session Layer, L5)
9🔗 應用層(Application Layer, L7)
10🔗 網路設備與 OSI 層級的對應關係
11🔗 TCP/IP 協定組與 OSI 的對應
12🔗 IETF 與 IRTF
13🔗 RFC 文件
14🔗 常見網路協定對照表
🔗 1|為什麼需要網路協定
線材、設備與系統種類繁多,製造廠商數量也相當可觀。為讓產品彼此間達到相容相通,必須制定大家可以接受的共通標準——這些標準稱之為通訊協定(Protocol)。
標準規範一般由具公信的機構經過多次會議討論所制定,目的是讓不同標準間的設備能夠相互通訊。
Gateway(閘道器)
不同標準間的轉譯設備
當兩端使用不同協定無法直接溝通時,Gateway 負責在兩種不同標準間進行轉譯,讓端點 A 和端點 B 可以順利通訊。
🔗 2|常見的國際性標準機構
📋 標準制定機構
- IEEE — Institute of Electrical and Electronics Engineers
電機電子工程師學會 - ANSI — American National Standards Institute
美國國家標準組織 - ITU / ITU-T — International Telecommunications Union
國際電信聯盟(前身 CCITT,1865~1993) - ISO — International Organization for Standardization
國際標準組織(制定 OSI 參考模式) - EIA / TIA — Electronic Industries Association / Telecommunication Industry Association
電子工業協會 / 電信工業協會 - IAB — Internet Architecture Board
網際網路架構委員會(隸屬 IETF/IRTF) - Cisco — 思科(設備廠商)
- AT&T — American Telephone and Telegraph Company
美國電話電報公司
🔑 常見標準對照
- RS232-C — EIA 制定的序列通訊標準
- OSI 參考模式 — ISO 於 1984 年制定
- TCP/IP — IAB 制定的網路架構
- T1 (1.544 Mbps) — AT&T 制定的廣域線路標準
🔗 3|OSI 參考模式總覽
OSI(Open Systems Interconnection)於 1984 年由 ISO 制定,是個參考模式(Reference Model),提供網路架構完整的參考標準。
OSI 有利於後續網路相容整合設計開發與突破,對網路初學者也提供良好的導引骨幹。
應用層 Application (L7)
展示層 Presentation (L6)
會議層 Session (L5)
傳輸層 Transport (L4)
網路層 Network (L3)
資料鏈結層 Data Link (L2)
實體層 Physical (L1)
📦 資料封包的組成(封裝過程)
大的資料在傳輸層進行拆組裝(Segmentation & Reassembly)的工作。每一層都會加上一層 Header:
- 應用層:Data(資料)
- 傳輸層:TCP/UDP Header + Data = Segment
- 網路層:IP Header + Segment = Packet(封包)
- 資料鏈結層:MAC Header + Packet + Trailer = Frame
- 實體層:轉換為 Bit(位元)訊號
🔗 4|實體層(Physical Layer, L1)
協定最底層,處理硬體規格與訊號轉換。
- 傳輸線材、中繼器(Repeater)與一般型集線器(Hub)
- 訊號類型:光訊號、電訊號、無線電波
🔗 5|資料連結層(Data Link Layer, L2)
處理相同區域網路(未透過路由器)內的通訊。IEEE 將資料連結層分為兩個子層:
- LLC(Logical Link Control)— 邏輯連結控制子層
- MAC(Medium Access Control)— 媒體存取控制子層
典型產品:網路卡(NIC)、橋接器(Bridge)、交換式集線器(Switch)
🔗 6|網路層(Network Layer, L3)
負責定址(Addressing)以及尋找路徑(Routing)。
路由器(Router)
依據多項資訊建立尋徑表,進行路徑選擇
透過尋徑協定(Routing Protocol),依據連線路由器數量、傳輸頻寬、傳輸距離、傳輸負載、可靠度等訊息,建立尋徑表(Routing Table)進行路徑選擇。
📡 常見尋徑協定
- RIP(Routing Information Protocol)— 尋徑資訊協定
- OSPF(Open Shortest Path First)— 開放最短路徑優先
🔗 常見網路層協定
- IP(Internet Protocol)— 網際網路協定
- IPX(Internet Packet eXchange)
- ARP(Address Resolution Protocol)— IP 位址查 MAC 位址
- RARP(Reverse ARP)— MAC 位址查 IP 位址
- ICMP(Internet Control Message Protocol)— 網路控制訊息協定
🔗 7|傳輸層(Transport Layer, L4)
提供可靠性服務。
- 密封包編訂序列碼(Sequence Number) — 確認資料順序
- 常見協定:TCP、UDP、SPX
🔗 8|會議層(Session Layer, L5)
負責連線管理:
- 連線建立(Connection Establishment)
- 連線主控(Connection Control)
- 連線重建(Connection Rebuild)
- 連線結束(Connection Termination)
🔗 9|應用層(Application Layer, L7)
實際與使用者面對面,負責操作按鈕與使用的指令等。
🌐 常見應用層服務
- Telnet — 遠端登入
- FTP(File Transfer Protocol)— 檔案傳輸
- WWW — 全球資訊網
- DNS(Domain Name System)— 網域名稱系統
- SNMP(Simple Network Management Protocol)— 網路管理
- NFS(Network File System)— 網路檔案系統
🔗 10|網路設備與 OSI 層級的對應關係
| 設備 | 運作層級 | 說明 |
|---|---|---|
| 中繼器(Repeater) | L1 實體層 | 放大訊號、延伸傳輸距離 |
| 集線器(Hub) | L1 實體層 | 廣播訊號到所有連接埠 |
| 橋接器(Bridge) | L2 資料連結層 | 連接不同類型網路(如乙太網路↔無線網路) |
| 交換式集線器(Switch) | L2 資料連結層 | 依 MAC 位址轉送 Frame |
| 路由器(Router) | L3 網路層 | 依 IP 位址轉送 Packet,執行路由選擇 |
| 閘道器(Gateway) | L4~L7(多層) | 不同協定的轉換(如 Ethernet ↔ 記號環網路) |
🔗 11|TCP/IP 協定組與 OSI 的對應
TCP/IP 是目前網路最主流的協定組,1983 年正式納入 Internet 架構。
| OSI 層 | TCP/IP 層 | 代表協定 |
|---|---|---|
| L7 應用層 | 應用層(Application) | HTTP, FTP, Telnet, DNS, SMTP |
| L6 展示層 | (整合在應用層) | |
| L5 會議層 | ||
| L4 傳輸層 | 傳輸層(Transport) | TCP, UDP |
| L3 網路層 | 網路層(Internet) | IP, ICMP, ARP |
| L2 資料連結層 | 網路存取層(Network Access) | Ethernet, PPP |
| L1 實體層 | (實體介面) |
Microsoft 網路協定則在 OSI 架構下對應到:應用層→應用層、LLC→TCP/IP 傳輸層、MAC→TCP/IP 網路存取層。
🔗 12|IETF 與 IRTF
IAB(網際網路架構委員會)下分兩個機構:
IETF
Internet Engineering Task Force — 網際網路工程業務策進會
負責短中期課題的解決。協定透過 RFC(Request for Comment)文件提交到 IETF 進行發表制定。
IRTF
Internet Research Task Force — 網際網路工程研究策進會
負責長期、理論或前瞻性發展的研究。
🔗 13|RFC 文件
RFC(Request for Comments)是一系列與 Internet 相關的文件,內容包括網路協定、演算法與機制的建置概念、編碼記錄與意見。
對網路工作者而言:RFC 絕對是必須參考的文件。
下載格式:
下載格式:
http://www.ietf.org/rfc/rfcXXXX.txt(XXXX 為 RFC 編號)
📄 RFC 文件類型
- Standards Track(標準制訂過程):
- Proposed Standard(提案標準)→ Draft Standard(草案標準)→ Standard(標準)
- Best Current Practice — 不是網路的標準,但是 IETF 建議要遵守的規範
- Information — 一些資訊或實驗中的規範,可能來自 IETF 或其他單位
- Experimental — 實驗性規範
- Historic — 過時的標準
RFC 歷史
1983 年 ARPA 正式將 TCP/IP 架構納入 Internet,並對 ICCB(網際網路組態控制委員會)進行重整,成立 IAB。
🔗 14|常見網路協定對照表
| 協定 | 全名 | RFC 編號 | 層級 |
|---|---|---|---|
| IP | Internet Protocol | RFC 791 | L3 網路層 |
| TCP | Transmission Control Protocol | RFC 793 | L4 傳輸層 |
| UDP | User Datagram Protocol | RFC 768 | L4 傳輸層 |
| ICMP | Internet Control Message Protocol | RFC 792, 2463 | L3 網路層 |
| ARP | Address Resolution Protocol | — | L3→L2 |
| RARP | Reverse ARP | — | L2→L3 |
| FTP | File Transfer Protocol | RFC 959 | L7 應用層 |
| Telnet | Telnet Protocol | RFC 854, 855 | L7 應用層 |
| DNS | Domain Name System | RFC 1034, 1035 | L7 應用層 |
| SNMP | Simple Network Management Protocol | RFC 1157 | L7 應用層 |
| PPP | Point-to-Point Protocol | RFC 1661 | L2 資料連結層 |
| RIP | Routing Information Protocol | RFC 1723, 2453 | L3 網路層 |
| OSPF | Open Shortest Path First | RFC 2328 | L3 網路層 |
| DHCP | Dynamic Host Configuration Protocol | RFC 2131 | L3 網路層 |
| IPv6 | Internet Protocol Version 6 | RFC 2460 | L3 網路層 |
| IPX | Internet Packet eXchange | — | L3 網路層 |
| SPX | Sequenced Packet eXchange | — | L4 傳輸層 |
| NFS | Network File System | — | L7 應用層 |
💡 想查詢更多 RFC 文件,可至 http://www.rfc-editor.org/rfcsearch.html 搜尋。