计算机网络2009

填空题

1. The commonest transmission media used in Local Area Network (LAN) is _____________________.
答案: UTP (Unshielded Twisted Pair)
解释:
• 英文: UTP is the most widely used transmission medium in LANs due to its low cost, flexibility, and sufficient performance for short distances.

• 中文: 非屏蔽双绞线(UTP)因其低成本、灵活性和短距离内的良好性能,成为局域网中最常用的传输介质。


2. In OSI reference model, the lowest layer is ________________layer.
答案: Physical Layer
解释:
• 英文: The OSI model's bottom layer is the Physical Layer, responsible for transmitting raw bit streams over physical media (e.g., cables, signals).

• 中文: OSI模型的最底层是物理层,负责通过物理介质(如电缆、信号)传输原始比特流。


3. Please list three traditional applications: _______________________, __________________________, ____________________________.
答案: Email, FTP, Telnet
解释:
• 英文: Classic internet applications include:

• Email: For electronic messaging.

• FTP (File Transfer Protocol): For file sharing.

• Telnet: For remote terminal access.

• 中文: 传统互联网应用包括:

• 电子邮件(Email):电子消息传递。

• 文件传输协议(FTP):文件共享。

• 远程登录(Telnet):终端远程访问。


4. The binary value of the decimal IP address 205.255.170.205 is ___________________________.___________________________.___________________________.___________________________.
答案: 11001101.11111111.10101010.11001101
解释:
• 英文: Convert each decimal octet to 8-bit binary:

• 205 → 11001101

• 255 → 11111111

• 170 → 10101010

• 205 → 11001101

• 中文: 将每个十进制数转换为8位二进制:

• 205 → 11001101

• 255 → 11111111

• 170 → 10101010

• 205 → 11001101


5. IPv6 address has ____________ binary bits.
答案: 128
解释:
• 英文: IPv6 addresses are 128 bits long, compared to IPv4's 32 bits, enabling a vastly larger address space.

• 中文: IPv6地址长度为128位(IPv4为32位),提供了更大的地址空间。


6. In TCP segment header, window size is decided by _______________.
答案: Receiver
解释:
• 英文: The receiver advertises its window size to inform the sender how much data it can accept (flow control).

• 中文: 接收方通过窗口大小告知发送方可接收的数据量(流量控制)。


7. If you want to buy a network interface card (NIC), please list three factors to affect you: _______________________, ____________________, ______________________________.
答案: Speed, Bus Type, Network Type
解释:
• 英文: Key NIC selection criteria:

• Speed: e.g., 1Gbps vs. 10Gbps.

• Bus Type: PCIe, USB, etc.

• Network Type: Ethernet, Wi-Fi, etc.

• 中文: 选择网卡时需考虑:

• 速度:如1Gbps或10Gbps。

• 总线类型:PCIe、USB等。

• 网络类型:以太网、Wi-Fi等。


8. In IPv4 address 193.168.125.0/30, meaning of 30 is: ___________________________________________________.
答案: The first 30 bits are network bits (subnet mask = 255.255.255.252).
解释:
• 英文: /30 indicates that the first 30 bits define the network, leaving 2 bits for hosts (only 2 usable IPs per subnet).

• 中文: /30表示前30位为网络位,剩余2位为主机位(每个子网仅2个可用IP)。


9. The basic unit of bandwidth is _______________________, The basic unit of throughput is _____________________.
答案: bps (bits per second), bps (bits per second)
解释:
• 英文: Both bandwidth and throughput are measured in bps, but bandwidth is theoretical capacity, while throughput is actual performance.

• 中文: 带宽和吞吐量的基本单位均为bps,但带宽是理论值,吞吐量是实际值。


10. In protocol 3 of data link layer (DLL), PAR technology is adopted. PAR is abbreviation of ______________________________________________________________.
答案: Positive Acknowledgement with Retransmission
解释:
• 英文: PAR ensures reliability by requiring the receiver to acknowledge received frames; unacknowledged frames are retransmitted.

• 中文: PAR通过要求接收方确认帧的接收来实现可靠性,未确认的帧会被重传。


