TCP/IP协议TCP/IP与OSI模型比较应用层表示层会话层传送层网络层数据链路层物理层应用层TCPUDP协议网络层IP协议网络接口协议物理网络OSITCP/IPTCP/IP结构TELNETFTPSMTPDNSTFTPTCPUDPICMPIPARPRARP网络接口协议TCP/IP应用层DNSDomainNameServiceTCP,UDP53SMTPSimpleMailTransportProtocolTCP25FTP-DataFileTransferProtocol/DataTCP20&1023FTPFileTransferProtocolTCP21TelnetTCP23NNTPNetworkNewsTransportProtocolTCP119HTTPHypertextTransportProtocolTCP80•TCP协议•Reliabledatatransfer•Connection-orientedvirtualcircuit•Bufferedtransfer•Resequencing•Multiplexing•Efficient,full-duplextransmission•Flowcontrol•UDP协议•提供无连接的数据操作TCP/IP传输层TCP/IPInternet层•IP_InternetProtocol协议•Connectionless,unreliabledeliveryservice•Packetfragmentationandreassembly•Routingfunctions•ICMP_InternetControlMessageProtocol•ARP_AddressResolutionProtocol•RARP_ReverseAddressResolutionProtocol•InARP_InverseAddressResolutionProtocol交换机的工作原理一、交换机的概念•LAN交换机用于多个LAN网段的相互连接,它在网络设备之间进行专用的无冲突的通讯,同时支持多个设备之间的对话。•只有几个用户数的网段称为微型网段,微型网段允许建立专用网段,即每个网段只有一个用户,每个用户立即对整个带宽访问,不会发生冲突。•LAN交换机属第二层设备,用于解决带宽问题。•最近LAN交换机涉及到OSI的多层,具有处理高带宽应用得协议。二、VLAN交换工作原理一、LAN交换机在功能上类似透明桥:1、当交换机通电时,它们通过分析所有相邻网络的输入帧源地址获取网络拓扑结构。如交换机从链路1上接收到一个来自主机A的帧,则该交换机推断可通过网络连接链路1访问主机A。通过这种处理,建立一个表。14网络号主机地址11312232、交换机以该表为基础进行通信。当交换机的某接口收到一个信息帧时,交换机在内部表中查看该帧得目的地址。如表中包含目的地址,则该帧被发送到指定的端口。3、如果未发现任何关联,则该帧采用广播法发往除输入端口以外的所有端口。二、LAN交换机除具有拓扑结构、转发和过滤功能外还具有独特等新功能:设备间的特定通信、多个并发会话、全双工通信等功能。三、LAN交换转发LAN交换机主要有两种转发方式:•存储转发(store-and-forward)LAN交换机将整个帧拷贝到入站缓冲区,并由计算机执行循环冗余校验(CRC),如果出现CRC错误,或该帧是小帧(包括CRC小于64字节)/大帧(包括CRC小于1518字节)/,则丢弃该帧,如果帧没有任何错误,LAN交换机在转发或交换时寻找目的地址,确定外出接口,然后将帧转发到目的地址。•直通(cut-through)LAN交换机仅将目的地址(跟在序号后的6个字节)拷贝到入站缓冲区,然后在交换表中寻找目的地址,确定外出接口,将帧转发到目的地。直通方式交换一旦读到目的地址并确定出站接口,就开始转发,因而减少了等待时间。有些交换可以先将每个端口配置为直通交换方式,当到达用户定义的出错限制时,将自动改变到存储转发方式。一旦错率降到限制以下,端口自动转回到直通交换模式。路由器基本功能、作用(四)•地区网:路由器主要作用是网络连接和路由选择,即连接下层各个基层网络单位-园区网,同时负责下层网络之间的数据转发。•园区网:路由器主要作用是分隔子网,各个子网在逻辑上独立,而路由器是唯一能够分隔它们的设备,它负责子网之间报文转发和广播隔离,同时在边界上的路由器与上层网络连接。IP地址的分类及规划TCP/IP地址概述UNIXHostCompanyBUNIXHostCompanyA介绍TCP/IP地址•选路基于位置•位置代表了一个地址•只允许具有唯一地址的工作站进行通讯InternetTCP/IPIP地址32BitsNetworkHost8Bits8Bits8Bits8Bits172.16.122.204•ClassA:•ClassB:•ClassC:•ClassD:formulticast•ClassE:forresearchN=NetworknumberassignedbyNICH=HostnumberassignedbynetworkadministratorIP地址分类NHHHNNHHNNNHIP地址位1724ClassA:#Bits0network#host#114161ClassB:#Bits1network#host#0121811ClassC:#Bits1network#host#10识别IP地址分类(第一字节)HighOrderBitsOctetinDecimalAddressClass0101101-126128-191192-223ABC练习:IP地址分类AddressClassNetworkHost10.2.1.1128.63.2.100201.222.5.64192.6.141.2130.113.64.16256.241.201.10A10.0.0.00.2.1.1B128.63.0.00.0.2.100C201.222.5.00.0.0.64C192.6.141.00.0.0.2B130.113.0.00.0.64.16NonexistentIP地址规划Host地址172.16.200.1172.16.3.10172.16.12.12IP:172.16.2.110.1.1.110.250.8.1110.180.30.118IP:10.6.24.2E0E1172.161212NetworkHost..NetworkInterface172.16.0.010.0.0.0E0E1RoutingTable•Network172.16.0.0172.16.0.0地址没有进行子网(SubNets)•Network172.16.0.0地址有子网(SubNets)172.16.1.0172.16.2.0172.16.3.0172.16.4.0Subnet(子网)地址172.16.200.1172.16.2.2172.16.2.160172.16.3.5172.16.3.100172.16.3.150E0E1NetworkInterface172.16.0.0172.16.0.0E0E1RoutingTableNetworkInterface172.16.2.0172.16.3.0E0E1RoutingTableIP:172.16.2.1IP:172.16.3.1172.162160NetworkHost..SubnetSubnetMask(子网掩码)1721600IP地址NetworkHost25525500缺省子网掩码NetworkHost25525525508-bit子网掩码Usehostbits,startingatthehighorderbitpositionNetworkSubnetHost十进制与位的等值10000000=12811000000=19211100000=22411110000=24011111000=24811111100=25211111110=25411111111=2551286432168421NetworkHost172.16.2.160255.255.0.017216001010110011111111101011000001000011111111000100000000000000000000101000000000000000000000•不用子网(Subnets)___缺省00000010子网掩码(SubnetMask)没有子网(Subnets)NetworkHost172.16.2.160255.255.255.01721620Subnet11111111111111110000000011111111•网络号码扩展8位(bits)1010110010101100000100000001000000000010101000000000000000000010子网掩码(SubnetMask)没有子网(Subnets练习:子网掩码(SubnetMasks)AddressSubnetMaskClassSubnet172.16.2.1010.6.24.20172.30.36.12255.255.255.0255.255.0.0255.255.255.0B172.16.2.0A10.6.0.0B172.30.36.0子网规划其它子网20子网5hosts/每个子网C类地址:201.222.5.0IPHostAddress:172.16.2.120SubnetMask:255.255.255.0•子网(Subnet)地址=172.16.2.0•主机(Host)地址=172.16.2.1-72.16.2.254•广播(Broadcast)地址=172.16.2.255•八位子网NetworkSubnetHost1721620172.16.2.120:255.255.255.0/8:1010110011111111Subnet:10101100000100000001000011111111000000100000001011111111011110010000000000000000B类子网划分例子IPHostAddress:201.222.5.121SubnetMask:255.255.255.248NetworkSubnetHost2012225120201.222.5.121:1100100111111111Subnet:11001001110111101101111011111111000001010000010111111111011110011111100001111000255.255.255.248/5:C类地址例子•子网(Subnet)地址=201.222.5.120•主机(Host)地址=201.222.5.121-01.222.5.126•广播(Broadcast)地址=201.222.5.127•5位子网广播(Broadcast)地址255.255.255.255(Localnetworkbroadcast)X172.16.1.0172.16.2.0172.16.3.0172.16.4.0172.16.3.255(Directbroadcast)练习:广播(Broadcast)地址地址类子网广播201.222.10.60255.255.255.248子网掩码15.16.193.6255.255.248.0128.16.32.13255.255.255.252153.50.6.27255.255.255.128C201.222.10.56201.222.10.63A15.16.192.015.16.192.255B128.16.32.12128.16.32.15B153.50.6.0153.50.6.127子网(Subnetting)例子CiscoACiscoBE0S0E0S0T0CiscoAE0:172.16.2.1S0:172.16.1.1S0:172.16.1.2E0:172.31.4.1T