← Back to Hub ← 返回主页

Week 12: Internet-based Applications 第 12 周:互联网应用

Core Concepts 核心概念

1. Electronic Mail (SMTP, POP3, IMAP) (8.1)

  • Simple Mail Transfer Protocol (SMTP): Used to push email messages from a client to a server, or between email servers (uses TCP port 25).
  • Post Office Protocol v3 (POP3): Downloads emails from server to local machine and typically deletes them from the server (uses TCP port 110).
  • Internet Message Access Protocol (IMAP): Syncs and maintains emails on the server, permitting access from multiple devices (uses TCP port 143).

2. Web Access & HTTP/HTTPS Security (8.2 - 8.3)

Hypertext Transfer Protocol (HTTP) handles plain text request-response communication between web browsers and servers (uses port 80). HTTPS secures this by executing a TLS (Transport Layer Security) handshake (uses port 443). The TLS handshake authenticates the server using digital certificates and encrypts all subsequent HTTP payload details using symmetric keys.

3. Multimedia Applications (8.4)

Real-time multimedia transmission (like voice over IP or streaming video) demands high bandwidth and is sensitive to packet delays. It typically relies on Real-time Transport Protocol (RTP) running over UDP to minimize transmission overhead and packet buffering latency.

1. 电子邮件 (SMTP, POP3, IMAP) (8.1)

  • 简单邮件传输协议 (SMTP): 用于将电子邮件消息从客户端发送到服务器,或在邮件服务器之间发送(使用 TCP 端口 25)。
  • 邮局协议第 3 版 (POP3): 将电子邮件从服务器下载到本地计算机,通常会从服务器上删除邮件(使用 TCP 端口 110)。
  • 互联网消息访问协议 (IMAP): 在服务器上同步和保留电子邮件,允许从多个设备访问(使用 TCP 端口 143)。

2. 网络访问和 HTTP/HTTPS 安全性 (8.2 - 8.3)

超文本传输协议 (HTTP) 处理网络浏览器和服务器之间的纯文本请求-响应通信(使用端口 80)。HTTPS 通过执行 TLS(传输层安全)握手来保护其安全性(使用端口 443)。TLS 握手使用数字证书验证服务器身份,并使用对称密钥对后续所有 HTTP 有效载荷数据进行加密。

3. 多媒体应用 (8.4)

实时多媒体传输(如 IP 电话或流媒体视频)需要高带宽,并且对数据包延迟非常敏感。它通常依赖于在 UDP 上运行的实时传输协议 (RTP),以最大程度地减少传输开销和数据包缓冲延迟。

Concept Visualization: Plaintext HTTP vs Encrypted HTTPS 概念可视化:纯文本 HTTP 与加密 HTTPS

Plaintext HTTP (Port 80) Browser username=admin&password=secret123 Web Server Encrypted HTTPS (Port 443 - SSL/TLS) Browser x98f237f8ba120fe98cbef2498dfca211... (Encrypted) Web Server

Tips 提示

  • IMAP vs POP3 selection: Always recommend IMAP if users read email on multiple devices (phone, laptop, tablet). POP3 is only suitable for dedicated single-device workstations with limited mail server storage.
  • SSL/TLS Handshake: The asymmetric key exchange (RSA or Diffie-Hellman) is used only during the initial TLS handshake to securely share a temporary session key. All subsequent web data packets are encrypted using faster symmetric encryption (AES).
  • IMAP 与 POP3 选择: 如果用户在多个设备(手机、笔记本电脑、平板电脑)上阅读电子邮件,请始终推荐使用 IMAP。POP3 仅适用于邮件服务器存储空间有限的专用单设备工作站。
  • SSL/TLS 握手: 非对称密钥交换(RSA 或 Diffie-Hellman)仅在初始 TLS 握手期间使用,以安全地共享临时会话密钥。所有后续的网络数据包都使用速度更快的对称加密 (AES) 进行加密。

Practical Exercises & Step-by-Step Guide 实践练习与分步指南

Exercise 1: Inspect HTTP vs HTTPS Payloads in Wireshark 练习 1:在 Wireshark 中检查 HTTP 与 HTTPS 数据载荷

