90
15.1 Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANs Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.1

Chapter 15

Connecting LANs,

Backbone Networks,

and Virtual LANs

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 2: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.2

15-1 CONNECTING DEVICES

In this section, we divide connecting devices into five

different categories based on the layer in which they

operate in a network.

Passive Hubs(无源集线器)

Active Hubs(有源集线器)

Bridges(桥)

Two-Layer Switches(二层交换)

Routers(路由器)

Three-Layer Switches(三层交换)

Gateways(网关)

Topics discussed in this section:

Page 3: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.3

Figure 15.1 Five categories of connecting devices

Page 4: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.4

A passive hub is just a connector.

Note

无源集线器只是个连接器,连接来自不同分支的线路

在星型拓扑中,无源集线器只是一个来自不同站点的信号冲突点,集线器是冲突点

Page 5: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.5

Figure 15.2 A repeater connecting two segments of a LAN

Page 6: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.6

Figure 15.3 Function of a repeater

Page 7: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.7

A repeater connects segments of a LAN.

Note

中继器是仅工作在物理层的设备

中继器能够扩展局域网的物理长度

中继器并不能连接两个局域网,它连接的是同一局域网的两个分段

中继器转发每一帧,没有过滤能力

A repeater forwards every frame;

it has no filtering capability.

Page 8: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.8

A repeater is a regenerator,

not an amplifier.

Note

中继器是再生器,不是放大器

Page 9: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.9

A active hub is actually a multipart

repeater

Note

常用于星型结构中

是过去常用的连接器

可以如下图那样使用多级连级(级联)

Page 10: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.10

Figure 15.4 A hierarchy of hubs

Page 11: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.11

A bridge has a table used in

filtering decisions.

Note

网桥工作在物理层和数据链路层

作为物理层设备时,重新生成收到的信号

作为数据链路层设备时,可以检查帧所包含的MAC地址。

网桥具有过滤作用,检查帧的目的地址

网桥具有一个用作过滤决策的表

Page 12: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.12

Figure 15.5 A bridge connecting two LANs

Page 13: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.13

A bridge does not change the physical

(MAC) addresses in a frame.

Note

网桥不改变帧中的MAC地址

透明网桥是站点完全不知道桥的存在

802.1d规范了透明网桥的标准

帧必须能从一个站点转发到另外一个站点

学习帧中的地址,自动建立转发表

避免形成循环(Loop)问题

Page 14: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.14

Figure 15.6 A learning bridge and the process of learning

Page 15: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.15

Figure 15.7 Loop problem in a learning bridge

Page 16: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.16

Figure 15.8 A system of connected LANs and its graph representation

Page 17: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.17

Figure 15.9 Finding the shortest paths and the spanning

tree in a system of bridges

生成树

Page 18: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.18

Figure 15.10 Forwarding and blocking ports after using spanning

tree algorithm

生成树

Page 19: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

源路由网桥

是防止有环的另外一种方法

透明网桥的指责(过滤帧、转发和阻塞)有源站点来执行,目中程度上有目的站点来执行。

有源方指定帧必须经过的网桥。

被用于令牌环网。

15.19

Page 20: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

网桥与广播风暴

局域网1

结点101 结点205

结点803 结点504

N.1

N.2

N.3

N.4局域网2

局域网3

局域网4

网桥

504 Data

504 Data

504 Data

504 Data

Page 21: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

用网桥连接不同的局域网

需要考虑的问题:

帧格式

最大数据长度

数据速率

位顺序(先发送高位还是先发送地位)

安全

多媒体(介质)支持

15.21

Page 22: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.22

Figure 15.11 Routers connecting independent LANs and WANs

Page 23: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

两层交换(two-layer switch) 交换式集线器(switching hub) 问世于1990 年,可明显地提高局域网的性能。

交换机一般有两层交换机和三层交换机

两层交换机是一个多端口并且有更好性能的网桥

两层交换机可以像网桥一样,基于收到的帧的MAC地址做出过滤决策

两层交换机的工作过程比网桥更加复杂,它有缓存区来保存帧进行处理。

15.23

Page 24: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

Layer 2 Switch Benefits

No change to attached devices to convert bus LAN or hub LAN to switched LAN

For Ethernet LAN, each device uses Ethernet MAC protocol

Device has dedicated capacity equal to original LAN Assuming switch has sufficient capacity to keep up with all

