交换与路由基本知识.ppt

上传人:公**** 文档编号:568255312 上传时间:2024-07-23 格式:PPT 页数:52 大小:1.51MB
返回 下载 相关 举报
交换与路由基本知识.ppt_第1页
第1页 / 共52页
交换与路由基本知识.ppt_第2页
第2页 / 共52页
交换与路由基本知识.ppt_第3页
第3页 / 共52页
交换与路由基本知识.ppt_第4页
第4页 / 共52页
交换与路由基本知识.ppt_第5页
第5页 / 共52页
点击查看更多>>
资源描述

《交换与路由基本知识.ppt》由会员分享,可在线阅读,更多相关《交换与路由基本知识.ppt(52页珍藏版)》请在金锄头文库上搜索。

1、OSI七层协议七层协议 OSI(Open System interconnection)开放系开放系统互互连参考模型参考模型 1 1、物理层、物理层 数据单位是位数据单位是位(BIT)(BIT),典型设备是集线器,典型设备是集线器HUBHUB。 2 2、链路层、链路层 数据单位是帧,实现对数据单位是帧,实现对MACMAC地址的访问,典型设备是交换机地址的访问,典型设备是交换机SwitchSwitch。 3 3、网络层、网络层 数据单位是包,使用的是数据单位是包,使用的是IPIP地址,典型设备是路由器地址,典型设备是路由器RouterRouter。 4 4、传输层、传输层 提供端到端的服务。可以

2、实现流量控制、负载均衡。传输层信息包含提供端到端的服务。可以实现流量控制、负载均衡。传输层信息包含 端口、控制字和校验和。传输层协议主要是端口、控制字和校验和。传输层协议主要是TCPTCP和和UDPUDP。 5 5、会话层、会话层 主要内容是通过会话进行身份验证、会话管理和确定通讯方式主要内容是通过会话进行身份验证、会话管理和确定通讯方式 6 6、表示层、表示层 主要是解释通讯数据的意义,如代码转换、格式变换等,使不同的终主要是解释通讯数据的意义,如代码转换、格式变换等,使不同的终 端可以表示。还包括加密与解密、压缩与解压缩等。端可以表示。还包括加密与解密、压缩与解压缩等。 7 7、应用层、应

3、用层 应用层应该是直接面向用户的程序或服务,包括系统程序和用户程序,应用层应该是直接面向用户的程序或服务,包括系统程序和用户程序, 例如例如wwwwww、FTPFTP、DNSDNS、POP3POP3和和SMTPSMTP等都是应用层服务。等都是应用层服务。数据包封装与解封装数据包封装与解封装 数据在发送时是数据从应用层至物理层的一个打包的过程数据在发送时是数据从应用层至物理层的一个打包的过程 接收时是数据从物理层至应用层的一个解包的过程接收时是数据从物理层至应用层的一个解包的过程交换机交换机交换机是根据网桥的原理发展起来的,学习交换机先认识两个概念:交换机是根据网桥的原理发展起来的,学习交换机先

4、认识两个概念: (1)冲突域:冲突域: 冲突域是数据必然发送到的区域。冲突域是数据必然发送到的区域。 HUB是无智能的信号驱动器,有入必出,整个由是无智能的信号驱动器,有入必出,整个由HUB组成的网络是一个冲组成的网络是一个冲突域。突域。 交换机的一个接口下的网络是一个冲突域,所以交换机可以隔离冲突域。交换机的一个接口下的网络是一个冲突域,所以交换机可以隔离冲突域。 (2)广播域:广播域: 广播数据时可以发送到的区域是一个广播域。广播数据时可以发送到的区域是一个广播域。 交换机和集线器对广播帧是透明的,所以用交换机和交换机和集线器对广播帧是透明的,所以用交换机和HUB组成的网络是一组成的网络是

