目录摘要.....................................................IABSTRACT.....................................................................................II引言....................................................................................................1第一章TCP协议下通信概述......................................................21.1网络体系结构.........................................................................21.1.1概述...................................................................................21.1.2OSI网络体系模型...........................................................21.1.3TCP/IP网络体系模型.....................................................31.2ARM处理器简介...................................................................51.2.1ARM微处理器的特点.....................................................51.3嵌入式实时操作系统简介.....................................................51.3.1什么是嵌入式操作系统..................................................51.3.2uC/OS-II简介..................................................................51.3.3uC/OS-II在ARM2200上的移植..................................6第2章TCP/IP协议通信原理.....................................................82.1协议栈数据在各层之间的传输过程如下图所示:............82.2TCP/IP协议栈各层简介........................................................82.2.1概述...................................................................................82.2.2ARP协议........................................................................102.2.3IP协议............................................................................112.2.4ICMP协议......................................................................132.2.5TCP协议........................................................................132.2.6UDP协议.......................................................................16第三章TCP协议分析与实现....................................................173.1TCP协议简介......................................................................173.2TCP协议进行通信过程中的基本知识介绍......................173.2.1建立连接........................................................................173.2.2滑动窗(流量控制)....................................................183.2.3计时器(重传机制)....................................................193.2.4TCP协议的实现............................................................203.2.5输入处理........................................................................203.2.6超时重传处理................................................................223.2.7输出处理........................................................................223.2.8关闭连接........................................................................223.3TCP的处理及主要函数......................................................22第四章程序设计与调试.............................................................244.1程序设计...............................................................................244.1.1概述.................................................................................244.1.2详细程序流程图如下图................................................254.1.3主要程序说明................................................................265.结论.........................................................................................31致谢..................................................................................................32参考文献..........................................................................................33I摘要嵌入式系统的Internet网络化的研究与应用是近几年来嵌入式应用领域的一个研究热点。全球信息资源的全面共享是今后发展的潮流,与人们生活、生产关系最为密切并拥有着无尽的信息资源的嵌入式系统,如果不接入Internet的话,信息的全面共享就无从谈起。嵌入式系统网络化的前提是在嵌入式系统中实现TCP/IP协议栈。本文首先对ARM、通用TCP/IP和uC/OS-II进行了一定的探讨与研究,然后将uC/OS-II移植到ARM2200目标板上,再在此平台上进行编写TCP/IP协议栈。开发环境是用ARM公司的集编辑、编译、仿真与调试于一体的ADS1.2软件。整个协议栈的设计是围绕着TCP/IP协议的参考模型这个中心进行的。首先,为了使议具有可移植性,所有与硬件、OS、编译器相关的部分独立出来,在不同的操作系统(这里用的操作系统是uC/OS-II)上的实现只要修改这一部分,其它的文件一般不需要修改。最后,协议的主体采用纵向主线来进行设计,其实现的协议有ARP,IP,ICMP,UDP和TCP等协议。关键词:ARM处理器TCP/IP协议栈TCP通信实时操作系统IIAbstractInrecentyears,researchonconnectingembeddedsystemwithInternethasbecomeoneofthefocusesinapplicationsofembeddedsystem.Theoverallsharingoftheglobalinformationresourcesisthedevelopmenttrendinthefutureandthisresearchhasmetthetrend.TheimplementationofTCP/IPstackinembeddedsystemisthebasisoftheresearch.InthisarticlewriterprobesintotheARMS、TCP/IPprotocolanduC/OSIIoperationsystematfirst,latertransferuC/OS-IIintoARM2200,thencompileTCP/IPstack.ADSwhichintegratedwitheditorcompiler,emulatoranddebuggerasthedevelopmentenvironmentareadopted.ThedesignofthetinyTCP/IPstacktakestheTCP/IPreferencemodelasthefocus.First,inordertoenabletheprotocolhavetheattributetransplanted,thepartsrelatedtothehardware,OS,thecompilerindependentlycomesout.Thispartneededtoberevisedwhenrealizedinthedifferentoperatingsystem(hereuC/OS-II),thebodyoftheprotocolstackisdesignedwhichincludestheARPmodule,ICMPmodule,UDPmoduleandTCPmodule.KeyWords:ARMprocessor,TCP/IPstack,TCPcommunications,real-timeoperatingsyste引言TCP/IP协议可以说是目前世界上最成功的网络体系结构和协议规范。TCP/IP(TransmissionControlProtocol/InternetProtocol)是传输控制协议/互连网络协议的缩写。它包括一系列的协议,其中TCP和IP是最有名的两个协议,因此一般简称这个协议集为TCP/IP。TCP/IP的形成有一个过程,它最早在1969年由美国国防部高级研究计划局(DARPA)开发,用于ARPANE