交换机及虚拟局域网组网技术.ppt

上传人:本田雅阁 文档编号:3139910 上传时间:2019-07-16 格式:PPT 页数:45 大小:1.41MB
返回 下载 相关 举报
交换机及虚拟局域网组网技术.ppt_第1页
第1页 / 共45页
交换机及虚拟局域网组网技术.ppt_第2页
第2页 / 共45页
交换机及虚拟局域网组网技术.ppt_第3页
第3页 / 共45页
交换机及虚拟局域网组网技术.ppt_第4页
第4页 / 共45页
交换机及虚拟局域网组网技术.ppt_第5页
第5页 / 共45页
点击查看更多>>
资源描述

《交换机及虚拟局域网组网技术.ppt》由会员分享,可在线阅读,更多相关《交换机及虚拟局域网组网技术.ppt(45页珍藏版)》请在三一文库上搜索。

1、交换机及 虚拟局域网 组网技术,陈开恒 ,交换机简介,交换机是基于mac来工作,可以隔离冲突域不可以隔离广播域。 本质链路的逻辑拓展 冲突域 冲突域是数据必然发送到的区域。HUB组成的网络是一个冲突域。交换机的一个接口下的网络是一个冲突域,所以交换机可以隔离冲突域。 广播域 广播数据时可以发送到的区域是一个广播域。 交换机对广播帧是透明的,由交换机组成的网络是一个广播域。路由器的一个接口下的网络是一个广播域。所以路由器可以隔离广播域。,交换机的工作原理,交换机的作用: 维护CAM表(context address memory),该表是交换机的端口和各计算机MAC的映射表。 根据CAM表进行数

2、据帧的转发。 交换机对帧的处理: 交换机收到帧后,查询CAM表,如果查询不到目的计算机所在的端口,交换机把帧从源端口以外的端口转发。否则转b 交换机收到帧后,查询CAM表。如果目的端口不是计算机接收帧的源端口,对帧进行转发。否则转c 如果目的端口和源端口是同一端口,丢弃该帧。,两层交换机和三层交换机 两层交换机运行在数据链路层,三层交换机简单来讲即是是一个带有第三层路由功能的第二层交换机 。 三层交换原理: 假设两个使用IP协议的站点A、B通过第三层交换机进行通信,发送站点A在开始发送时,把自己的IP地址与B站的IP地址比较,判断B站是否与自己在同一子网内。若目的站B与发送站A在同一子网内,则

3、进行二层的转发。 若两个站点不在同一子网内,如发送站A要与目的站B通信,发送站A要向“缺省网关”发出ARP(地址解析)封包。如果交换机在以前的通信过程中已经知道B站的MAC地址,则向发送站A回复B的MAC。,否则交换机根据路由信息向B站广播一个ARP请求,B站得到此ARP请求后向回复其MAC地址,交换机保存此地址并回复给发送站A,同时将B站的MAC地址发送到二层交换MAC地址表中。从这以后,当A向B发送的数据包便全部交给二层交换处理。由于仅仅在路由过程中才需要三层处理,绝大部分数据都通过二层交换转发,因此三层交换机的速度很快,接近二层交换机的速度。 Note: 局域网必须通过路由器与公网实现跨

4、地域互联 三层交换机不具有同时处理多个协议的能力,简单交换机互连,三台终端通过交换机互连 终端IP地址分别为 192.168.1.1 192.168.1.2 192.168.1.3 测试连通性 仿真软件下载地址 http:/ System experiment 实验仿真软件.exe,VLAN的应用背景及实现功能,VLANVirtual Local Area Network 【背景描述】 某企业有两个主要部门:技术部(A1、A3)和销售部(A2、B1、B2),其中销售部门的个人计算机系统分散连接,也就有一名销售部的工作人员在技术部的办公室,他的电脑连接在技术部的交换机上。技术部之间、销售部之间需

5、要相互进行通信,但为了数据安全起见,技术部和销售部需要进行相互隔离。 【拓扑图如下:】,技术需求,同一个部门的主机在同一个局域网上,并且部门内的数据流量不希望其他部门收到,也不希望干扰其他部门,也就是要求同一个部门在同一个“广播域”上。 显然对于以上的物理拓扑,所有主机通过交换机相连,处在同一个广播域(没有划分VLAN的交换机上的各个端口上的设备分别属于不同的冲突域,每一交换端口构成一个冲突域,但同属于一个广播域)。如A1和A3之间的广播,A2、B1、B2也会收到,这不是我们所希望的。,不加限制,会产生广播风暴问题,广播,需求导致了VLAN的产生,需要有一种办法,在尽量不改动网络固有配置的前提