5、一个广播域。个广播域。 路由器的一个接口下的网络是一个广播域。所以路由器可以隔离广播域。路由器的一个接口下的网络是一个广播域。所以路由器可以隔离广播域。STP 交换网络中的环交换网络中的环 以太网是总线或星型结构,不能构成环路,否则会产两个严重后果:以太网是总线或星型结构,不能构成环路,否则会产两个严重后果: (1)产生广播风暴,造成网络堵塞。产生广播风暴,造成网络堵塞。 (2)克隆帧会在各个口出现,造成地址学习克隆帧会在各个口出现,造成地址学习(记录帧源地址记录帧源地址)混乱。混乱。 解决环路问题方案解决环路问题方案: (1)网络在设计时,人为的避免产生环路。网络在设计时,人为的避免产生环路

6、。 (2)使用生成树使用生成树STP(Spanning Tree Protocol)功能,将有环的网络功能,将有环的网络剪成无环网络。剪成无环网络。 STP被被IEEE802规范为规范为802.1d标准。标准。生成树协议术语生成树协议术语 (1)网桥协议数据单元:网桥协议数据单元:BPDU(Bridge Protocol Data Unit) BPDU是生成树协议交换机间通讯的数据单元,用于确定角色。是生成树协议交换机间通讯的数据单元,用于确定角色。 (2)网桥号:网桥号:Bridge ID 交换机的标识号,它由优先级和交换机的标识号,它由优先级和MAC地址组成,优先级地址组成,优先级16位,

7、位,MAC地址地址48位。位。 (3)根网桥:根网桥:Root bridge 根网桥定义为网桥号最小的交换机,根网桥所有的端口都不会阻塞。根网桥定义为网桥号最小的交换机,根网桥所有的端口都不会阻塞。 (4)根端口:根端口:Root port 非根网桥到根网桥累计路径花费最小的端口,负责本网桥与根网桥通讯的非根网桥到根网桥累计路径花费最小的端口,负责本网桥与根网桥通讯的接口。接口。 (5)指定网桥:指定网桥:Designated bridge 网络中到根网桥累计路径花费最小交换机,负责收发本网段数据。网络中到根网桥累计路径花费最小交换机,负责收发本网段数据。 (6)指定端口:指定端口:Desig

8、nated port 网络中到根网桥累计路径花费最小的交换机端口,根网桥每个端口都是指网络中到根网桥累计路径花费最小的交换机端口,根网桥每个端口都是指定端口。定端口。 (7)非指定端口:非指定端口:NonDesignated port 余下的端口是非指定端口,它们不参与数据的转发,也就是被阻塞的端口。余下的端口是非指定端口,它们不参与数据的转发,也就是被阻塞的端口。 (根端口是从非根网桥选出,指定端口是网段中选出根端口是从非根网桥选出,指定端口是网段中选出)。STP生成树协议的状态:生成树协议的状态: 生成树协议工作时,所有端口都要经过一个端口状态的建立过程。生成树协议工作时,所有端口都要经过

9、一个端口状态的建立过程。 生成树协议通过生成树协议通过BPDU广播,确定各交换机及其端口的工作状态和广播,确定各交换机及其端口的工作状态和角色,角色, 交换机上的端口状态分别为:关闭、阻塞、侦听、学习和转发状态。交换机上的端口状态分别为:关闭、阻塞、侦听、学习和转发状态。 (1)关闭状态:关闭状态:Disabled 不收发任何报文,当接口空连接或人为关不收发任何报文,当接口空连接或人为关闭时处于关闭状态。闭时处于关闭状态。 (2)阻塞状态:阻塞状态:Blocking 在机器刚启动时,端口是阻塞状态在机器刚启动时,端口是阻塞状态(20秒秒),但接收但接收BPDU信息。信息。 (3)侦听状态:侦听

10、状态:listening 不接收用户数据不接收用户数据(15秒秒),收发,收发BPDU,确定,确定网桥及接口角色。网桥及接口角色。 (4)学习状态:学习状态:learning 不接收用户数据不接收用户数据(15秒秒),收发,收发BPDU,进行,进行地址学习。地址学习。 (5)转发状态:转发状态:Forwarding 开始收发用户数据,继续收发开始收发用户数据,继续收发BPDU和和地址学习地址学习,维护维护STP。VLANVLAN(Virtual Lan)是虚拟逻辑网络是虚拟逻辑网络交换机通过交换机通过VLAN设置,可以划分为多个逻辑网络,从而设置,可以划分为多个逻辑网络,从而隔离广播域。具有三