11. In a LAN which uses OSPF, suppose the bandwidth of a line is 100M, then cost (metric) of the line is ____________________.
答案: 1
解释:
• 英文: OSPF calculates cost as Reference Bandwidth (default 100Mbps) / Link Bandwidth. For 100Mbps, cost = 100/100 = 1.

• 中文: OSPF的代价计算公式为参考带宽(默认100Mbps)/链路带宽。100Mbps链路的代价=100/100=1。


判断题


1. Throughput usually refers to actually measured bandwidth at a specific time of day.
答案: √ (True)
解释:
• 英文: Throughput is the real-world measured data transfer rate at a given time, influenced by network congestion, latency, and other factors. Bandwidth is the theoretical maximum capacity.

• 中文: 吞吐量是实际测量的数据传输速率(受网络拥塞、延迟等影响),而带宽是理论最大值。


2. PAP authentication in PPP is more secure than CHAP authentication.
答案: × (False)
解释:
• 英文: PAP sends passwords in plaintext, while CHAP uses challenge-response hashing. CHAP is far more secure.

• 中文: PAP以明文传输密码,CHAP使用挑战-应答哈希机制,安全性更高。


3. BGP is a link-state routing protocol, so it has no routing-loop problem.
答案: × (False)
解释:
• 英文: BGP is a path-vector protocol (not link-state), and it can have routing loops if policies are misconfigured.

• 中文: BGP是路径矢量协议(非链路状态),配置错误时仍可能产生路由环路。


4. EUI-64 address can be produced via corresponding MAC address.
答案: √ (True)
解释:
• 英文: EUI-64 embeds the 48-bit MAC address into IPv6 by splitting it and inserting FFFE. Example: 00:1A:2B021A:2BFF:FE3C:4D5E.

• 中文: EUI-64通过将MAC地址拆开并插入FFFE生成IPv6地址(如00:1A:2B021A:2BFF:FE3C:4D5E)。


5. The field number of basic header of IPv6 packet is much more than that of IPv4 packet header.
答案: × (False)
解释:
• 英文: IPv6’s basic header has 8 fixed fields, while IPv4 has 12+ variable fields. IPv6 is simpler but uses extension headers for additional functions.

• 中文: IPv6基本头部只有8个固定字段,IPv4有12个以上可变字段。IPv6更简洁,但通过扩展头部实现附加功能。


6. Data can be transmitted more than 185 meters using Category 5 UTP.
答案: × (False)
解释:
• 英文: Standard Cat5 UTP has a 100-meter limit for Ethernet (e.g., 100BASE-TX). Beyond this, signal degradation occurs.

• 中文: 标准Cat5 UTP的传输距离上限为100米(如100BASE-TX),超过后信号会衰减。


7. Light through fiber has no attenuation, so data can be transmitted far away.
答案: × (False)
解释:
• 英文: Fiber optics do experience attenuation (though lower than copper). Repeaters or amplifiers are needed for long-distance transmission.

• 中文: 光纤仍有衰减(比铜缆低),长距离传输需中继器或放大器。


8. Split-horizon is used to avoid routing loop in distance vector protocol.
答案: √ (True)
解释:
• 英文: Split-horizon prevents a router from advertising routes back to the interface they were learned from, reducing loops in protocols like RIP.

• 中文: 水平分割阻止路由器将路由信息发回来源接口,避免RIP等协议的路由环路。


9. TCP is more reliable than UDP, but is more complex.
答案: √ (True)
解释:
• 英文: TCP guarantees delivery via acknowledgments and retransmissions, while UDP is lightweight but unreliable.

• 中文: TCP通过确认和重传保证可靠性,UDP轻量但不可靠。


10. The function of Hop-limit in IPv6 packet header is same as that of TTL in IPv4 packet header.
答案: √ (True)
解释:
• 英文: Both Hop-limit (IPv6) and TTL (IPv4) prevent infinite packet forwarding by decrementing at each hop, dropping packets when reaching 0.

• 中文: IPv6的跳数限制和IPv4的TTL功能相同,通过逐跳递减防止数据包无限转发。