6、下,通过灵活的、标准的、基于软件的做法将具有相同需求的用户放到一起,使之就象在一个LAN中那样工作。 它不但能够在物理上使网络延伸,还能使对网络实施更灵活强大的控制功能成为可能。 VLAN的出现使之成为可能。,VLAN简介,冲突域和广播域 交换机能隔离冲突域,但不能隔离广播域,通过多个交换机连接在一起的所有计算机都在一个广播域中,任何一台计算机发送的广播包,其他计算机都会收到,这样大大降低了带宽的利用率。 VLAN(Virtual LAN)可以隔离广播域,VLAN工作在OSI模型的第2层,是交换机端口的逻辑组合。 VLAN的主要优点 广播风暴防范 安全 性能提高 提高管理效率,VLAN的划分,

7、基于端口的VLAN 在这种定义方法中,某个交换机上的端口(例如端口1、3、5)构成VLAN A,而该交换机上的其他端口构成VLAN B。早期基于端口的VLAN成员只能位于一个交换机中。第二代基于端口的VLAN支持多个交换机,例如交换机X上的端口1和端口2与交换机Y上的端口3和端口4构成一个VLAN。 基于MAC地址的VLAN 在这种定义方法中,若干个MAC地址构成VLAN成员。用户属于哪个VLAN由其网卡中的MAC地址决定。,Trunk简介,VLAN可以把在同一个交换机上端口组合成一个VLAN,也可以不同交换机上的端口组合成一个VLAN。当一个VLAN跨过不同的交换机时,在同一个VLAN上但是

8、接在不同的交换机上的计算机如何实现通信?,VLAN 2,VLAN 1,VLAN 1,VLAN 2,VLAN标记技术,直观的方法是为每一个VLAN增加连线,这样多个VLAN会占用太多接口。 可以采用Trunk技术实现跨交换机的VLAN内通信,Trunk技术使得在一条物理线路上可以传递多个VLAN的信息。 为了区别多个VLAN的数据帧,需要某种标记技术。有两种常见的Trunk帧标记技术:ISL和IEEE 802.1Q。 ISL技术在原有的帧上重新加了一个帧头,并重新生产了帧校验序列(FCS)。ISL是思科特有的技术。 IEEE 802.1Q技术是在原有帧的源MAC地址字段后插入4字节的标记字段,同

9、时用新的CRC字段替代了原有的CRC字段。IEEE 802.1Q是国际标准。,采用ISL的Trunk,使用ASIC执行 对计算机透明,计算机看不到ISL头部 可以在交换机与交换机之间、交换机与路由器之间使用,ISL帧格式,封装技术(Encapsulated) 协议无关的(Protocol independent) 将原有的帧封装在新的帧中,采用802.1Q的Trunk,802.1Q帧格式,标记技术(Tagged) 协议相关的(Protocol dependent) 在原有帧中添加一个字段,采用Trunk技术实现了VLAN的跨计算机通信,VLAN 2,VLAN 1,VLAN 1,VLAN 2,带

10、有VLAN 1标签的以太网帧,带有VLAN 2标签的以太网帧,不带VLAN标签的 以太网帧,DTP(Dynamic Trunk Protocol)简介,管理员可以手动指定交换机之间的链路是否形成Trunk,也可以让交换机自动协商,这个协议称为DTP,DTP还可以协商Trunk链路的封装类型。 配置了DTP的交换机会发送DTP协商包,或者对对方发送来的DTP包进行响应,双方最终商讨他们之间的链路是否形成Trunk,以及采用什么样的Trunk封装方式。 Cisco网络设备支持动态协商端口的工作状态。 根据动态协议的实现方式,Cisco网络设备接口有多种不同的工作模式。,交换机接口模式,cisco网

