[計算機網路 03] 應用層(Application Layer)


Posted by RexWei1016 on 2025-04-08

🌐 第一節:Application Layer 是什麼?

✅ 概念:

  • Application Layer 是 Internet 模型(五層模型)的最上層(第 5 層)
  • 它是讓使用者可以與網路互動、完成任務的軟體層級,比如瀏覽網頁、收發 Email、FTP 等。

📶 Internet 五層模型回顧:

[5] 應用層(Application Layer)🧑‍💻:瀏覽器、Email、FTP
[4] 傳輸層(Transport Layer)🚚:TCP / UDP
[3] 網路層(Network Layer)🧭:IP
[2] 資料鏈結層(Data Link Layer)🔗:Ethernet, Wi-Fi
[1] 實體層(Physical Layer)🔌:實體傳輸(電線、光纖)

🏗️ 第二節:Application Architecture(應用架構)

✅ 四大功能模組(Function Modules):

  1. Presentation Logic:資料顯示與輸入(UI/UX)
  2. Application Logic:業務邏輯(例如:表單送出、計算邏輯)
  3. Data Access Logic:與資料庫溝通的邏輯
  4. Data Storage:實際資料儲存(DB)

🖥️ 第三節:應用架構類型(Application Architecture Types)

1. Host-Based Architecture(主機型架構)

  • 所有邏輯都在伺服器端,Client 端只是終端機
  • 常見於舊式大型主機(Mainframe)與終端機架構

優點:

  • 架構簡單、集中管理

缺點:

  • 伺服器容易成為效能瓶頸,升級成本高

2. Client-Based Architecture(客戶端型)

  • 使用者端(Client)擁有 Presentation、Application、Data Access
  • Server 端只提供 Data Storage(資料庫)

優點:

  • 客戶端運算強大時效率高

缺點:

  • 每次資料都要在 Client 與 Server 間傳輸,增加網路流量

3. Client-Server Architecture(分工架構)

  • 業界主流架構,Client 與 Server 分別負責不同邏輯
  • Client:Presentation + Application(有些也做 Data Access)
  • Server:Data Access + Data Storage

可分:

  • Thick Client:Client 負責較多邏輯
  • Thin Client:Client 只做 UI,邏輯全在伺服器

優點:

  • 分散效能壓力,可混用不同平台
  • 易擴充、減少頻寬使用

缺點:

  • 系統整合難度高,常需使用 Middleware

4. Tiered Architectures(多層架構)

  • 依功能拆分出兩層(2-tier)、三層(3-tier)、甚至多層(n-tier)

例如:

  • 三層架構
    • Client:Presentation Logic
    • App Server:Application Logic
    • DB Server:Data Access + Storage

優點:

  • 容易負載平衡、擴充性高

缺點:

  • 建置成本與複雜度增加

5. Peer-to-Peer Architecture(點對點架構)

  • 每台設備都可同時扮演 Client 與 Server,例如 BitTorrent

優點:

  • 彈性高、資料分散、節省頻寬

缺點:

  • 安全性與資料查找困難

6. Cloud Computing(雲端運算)

  • 指透過網路使用遠端計算資源的模式

模型分類:

模型 用戶管理 供應商管理 例子
IaaS OS與應用 基礎設施(硬體) AWS EC2
PaaS 應用 OS + DB + 硬體 Azure
SaaS 幾乎無需管理 所有層 Google Workspace, Salesforce

#計算機網路







Related Posts

Advanced iOS App Architecture (Second Edition): Real-World App Architecture in Swift

Advanced iOS App Architecture (Second Edition): Real-World App Architecture in Swift

React-[入門篇]- JSX聲明式語法

React-[入門篇]- JSX聲明式語法

Dcat-admin 更改後台登入後首頁位置

Dcat-admin 更改後台登入後首頁位置


Comments