总结 (Summary)
| 题号 | 答案 | 关键点 (Key Points) | | ---- | ---- | ---------------------------------- | | 1 | √ | 吞吐量是实际测量值,带宽是理论值。 | | 2 | × | CHAP比PAP更安全。 | | 3 | × | BGP是路径矢量协议,仍可能环路。 | | 4 | √ | EUI-64通过MAC地址生成IPv6地址。 | | 5 | × | IPv6头部字段更少,设计更简洁。 | | 6 | × | Cat5 UTP最大传输距离100米。 | | 7 | × | 光纤有衰减,需中继器。 | | 8 | √ | 水平分割用于避免距离矢量协议环路。 | | 9 | √ | TCP可靠但复杂,UDP简单但不可靠。 | | 10 | √ | IPv6的Hop-limit = IPv4的TTL。 |

选择题


1. What is the function of the session layer? ________
答案: D. manages data exchange between presentation layer entities
解释:
• 英文: The Session Layer (Layer 5) establishes, manages, and terminates communication sessions between applications. It synchronizes data exchange and handles dialog control (e.g., login sessions).

• 中文: 会话层(第5层)负责建立、管理和终止应用程序间的通信会话,同步数据交换并控制对话(如登录会话)。

• 其他选项分析:

• A: Describes the Presentation Layer (data format negotiation).

• B: Describes the Physical Layer (raw bit transmission).

• C: Describes the Network Layer (routing).


2. Which statement best describes bridges and the way they make forwarding decisions? ______
答案: C. they operate at OSI Layer 2 and use MAC addresses to make decisions
解释:
• 英文: Bridges are Layer 2 devices that forward frames based on MAC addresses (not IP addresses). They segment collision domains but not broadcast domains.

• 中文: 网桥是二层设备,根据MAC地址转发帧(非IP地址),用于分割冲突域而非广播域。

• 其他选项分析:

• A/B/D: Incorrect because bridges do not use IP addresses (Layer 3).


3. What is the Organizational Unique Identifier (OUI)? ______
答案: B. the first 6 hex digits of a MAC address
解释:
• 英文: The OUI is the first 3 bytes (6 hex digits) of a MAC address, assigned by IEEE to manufacturers (e.g., 00:1A:2B). The last 6 digits are device-specific.

• 中文: OUI是MAC地址的前3字节(6位十六进制数),由IEEE分配给厂商(如00:1A:2B),后6位由厂商自定义。

• 其他选项分析:

• A: Incorrect (OUI is only the first half).

• C: Describes the device-specific part.

• D: Irrelevant to MAC addresses.


4. Which of the following is the approximate number of hosts supported in a Class B unsubnetted network? _______
答案: C. 65 thousand
解释:
• 英文: A Class B network uses 16 bits for hosts (2^16 = 65,536 addresses). Subtracting network/broadcast addresses gives ~65,534 usable hosts.

• 中文: B类网络的主机部分为16位(2^16 = 65,536个地址),扣除网络和广播地址后约65,534个可用主机。

• 其他选项分析:

• A: Typical for a Class C (/24 subnet).

• B/D: Not relevant to Class B.


5. Which address represents a multicast address? _______
答案: A. 224.2.5.2
解释:
• 英文: Multicast addresses range from 224.0.0.0 to 239.255.255.255. 224.2.5.2 is a valid multicast IP (e.g., used in video streaming).

• 中文: 组播地址范围为224.0.0.0239.255.255.255224.2.5.2是合法的组播IP(如视频流传输)。

• 其他选项分析:

• B: A unicast address in 172.16.0.0/12 private range.

• C: A small subnet (only 2 usable hosts).

• D: A legacy broadcast address (deprecated in modern networks).


6. Which of the following services did not use TCP? ______
答案: C. SNMP
解释:
• 英文: SNMP (Simple Network Management Protocol) primarily uses UDP (port 161/162) for lightweight monitoring, while HTTP (A), SMTP (B), and FTP (D) rely on TCP for reliability.

• 中文: SNMP(简单网络管理协议)默认使用UDP(端口161/162),而HTTP(A)、SMTP(B)、FTP(D)依赖TCP保证可靠性。


7. What does a Layer 2 switch do if it receives a frame with a destination MAC address not in its MAC table?______
答案: C. The frame is sent out all ports except the receiving port.
解释:
• 英文: A Layer 2 switch floods unknown unicast frames to all ports (except the incoming port) to discover the destination MAC (broadcast domain behavior).