11、络中,交换机在局域网中最终稳定状态的接口类型主要有四种:access / trunk / multi / dot1q-tunnel。 1、access: 主要用来接入终端设备,如PC机、服务器、打印服务器等。 2、trunk: 主要用在连接其它交换机,以便在线路上承载多个VLAN。 3、multi: 在一个线路中承载多个vlan,但不像trunk,它不对承载的数据打标签。主要用于接入支持多vlan的服务器或者一些网络分析设备。现在基本不使用此类接口,在Cisco的网络设备中,也基本不支持此类接口了。 4、dot1q-tunnel: 用在Q-in-Q隧道配置中。,Cisco交换机接口模式的设置,

12、1、switchport mode access:强制接口成为access接口,并且可以与对方主动进行协商,诱使对方成为access模式。 2、switchport mode trunk:强制接口成为trunk接口,并且主动诱使对方成为trunk模式,所以当邻居交换机接口为trunk/desirable/auto时会成为Trunk接口。 3、switchport mode dynamic desirable:主动协商建立trunk,发送并接收DTP信号。如果邻居交换机模式为trunk/desirable/auto之一,则接口将变成trunk接口。如果不能形成trunk模式,则工作在access

13、模式。 4、switchport mode dynamic auto:被动协商建立trunk,只接收不发送DTP信号。当邻居接口为trunk/desirable之一时,才会成为trunk。如果不能形成trunk模式,则工作在access模式。 5、switchport nonegotiate:严格的说,这不算是种接口模式,它的作用只是阻止交换机接口发出DTP数据包,它必须与switchport mode trunk或者switchport mode access一起使用。 6、switchport mode dot1q-tunnel:配置交换机接口为隧道接口(非trunk),以便与用户交换机的

14、trunk接口形成不对称链路。,VLAN实验,【实验目的】 了解VLAN交换机的特性与应用场合 掌握VLAN交换机组网的基本配置方法 【实验环境】:模拟软件 Cisco Packet Tracer 5.2 Packet Tracer是思科公司为网络学员认证学习而开发的一套用来设计、配置和排除故障的网络模拟系统,目前最新版本为5.2。 该软件支持大量的设备仿真模型:路由器、交换机、无线网络设备、服务器、各种连接电缆、终端等,还能仿真各种模块,这在实际实验设备中是无法配置齐全的。 对设备均提供图型化和终端两种配置方法,各设备模型均有可视化的外观仿真。,VLAN实验内容,实验器材:3560交换机2台

15、,PC机5台,连接线若干。 网络拓扑图如下: 图中:A1、A2、A3连接在Switch1上,B1、B2连接在Switch2上。 假定应用场景是A1、A3属于技术部,B1、B2、A2属于销售部,要求同一部门的主机在同一个局域网上。,VLAN实验内容,交换机端口连接配置,主机IP地址配置,配置各台主机,配置主机IP地址 点击 主机 图标,在弹出的窗口中,点击“Desktop”选项卡,在“IP Configuration”里直接配置IP地址和子网掩码。 或者在“Command Prompt”里,输入命令 ipconfig ip_addr net_mask 配置完主机IP地址,回答【问题1】: 每台主

16、机相互ping,查看哪些主机可以连通,哪些不可以?为什么? 注:可以用 ping -n 1 255.255.255.255 发起一个受限广播,(参数 -n 1指明只发送一次,免得默认发送4次受到干扰),观察都收到了哪些主机的回复?,在交换机上配置VLAN,VLAN配置如下:,点击 交换机 图标,在弹出的窗口中,点击“CLI”,进入交换机配置终端。,在Switch上创建VLAN,在Switch1上创建VLAN 进入特权模式: Switchenable 进入VLAN配置模式: Switch#vlan database Switch(vlan)#vlan 2 name tech Switch(vla

17、n)#vlan 3 name sales Switch(vlan)#exit 进入全局设置模式 Switch#configure terminal,在Switch上创建VLAN,将Switch1的各端口划分在VLAN中 Switch(config)#interface FastEthernet 0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 2 Switch(config-if)#interface FastEthernet 0/2 Switch(config-if)#s

18、witchport mode access Switch(config-if)#switchport access vlan 3 Switch(config-if)#interface FastEthernet 0/3 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 2,在Switch上创建VLAN,配置与Switch2连接的Trunk接口 Switch(config-if)#interface FastEthernet 0/11 Switch(config-if)#switch

19、port mode trunk 在Switch2上创建VLAN Switchenable Switch#vlan database Switch(vlan)#vlan 3 name sales Switch(vlan)#exit Switch#configure terminal,在Switch上创建VLAN,将Switch2的各端口划分在VLAN中 Switch(config)#interface FastEthernet 0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan

