Skip to Content
核心网络协议数据包指南
book

核心网络协议数据包指南

by Bruce Hartpence
May 2025
Beginner to intermediate
264 pages
2h 55m
Chinese
O'Reilly Media, Inc.
Content preview from 核心网络协议数据包指南

第 5 章 网络设备 Network+ 设备

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

每个网络都需要一定数量的设备来促进数据传输。设备的选择取决于手头的任务。为了选择最佳设备,我们必须了解操作,并提出有关网络和计算机互连的问题。除了处理特定的任务外,基础设施设备还被设计为在 TCP/IP 模型的特定层上运行。这意味着集线器(也称为中继器)、交换机(或网桥)、路由器、接入点(AP)和网关可以像协议一样插入模型中。虽然当代网络继续使用定义明确的设备,但更新的设备可以跨越层的界限。

本章将从运行和行为的角度研究典型网络的各个组成部分。我们还将探讨与每个组件相关的一些安全问题。这包括现代设备、小型办公室/家庭办公室 (SOHO) 网络和无处不在的家庭网关的变化。

图 5-1是本章大部分内容的基础。图中展示了 OSI 和 TCP/IP 模型,以及各层的主要协议。集线器、交换机和路由器将两边互连起来。底部的实线表示设备之间的物理连接,也就是我们常说的传输路径。 不过,设备可能会在上层做出决定,因此它们在逻辑上是通过虚线连接的。例如,交换机处理包含 MAC 地址的第 2 层帧。

图 5-1. 型号和设备

桌子和主持人

虽然本章讲述的是网络设备,但如果不提及网络上的主机或节点,本章就不完整。节点拥有 IP 和 MAC 地址,用于在网络基础设施上进行通信。几乎无一例外,设备都使用这些地址来转发数据包或帧。此外,认识到在网络内,几乎所有事情都遵循基于同一套规则的循序渐进的流程也很有帮助。这个过程可以通过一系列表格和数据包来追踪。网络上的所有设备,包括主机,都有这些表,并且能够生成和/或转发数据包。在下面的章节中,我们将讨论主要的设备类型及其用于处理帧的表。表 5-1列出了这些表,以及每个表的用途和在网络中的位置。

表 5-1. Network+ 表格和用途
表格地点目的

ARP 表

路由器和主机

将 IP 地址映射到 MAC 地址

源地址表

开关/电桥

将 MAC 地址映射到交换机端口

路由表

路由器和主机

确定正确的接口和下一跳

AP 转发数据库

接入点

由 AP 管理的节点集合

这些操作中有许多在本书的其他章节中都有更深入的介绍,下面我们来看一个普通的示例。图 5-2显示了一个基本网络,说明了本章所涉及的组件。

图 5-2. 基本网络

如果我们假设节点 A 正在向节点 B 发送数据,则会遵循以下基本步骤:

  1. 节点 A 会查询其主机路由表,以确定数据包是用于本地网络还是异地。

  2. 节点 A 从 ARP 表中提取适当的 MAC 地址,或发送 ARP 请求并接收适当的应答,从而为第 2 层目标构建帧。

  3. 帧从节点 A 通过交换机 1 发送到路由器。

  4. 收到帧后,交换机 1 会查询源地址表 (SAT),以确定目的地的正确端口。

  5. 路由器从交换机 1 接收帧,并检查 IP 标头以确定目标网络。

  6. 路由器会处理路由表,以确定目的地要使用的正确接口。

  7. 路由器从 ARP 表中提取适当的 MAC 地址,或发送 ARP 请求并接收适当的应答,从而为第 2 层目标构建帧。

  8. 帧从路由器通过交换机 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

IPv6解析 第三版

IPv6解析 第三版

Silvia Hagen

Publisher Resources

ISBN: 9798341658752