11、层模块的交换机可以实现隔离广播域。具有三层模块的交换机可以实现VLAN间的间的路由。路由。VLAN (1)端口模式端口模式 交交换机端口有两种模式,机端口有两种模式,access和和trunk。access口用于与口用于与计算算机相机相连,而交,而交换机之机之间的的连接,接,应该是是trunk。 交交换机端口默机端口默认VLAN是是VLAN1,工作在,工作在access模式。具有相同模式。具有相同VLAN号的端口在同一个广播域中。号的端口在同一个广播域中。 Trunk又称又称为干干线,可以,可以设置允置允许多个多个VLAN通通过。 (2)VLAN中中继协议: VLAN中中继协议有两种:有两种:

12、 ISL(Inter-Switch Link): ISL是是Cisco专用的用的VLAN中中继协议。 802.1q(dot1q):802.1q是是标准化的,准化的,应用用较为普遍。普遍。What Is an End-to-End VLAN?Users are grouped into VLANs independent of physical location.If users are moved within the campus, their VLAN membership remains the same.VLAN Configuration Modes Global ModeSwitc

13、h# configure terminal Switch(config)# vlan 3 Switch(config-vlan)# name Vlan3Switch(config-vlan)# exit Switch(config)# endVLAN Configuration Modes Database ModeSwitch# vlan database Switch(vlan)# vlan 3 VLAN 3 added: Name: VLAN0003Switch(vlan)# exit APPLY completed.Exiting.VLAN Access Ports The acces

14、s switch port associated with a single data VLANVLAN Implementation CommandsConfiguring VLANsvlan 101switchport mode accessswitchport access vlan 101Verifying VLANsshow interfacesshow vlanConfiguring an Access VLAN Switch(config)# vlan vlan_idCreate a VLAN.Switch(config-vlan)# name vlan_nameProvide

15、a VLAN name.Switch(config-if)# switchport mode access Place the switch port into access mode.Switch(config-if)# switchport access vlan vlan_idAssociate the access switch port with a VLAN.Verifying the Access VLAN ConfigurationSwitch#show vlanVLAN Name Status Ports- - - -1 default active Fa0/1, Fa0/2

16、, Fa0/3, Fa0/4 Fa0/5, Fa0/7, Fa0/911 asw11_data active12 asw12_data active95 VLAN0095 active Fa0/899 Trunk_Native active100 Internal_Access active111 voice-for-group-11 active112 voice-for-group-12 active1002 fddi-default act/unsup1003 token-ring-default act/unsup1004 fddinet-default act/unsup1005 t

17、rnet-default act/unsupVLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 - - - - - - - - -1 enet 100001 1500 - - - - - 0 11enet 100011 1500 - - - - - 0 . . . . . . . . . .Defining VLANsImplementing TrunksMaintaining Specific VLAN IdentificationSpecifically developed for multi-VLAN intersw

18、itch communicationsPlaces a unique identifier in each frameFunctions at Layer 2VLAN TrunkingComparing ISL and 802.1QISL802.1QProprietary专有专有Nonproprietary非专有非专有EncapsulatedTaggedProtocol independentProtocol dependentEncapsulates the old frame in a new frameAdds a field to the frame headerTrunking wi

19、th ISLIs a Cisco proprietary 专利专利protocolSupports PVSTUses an encapsulation process Does not modify the original frameISL EncapsulationTrunking with 802.1QAn IEEE standardAdds a 4-byte tag to the original frameAdditional tag includes a priority field Does not tag frames that belong to the native VLA