20、 3 Switch(config-if)#interface FastEthernet 0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 3 配置与Switch1连接的Trunk接口 Switch(config-if)#interface FastEthernet 0/11 Switch(config-if)#switchport mode trunk,实验结果,在Switch1上用 show vlan 查看VLAN信息 VLAN Name Status Ports - -

21、 - - 1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7 Fa0/8, Fa0/9, Fa0/10, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23, Fa0/24 Gig0/1, Gig0/2 2 tech active Fa0/1, Fa0/3 3 sales active Fa0/2 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004

22、 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 - - - - - - - - - - - 1 enet 100001 1500 - - - - - 0 0 2 enet 100002 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 150

23、0 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs - Primary Secondary Type Ports - - - -,实验结果,在Switch1上用 show interfaces FastEthernet 0/1 switchport 查看端口信息 Name: Fa0/1 Switchport: Enabled Administrative Mode: static access Operational Mo

24、de: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: native Negotiation of Trunking: Off Access Mode VLAN: 2 (tech) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan map

25、ping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All Pruning VLANs En

26、abled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,实验结果,在Switch1上用 show interfaces FastEthernet 0/2 switchport 查看端口信息 Name: Fa0/2 Switchport: Enabled Administrative Mode: static a

27、ccess Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: native Negotiation of Trunking: Off Access Mode VLAN: 3 (sales) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administra

28、tive private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled:

29、 All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disa Appliance trust: none,实验结果,在Switch1上用 show interfaces FastEthernet 0/11 switchport查看端口信息 Name: Fa0/11 Switchport: Enabled Administrat

30、ive Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administ

31、rative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enable

32、d: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,实验结果,在Switch2上用 show vlan 查看VLAN信息 VLAN Name Status Ports - - - - 1 default active Fa0/3, Fa0/4, Fa0/5, F

33、a0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/12, Fa0/13, Fa0/14, Fa0/15 Fa0/16, Fa0/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 Fa0/24, Gig0/1, Gig0/2 3 sales active Fa0/1, Fa0/2 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup V

34、LAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 - - - - - - - - - - - 1 enet 100001 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm -

35、 0 0 Remote SPAN VLANs - Primary Secondary Type Ports - - - -,实验结果,在Switch2上用 show interfaces FastEthernet 0/1 switchport 查看端口信息 Name: Fa0/1 Switchport: Enabled Administrative Mode: static access Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encaps

36、ulation: native Negotiation of Trunking: Off Access Mode VLAN: 3 (sales) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vla

37、n trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown u

38、nicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,实验结果,在Switch2上用 show interfaces FastEthernet 0/11 switchport 查看端口信息 Name: Fa0/11 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking

39、 Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative priv

40、ate-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Un

41、known unicast blocked: disabled Unknown multicast blocked: disabled Appliance trust: none,查看各台主机的连通性,在配置VLAN之后,回答【问题2】: 每台主机相互ping,查看哪些主机可以连通,哪些不可以?为什么? 注:可以用 ping -n 1 255.255.255.255 发起一个受限广播,(参数 -n 1指明只发送一次,免得默认发送4次受到干扰),观察都收到了哪些主机的回复?,DTP的配置,将Switch1的FastEthernet 0/11接口的Trunk配置为desirable模式: Swit

42、ch1(config)#interface FastEthernet 0/11 Switch1(config-if)#shutdown Switch1(config-if)#switchport mode dynamic desirable Switch1(config-if)#no shutdown 将Switch2的FastEthernet 0/11接口的Trunk配置为auto模式: Switch2(config)#interface FastEthernet 0/11 Switch2(config-if)#shutdown Switch2(config-if)#switchport m

43、ode dynamic auto Switch2(config-if)#no shutdown,实验结果,在Switch1上用 show interfaces FastEthernet 0/11 switchport查看端口信息 Name: Fa0/11 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Ne

44、gotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsula

45、tion: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: All Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Unknown unicast blocked: d

46、isabled Unknown multicast blocked: disabled Appliance trust: none,实验结果,在Switch2上用 show interfaces FastEthernet 0/11 switchport 查看端口信息 Name: Fa0/11 Switchport: Enabled Administrative Mode: dynamic auto Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1