設(shè)計(jì)外文翻譯_第1頁
設(shè)計(jì)外文翻譯_第2頁
設(shè)計(jì)外文翻譯_第3頁
設(shè)計(jì)外文翻譯_第4頁
設(shè)計(jì)外文翻譯_第5頁
已閱讀5頁,還剩10頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

-嵌入式技術(shù)的發(fā)展需要網(wǎng)絡(luò)/服務(wù)器技術(shù)在嵌入式領(lǐng)域的應(yīng)用,并提供基TCPIP協(xié)議棧、協(xié)議模型的低效率,在嵌入式系統(tǒng)接入到因特網(wǎng)時(shí)實(shí)現(xiàn)完整的TCPIPTCPIP協(xié)議,并給出協(xié)議每一LwIPLwIP設(shè)計(jì)的,并且能分析通信時(shí)客戶端和服務(wù)器狀態(tài)的轉(zhuǎn)換。最后,EWS被用于對蓄電關(guān)鍵詞-LwIP;嵌入式技術(shù);網(wǎng)頁服務(wù)器;uC/OS-II;Web服務(wù),從而實(shí)現(xiàn)通過瀏覽器靈活地進(jìn)行遠(yuǎn)程監(jiān)控和管理,這已經(jīng)成為嵌TCPIP子網(wǎng)到嵌入式系統(tǒng)中。為了保證實(shí)1時(shí)性和可靠性,我們還需要移植μC/OS-II??紤]到時(shí)間和性能的限制,最好是使用裁剪的TCP/IP。LWIP[2](Light-WeightInternetProtocol)TCPIP協(xié)議套件,由AdamDunkels在瑞典計(jì)算機(jī)科學(xué)院(SICS)的計(jì)算機(jī)和網(wǎng)絡(luò)架構(gòu)(CNA)實(shí)驗(yàn)室開發(fā)。lwIP協(xié)議棧實(shí)現(xiàn)的重點(diǎn)是在減少內(nèi)存使用量和代碼尺寸的情況下,使LWIP適用于資源非常有限的小型客戶端。ICMP(InternetControlMessageProtocol)1WEICHEN,SHU-BOQIU,YING-CHUNZHANG.IEEEXploreDigitalDHCP(DynamicHostConfigurationPPP(Point-to-PointARP(AddressResolutionProtocol)IPLwIPIP最基本的功能。它可以發(fā)送,接收和轉(zhuǎn)發(fā)數(shù)據(jù)包,但不能IP版本字段和報(bào)頭長度的初始檢查,并對包頭校驗(yàn)和進(jìn)行IP地址,來確定數(shù)據(jù)驗(yàn)和計(jì)算。IP數(shù)據(jù)包的源地址和目的地址被作為一個(gè)參數(shù)傳遞給函數(shù)ICMPip_input()ICMPicmp_input()進(jìn)行解碼,并進(jìn)行適當(dāng)處理。ICMP目的地址不可達(dá)消息可以通過傳輸層協(xié)議發(fā)送,特別是通過UDP,函數(shù)icmp_dest_unreach()ICMP1所示。UDPrecvrecv_arg將被使用。當(dāng)數(shù)據(jù)包被接收時(shí),recv所指向的函數(shù)UDP的簡單性,輸入和輸出的處理也同樣簡單,并遵循一個(gè)相當(dāng)直的IPIPip_route()在某些情況下被調(diào)用,以便址。最后,該包被移交給ip_output_if()進(jìn)行傳輸。TCPTCPTCPtcp_output()將檢()TCP段所屬的TCP連接。TCPtcp_process()TCP狀態(tài)機(jī),ACK,該數(shù)據(jù)將從緩沖區(qū)移除并回收其內(nèi)存。此外,LwIP已經(jīng)把有關(guān)硬件,操作系統(tǒng),編譯器的部分包含在/src/arch下。我們這個(gè)操作系統(tǒng)模擬層為底層操作系統(tǒng)和LwIP提供一個(gè)接口,因此當(dāng)我們移植LwIP到新的目標(biāo)時(shí),我們只需要在這一層設(shè)計(jì)一些函數(shù)。這些函數(shù)有關(guān)段,消UC/OS-II并不對其進(jìn)行管理。我們必須根據(jù)UC/OS-II來實(shí)現(xiàn)它們。以下結(jié)構(gòu)用來管理信息。struct{OS_EVENT*void*pvQEntries[MAX_QUEUE_使用和刪除的消息。整合上述兩成員就形成了lwIP的消息隊(duì)列功能。UC/OS-IIOSTaskCreate()創(chuàng)建一個(gè)新的線程,但我們必須提前分配優(yōu)先級給在lwIP中的新線程。PS的關(guān)鍵[7]P的服務(wù)器我們稱為瘦服務(wù)器[8]eb服務(wù)器將數(shù)據(jù)上傳至網(wǎng)絡(luò)上,并在網(wǎng)頁上顯PLPDPS是非常有利的。這是種典型的網(wǎng)絡(luò)/。S4。在被添加到服務(wù)器中的“RET”狀態(tài)下,不需要接收任何消息就可以直接跳轉(zhuǎn)到“IN”狀態(tài)。這個(gè)服務(wù)器的端口始終是敞開的。當(dāng)連接建立后,一旦服務(wù)80”pingEWS,我們可以得到四個(gè)響應(yīng)數(shù)據(jù)包,并且司的蓄電池生產(chǎn)控制系統(tǒng)上進(jìn)行測試過。當(dāng)我們輸入蓄電池生產(chǎn)控制系統(tǒng)的IPEWS的優(yōu)點(diǎn)是成本低,可視化,獨(dú)立的平臺(tái),靈活的部署,優(yōu)良的遠(yuǎn)程Web服務(wù)器,可以在網(wǎng)頁上對設(shè)備進(jìn)行監(jiān)測和靈活地Web服務(wù)器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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論