devices

For example if switch can sustain throughput of 20 Mbps, each device appears to have dedicated capacity for either input or output of 10 Mbps

Layer 2 switch scales easily Additional devices attached to switch by increasing capacity of

layer 2

Page 25: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

Types of Layer 2 Switch

Store-and-forward(存储-转发) switch Accepts frame on input line

Buffers it briefly,

Then routes it to appropriate output line

Delay between sender and receiver

Boosts integrity of network

Cut-through(直通式) switch Takes advantage of destination address appearing at beginning

of frame

Switch begins repeating frame onto output line as soon as it recognizes destination address

Highest possible throughput

Risk of propagating bad frames Switch unable to check CRC prior to retransmission

Page 26: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

... ... 主机A

主机B

port1

port2

port8

port9

port10

port16

主机C

引导码 目的MAC地址 源MAC地址 长度 帧内容 校验码

不等收到整个帧,就开始交换

直通模式:

• 端口刚刚收到帧的目

的地址和源地址,还没有收到整个帧,就开始交换。

• 速度快,达到线速。

• 没有检查校验码,容

易出错,因此用于误码率低的网络。

包转发模式-直通模式

Page 27: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

... ...

主机A 主机B

port1

port2

port8

port9

port10

port16

目的 = B 源 = A 内容

MAC PORT

A 1

源地址学习,通过port1可到达主机A

二层交换流程之-源地址学习

Page 28: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

... ...

主机A 主机B

port1

port2

port8

port9

port10

port16

目的 = A 源 = C 内容 MAC PORT

A 1 主机C

查表得知A在port1上

二层交换流程之-转发

Page 29: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

二层交换流程之-广播/洪泛

... ...

MAC PORT

主机A 主机B

MAC地址表空,于是向所有端口广播以太网帧

port1

port2

port8

port9

port10

port16

目的 = B 源 = A 内容

MAC地址表空

Page 30: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

30

二层交换网络——广播网络

传统的二层交换网络,整个网络就是一个广播域,当网络规模增大的时候,网络广播严重,效率下降,不利管理。

二层交换

广播域

Page 31: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

L2交换关键的三张表

地址学习表:是L2交换的转发依据。它主要记录某个MAC地址是从哪个端口收到的,以及这个被学习的帧属于哪个VLAN的信息,可以设置标志表示该表项是属于静态表项,不进行老化处理。

MAC地址

VID

端口号

标志

MACA

1

12

VID

端口号列表

1

1,2,3.。。

端口号

端口VLAN标识(PVID)

VLAN表:主要记录哪些端口属于某个VLAN。一个端口可以属于多个VLAN,比如端口1既属于VLAN1,又属于VLAN3,此时这个端口输出时采用802.1Q的帧格式。

端口寄存器表:主要记录了该端口的缺省VLAN。

Page 32: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

L2交换过程-初始配置

假设一台交换机,有四个端口,1,2,3,4,每个端口连接一台主机,这四台主机的MAC地址分别为MAC A,MAC B,MAC C,MAC D,我们对该交换机做如下的配置:

划分VLAN:VLAN1包括端口1,3 VLAN2包括端口2,3,4

配置端口的PVID:端口1的PVID为1,端口2的PVID为2,端口3的PVID为

2,端口4的PVID为2。

MAC

A

MAC C

MAC

B

MAC

D

端口1

端口2

端口3

端口4

VID

端口号列表

1

1,3

2

2,3,4

端口号

端口VLAN标识(PVID)

1

1

2

2

3

2

4

2

MAC地址

VID

端口号

标志

Page 33: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

L2交换过程-地址学习

假设主机D向主机B发送一帧,由于端口4的PVID号是2,则地址学习表增加一项(学习源地址):

MAC C

MAC B MAC D 端口1

端口2

端口3

端口4

MAC A

MAC B MAC D

MAC地址

VID

端口号

标志

MAC D

2

4

Page 34: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

L2交换过程-桥转发

假设主机B向主机D发送一帧,交换机从端口2接收到以后,以该帧的目的MAC地址(MAC D)加上端口2的PVID(PVID=2)作为索引匹配地址学习表,匹配到表项1,端口号是4,则该帧被交换到端口4送出。 (以目的MAC地址查找地址学习表 )

MAC C

MAC B MAC D 端口1

