网络与通信 小型网络.docx
第1章绪论1.1 计算机网络功能硬件资源共享可以在全网范围内提供对处理资源、存储资源、输入输出资源等昂贵设备的 共享,使用户节省投资,也便于集中管理和均衡分担负荷。软件资源共享允许互联网上的用户远程访问各类大型数据库,可以得到网络文件传送服 务、远地进程管理服务和远程文件访问服务,从而避免软件研制上的重复劳动以 及数据资源的重复存贮,也便于集中管理。用户间信息交换计算机网络为分布在各地的用户提供了强有力的通信手段。用户可以通过 计算机网络传送电子邮件、发布新闻消息和进行电子商务活动。1.2 几种主要计算机网络局域网通常我们常见的“LAN”就是指局域网,这是我们最常见、应用最广的一种 网络。现在局域网随着整个计算机网络技术的发展和提高得到充分的应用和普 及,几乎每个单位都有自己的局域网,有的甚至家庭中都有自己的小型局域网。 很明显,所谓局域网,那就是在局部地区范围内的网络,它所覆盖的地区范围较小。 局域网在计算机数量配置上没有太多的限制,少的可以只有两台,多的可达几百台。 一般来说在企业局域网中,工作站的数量在几十到两百台次左右。在网络所涉及的地理距离上一般来说可以是几米至10公里以内。局域网一般位于一 个建筑物或一个单位内,不存在寻径问题,不包括网络层的应用。 这种网络 的特点就是:连接范围窄、用户数少、配置容易、连接速率高。目前局域网最连线连线过程中应该注意路由器、交换机以及主机之间各个端口的名称,性质,避免 端口选择不正确导致实验失败。完成拓扑图绘制经过检验,最终绘制的拓扑图如图3.4所示经过检验,最终绘制的拓扑图如图3.4所示图3.4拓扑图3.2 Router的配置绘制完拓扑图后保存(文件类型为.top),打开BOSON Netsim,将该文件导入 进来对各个设备进行配置。首先对路由器R1进行配置,在eRouters中选择R1, 键入相关命令进行配置,具体如下:Router>enableRouter#conf t进入特权模式 进入全局模式Router(config)#host R1为交换机命名为R1R1 (config-line)#intethO进入端口 eOR1 (config-if)#ip add 1配置IP地址与子网掩码R1 (config-if)#noshut激活端口R1 (config-if)#int se 0进入端口 seO配置IP地址与子网掩码R1 (config-if)#clock rate64000R1 (config-if)#no shutR1 (config-if)#endR1 #copy run start同样地,对R2进行配置如下:设置主时钟频率退出全局设置状态保存配置文件Router>enableRouter#conf tRouter(config)#host R2R2(config-line)#int eth 0R2(config-if)#no shutR2(config-if)#int se 0R2(config-if)#no shutR2(config-if)#endR2#copy run start配置、测试静态路由选择路由器R1并配置相关的静态路由信息,如下所示:R1 #conf tR1 (config)#endR1 #copy run start择路由器R2并配置相关的静态路由信息,如下所示:R2#conf tR2(config)#endR2#copy run startPC配置进入eStations里配置,在Host 1的命令提示符下键入WINIPCFG为Host 1 设置IP地址、子网掩码。键入WINIPCEG后界面显示如图3.5所示,在里面手动输入要设置的IP地址、子网掩码。设置完毕后保存。根据上面操作,完成其他主机的IP地址、子网掩码的设置在Host 2的命令提示符下键入WINIPCFG为Host 2设置IP地址、子网掩码 在Host 3的命令提示符下键入WINIPCFG为Host 3设置IP地址、子网掩码。在Host 4的命令提示符下键入WINIPCFG为Host 4设置IP地址、子网掩码。 在Host 5的命令提示符下键入WINIPCFG为Host 5设置IP地址、子网掩码。Host!、Host2、Host 3 的默认网关为 Host4、Host5 的默认网关为 192.16864。各个主机IP地址、子网掩码、默认网关如表3.1 o主机IP地址H1H2H3H4H5子网掩码子网掩码默认网关表5.1主机IP地址、子网掩码、默认网关配置完后可用show ip route查看各路由器中的路由表,如图3.6图3.7所示:R1#Rl#show ip routeCodes: C - connected, S - static, I -工GRP, R - RIP, M - mobile, B - BGPD - E工GRP, EX - EIGRP external, O - OSPFr IA - OSPF inter area El - OSPF external type 1r E2 - OSPF external type 2 r E - EGP i - IS-IS, LI - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static routeGateway of last resort is not set192.168.0.0 is directly connected, FastEthernetO/O图3.6 R1路由表R2#R2#show ip routeCodes: C - connectedr S - static, I -工GRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area El - OSPF external type 1, E2 - OSPF external type 2 r E - EGP i - IS-IS, LI - IS-IS level-1, L2 - IS-IS level-2r * - candidate default U - per-user static routeGateway of last resort is not set192.168.1.0 is directly connected, SerialO192.168.6.0 is directly connected, FastEthernet0/0图3.7 R2路由表由以上各个路由表的信息显示可知,各路由器之间连接正确,且路由配置 成功实现,为了验证网络的连通性,我们通过测试位于不同网络下的主机是否互 通来判断其连通性。3. 4虚拟局域网划分绘制拓扑结构图利用Boson Network Designer绘制网络拓扑结构图,如下图。完成拓扑结 构图绘制后,保存到扩展名为.top文件中(如myvlan. top) o步骤如下图逐步完 成。田.繇,,|<A吐缸RoU妇Av 妇 妇田圭1900归已田.曰:'900坛李白PC6:.孟.2,950 田竺3500知独 号妇 labLe Connect »p口 Other Devices-n采用选择和双击的方式,把PC 机和交换机选择好,交换机命 名为叮1 机器分别命名为下石.PCIPC InformationModel: PC否 Bos on Network Designer心 1 e 心.:ard )jel pDevices and Connectors田.缅扣h bleRouU曰.知,但bLE亟田竺 日.生19”290-0 如i? S :50田芦35 0心血用.W 扣I比bl己也吟妇 日.已0归D部哗已邑PC InformationModel: PC 巨 er n e tPC2PC3pc、pc 目PCg图3.8交换机主机选择图3.10连接完成的拓扑图配置PC机的参数2、配置PC机的参数启动Boson NetSimo选择“Load NetMapv选项,装入上面保存好的拓扑结Boson Net Sim? v 6 - Control PanelBETA 3 - eSwitch 1File Modes Devices Tools Ordering Window Help-Bl 回 痈网eSwitcheseStations Lab Navi gator NetMap Remote Control构网的.top文件。在BosonNetSim工具栏按钮“eStations”先选择“PCI”图3.11 Boson NetSim选择界面由于PC设置在前面提到,这里不一一设置,设置后的各个主机IP地址如表3.2表3.2各个主机IP地址、子网掩码、默认网关主机IP地址子网掩码默认网关PC1PC2PC3PC4PC5PC6配置交换机的参数接着上面,重新回到菜单和工具栏选项。在Boson NetSim工具栏按钮Swi tch (conf ig) # %LINK-3-UPDOWN: Interface %LINEPROTO-5-UPDOWN: Line %LINK-3-UPDOWN: Interface %LINEPROTO-5-UPDOWN: Line %LINK-3-UPDOWN: InterfaceSwi tch (conf ig) # %LINK-3-UPDOWN: Interface %LINEPROTO-5-UPDOWN: Line %LINK-3-UPDOWN: Interface %LINEPROTO-5-UPDOWN: Line %LINK-3-UPDOWN: InterfaceFastEthernetO/1, changed state to up protocol on Interface FastEthernetO/1, FastEthernetO/2, changed state to up protocol on Interface FastEthernetO/2, FastEthernetO/3, changed state to upchangedchangedstatestateto upto up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernetO/3,changedstateto up%LINK-3-UPDOWN: Interface FastEthernetO/4, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernetO/4, %LINK-3-UPDOWN: Interface FastEthernetO/5, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernetO/5, %LINK-3-UPDOWN: Interface FastEthernetO/6, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernetO/6,changedchangedchangedstatestatestatetototoupupupSwitch(config)#图 3.12 Switch 界面然后按照下面的命令进行相关配置。Switch>enableSwitch#vlan databaseSwitch(vlan)#vlan 10 name 1Switch(vlan)#vlan 20 name 2Switch(vlan)#exitVLAN NameVLAN NameStatusPortsdefaultactiveFa0/l,FaO/5,FaO/9,FaO/2, FaO/3, FaO/4FaO/6, FaO/7, FaO/8 Fa0/10, Fa0/llr FaO/12io20 100210031004100512fddi-default token-ring-default fddinet-default trnet-defaultactive active active active active active图3.13 VLAN配置结果VLANTypeSAIDMTUParent RingNo BridgeNoStpBrdgMode Trans1Trans21enet1000011500一 一-0010enet1000101500一 一-0020enet1Q0Q201500一结臬如图3.13.-00瑞Hashcwovlan ,一-001003tr1010031500一 一-001004fdnet1010041500一 ieee-001005trnet1010051500一 ibm-00配置交换机,将端口分配到VLANSwitch#enableSwitch#conf tSwitch(config)#int rang faO/1-3将交换机的 faO/1faO/2 端 口 力口入 VLAN10Switch (config-if-range) #switchport access vlan 10Switch(config)#int rang faO/4-6将交换机的 faO/3faO/4 端 口 力口入 VLAN20Switch (config-if-range) #switchport access vlan 20再次查看配置结果Switch#show vlanVLAN NameStatusPorts1defaultactiveFaO/7, FaO/8, FaO/9, Fa0/10FaO/11, FaO/12101activeFa0/lr FaO/2r FaO/3202activeFaO/4, FaO/5, FaO/61002 fddi-defaultactive1003 token-ring-defaultactive1004 fddinet-defaultactive1005 trnet-defaultactiveVLAN Type SAIDMTUParent RingNo BridgeNo Stp BrdgMode Trans1 Trans21enet 1000011500 -0010 enet 1000101500 -0020 enet 1000201500 -001002 fddi 1010021500 -001003 tr1010031500 -001004 fdnet 1010041500 ieee -001005 trnet 1010051500 ibm -00Switch#show vlan,结果如图 3.14图3.14分配VLAN后结果图第4章结果分析4.1连通性测试:Packets: Sent55ms6:6:6:6:6:time=60mstime=60mstime=60mstime=60mstime=60msbvtes=32bytes=32bytes=32bytes=32TTL=241TTL=241TTL=241TTL=241TTL=2415,ReceivedMinimum =5Max i mum =ng statistics rproximate roundbytes=32p times in mi111-seconds:60ms, AverageHl与H2连通,如图4. 1所示Pinging 192.168.0.7 with 32 bytes of data:Replyfrom192.168.0.7:bytes=32time=60msTTL=241Replyfrom192.168.0.7:bytes=32time=60msTTL=241Replyfrom192.168.0.7:bytes=32time=60msTTL=241Replyfrom192.168.0.7:bytes=32time=60msTTL=241Replyfrom192.168.0.7:bytes=32time=60msTTL=241Ping statistics for 192.168.0.7:Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),/proximate round trip times in mi Hi-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55msHl与H3连通,如图4.2所示图4.2H1与H3相互连通快的速率要算现今的10G以太网了。IEEE的802标准委员会定义了多种主要的 LAN网:以太网(Ethernet)令鹘啊(Token Ring),光纤分布式接口网络(FDDI)、 异步传输模式网(ATM)以及最新的无线局域网(WLAN)o这些都将在后面详细介 绍。城域网这种网络一般来说是在一个城市,但不在同一地理小区范围内的计算机互 联。这种网络的连接距离可以在10100公里,它采用的是IEEE802. 6标准。MAN 与LAN相比扩展的距离更长,连接的计算机数量更多,在地理范围上可以说是 LAN网络的延伸。在一个大型城市或都市地区,一个MAN网络通常连接着多个LAN 网。如连接政府机构的LAN、医院的LAN、电信的LAN、公司企业的LAN等等。 由于光纤连接的引入,使MAN中高速的LAN互连成为可能。城域网多采用ATM技术做骨干网。ATM是一个用于数据、语音、视频以及多媒体应用程序的高速网 络传输方法。ATM包括一个接口和一个协议,该协议能够在一个常规的传输信道 上,在比特率不变及变化的通信量之间进行切换。ATM也包括硬件、软件以及与 ATM协议标准一致的介质。ATM提供一个可伸缩的主干基础设施,以便能够适应 不同规模、速度以及寻址技术的网络。ATM的最大缺点就是成本太高,所以一般 在政府城域网中应用,如邮政、银行、医院等。广域网这种网络也称为远程网,所覆盖的范围比城域网(MAN)更广,它一般是在 不同城市之间的LAN或者MAN网络互联,地理范围可从几百公里到几千公里。因 为距离较远,信息衰减比较严重,所以这种网络一般是要租用专线,通过IMP (接口 信息处理)协议和线路连接起来,构成网状结构,解决循径问题。这种城域网因 为所连接的用户多,总出口带宽有限,所以用户的终端连接速率一般较低,通常为 9. 6Kbps45Mbps 如:邮电部的 CHINANET, CHINAPAC,和 CHINADDN 网。互联网互联网又因其英文单词“Internet”的谐音,又称为“英特网”。在互联网 应用如此发展的今天,它已是我们每天都要打交道的一种网络,无论从地理范围,Pinging 192.168.6.15 with 32 bytes of data:epiy epiy epiy epiy epiyfrom from from from from192,168.6.15:192.168.6.15:192.168.6.15:192.168.6.15:192.168.6.15:bytes=32bytes=32bytes=32bytes=32bytes=32time=60ms time=60ms time=60ms time=60ms time=60msTTL=241TTL=241TTL=241TTL=241TTL=241Ping statistics for 192.168.6.15:Packets: Sent5, Received = 5, Lost0 (0% loss),proximate round trip times in mi Hi-seconds:Minimum = 50ms, Maximum = 60ms r Averageproximate round trip times in mi Hi-seconds:Minimum = 50ms, Maximum = 60ms r Average55msPinging 192.168.0.7 with 32 bytes of data:eply eply eply eply eplyfrom from from from from192.168.0.7:192.168.0.7:192.168.0.7:192.168.0.7:192.168.0.7:bytes=32 bytes=32 bytes=32 bytes=32 bytes=32time=60ms time=60ms time=60ms time=60ms time=60msTTL=241TTL=241TTL=241TTL=241TTL=241Ping statistics for 192.168.0.7:Packets: Sent5, Received = 5, Lost0 (0% loss),proximate round trip times in mi111-seconds:Minimum = 50ms, Maximum = 60ms, Averageproximate round trip times in mi111-seconds:Minimum = 50ms, Maximum = 60ms, Average55msH1与H1与H5连通,如图4.4所示图4.4H1与H5相互连通H2与H3连通,如图4.5所示图4.5 H2与H3相互连通H2与H4连通,如图4.6所示Pinging 192.168.6.14 with 32 bytes of data:epiy eply epiy eply epiyfrom 192,168.6.14:from 192.168.6.14:from 192.168.6.14:from 192.168.6.14:from 192.160.6.14:bytes=32 bytes=32 bytes=32 bytes=32 bytes32time=60ms time=60ms time=60ms time=60ms time60msTTL=241TTL=241TTL=241TTL=241TTL-241Ping statistics for 192.168.6.14:Ping statistics for 192.168.6.14:Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),proximate round trip times in mi11i-seconds:Minimum = 50ms, Maximum = 60ms, Average55ms图4.6 H2与H4相互连通Pinging 192.168.6.14 with 32 bytes of data:eply epiy epiy eply eplyfrom from from from from192.168.6.14:192.168.6.14:192,168,6,14:192.168.6.14:192.168.6.14:bytes=32bytes=32bytes=32bytes=32bytes=32time=60ms time=60ms time=60ms time=60ms time=60msTTL=241TTL=241TTL=241TTL=241TTL=241Ping statistics for 192.168.6.14:Packets: Sent5, Received = 5, Lost0 (0% loss),Hiproximate round trip times in mi Hi-seconds:Minimum = 50ms, Maximum = 60ms/ Average55msH2与H5连通,如图4.7所示图4.7 H2与H5相互连通Pinging 192.168.6.15 with 32 bytes of data:leply Leply Leply Leply Leplyfrom from from from from192.168.6.15:192.168.6.15:192.168.6.15:192.168.6.15:192.168.6.15:bytes=32bytes=32bytes=32bytes=32bytes=32time=60ms time=60ms time=60ms time=60ms time=60msTTL=241TTL=241TTL=241TTL=241TTL=241Ping statistics for 192.168.6.15:Packets: Sent5, Received = 5, Lost0 (0% loss),proximate round trip times in mi Hi-seconds:Minimum = 50ms, Maximum = 60ms, Average55mstime=60ms time=60ms time=60ms time=60ms time=60msTTL=241 TTL=241 TTL=241TTL=241TTL=241Ping statistics for 192.168.6.14:Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),Approximate round trip times in miHi-seconds:Minimum = 50ms, Maximum = 60ms t Average = 55mswith 32 bytes of data:Pinging 192.168.6.14 with 32 bytes of data:ReplyfromReplyfromReplyfromReplyfromReplyfrom2 2 2 2 2 3 3 3 3 3 -=-= s s s s s e e e e e 匕 t t t t wbybybybyH3与H5连通,如图4.9所示Pinging 192.168.6.15 with 32 bytes of data:leply leply leply leply leplyfrom from from from from192.168.6.15:192.168.6.15:192.168.6.15:192.168.6.15:192.168.6.15:bytes=32bytes=32bytes=32bytes=32bytes=32time=60ms time=60ms time=60ms time=60ms time=60msTTL=241TTL=241TTL=241TTL=241TTL=241Ping statistics for 192.168.6.15:Packets: Sent = 5, Received = 5, Lost0 (0% loss)rpproximate round trip times in miHi-seconds:Minimum = 50ms, Maximum60ms, Average55ms图4.9 H3与H5相互连通H4与H5连通,如图4.10所示C: >Pinging 192.168.6.14 with 32 bytes of data:Replyfrom192.168.6.14:Replyfrom192,168.6.14:Replyfrom192.168.6.14:Replyfrom192.168.6.6.14:Replyfrom192.16814:bytes=32bytes=32bytes=32bytes=32bytes=32time=60ms time=60ms time=60ms time=60ms time=60msTTL=241TTL=241TTL=241TTL=241TTL=241Ping statistics for 192.168.6.14:Packets: Sent = 5f Received = 5r Lost = 0 (0% loss),rproximate round trip times in mi Hi -seconds: Minimum = 50ms, Maximum = 60ms f Average = 55ms图4.10H4与H5相互连通Hl与R1连通,如图4.11所示图4.11 H1与R1相互连通H1与R2连通,如图4.12所示图4.12H1与R2相互连通H4与R1连通,如图4.13所示192.1 68.6. 15lwith|32,王旦凶五一,王旦凶五一proximateI < >u I u !( rMi n i m 立from 192. 168. 6.1 5 from 192.1686 15: from 192. 168. 6. 1 5 fir-om 192.168615 Irom I . I GX. G. I 5i me;time=60ms time=6Dms tirne=60ms t ime = 60ms t i e=60msi m imhI(0%ll os sPinging 192.168.1.1 with 32 bytes of data:Replyfrom192.168.1.1:bytes=32time=60msTTL=241Replyfrom192,168.1.1:bytes=32time=60msTTL=241Replyfrom192.168.1.1:bytes=32time=60msTTL=241Replyfrom192.168.1.1:bytes=32time=60msTTL=241Replyfrom:bytes=32time=60msTTL=241Ping istatistics for 192.168.1.1:Packets: Sent = 5, Received = 5,Lost = 0 (0% loss)rtoproximate;round triptimes in mi111-seconds:Minimum = 50ms, Maximum =60ms, Average = 55ms图4.13H4与R1相互连通Pinging 192.168.1.2 with 32 bytes of data:Replyfrom 192.168.1.2:bytes=32time=60msTTL=241Replyfrom192.168.1.2:bytes=32time=60msTTL=241Replyfrom192.168.1.2:bytes=32time=60msTTL=241Replyfrom192.168.1.2:bytes=32time=60msTTL=241Replyfrom192.168.1.2:bytes=32time=60msTTL=241Ping statistics for 192.168.1.2:Packets: Sent = 5, Received = 5, Lost = 0 (0% loss)r proximate round trip times in mi111-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msH4与R2连通,如图4. 14所示图4.14H4与R2相互连通Pinging 192.168.1.1 with