LWIP中文手册

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

LwipSwedishInstituteofComputerScienceFebruary20,2001AdamDunkelsadam@sics.se(QQ:10205001)(QQ:329147)(QQ:3232253)(QQ:3232253)QQARMTCPIPLCD10988210LWIPTCP/IPLWIPLWIPlwIPAPIlwIPLWIPAPILWIP1Introduction…………………………………………………………………………………………..12Protocollayering……………………………………………………………………………………..13Overview……………………………………………………………………………………………...24Processmodel………………………………………………………………………………………...25Theoperatingsystememulationlayer……………………………………………………………...36Bufferandmemorymanagement……………………………..……………………………..……...36.1Packetbufferspbufs………………………………………………………………………………36.2Memorymanagement………………………………………………………………………………..57Networkinterfaces…………………………………………….……………………………………..58IPprocessing………………………………………………….………………………………………78.1Receivingpackets…………………………………………………………………………………….78.2Sendingpackets………………………………………………………………………………………78.3Forwardingpackets…………………………………………………………………………………..88.4ICMPprocessing…………………………………………………………………………………….89UDPprocessing………………………………………………………………………………..……...810TCPprocessing……………………………………………………………………………………...910.1Overview……………………………………………………………………………………………910.2Datastructures……………………………………………………………………………………..1010.3Sequencenumbercalculations…………………………………………………………………….1210.4Queuingandtransmittingdata…………………………………………………………………….1210.4.1Sillywindowavoidance…………………………………………………………………………1310.5Receivingsegments………………………………………………………………………………..1310.5.1Demultiplexing…………………………………………………………………………………..1310.5.2Receivingdata…………………………………………………………………………………...1410.6Acceptingnewconnections……………………………………………………………………….1410.7Fastretransmit……………………………………………………………………………………..1410.8Timers……………………………………………………………………………………………..1410.9Round-triptimeestimation………………………………………………………………………..1510.10Congestioncontrol………………………………………………………………………………..1511Interfacingthestack………………………………………………………………………………1512ApplicationProgramInterface…………………………………………………………….……..1612.1Basicconcepts……………………………………………………………………………………..1612.2ImplementationoftheAPI………………………………………………………………………..1713Statisticalcodeanalysis……………………………………………………………………………1713.1Linesofcode………………………………………………………………………………………1813.2Objectcodesize…………………………………………………………………………………...1914Performanceanalysis……………………………………………………………………………...2015APIreference……………………………………………………………………………….……...2115.1Datatypes………………………………………………………………………………………….2115.1.1Netbufs…………………………………………………………………………………………..2115.2Bu®erfunctions…………………………………………………………………………………..2115.2.1netbufnew()……………………………………………………………………………………..2115.2.2netbufdelete()…………………………………………………………………………………...2115.2.3netbufalloc()…………………………………………………………………………………….2215.2.4netbuffree()……………………………………………………………………………………..2215.2.5netbufref()………………………………………………………………………………………2215.2.6netbuflen()……………………………………………………………………………………...2315.2.7netbufdata()…………………………………………………………………………………….2315.2.8netbufnext()…………………………………………………………………………………….2315.2.9netbuf¯rst()……………………………………………………………………………………..2415.2.10netbufcopy()…………………………………………………………………………………...2415.2.11netbufchain()…………………………………………………………………………………..2415.2.12netbuffromaddr()………………………………………………………………………………2415.2.13netbuffromport()………………………………………………………………………………2516Networkconnectionfunctions…………………………………………………………………….2516.0.14netconnnew()…………………………………………………………………………………..2516.0.15netconndelete()………………………………………………………………………………...2516.0.16netconntype()…………………………………………………………………………………..2516.0.17netconnpeer()………………………………………………………………………………….2516.0.18netconnaddr()…………………………………………………………………………………2616.0.19netconnbind()…………………………………………………………………………………2616.0.20netconnconnect(……………………………………………………………………………….2616.0.21netconnlisten()…………………………………………………………………………………2616.0.22netconnaccept()………………………………………………………………………………..2616.0.23netconnrecv()………………………………………………………………………………….2716.0.24netconnwrite()…………………………………………………………………………………2816.0.25netconnsend()………………………………………………………………………………….2916.0.26netconnclose()…………………………………………………………………………………3017BSDsocketlibrary………………………………………………………………………………...3017.1Therepresentationofasocket…………………………………………………………………….3017.2Allocatingasocket………………………………………………………………………………..3017.2.1Thesocket()call…………………………………………………………………………………3017.3Connectionsetup…………………………………………………………………………………..3117.3.1Thebind()call…………………………………………………………………………………...3117.3.2Theconnect()call……………………………………………………………………………….3117.3.3Thelisten()call………………………………………………………………………………….3217.3.4Theaccept()call………………………………………………………………………………..3217.4Sendingandreceivingdata………………………………………………………………………..3317.4.1Thesend()call………………………………………………………………………………….3317.4.2Thesendto()andsendmsg()calls………………………………………………………………3417.4.3Thewrite()call………………………………………………………………………………….3417.4.4Therecv()andread()calls………………………………………………………………………3517.4.5Therecvfrom()andrecvmsg()calls…………………………………………………………….3618Codeexamples…………………………………………………………………………………….3618.1UsingtheAPI…………………………………………………………………………………….3618.2Directlyinterfacingthestack……………………………………………………………………..39Bibliography…………………………………………………………………………………………..4112Protocollayering3Overview4Processmodel5lwIPlwIP“”6PbuflwIPPbufsBSDmbufspbufPbufspbufpbufsPbufsPBUFRAM

1 / 37
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功