端口2

端口3

端口4

MAC A

MAC D MAC B

MAC地址

VID

端口号

标志

MAC D

2

4

Page 35: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

L2交换过程-洪泛过程

假设主机A向主机C发送一不带TAG的帧,交换机从端口1接收到以后,以该帧的目的MAC地址(MAC C)加上端口1的PVID(PVID=1)作为索引匹配地址学习表,表项中没有MAC C,所以查表失败,此时交换机查找VLAN表,得到VLAN1所属的

端口列表(1,3),其中端口1是源端口,所以这个帧从端口3洪泛出去。

MAC C

MAC B MAC D 端口1

端口2

端口3

端口4

MAC A

MAC C MAC A

MAC地址

VID

端口号

标志

MAC D

2

4

Page 36: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

L2组播原理

建立一张MAC组播表,建立MAC组播组(以组播MAC地址区分和VID来识别)与加入这个组播组组播成员(以交换机的端口号识别,表示这个端口所连接的网络中至少有一台主机或交换机加入了这个组播组,需要向这个端口转发这个组播组的组播业务帧)之间的关系

当收到一个组播帧时,以该组播MAC地址加上VID号去匹配组播表,如果查到表项则取出组播输出端口列表中的端口列表,向这些端口发送。如果查表失败,则以VID号去查VLAN表,得到该VLAN的所属端口列表,向

这些端口转发。

组播MAC地址

VID

组播输出端口列表

MAC A

N

1,3,4,…

Page 37: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

IGMP snooping功能 IGMP Snooping的作用是在2层交换机上实现IGMP组播的功能,它认为

L2交换机处于主机和路由器(L3交换机)之间。而路由器和主机之间是通过IGMP协议在路由器上建立IP组播组与成员之间的关系的,路由器会向所有端口发送一个QUERY包,查询对于某个IP组播组有没有哪个主机想加入,而主机收到了这个查询包后会向路由器发送一个REPORT包,告

诉路由器有一个主机,IP地址是XX,希望加入这个组播组。 L2交换机偷窥了这些信息建立了L2组播表

QUERY

REPORT

路由器

L2交换机

组播IP地址

组播MAC地址

VLAN号

组 播 源 端 口 (UpStream端口)

组播输出端口列表( DownStream 端 口)

Page 38: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器基本概念

PC

分支机构二

MP2630

MP3600

MP2690

分支机构一

公共IP网络(Internet)

中心机房

Server

PC

PC

PC

路由器通过一定的策略决定数据的转发。转发策略称为路由选择(routing)

网络上传输的IP数

据包就是“行人、车辆”

路由器是IP互联网络的枢

纽、主要节点设备、“交通警察”

Page 39: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器功能

• 实现远程网络的互联(DDN、LAN、ATM…)

• 数据在各种链路协议间的转换(HDLC、PPP

、FR)

• 流量管理(QOS)

• 互联网络的“邮递员”-数据包路由(静态路由、动态路由…)

Page 40: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器和网络协议体系

中继器、交换机、路由器、网关在OSI分层中所处地位

物理层

数据链接层

网络层

传输层

会话层

表示层

应用层

中继器

交换机

路由器

网 关

Page 41: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器数据处理示意图

物理层

数据链路层

网络层

传输层

实体A 实体B

应用层 Packets分组

Router

物理层

数据链路层

网络层

传输层

应用层

物理层

数据链路层

网络层

Page 42: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

• 路由(Routing)是指导IP报文发送的路径信息。

我想去192.168.1.1

请走R2方向

R1

R2

R3

R4

请走R4方向 从以太口方向出

去就到了。

192.168.0.1/24

192.168.1.1/24

路由器的基本工作原理

Page 43: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由表

• 路由表(routing table,也称路径表):路由

表用于保存各种传输路径的相关数据(路由信息)供数据转发(路由选择)时使用。

• 路由表中保存着子网的标志信息、网上路由器的个数和下一个路由器的名字等内容。

192.168.1.0 255.255.255.0 192.168.3.1

要去“192.168.1.0”这个网段,你找192.168.3.1

Page 44: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由的来源

链路层协议发现的直连路由 开销小,配置简单,无需人工维护。只能发现本接口所属网段的路由。

手工配置静态路由

无开销,配置简单,需人工维护,适合简单拓朴结构的网络。