20、NSupports Cisco IP telephonyThe 802.1Q Tagging Process 802.1Q Native VLAN Native VLAN frames are carried over the trunk link untagged.VLAN RangesVLAN RangeUse 0, 4095Reserved for system use only1Cisco default21001For Ethernet VLANs10021005Cisco defaults for FDDI and Token Ring10064094Ethernet VLANs

21、only, unusable on specific legacy platformsTrunking Configuration Commands Configuring a Trunkswitchport trunkswitchport modeswitchport nonegotiateTrunks can be configured statically or via DTP.DTP provides the ability to negotiate the trunking method.Switchport Mode InteractionsDynamic AutoDynamic

22、DesirableTrunkAccessDynamic AutoAccessTrunkTrunkAccessDynamic DesirableTrunkTrunkTrunkAccessTrunkTrunkTrunkTrunkNot recommendedAccessAccessAccessNot recommendedAccessNote: Table assumes DTP is enabled at both ends.show dtp interface to determine current settingHow to Configure Trunking 1.Enter inter

23、face configuration mode.2.Shut down interface.3.Select the encapsulation (802.1Q or ISL).4.Configure the interface as a Layer 2 trunk.5.Specify the trunking native VLAN (for 802.1Q).6.Configure the allowable VLANs for this trunk.7.Use the no shutdown command on the interface to activate the trunking

24、 process.8.Verify the trunk configuration.802.1Q Trunk ConfigurationSwitch(config)#interface fastethernet 5/8 Switch(config-if)#shutdown Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport trunk allowed vlan 1,5,11,1002-1005 Switch(config-if)#switchport mode trunkSwit

25、ch(config-if)#switchport trunk native vlan 99Switch(config-if)#switchport nonegotiate Switch(config-if)#no shutdown Verifying the 802.1Q ConfigurationSwitch#show running-config interface fastethernet | gigabitethernet slot/portSwitch#show interfaces fastethernet | gigabitethernet slot/port switchpor

26、t | trunk Switch#show interfaces fastEthernet 5/8 switchportName: fa5/8Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OffAccess Mode VLAN: 1 (default)Trunking Native Mod

27、e VLAN: 99 (trunk_only)Trunking VLANs Enabled: 1,5,11,1002-1005 Pruning VLANs Enabled: 2-1001 . . .Verifying a 802.1Q Dynamic Trunk Link Switch#show running-config interface fastethernet 5/8 Building configuration.Current configuration:!interface FastEthernet5/8 switchport mode dynamic desirable swi

28、tchport trunk encapsulation dot1q Switch#show interfaces fastethernet 5/8 trunk Port Mode Encapsulation Status Native vlanFa5/8 desirable 802.1q trunking 99 Port Vlans allowed on trunkFa5/8 1,5,11,1002-1005 Port Vlans allowed and active in management domainFa5/8 1,5,1002-1005 Port Vlans in spanning

29、tree forwarding state and not prunedFa5/8 1,5,1002-1005ISL Trunk ConfigurationSwitch(config)#interface fastethernet 2/1 Switch(config-if)#shutdown Switch(config-if)#switchport trunk encapsulation isl Switch(config-if)#switchport trunk allowed vlan 1-5,1002-1005Switch(config-if)#switchport mode trunk

30、Switch(config-if)#switchport nonegotiateSwitch(config-if)#no shutdown Verifying ISL TrunkingSwitch#show running-config interface fastethernet | gigabitethernet slot/portSwitch#show interfaces fastethernet | gigabitethernet slot/port switchport | trunk Switch#show interfaces fastethernet 2/1 trunk Po

31、rt Mode Encapsulation Status Native VLAN Fa2/1 trunk isl trunking 99 Port VLANs allowed on trunk Fa2/1 1-5,1002-1005 Port VLANs allowed and active in management domain Fa2/1 1-2,1002-1005 Port VLANs in spanning tree forwarding state and not pruned Fa2/1 1-2,1002-1005SummaryTrunk links carry traffic

32、from multiple VLANs.ISL is Cisco proprietary and encapsulates the Layer 2 frames.802.1Q is an IEEE standard for trunking, which implements a 4-byte tag.The 802.1Q native VLANs forward frames without the tag.VLAN numbers have specific ranges and purposes.Various commands are used to configure and ver