• 中文: 二层交换机会将未知单播帧泛洪到所有端口(除接收端口外),以寻找目标MAC地址(广播域行为)。

• 其他选项分析:

• A: Incorrect (switches do not drop unknown frames by default).

• B: Incorrect (only applies to broadcast frames, not unknown unicast).

• D: ARP is a Layer 3 process, not Layer 2.


8. Which command will test the loopback function on the NIC? ______
答案: A. Ping 127.0.0.1
解释:
• 英文: ping 127.0.0.1 tests the local NIC’s loopback interface (TCP/IP stack functionality). Telnet (B/D) requires a service to be running, and 127.0.0.0 (C) is an invalid loopback address.

• 中文: ping 127.0.0.1 用于测试网卡环回接口(TCP/IP协议栈功能)。Telnet(B/D)需服务支持,127.0.0.0(C)是无效地址。


9. Switches that receive the entire frame before sending it, use what type of frame forwarding? _______
答案: D. Store-and-forward
解释:
• 英文: Store-and-forward switches buffer and check the entire frame for errors before forwarding, unlike cut-through (A) which forwards immediately after reading the destination MAC.

• 中文: 存储转发交换机会缓存并检查完整帧的完整性,而直通转发(A)仅读取目标MAC后立即转发。


10. When is ARP used? _______
答案: B. The destination MAC address is unknown.
解释:
• 英文: ARP resolves an IP address to a MAC address when the destination is on the same LAN. It is not needed if the MAC is already known.

• 中文: ARP在目标MAC地址未知时,将IP地址解析为MAC地址(同一局域网内)。若MAC已知则无需ARP。

• 其他选项分析:

• A: Incorrect (ARP does not resolve IP addresses).

• C/D: Source addresses are always known locally.


11. What is the result of executing the “erase startup-config” command?_______
答案: B. It deletes the saved configuration file in NVRAM.
解释:
• 英文: erase startup-config removes the backup configuration stored in NVRAM (non-volatile memory), but the active config in RAM (A) remains until reboot.

• 中文: erase startup-config 删除NVRAM中的备份配置,但RAM中的当前配置(A)在重启前仍有效。


12. What is used by distance-vector routing protocols? ________
答案: C. Periodic updates of entire routing table
解释:
• 英文: Distance-vector protocols (e.g., RIP) periodically broadcast full routing tables to neighbors, unlike link-state protocols (A/B/D) which use topology databases.

• 中文: 距离矢量协议(如RIP)定期向邻居广播完整路由表,而链路状态协议(A/B/D)使用拓扑数据库。


13. When MUST a default route be used? _______
答案: C. There is no entry in the routing table for the destination network.
解释:
• 英文: A default route (0.0.0.0/0) acts as a fallback when no specific route matches the destination IP.

• 中文: 默认路由在路由表中无匹配条目时作为备用路径。

• 其他选项分析:

• A/B: Specific routes may still exist.

• D: Stub networks may use static routes.


14. Which factor determine throughput? _______
答案: E. all of above
解释:
• 英文: Throughput is affected by devices (A), data type (B), topology (C), and user load (D) due to congestion, latency, and processing overhead.

• 中文: 吞吐量受设备(A)、数据类型(B)、拓扑(C)和用户数(D)影响(拥塞、延迟、处理开销)。


15. The name of the transport layer PDU (Protocol Data Unit) is: _______
答案: A. Segment
解释:
• 英文: Transport layer PDUs are called segments (TCP) or datagrams (UDP). Lower layers use packets (C, Network) or frames (D, Data Link).

• 中文: 传输层PDU称为段(TCP)或数据报(UDP),网络层为包(C),数据链路层为帧(D)。


16. Generally, PSTN (public switched telephone network) is made up of: _______
选项:
A. Local loop, toll connecting trunk, and intertoll trunk
B. Telephone and central office
C. Local loop, end office, and central office
D. Telephone, end office, and trunks
答案: A. Local loop, toll connecting trunk, and intertoll trunk
解释:
• 英文: PSTN consists of:

• Local loop: Connects subscribers to the central office.

• Toll connecting trunk: Links central offices to toll offices.

• Intertoll trunk: Connects toll offices for long-distance calls.