动态路由协议发现的动态路由

开销大,配置复杂,无需人工维护,适合复杂拓朴结构的网络。

Page 45: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

静态路由的特点

一切按章程办~

Router A Router B

静态路由:是网络管理员在路由器中设置的固定的路由表,除非人为干预,否则不会发生变化,一般用于网络规模不大、拓扑结构固定的网络中。

静态路由的优点:简单、高效、可靠,优先级最高;

静态路由的缺点:配置繁琐,而且无法适应网络环境的变化,配置繁琐。

Page 46: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

动态路由的特点

Router A Router B

兄弟,咱们来交流下吧~

好啊,多个朋友多条路~

动态路由:网络中的路由器之间运行动态路由协议,相互通信、传递路由信息,利用收到的路由信息更新路由表。一般适用于大型、拓扑经常变动的网络中。

动态路由的优点:配置简单,并能实时地适应网络结构的变化。如果发生了网络变化,就会引起网络中所有路由器重新计算路由。

动态路由的缺点:各种动态路由协议会不同程度地占用网络带宽和CPU资源。

Page 47: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由转发的基本原理

匹配主机路由

IP Packet

不可达,丢弃

匹配网段路由

匹配缺省网关

最长掩码匹配规则

我要到迈普公司

迈普公司走左边这条路

迈普在高新区,走这边

我不清楚,你去找这个人吧

抱歉,我不知道

Page 48: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器简要工作流程

• 封装并发送数据帧

• 链路层寻址

• 数据包分段(MTU值)

• IPSec隧道加密处理--可选

• 地址转换(NAT)处理--可选

• 生存时间TTL处理

• 转发验证(ACL)--可选

• IP包本地提交与转发寻径

• IP包头完整性验证及选项处理

• 接收帧,去掉帧头分解出IP数据包

Page 49: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器体系结构的发展历史

接口

接口

CPU

控制总线

共享数据总

线接口

接口

接口

接口

接口

接口

接口

接口

接口

接口

CPU

控制总线

共享数据总

线

CPU 接口接口 CPU

CPU

控制总线

共享数据总

线

接口 CPU

接口 CPU

CPU 接口

CPU 接口

第二代 第三代第一代

Page 50: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器体系结构的发展历史

ASIC 接口

AISC 接口

ASIC 接口

接口 ASIC

接口 ASIC

UPC协议处理模块

UPC协议处理模块

交换网络

接口 ASIC

Routing

Processor

OAM

Processor

控制总线

NP 接口

NP 接口

NP 接口

接口 NP

接口 NP

UPC协议处理模块

UPC协议处理模块

交换网络

接口 NP

Routing

Processor

OAM

Processor

控制总线

NP 接口

虚拟路由器单元

NP 接口

虚拟路由器单元

NP 接口

虚拟路由器单元

接口 NP

虚拟路由器单元

接口 NP

虚拟路由器单元

UPC协议处理模块

UPC协议处理模块

多级交换网络接口 NP

Routing

Processor

OAM

Processor

控制总线

虚拟路由器单元

CPU

CPU

CPU

CPU

CPU

CPU

TCAM

TCAM

TCAM TCAM

TCAM

TCAM

第五代 第六代第四代

Page 51: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

中高端路由器通用硬件体系结构 SerDes

SerDes

SerDes

SerDes

Switch Fabric

NPFramer

Physical

Line

NPFramer

Physical

Line

NPFramer

Physical

Line

NPFramer

Physical

Line

Page 52: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

• 按路由器功能的实现方式分类:

按路由器功能的实现方式可分为软件路由器和硬件路由器

路由器的分类

Page 53: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器分类

• 按功能是否模块化分类:

按功能是否模块化分类可分为模块化结构的路由器和固定配置路由器。

Page 54: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器分类

• 按适用的网络环境分类:

按适用的网络环境可分为电信级路由器、企业级路由器和家

用路由器。

高性能,高可靠性

多业务支持,高扩展性

宽带环境专用

,经济性

Page 55: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

路由器分类

• 按所处网络级别分类

在各种级别的网络环境中每台路由器都担负着特定的职责功能,按这些功能可将路由器分为骨干层(核心级)路由器,分发层(汇聚级)路由器和访问层(接入级)路由器。

核心路由器

汇聚路由器

接入路由器

Page 56: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.56

三层交换

Page 57: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