33、ify ISL and 802.1Q trunk links. Allow only required VLANs over the trunk.Defining VLANsPropagating VLAN Configurations with VTPThe VTP Domain Group of switches that exchange VLAN information VLANs administered centrally at a chosen switch The VTP Protocol Advertises VLAN configuration informationMai

34、ntains VLAN configuration consistency throughout a common administrative domainSends advertisements on trunk ports onlyVTP Modes ClientCannot create, change, or delete VLANs Forwards advertisementsSynchronizes VLAN configurationsDoes not save in NVRAMTransparentCreates, modifies, and deletes local V

35、LANsForwards advertisementsDoes not synchronize VLAN configurationsSaves configuration in NVRAMServer (default mode)Creates, modifies, and deletes VLANsSends and forwards advertisementsSynchronizes VLAN configurationsSaves configuration in NVRAMPruning DisabledPruning EnabledVTP PruningUses bandwidt

36、h more efficiently by reducing unnecessary flooded trafficExample: Station A sends broadcast; broadcast flooded only toward any switch with ports assigned to the red VLANVTP Operation VTP advertisements are sent as multicast frames. VTP servers and clients are synchronized to the latest revision num

37、ber.VTP advertisements are sent every 5 minutes or when there is a change.VTP Configuration Commands Configuring VTPvtp domainvtp modevtp passwordVerifying VTPshow vtp statusshow vtp countersConfiguring a VTP Management DomainConfigure each switch in the following order to avoid dynamic learning of

38、the domain name:VTP passwordVTP domain name (case sensitive)VTP mode (server mode is the default)Configuring and Verifying VTPSwitch#show vlan brief Displays a list of current VLANsSwitch(config)#vtp mode Sets the VTP mode to server, client, or transparentSwitch(config)#vtp domain domain_name Sets t

39、he VTP domain nameSwitch# show vtp status Displays the current settings for VTP Sets the VTP passwordSwitch(config)#vtp password password_stringVerifying the VTP ConfigurationSwitch#show vtp status VTP Version : 2Configuration Revision : 28Maximum VLANs supported locally : 1005Number of existing VLA

40、Ns : 17VTP Operating Mode : ClientVTP Domain Name : BCMSNVTP Pruning Mode : EnabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x45 0x52 0xB6 0xFD 0x63 0xC8 0x49 0x80Configuration last modified by 10.1.1.1 at 8-12-05 15:04:49Switch# Switch#show vtp statusVerifying the VTP Confi

41、guration (Cont.)Switch#show vtp countersVTP statistics:Summary advertisements received : 7Subset advertisements received : 5Request advertisements received : 0Summary advertisements transmitted : 997Subset advertisements transmitted : 13Request advertisements transmitted : 3Number of config revision

42、 errors : 0Number of config digest errors : 0Number of V1 summary errors : 0 VTP pruning statistics:Trunk Join Transmitted Join Received Summary advts received from non-pruning-capable device- - - -Fa5/8 43071 42766 5Switch#show vtp counters Implementing Inter-VLAN RoutingDescribing Routing Between

43、VLANsInter-VLAN Routing with External Router Single trunk link carries traffic for multiple VLANs to and from router.Inter-VLAN Routing External Router Configuration Commands Configure on subinterfaceencapsulation dot1Q (or isl) 10ip address 10.10.1.1 255.255.255.0Verifyshow vlan 10show ip routeInte

44、r-VLAN Routing on External Router: 802.1Q Trunk Link Inter-VLAN Routing on External Router: ISL Trunk LinkVerifying Inter-VLAN RoutingThe ping command tests connectivity to remote hosts. Verifying the Inter-VLAN Routing ConfigurationRouter#show ip interface briefDisplays the current IP configuration per VLANRouter#show ip routeDisplays IP route table informationRouter#show vlanDisplays IP address on interfaces and current state of interface

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 研究生课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号