• 中文: PSTN由以下组成:

• 本地环路:连接用户和中心局。

• 长途连接中继:连接中心局和长途局。

• 长途局间中继:用于长途电话互联。


17. _______ forms the heart of the modern telephone system, all time intervals within the telephone system are multiples of ________ μsec.
选项:
A. Codec/4000
B. PCM/4000
C. PCM/8000
D. PCM/125
答案: D. PCM/125
解释:
• 英文: PCM (Pulse Code Modulation) is the core technology, and its sampling interval is 125 μsec (derived from 8000 samples/sec: 1/8000 = 125 μsec).

• 中文: PCM(脉冲编码调制)是核心技术,其采样间隔为125微秒(源于每秒8000次采样:1/8000 = 125 μsec)。


18. Which is correct about RFCs (request for comments)? _______
选项:
A. Are internet standards
B. Are technical reports which is stored on-line and can be fetched by anyone
C. Are proposed standards
D. Just are standard drafts
答案: B. Are technical reports which is stored on-line and can be fetched by anyone
解释:
• 英文: RFCs are publicly accessible documents describing internet technologies, protocols, or best practices. Not all RFCs become standards (some are informational).

• 中文: RFCs是公开的技术文档,描述互联网技术、协议或最佳实践,并非所有RFC都会成为标准(部分仅为信息类)。


19. The metric of RIP (routing information protocol) is ________
选项:
A. Hop
B. Bandwidth
C. Load
D. Delay
答案: A. Hop
解释:
• 英文: RIP uses hop count (number of routers to cross) as its metric, with a maximum limit of 15 hops.

• 中文: RIP使用跳数(经过的路由器数量)作为度量值,最大限制为15跳。


20. Which device would result in extension of collision domain? ________
选项:
A. Router
B. Hub
C. Bridge
D. Switch
答案: B. Hub
解释:
• 英文: Hubs operate at Layer 1 and extend collision domains by forwarding all traffic to every port. Switches (D) and bridges (C) segment collision domains.

• 中文: 集线器工作在一层,将所有流量泛洪到所有端口,从而扩展冲突域。交换机(D)和网桥(C)分割冲突域。


21. Which IP address can be used to locally broadcast? ________
选项:
A. 127.255.255.255
B. 255.255.255.255
C. 164.0.0.0
D. 127.0.0.0
答案: B. 255.255.255.255
解释:
• 英文: 255.255.255.255 is the limited broadcast address for the local subnet. 127.x.x.x (A/D) is reserved for loopback.

• 中文: 255.255.255.255是本地子网的受限广播地址,127.x.x.x(A/D)保留用于环回。


22. Which is the default subnet mask of D class ? ________
选项:
A. 255.0.0.0
B. 255.255.0.0
C. 255.255.255.0
D. None
答案: D. None
解释:
• 英文: Class D addresses (224.0.0.0–239.255.255.255) are for multicast and have no subnet mask (they are not assigned to individual hosts).

• 中文: D类地址(224.0.0.0–239.255.255.255)用于组播,无子网掩码(不分配给单个主机)。


23. Which is legal IP address? ________
选项:
A. 1.255.255.2
B. 127.2.3.5
C. 225.23.200.9
D. 192.240.150.255
答案: C. 225.23.200.9
解释:
• 英文: Valid IP ranges exclude:

0.x.x.x and 127.x.x.x (reserved).

255.255.255.255 (broadcast).

• 225.23.200.9 is a valid multicast address (Class D).

• 中文: 合法IP需避开保留地址(如0.x.x.x127.x.x.x),225.23.200.9是合法的组播地址(D类)。


24. Which is not a legal IP address if subnet mask is 255.255.240.0? ________
选项:
A. 143.49.37.2
B. 143.49.16.2
C. 143.49.8.12
D. 143.49.49.15
答案: C. 143.49.8.12
解释:
• 英文: With /20 (255.255.240.0), the third byte must have 4-bit network part. 8 in 143.49.8.12 is 00001000 (invalid if network bits are 0000).

• 中文: 子网掩码255.255.240.0(/20)要求第三字节前4位为网络位,8的二进制为00001000(前4位全0,非法)。