Steps to capture:

  1. Open **Wireshark** on your client machine. Start capturing on the active interface.
  2. Open a browser, visit a plaintext site (e.g. http://example.com).
  3. Next, visit a secure HTTPS site (e.g. https://www.google.com).
  4. Stop the Wireshark capture.
  5. Filter HTTP: Enter http in the filter bar. Click a **GET** or **POST** packet, expand the **Hypertext Transfer Protocol** layer in the details, and check the readable headers.
  6. Filter HTTPS: Enter tls in the filter bar. Inspect the client/server hello packets and the subsequent "Application Data" packets (which are fully encrypted).

捕获步骤:

  1. 在您的客户端计算机上打开 **Wireshark**。开始捕获活动网卡接口。
  2. 打开网页浏览器,访问一个纯文本站点(例如 http://example.com)。
  3. 接着,访问一个安全的 HTTPS 站点(例如 https://www.google.com)。
  4. 停止 Wireshark 捕获。
  5. 过滤 HTTP:在过滤栏中输入 http。点击一个 **GET** 或 **POST** 包,在详细信息中展开 **Hypertext Transfer Protocol** 层,查看完全可读的数据标头。
  6. 过滤 HTTPS:在过滤栏中输入 tls。检查客户端/服务器握手包和随后的“Application Data”包(这些数据包已被完全加密)。

Exercise 2: Setup DNS and Web Server Topology in Packet Tracer 练习 2:在 Packet Tracer 中搭建 DNS 和 Web 服务器拓扑

Steps to configure:

  1. In Packet Tracer, place one PC, one Switch, and two Servers. Connect them using copper straight-through cables.
  2. Name Server0 as **Web-Server** and Server1 as **DNS-Server**.
  3. Configure Static IPs:
    • Client PC: IP `192.168.1.10`, subnet mask `255.255.255.0`, DNS `192.168.1.250`.
    • DNS-Server: IP `192.168.1.250`, subnet mask `255.255.255.0`.
    • Web-Server: IP `192.168.1.100`, subnet mask `255.255.255.0`.
  4. Click **DNS-Server** -> Services tab -> DNS. Turn the Service **ON**. Add an A record mapping `www.test.com` to `192.168.1.100`.
  5. Click **Web-Server** -> Services tab -> HTTP. Ensure HTTP and HTTPS services are **ON**.
  6. Click PC -> Desktop -> Web Browser. Type www.test.com and press Go. The index page of the server should load.

配置步骤:

  1. 在 Packet Tracer 中,放置一台 PC、一台交换机和两台服务器。使用直通双绞线连接它们。
  2. 将 Server0 命名为 **Web-Server**,Server1 命名为 **DNS-Server**。
  3. 配置静态 IP 地址:
    • 客户端 PC: IP `192.168.1.10`,子网掩码 `255.255.255.0`,DNS 服务器设为 `192.168.1.250`。
    • DNS-Server: IP `192.168.1.250`,子网掩码 `255.255.255.0`。
    • Web-Server: IP `192.168.1.100`,子网掩码 `255.255.255.0`。
  4. 点击 **DNS-Server** -> 服务选项卡 -> DNS。开启该服务。添加一条 A 记录,将名称 `www.test.com` 映射到 IP `192.168.1.100`。
  5. 点击 **Web-Server** -> 服务选项卡 -> HTTP。确保 HTTP 和 HTTPS 服务均处于开启状态。
  6. 点击 PC -> 桌面 -> 网页浏览器。输入 www.test.com 并按 Go。应能加载出 Web 服务器的索引首页。

Self-Check Practice Questions 自测练习题

1. Explain the role of DNS in Internet communications. 解释 DNS 在互联网通信中的作用。

2. Identify which protocol is used to push email from a client to a mail server. 识别哪种协议用于将电子邮件从客户端发(推)送到邮件服务器。

3. Identify the default TCP port number used by secure HTTPS traffic. 识别安全的 HTTPS 流量所使用的默认 TCP 端口号。

4. Explain why real-time VoIP audio traffic utilizes UDP instead of TCP. 解释为什么实时 VoIP 音频流量使用 UDP 而不是 TCP。

5. Describe the hierarchical structure of the Domain Name System (DNS). 描述域名系统 (DNS) 的分层结构。

6. Identify which protocol is used by email clients to retrieve messages from a mail server. 识别电子邮件客户端用于从邮件服务器接收(拉取)邮件的协议。

7. What is the default TCP port number used by unsecure HTTP web traffic? 非安全的 HTTP 网页流量使用的默认 TCP 端口号是多少?

8. Contrast the difference between TCP and UDP transport protocols. 对比 TCP 和 UDP 传输层协议的区别。

Vocabulary Matching Game 词汇配对游戏

Match the protocol on the left with its default TCP port on the right. (Click a term, then click its matching definition). 将左侧的协议与右侧的默认 TCP 端口进行配对。(点击术语,然后点击匹配的定义)。

HTTP
HTTPS
SMTP
IMAP
POP3
Port 110
Port 80
Port 25
Port 143
Port 443