中国外贸网


打 印
关 闭
评 论
您的位置: 首页 -> 外贸英语 -> 行业英语 -> 计算机 -> 正文
TCP/IP是如何工作的
2007-7-16 12:23:39 来源:来源不详 阅读:

  HowTCP/IPWorks

  Overthepastfewyears,oneofthemostwritten-aboutnetworktopicshasbeenIP.Butevenwithallthisattention,few,ifany,storieshavetracedtheprotocol/'sbasicworkings,thatis,howroutersandLayer3switchesactuponIPinformationtomoveEthernetpacketsacrossthenetwork.

  Asapointofreferenced,bearinmindthatIPisamemberoftheTCP/IPprotocolsuite.

  TCPfunctionsattheOpenSystemsInterconnection(OSI)transportlayer,orLayer4.Itschiefresponsibilityistoensurereliableend-to-endconnectivity.IP,locatedonelayerdown,attheOSInetworklayer,orLayer3,communicatestheaddressesofeachpacket/'ssenderandreceivertotheroutersalongtheway.RoutersandLayer3switchescanreadIPandotherLayer3protocols.Thisinformation,combinedwithroutingtablesandothernetworkintelligence,isallittakestogetacrosstheroomoraroundtheworldviaTCP/IP.

  TheroutingprocessbeginswithanIPaddressthatisuniquetothesendingendstation.EndstationsmaybeassignedpermanentIPaddressesortheymayborrowthemasneededfromaDynamicHostConfigurationProtocol(DHCP)serverorotherservice.

  Eachpacketcarriesasourceaddress,whichundercurrent(IPv4)specificationsis32bitslong.Initsheader,eachpacketalsocarriestheIPaddressofthefinaldestination.

  Ifthesendingendstationdeterminesthatthedestinationaddressisnotlocal,thepacketgoestoafirst-hoprouter,typicallyonethatiscloseandhasbeenpreassignedtothesender.

  Therouterinspectsthepacket/'sIPaddressandperformsaroutetablelookuptoseeifthedestinationendstationresidesonthelocal(physicallyconnected)network,typicallycalledanIPsubnet.AnIPsubnetusuallyisassignedtoeachoftherouter/'snetworkinterfaces.

  IfthedestinationIPaddressislocal,theroutersearchesaninternalstoreofIPaddressesandlocal-deviceMediaAccessControl(MAC)addresses.ThisstoreisknownastheAddressResolutionProtocol(ARP)cache.ARPistheuniversaltoolformatchingIPaddressestoMACaddresses.Ifthedestination/'sMACaddressappears,therouterinstallsthatMACaddressinthepacketheader(removingitsownMACaddressbecausethat/'snolongerneeded)andsendsthepackettothedestinationendstation.

  IntheeventthatthedestinationMACaddressdoesnotappearintheARPcache―itmighthavetimedout,forinstance―theroutermustbroadcastanARPrequesttothesubnetreferencedbythepacket/'sdestinationIPaddress.TheendstationwiththatIPaddressresponds,sendingbackitsMACaddress.Therouterupdatesitscache,installsthenewMACaddressintothepacketheaderandlaunchesthepacket.Iftheroutetablelookupshowsthatthepacketisdestinedforanon-localsubnet,therouterforwardsthepackettothenext-hoprouterusingthenext-hoprouter/'sMACaddress.Routingtablesarecontinuouslybuiltandrebuiltbyintelligentdiscoveryprotocols,suchasRoutingInformationProtocolorOpenShortestPathFirst(OSPF).Eachrouter/'sroutingtableshowsthebestroutetothedestinationaddress;foraddressesthatmaybeseveralhopsaway,itshowsthebestnext-hoprouter.

  在过去几年中,写得最多的网络题目之一就是IP。但是,即使引起了这么多的注意,仍很少有(如果有的话)文章介绍此协议的基本工作原理,即路由器和第三层交换器是如何对IP信息起作用,以便在整个网络中传递以太网包的。

  作为参考,请记住,IP是TCP/IP整套协议中的一个协议。

  TCP完成开放系统互连(OSI)模型中传输层,即第四层的功能。它的主要责任是确保端至端之间的可靠连接。IP位于下一层,在OSI的网络层,即第三层,把每个包的发送者和接收者地址告诉一路上各个路由器。路由器和第三层交换器可以读出IP和其他的第三层协议。这些信息与路由表以及其他网络智能结合在一起,能通过TCP/IP在整个房间或围绕地球进行传递。

  路由过程始于对发送端站而言是唯一的一个IP地址,端站可以被分配永久的IP地址,或者按需要从动态主机配置协议(DHCP)服务器或其他服务中借用。

  每个包携带一个源地址,在目前(IPv4)规范下,包长度是32位。在报头中,每个包也携带最终目的地的IP地址。

  如果发送端站确定目的地址不在本地,该包就被送到第一跳路由器,一般来说,该路由器是在附近的,并已被预先分配给发送者。

  该路由器检查包的IP地址,查找路由表,看看目的端点是否位于本地(物理位置)网络,它通常叫做IP子网,IP子网一般被分配到路由器的每个网络接口上。

  如果目的IP地址为本地的,该路由器就搜寻存储着IP地址和本地设备介质访问控制(MAC)地址的内部存储器,这个存储器叫作地址分辨协议(ARP)高速缓存。ARP是把IP地址映射到MAC地址的通用工具。如果目的地的MAC地址出现了,该路由器就把这个MAC地址装进包的报头中(取掉自己的MAC地址,因为不再需要它了),把该包送到目的端站。

  万一目的地的MAC地址没有出现在ARP高速缓存中(例如,有可能超时了),路由器必须向与包的目的IP地址有关的子网广播一个ARP请求,拥有此IP地址的端站就作出响应,把MAC地址发送回去,路由器因此更新高速缓存,把新的MAC地址装进包的报头并发送该包。

  如果查找路由表显示包的目的地不在本地子网,路由器就利用下一跳路由器的MAC地址把包转发给下一跳路由器。路由表由智能发现协议,如路由信息协议或者开放最短路径优先协议,不断地被建立和再建立。每个路由器的路由表显示了到达目的地址的最佳路径,对于要有几跳的地址,它显示出最佳的下一跳路由器。



编辑:admin
上一篇:何谓WAP
下一篇:电子墨水与纸

相关资源 我来说两句: 昵称: 邮箱:   评论
  • 第15课:TalkingaboutHobbies谈爱好
  • 什么叫“蓝牙”
  • 数字钱包
  • “游戏”译名一览
  • 电子墨水与纸
  • 何谓WAP
  • 搜索引擎
  • 数据通信系统
  • 先进加密标准
  • 与光驱相关的英语词汇
  •  

    请您注意:
    • 尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法规。
    • 尊重网上道德,遵守中华人民共和国的各项有关法律法规。
    • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任。
    • 参与本评论即表明您已经阅读并接受上述条款。

    关于本站 | 版权声明 | 联系我们 | 友情连接 | 回到顶端

    Copyright (C) 1997-2007 zuowaimao.com All Rights Reserved
    Powered By zuowaimao.com
    中国外贸网