25. The metric of OSPF is _________
选项:
A. Hop
B. Bandwidth
C. Load
D. Delay
答案: B. Bandwidth
解释:
• 英文: OSPF calculates cost based on interface bandwidth (higher bandwidth = lower cost).

• 中文: OSPF根据接口带宽计算代价(带宽越高,代价越低)。


列出5种OSPF消息(数据包)类型,并说明这些消息的使用场景。

答案与解析(中英文对照)


1. Hello 消息
• 英文:

• When used:

① When an OSPF router starts up.  
② Periodically to maintain neighbor relationships (default every 10/30 seconds).  

• Purpose: Discovers neighbors and ensures they are still active.

• 中文:

• 使用场景:

① OSPF路由器启动时。  
② 定期发送以维持邻居关系(默认每10/30秒一次)。  

• 作用: 发现邻居并确认其活跃状态。


2. DD (Database Description) 消息
• 英文:

• When used: When two OSPF routers are in the Exchange state.

• Purpose: Summarizes the router’s link-state database (LSDB) to synchronize with neighbors.

• 中文:

• 使用场景: 两台OSPF路由器处于Exchange(交换)状态时。

• 作用: 发送链路状态数据库(LSDB)的摘要,用于邻居间同步。


3. LSR (Link State Request) 消息
• 英文:

• When used: When a router detects (via DD messages) that a neighbor has newer or missing LSAs.

• Purpose: Requests specific link-state records from the neighbor.

• 中文:

• 使用场景: 当路由器通过DD消息发现邻居有更新或缺失的LSA时。

• 作用: 向邻居请求具体的链路状态信息。


4. LSU (Link State Update) 消息
• 英文:

• When used:

① As a response to an LSR.  
② When a router detects a change in its local links (e.g., interface failure).  

• Purpose: Sends updated link-state information to neighbors.

• 中文:

• 使用场景:

① 响应LSR请求。  
② 当路由器检测到本地链路变化时(如接口故障)。  

• 作用: 向邻居发送更新的链路状态信息。


5. LSAck (Link State Acknowledgment) 消息
• 英文:

• When used: When a router receives an LSU to confirm receipt.

• Purpose: Ensures reliable flooding of LSAs (acknowledgment prevents retransmission).

• 中文:

• 使用场景: 路由器收到LSU后发送确认。

• 作用: 确保LSA的可靠泛洪(避免重复传输)。


总结 (Summary)
| 消息类型 | 英文使用场景 | 中文使用场景 | | --------------------------------- | ------------------------------------------------------ | ---------------------------------- | | Hello | Startup & periodic keep-alive. | 启动和周期性维护邻居关系。 | | DD (Database Description) | During neighbor LSDB synchronization (Exchange state). | 邻居间LSDB同步时(Exchange状态)。 | | LSR (Link State Request) | Requesting missing/updated LSAs. | 请求缺失或更新的LSA。 | | LSU (Link State Update) | Responding to LSR or reporting local link changes. | 响应LSR或报告本地链路变化。 | | LSAck (Link State Acknowledgment) | Acknowledging LSU receipt. | 确认LSU的接收。 |

问题:解释交换机的工作原理

答案与解析(中英文对照)


1. Flooding(泛洪)
• 英文:

• When a switch receives a frame with an unknown destination MAC address, it broadcasts the frame to all ports (except the incoming port).

• Purpose: Discover the destination device’s MAC address.

• 中文:

• 当交换机收到目标MAC地址未知的帧时,会将该帧广播到所有端口(除接收端口外)。

• 作用: 通过广播寻找目标设备的MAC地址。

示例:
• 主机A发送帧给主机B(B的MAC不在交换机表中)→ 交换机会泛洪该帧。


2. Learning(学习)
• 英文:

• The switch records the source MAC address of incoming frames and maps it to the receiving port in its MAC address table.

• Purpose: Build a dynamic mapping of MAC-to-port for future forwarding.

• 中文:

• 交换机会记录帧的源MAC地址,并将其与接收端口绑定到MAC地址表中。

• 作用: 建立MAC地址与端口的动态映射,供后续转发使用。

示例:
• 主机A从端口1发送帧 → 交换机记录 MAC_A: Port 1