57

VLAN 隔离二层广播域

VLAN隔离了二层广播域,也就严格地隔离了各个VLAN之间的任何流量,分属于不同VLAN的用户不能互相通信。

VLAN 100 VLAN 200

VLAN 300

Page 58: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

58

VLAN间通信

不同VLAN之间的流量不能直接跨越VLAN的边界,需要使用路由,通过路由将报文从一个VLAN转发到另外一个VLAN。

VLAN 100 VLAN 200

VLAN 300

Page 59: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

三层交换解决瓶颈问题

三层交换=二层交换+三层转发

Page 60: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

以太帧头 IP包头 数据 CRC

传统的MLS -1(MultiLayer Switching-1)

3层转发过程中要重新封装2层,在三层交换机上,由第3层引擎处理数据流的第一个包

VLAN 1 VLAN 2

以太帧头 IP包头 数据 CRC

以太帧头 CRC IP包头 数据

ARP请求与响应

Page 61: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

传统的MLS -2

交换ASIC从3层引擎中获悉2层重写信息,在硬件中创建一个MLS条目,负责重写和转发数据流中的后续数据包

VLAN 1 VLAN 2

以太帧头 IP包头 数据 CRC 以太帧头 CRC IP包头 数据 以太帧头 IP包头 数据 CRC 以太帧头 CRC IP包头 数据 一次路由,多次交换

Page 62: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

62

VLAN间通信的路由选择

在主机上配置默认网关,对于非本地的通信,主机会自动寻找默认网关,并把报文交给默认网关转发而不是直接发给目的主机。

VLAN 100

1.1.1.10/24

VLAN 200

2.2.2.20/24

Ping 2.2.2.20

非本地通信

使用默认网关

网络1.1.1.0/24在接口1

网络2.2.2.0/24在接口2

Page 63: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

63

每个VLAN一个物理连接

在二层交换机上配置VLAN,每一个VLAN使用一条独占的物理连接连接到路由器的一个接口上。

VLAN 100 VLAN 200

VLAN 300

Page 64: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

64

使用VLAN Trunking

二层交换机上和路由器上配置他们之间相连的端口使用VLAN Trunking,使多个VLAN共享同一条物理连接到路由。

VLAN 100 VLAN 200

VLAN 300

Page 65: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

65

交换和路由的集成

二层交换机上和路由器在功能上的集成构成了三层交换机,三层交换机在功能上实现了VLAN的划分、VLAN内部的二层交换和VLAN间路由的功能。

VLAN 100 VLAN 200

VLAN 300

VLAN 100 VLAN 200

VLAN 300

Page 66: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

66

三层交换机功能模型

10.110.0.113/24

G:10.110.0.254

10.110.1.69/24

G:10.110.1.254

10.110.1.88/24

G:10.110.1.254

10.110.2.200/24

G:10.110.2.254

ETH0:10.110.0.254/24

ETH1:10.110.1.254/24

ETH2:10.110.2.254/24

Page 67: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

67

三层交换机中的路由和二层交换

二层交换引擎:实现同一网段内的快速二层转发

三层路由引擎:实现跨网段的三层路由转发

Page 68: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

68

报文到报文的三层交换技术

1

2

3

1

2

3

1

2

3

1

2

3

传统三层技术对每个报文进行处理,并基于第三层地址转发报文。这一方法称为报文到报文(Px P)。

Page 69: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

69

基于流交换的三层交换技术

不在三层处理所有报文的的方法称之为流交换(FS)。

第一个报文

后续报文

1

2

3

1

2

3

1

2

3

1

2

3

Page 70: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

70

三层交换机转发流程

二层交换

模块

MAC表

VLAN表

三层路由

模块

路由表

多层

流分类

流分类

规则表

多层流处理

流处理属性表

(接入带宽约束/优先级)

策略/管理服务器

以太

网包

以太

网包

广

包转发

广播包和无法

路由的包

包转发

Page 71: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.71

15-2 BACKBONE NETWORKS

A backbone network allows several LANs to be

connected. In a backbone network, no station is

directly connected to the backbone; the stations are

part of a LAN, and the backbone connects the LANs.

主干网允许连接多个局域网

站点不直接连接到主干上

站点是局域网的一部分,有主干连接这些局域网

Bus Backbone

Star Backbone

Connecting Remote LANs

