版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
-嵌入式技术的发展需要网络/服务器技术在嵌入式领域的应用,并提供基TCPIP协议栈、协议模型的低效率,在嵌入式系统接入到因特网时实现完整的TCPIPTCPIP协议,并给出协议每一LwIPLwIP设计的,并且能分析通信时客户端和服务器状态的转换。最后,EWS被用于对蓄电关键词-LwIP;嵌入式技术;网页服务器;uC/OS-II;Web服务,从而实现通过浏览器灵活地进行远程监控和管理,这已经成为嵌TCPIP子网到嵌入式系统中。为了保证实1时性和可靠性,我们还需要移植μC/OS-II。考虑到时间和性能的限制,最好是使用裁剪的TCP/IP。LWIP[2](Light-WeightInternetProtocol)TCPIP协议套件,由AdamDunkels在瑞典计算机科学院(SICS)的计算机和网络架构(CNA)实验室开发。lwIP协议栈实现的重点是在减少内存使用量和代码尺寸的情况下,使LWIP适用于资源非常有限的小型客户端。ICMP(InternetControlMessageProtocol)1WEICHEN,SHU-BOQIU,YING-CHUNZHANG.IEEEXploreDigitalDHCP(DynamicHostConfigurationPPP(Point-to-PointARP(AddressResolutionProtocol)IPLwIPIP最基本的功能。它可以发送,接收和转发数据包,但不能IP版本字段和报头长度的初始检查,并对包头校验和进行IP地址,来确定数据验和计算。IP数据包的源地址和目的地址被作为一个参数传递给函数ICMPip_input()ICMPicmp_input()进行解码,并进行适当处理。ICMP目的地址不可达消息可以通过传输层协议发送,特别是通过UDP,函数icmp_dest_unreach()ICMP1所示。UDPrecvrecv_arg将被使用。当数据包被接收时,recv所指向的函数UDP的简单性,输入和输出的处理也同样简单,并遵循一个相当直的IPIPip_route()在某些情况下被调用,以便址。最后,该包被移交给ip_output_if()进行传输。TCPTCPTCPtcp_output()将检()TCP段所属的TCP连接。TCPtcp_process()TCP状态机,ACK,该数据将从缓冲区移除并回收其内存。此外,LwIP已经把有关硬件,操作系统,编译器的部分包含在/src/arch下。我们这个操作系统模拟层为底层操作系统和LwIP提供一个接口,因此当我们移植LwIP到新的目标时,我们只需要在这一层设计一些函数。这些函数有关段,消UC/OS-II并不对其进行管理。我们必须根据UC/OS-II来实现它们。以下结构用来管理信息。struct{OS_EVENT*void*pvQEntries[MAX_QUEUE_使用和删除的消息。整合上述两成员就形成了lwIP的消息队列功能。UC/OS-IIOSTaskCreate()创建一个新的线程,但我们必须提前分配优先级给在lwIP中的新线程。PS的关键[7]P的服务器我们称为瘦服务器[8]eb服务器将数据上传至网络上,并在网页上显PLPDPS是非常有利的。这是种典型的网络/。S4。在被添加到服务器中的“RET”状态下,不需要接收任何消息就可以直接跳转到“IN”状态。这个服务器的端口始终是敞开的。当连接建立后,一旦服务80”pingEWS,我们可以得到四个响应数据包,并且司的蓄电池生产控制系统上进行测试过。当我们输入蓄电池生产控制系统的IPEWS的优点是成本低,可视化,独立的平台,灵活的部署,优良的远程Web服务器,可以在网页上对设备进行监测和灵活地Web服务器BilekJ,RuzickaIP.Evolutionarytrendsofembeddedsystems.IEEEInternationalConferenceonIndustrialTechnology,vol2,no3,2003,pp.901-905.AdamD.DesignandImplementationoftheLwIPTCP/IPStack[Z].SwedishInstituteofComputerScience,2001.TianZe.TheDevelopmentandImplementationofEmbeddedSystem[M].Beijing:BeiHangUniversityPress,2005.JeanJ.Labrosse.TheEmbeddedReal-timeμC/OS-II[M].Beijing:BeiHangUniversityPress,2003.J.Benthem.TCP/IPLean:EmbeddedWEBServer[M].Beijing:ChinaMachinePress,2003.YangYe.TheImplementationofTCP/IPunderμC/OS-II[J].Microcontrollers&EmbeddedSystems,vol7,no3,2003,pp.80-83JuHT,ChoiMJ,HongJW."Ews-basedmanagementapplicationinterfaceandintegrationmechanismsforweb-basedelementmanagement,"JournalofNetworkandSystemsManagement,vol.9,no.1,pp.31-50.,Jan,2001.XuFeng,ChenYan,ZhaoHai,HanGuang-jie.StudyonArchitectureofInternetAccessServerforNon-PCDevices[J].JournalofNortheasternUniversity(NaturalScience),vol26,no1,2005,pp.236-239.GaoPo-po,ShaoShi.ResearchandImplementationofEmbeddedWebServeronLow-endDevice[J].ComputerEngineering,vol31,no5,2005,pp.219-221.ThePortingandImplementationofLight-WeightTCP/IPforEmbeddedWebServerWEICHEN, SHU-BOQIU, YING-CHUNZHANG,DepartmentofAutomationofShandongInstituteofLightIndustryˈJinan,Abstract--Thedevelopmenttrendofembeddedtechnologyneedtheweb/servertechnologyappliesintoembeddedfieldsandprovidesaflexibleremotedevicemonitoringandmanagementfunctionbasedonInternetbrowser.But,duetothelimitationofhardwareresourceandthelow-efficiencyofgeneralpurposeTCP/IPprotocolstacksandprotocolmodels,itisquitedifficulttoimplementfullTCP/IPprotocolintoembeddedsystemwhenaccessingtoInternet.ThepaperanalysestheLight-WeightTCP/IPandgivesthedetailedprocessingofeverylayerfirst,thenesignedthehardwareplatformwiththePHILIPSLPC2200andRTL8019AScoreandthesoftwareplatformwithUC/OS-II,portingtheLwIPbasedonthem.AthinserverisdesignedbasedonLwIP,andthestatetransformofclientandserverwhentheywerecommunicatingwasanalyzed.Atlast,theEWSwastestedontheProductionofStorageBatteryControlSystem,theresultindicatedtheEWScanlong-distancemonitorthedevicesreal-timelyandperfectly.Keywords--LwIP;embeddedtechnology;web/server;UC/OS-II; ThetraditionalInternetweb/serveristhefatserver/thinclient,thismodeisperfectwhentranslateandstoreabundanceofdata,butdoesn'tbehaveexcellentinembeddedfield.AndtheInternethasbecomeoneofthemostimportantbasicinformationfacilitiesintheworld,theWWWserviceitoffershasbecomeoneofthefastestgrowingandwidestappliedservice,whichhaveagreatdealofadvantagessuchasvisualization,easyremoteaccessing,multidataformatsupporting,platformindependentandthinclient,etc.ConnectingtheembeddeddevicetotheInternet,implementingperfectWebserviceonit,andthusrealizingaflexibleremotemonitoringandmanagementthroughInternetbrowserhasalreadybecomeaninevitabledevelopmenttrendofembeddedTechnology[1].But,duetothelimitationofhardwareresourceandthelow-efficiencyofpurposeTCP/IPprotocolstacksandprotocolmodels,itisquitedifficulttoimplementfullTCP/IPprotocolintoembeddedsystemwhenaccessingtoInternet.Therefore,weneedtoportasubnetofTCP/IPintotheembeddedsystem.Inordertoensurethereal-timecharacterandthereliability,wealsoneedtoporttheµC/OS-II.Consideringthelimitationoftimeandperformance,itisbettertousetheexitedreducedTCP/IP.lwIP[2](Light-WeightInternetProtocol)isasmallindependentimplementationoftheTCP/IPprotocolsuitethathasbeendevelopedbyAdamDunkelsattheComputerandNetworksArchitectures(CNA)labattheSwedishInstituteofComputerScience(SICS).ThefocusofthelwIPstackistoreducememoryusageandcodesize,makinglwIPsuitableforuseinsmallclientswithverylimitedresources.lwIPfeatures:IP(InternetProtocol)includingpacketforwardingovermultiplenetworkICMP(InternetControlMessageProtocol)fornetworkmaintenanceandUDP(UserDatagramProtocol)includingexperimentalUDP-liteTCP(TransmissionControlProtocol)withcongestioncontrol,RTTestimationandfastrecovery/fastretransmitSpecializedrawAPIforenhancedOptionalBerkeley-alikesocketDHCP(DynamicHostConfigurationPPP(Point-to-PointARP(AddressResolutionProtocol)for IPlwIPimplementsonlythemostbasicfunctionalityofIP.Itcansend,receiveandforwardpackets,butcannotsendorreceivefragmentedIPpacketsnorhandlepacketswithIPoptions.Formostapplicationsthisdoesnotposeanyproblems.ReceivingForincomingIPpackets,processingbeginswhentheip_input()functioniscaiiedbyanetworkdevicedriver.Here,theinitialsanitycheckingoftheIPversionfieldandtheheaderlengthisdone,aswellascomputingandcheckingtheheaderchecksum.Next,thefunctionchecksthedestinationaddresswiththeIPaddressesofthenetworkinterfacestodetermineifthepacketwasdestinedforthehost.SendingAnoutgoingpacketishandledbythefunctionip_output(),whichusesthefunctionip_route()tofindtheappropriatenetworkinterfacetotransmitthepacketon.Whentheoutgoingnetworkinterfaceisdetermined,thepacketispassedtoip_output_if()whichtakestheoutgoingnetworkinterfaceasanargument.Here,allIPheaderfieldsarefilledinandtheIPheaderchecksumiscomputed.ThesourceanddestinationaddressesoftheIPpacketispassedasanargumenttoip_output_if().ICMPICMPpacketsreceivedbyip_input()arehandedovertoicmp_input(),whichdecodestheICMPheaderandtakestheappropriateaction.ICMPdestinationunreachablemessagescanbesentbytransportlayerprotocols,inparticularbyUDP,andthefunctionicmp_dest_unreach()isusedforthis.TheICMPprocessingisshowninFig.1.UDPUDPisasimpleprotocolusedfordemultiplexingpacketsbetweendifferentprocesses.ThestateforeachUDPsessioniskeptinaPCBstructure.Thelasttwoargumentsrecvandrecv_argareusedwhenadatagramisreceivedinthesessionspecifiedbythePCB.ThefunctionpointedtobyrecviscalledwhenadatagramisDuetothesimplicityofUDP,theinputandoutputprocessingisequallysimpleandfollowsafairlystraightline(Fig.2).Tosenddata,theapplicationprogramcallsudp_send()whichcallsuponudp_output().Herethenecessarycheck-summingisdoneandUDPheaderfieldsarefilled.SincethechecksumincludestheIPsourceaddressoftheIPpacket,thefunctionip_route()isinsomecasescalledtofindthenetworkinterfacetowhichthepacketistobetransmitted.TheIPaddressofthisnetworkinterfaceisusedasthesourceIPaddressofthepacket.Finally,thepacketisturnedovertoip_output_if()fortransmission.TCPTCPisatransportlayerprotocolthatprovidesareliablebytestreamservicetotheapplicationlayer.ThebasicTCPprocessing(Fig.3)isdividedintosixfunctions;whenanapplicationwantstosendTCPdata,tcp_write()iscalled.Thefunctiontcp_write()passescontroltotcp_enqueue()whichwillbreakthedataintoappropriatesizedTCPsegmentsifnecessaryandputthesegmentsonthetransmissionqueuefortheconnection.Thefunctiontcp_output()willthencheckifitispossibletosendthedata,Inputprocessingbeginswhenip_input()afterverifyingtheIPheaderhandsoveraTCPsegmenttotcpinput().InthisfunctiontheinitialsanitychecksaredoneaswellasdecidingtowhichTCPconnectionthesegmentbelongs.Thesegmentisthenprocessedbytcp_process(),whichimplementstheTCPstatemachine,andanynecessarystatetransitionsaremade.Thefunctiontcp_receive()willbecallediftheconnectionisinastatetoacceptdatafromthenetwork.Ifso,tcp_receive()willpassthesegmentuptoanapplicationprogram.IfthesegmentconstitutesanACKforunacknowledgeddata,thedataisremovedfromthebuffersanditsmemoryisreclaimed.Also,ifanACKfordatawasreceivedthereceivermightbewillingtoacceptmoredataandthereforetcp_output()iscalled. PORTINGOFLWIPBASEDONTheportingofFormula[4]isveryeasynow,soItalkabouttheportingoflwIPonitdirectly.lwIPhadputtheportionabouthardware,OS,compilerunder/src/arch.Ourmaintaskistoperfectthefilesunderthatdirectoryandseldommodifytheotherfilesintheporting.Inthisporting,therealizationoftheoperatingsystememulationlayerisveryimportant.InordertomakelwIPportable,operatingsystemspecificfunctioncallsanddatastructuresarenotuseddirectlyinthecode.Instead,whensuchfunctionsareneededtheoperatingsystememulationlayerisused.Theoperatingsystememulationlayerprovidesauniforminterfacetooperatingsystemservicessuchastimers,processsynchronization,andmessagepassingmechanisms.Inprinciple,whenportinglwIPtootheroperatingsystemsonlyanimplementationoftheoperatingsystememulationlayerforthatparticularoperatingsystemisneeded.TheoperatingsystememulationlayerprovideaninterfacebetweenthebottomoperationsystemandthelwIP,thusweonlyneedtodesignsomefunctionsinthislayerwhenweportlwIPtoanewtargetoperation.Somefunctionaboutsegment,message,timeout,newthreadandsoon.Besides,wehavetoputattentionontwoquestionsaboutFormuladuringtheimplementationoflwIP[6].Wecan'tusethemessageswhichinthemessagequeuedirectly,becauseFormuladoesn'tmanagethem.WemustimplementthembasedontheFormula.Thestructuredefinedtomanagethemessages.typedefOS_EVENT*void*pvQEntries[MAX_QUEUE_TothequeueitselfmanagedbyFormulaandusethemoduleofEMSmemorymanagetorealizetheset,useanddeleteofmessage.TheintegrationoftheabovetwocanformthemessagequeuefunctionoflwIPCreateNewThereisnothreadbuttaskinFormulaWecancreatethenewthreadthroughcallingOSTaskCreate(),butwemustassignedthePRIforthenewthreadinlwIPinIVREALIZATIONOFTheportingoflwIPisthekeytorealizetheEWS[7].TheserverbasedonlwIPwenamedthinserver[8],itsatisfiestheembeddeddevices'request.Thedeviceinformationcanbeuploadedonthewebpageandappearasdata,tableandcartoonetc.EmbeddedwebserverissuethedatatotheInternetasthewebpagesothattheremoteusercanbrowsetheinformation.Fromthewebpagewecanknowthedetailedstatusofdevicesandmaketherelevantcontrolimmediately.Inapplicationlayer,HTTPistheprimaryprotocol,wecanmonitorthedevicesonthespotordownloadthenewestdriver.Inaddition,theDHCPinlwIPisverybeneficialforourEWS.It'smodeofserviceisthetypicalweb/server,themasterServercanreceivetherequestdatapackagefromclients,readtherequestmessage,parseitandsendtheresponsetotheclients[9].ThestatetransformofEWSasshowninFig.4.Thestate“RESET”beingaddedintotheserver,thereneedn'treceiveanymessagetojumptothestateof“LISTEN”directlyinthisstate.Theportoftheserverisalwaysopen.Oncetheserverfindsthe“ACK”packageiswrongortheserverportisnot80whentheconnectionhasbeenestablished,thestatewilljumpto“RESET”andsendaof“RST”toreestablishconnection.Inordertoavoidcongestion,oncetheconnectionisovertime,itwillbeclosed. UsingPINGcommandtolinkEWSinlocalareanetwork,wecangetfourresponsedatapackagesandthetimeitusedislessthan20msandthereisnodatapackagelost.ThisEWSwastestedontheProductionofStorageBatteryControlSystemwhichbelongstoTuo-ChiElectricApplianceCompanyinZi-Bo.WhenweinputtheIPaddressofProductionofStorageBatteryControlSystem,wecanopenthewebpagethroughthebrowserquicklyandcorrectly.ThuswecanbelievetheEWScanlong-distancemonitorthedevicesreal-timelyandperfectly.functionistoassignIPaddress.UsingtheHTTPtheWeb TheadvantagesofthisEWSarelowcost,visualization,platformindependent,flexibledeployment,excellentremoteaccessing,etc.Theequipmentscanbemonitoredandcontrolledflexiblyinwebpagesthroughembeddedwebserver.Inindustrycontrolfield,theusingofembeddedwebserveronintelligencedevice,instrumentandsensortorealizeflexibleremotecontrolhasveryhightheoreticalandapplicationvalue.BilekJ,RuzickaIP.Evolutionarytrendsofembeddedsystems.IEEEInternationalConferenceonIndustrialTechnology,vol2,no3,2003,pp.901-905.AdamD.DesignandImplementationoftheLwIPTCP/IPStack[Z].SwedishInstituteofComputerScience,2001.TianZe.TheDevelopmentandImplementationofEmbeddedSystem[M].Beijing:BeiHangUniversityPress,2005.JeanJ.Labrosse.TheEmbeddedReal-timeμC/OS-II[M].Beijing:BeiHangUniversityPress,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【课件】部编语文三上13 胡萝卜先生的长胡子【国家级】一
- 锂电池开路电压的温度导数-概述说明以及解释
- 《斑羚飞渡》课件
- 信息化规划图
- 一年级数学两位数加减一位数题竞赛练习训练题大全附答案
- 性格的含义微电影分库周欣然
- 新单位参保用户注册
- 意外伤害事故的防范与处理任务八意外事故界定类型
- 《同济大学数学系》课件
- 便利店员工培训方案
- 《中国的饭局文化》课件
- 2024-2030年中国特色茶具行业市场销售策略及未来发展趋势分析报告
- 2024-2030年中国聚醚醚酮树脂行业前景动态及发展方向预测报告
- 大数跨境-2024短剧出海市场洞察报告-2024.09
- 2024-2025学年译林版七年级英语上学期期中复习试卷(南京卷)含解析
- 2024新版行政复议法知识培训课件
- 人教版九年级化学电子版教材(全册)-课件资料
- 生物人教版(2024)版七年级上册1.2.1学习使用显微镜教学课件03
- 第三单元分数除法(单元测试)-2024-2025学年六年级上册数学人教版
- 江西省南昌市(2024年-2025年小学四年级语文)人教版期中考试(上学期)试卷及答案
- 2024年8-9月高三名校模考语用题精(四)含答案
评论
0/150
提交评论