3. Filtering(过滤)
• 英文:

• If the destination MAC address is on the same port as the source, the switch drops the frame (no need to forward).

• Purpose: Avoid unnecessary traffic within the same collision domain.

• 中文:

• 如果目标MAC地址和源MAC地址位于同一端口,交换机会丢弃该帧(无需转发)。

• 作用: 避免同一冲突域内的冗余流量。

示例:
• 主机A和B都连接在端口1 → A发送给B的帧会被交换机丢弃。


4. Forwarding(转发)
• 英文:

• If the destination MAC address is known (in the MAC table), the switch forwards the frame only to the mapped port.

• Purpose: Enable precise and efficient communication between devices.

• 中文:

• 如果目标MAC地址已知(在MAC表中),交换机仅将帧转发到对应的端口。

• 作用: 实现设备间精准高效的通信。

示例:
• 交换机表中有 MAC_B: Port 3 → 主机A发给B的帧仅从端口3转发。


总结 (Summary)
| 原理 | 英文说明 | 中文说明 | | ---------- | -------------------------------------------------------- | ------------------------------ | | Flooding | Broadcasts unknown frames to find destinations. | 泛洪未知帧以寻找目标设备。 | | Learning | Records MAC-port mappings dynamically. | 动态学习MAC地址与端口的映射。 | | Filtering | Drops frames if source/destination are on the same port. | 同端口通信时丢弃帧以避免冗余。 | | Forwarding | Sends frames only to the target port. | 仅转发到目标端口,提高效率。 |

关键点:
• 英文: Switches use these four principles to reduce collisions, improve efficiency, and enable direct communication within a LAN.

• 中文: 交换机通过这四大原理减少冲突、提升效率,并实现局域网内的精准通信。

TCP三次握手头部字段填充问题解析

问题描述 主机H(初始序列号ISN=200,端口=3000)访问Web服务器S(ISN=500,端口=80),请补全三次握手过程中TCP段的头部字段。


答案与分步解析

第一次握手:H → S 发送SYN段

1
2
3
4
Source port      = 3000    (H的客户端端口)
Destination port = 80 (S的HTTP服务端口)
Sequence number = 200 (H的初始序列号ISN)
Acknowledge number = 0 (初始ACK无效,因为尚未收到S的序列号)

解释: • 序列号(Seq):H首次通信时使用自己的ISN(200)。

• 确认号(ACK):此时未收到S的序列号,故为0。


第二次握手:S → H 发送SYN-ACK段

1
2
3
4
Source port      = 80       (S的服务端口)
Destination port = 3000 (H的客户端端口)
Sequence number = 500 (S的初始序列号ISN)
Acknowledge number = 201 (期望收到H的下一个Seq=200+1)

解释: • 序列号(Seq):S使用自己的ISN(500)。

• 确认号(ACK):对H的SYN(Seq=200)的确认,值为200+1=201(TCP规定ACK号为收到的Seq+1)。


第三次握手:H → S 发送ACK段

1
2
3
4
Source port      = 3000     (H的客户端端口)
Destination port = 80 (S的HTTP服务端口)
Sequence number = 201 (H的Seq递增,因SYN占用1序号)
Acknowledge number = 501 (期望收到S的下一个Seq=500+1)

解释: • 序列号(Seq):H的Seq从200变为201(SYN标志位消耗1个序号)。

• 确认号(ACK):对S的SYN(Seq=500)的确认,值为500+1=501


完整三次握手流程图示

1
2
3
H (Seq=200) --SYN--> S
H (Seq=201) <--SYN, ACK(201)-- S (Seq=500)
H (Seq=201) --ACK(501)--> S

关键点总结 1. 序列号(Sequence Number): • 每次SYN标志置1时,序列号使用通信方的ISN。

• SYN和FIN标志均会消耗1个序号(Seq+1)。

  1. 确认号(Acknowledge Number): • 总是对收到的序列号+1进行确认。

    • 第二次握手后,双方均知道对方的ISN。

  2. 端口号: • 客户端端口(H)为临时端口(3000),服务端端口(S)为固定服务端口(80)。

注:TCP头部其他字段(如标志位、窗口大小等)在题目中未提及,故省略。此解析仅针对题目要求的字段。