Topics discussed in this section:

Page 72: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.72

In a bus backbone, the topology

of the backbone is a bus.

Note

如果一个站需要向同一LAN中的另外一个站点

发送帧,相应的网桥将阻塞该帧,到达不了主干;

如果一个站点需要向另外一个LAN中的站点发

送帧,网桥将传输该帧到主干网,哟由适当的网桥接收并发送到目的LAN

Page 73: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.73

Figure 15.12 Bus backbone

Page 74: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.74

In a star backbone, the topology of the

backbone is a star;

the backbone is just one switch.

Note

在星型主干网中,拓扑结构是星型

主干网仅是一台交换机

Page 75: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.75

Figure 15.13 Star backbone

Page 76: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.76

Figure 15.14 Connecting remote LANs with bridges

Page 77: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.77

A point-to-point link acts as a LAN in a

remote backbone connected by

remote bridges.

Note

在远程网桥连接的远程主干网中,点对点链路被认为一个局域网

Page 78: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.78

15-3 VIRTUAL LANs

We can roughly define a virtual local area network

(VLAN) as a local area network configured by

software, not by physical wiring.

Membership

Configuration

Communication between Switches

IEEE Standard

Advantages

Topics discussed in this section:

Page 79: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.79

Figure 15.15 A switch connecting three LANs

Page 80: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.80

Figure 15.16 A switch using VLAN software

Page 81: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.81

Figure 15.17 Two switches in a backbone using VLAN software

Page 82: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

VLAN

VLAN技术的全部思想是将LAN划分成逻辑的,而不是物理的网段

一个LAN可以划分成VLAN的多个逻辑LAN

每个VLAN是组织的一个工作组

VLAN甚至允许连接在不同交换机上的站点组成一个VLAN。

15.82

Page 83: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

15.83

VLANs create broadcast domains.

Note

VLAN将属于一个或多个物理LAN的站点分组到广播域中。

VLAN中的站点和其他站点通信时就像他们属于一个无理网段一样。

Page 84: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

VLAN划分方式

• 1.基于端口,使用交换机的端口号作为分

组依据

• 2.基于MAC地址,使用48位MAC地址作为

分组的依据

• 3.基于第三层协议,如使用IP地址作为分

组的依据。

• 4.基于组播组

15.84

Page 85: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

基于端口的VLAN

E1/0/1

E1/0/2

E1/0/3

E1/0/4

PCA

PCB

PCC

PCD

VLAN Table

VLAN ID Port

10 E1/0/1

10 E1/0/2

20 E1/0/3

20 E1/0/4

VLAN 10 VLAN 20

Page 86: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

基于MAC地址的VLAN

E1/0/1

E1/0/2

E1/0/3

E1/0/4

PCA

PCB

PCC

PCD

VLAN Table

VLAN ID MAC Address

10 MAC_A

10 MAC_B

20 MAC_C

20 MAC_D

VLAN 10 VLAN 20

Page 87: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

基于协议的VLAN

E1/0/1

E1/0/2

E1/0/3

E1/0/4

PCA

PCB

PCC

PCD

VLAN Table

VLAN ID Protocol

10 IP

20 IPX

VLAN 10

运行IP协议

VLAN 20

运行IPX协议

Page 88: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

基于子网的VLAN

E1/0/1

E1/0/2

E1/0/3

E1/0/4

10.0.0.1/24

VLAN Table

VLAN ID IP子网

10 10.0.0.0/24

20 20.0.0.0/24

VLAN 10 VLAN 20

10.0.0.2/24

20.0.0.1/24

20.0.0.2/24

Page 89: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

2015-01-03

802.1q帧格式

在TRUNK(两个交换机间用来传递VLAN

通信的链路)上传输这种类型的帧,对端交

换机根据802.1q中的VLAN ID来区分正确

的VLAN,然后向该VLAN包含的端口转发.

D_Addr S_Addr 802.1q L/T DATA

TYPE PRI/CFI/VID

NAME VLUE

TYPE

PRI

CFI

VID

8100

优先级

用于环形结构网络

VLAN ID

IEEE802.1Q 协议

Page 90: Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANsweb.xidian.edu.cn/ynquan/files/20150104_000958.pdf · 2015. 1. 3. · Backbone Networks, and Virtual LANs ... 15.2 15-1

习题:

P310页

13

14

15

15.90