c/c++ beginner
===========================================================
几种开源的TCP/IP协议栈分析 zz
===========================================================

1、BSD TCP/IP协议栈,BSD栈历史上是其他商业栈的起点,大多数专业TCP/IP栈(VxWorks内嵌的TCP/IP栈)是BSD栈派生的。这是因为BSD栈在BSD许可协议下提供了这些专业栈的雏形,BSD许用证允许BSD栈以修改或未修改的形式结合这些专业栈的代码而无须向创建者付版税。同时,BSD也是许多TCP/IP协议中的创新(如广域网中饿拥塞控制和避免)的开始点。
ftp://ftp.FreeBSD.org/pub/FreeBSD-stable/src/sys.netinet

2、uC/IP是由Guy Lancaster编写的一套基于uC/OS且开放源码的TCP/IP协议栈,亦可移植到其它操作系统,是一套完全免费的、可供研究的TCP/IP协议栈,uC/IP大部分源码是从公开源码BSD发布站点和KA9Q(一个基于DOS单任务环境运行的TCP/IP协议栈)移植过来。uC/IP具有如下一些特点:带身份验证和报头压缩支持的PPP协议,优化的单一请求/回复交互过程,支持IP/TCP/UDP协议,可实现的网络功能较为强大,并可裁减。UCIP协议栈被设计为一个带最小化用户接口及可应用串行链路网络模块。根据采用CPU、编译器和系统所需实现协议的多少,协议栈需要的代码容量空间在30-60KB之间。
http://ucip.sourceforge.net

3、LwIP是瑞士计算机科学院(Swedish Institute of Computer Science)的Adam Dunkels等开发的一套用于嵌入式系统的开放源代码TCP/IP协议栈。LwIP的含义是Light Weight(轻型)IP协议,相对于uip。LwIP可以移植到操作系统上,也可以在无操作系统的情况下独立运行。LwIP TCP/IP实现的重点是在保持TCP协议主要功能的基础上减少对RAM的占用,一般它只需要几十K的RAM和40K左右的ROM就可以运行,这使LwIP协议栈适合在低端嵌入式系统中使用。LwIP的特性如下:支持多网络接口下的IP转发,支持ICMP协议 ,包括实验性扩展的的UDP(用户数据报协议),包括阻塞控制,RTT估算和快速恢复和快速转发的TCP(传输控制协议),提供专门的内部回调接口(Raw API)用于提高应用程序性能,并提供了可选择的Berkeley接口API。
http://sics.se/~sdam/lwip/

4、uIP是专门为8位和16位控制器设计的一个非常小的TCP/IP栈。完全用C编写,因此可移植到各种不同的结构和操作系统上,一个编译过的栈可以在几KB ROM或几百字节RAM中运行。uIP中还包括一个HTTP服务器作为服务内容。许可:BSD许用证 http://dunkels.com/adam/uip/

5、TinyTcp 栈是TCP/IP的一个非常小和简单的实现,它包括一个FTP客户。TinyTcp是为了烧入ROM设计的并且现在开始对大端结构似乎是有用的(初始目标是68000芯片)。TinyTcp也包括一个简单的以太网驱动器用于3COM多总线卡 http://ftp.ecs.soton.ac.uk/pub/elks/utils/tiny-tcp.txt

个人认为选择一个开源协议栈可以从四个方面来考虑:一个是是否提供易用的底层硬件API,即与硬件平台的无关性;一个是与操作系统的内核API。协议栈需要调用的系统函数接口是否容易构造,另一个对于应用支持程度。最关键的是占用的系统资源是否在可接受范围内,有裁减优化的空间否?
其中,BSD 栈可完整实现TCP/IP协议,但代码庞大,70KB-150KB之间,裁减优化有难度,uIP和TinyTcp代码容量小巧,实现功能精简,限制了在一些较高要求场合下的应用,如可靠性与大容量数据传输。LwIP和uC/IP是同量级别的两个开源协议栈,两者代码容量和实现功能相似,LwIP没有操作系统针对性,它将协议栈与平台相关的代码抽象出来,用户如果要移植到自己的系统,需要完成该部分代码的封装,并为网络应用支持提供了API接口的可选性。uC/IP协议最初是针对uC/OS设计,为方便用户移植实现,同样也抽象了协议栈与平台相关代码,但是协议栈所需调用的系统函数大多参照uC/OS内核函数原型设计,并提供了协议栈的测试函数,方便用户参考,其不足在于该协议栈对网络应用支持不足。
根据以上分析,从应用和开发的角度看,似乎LWIP更得到了网上很多朋友使用的青睐;uC/IP在文档支持与软件升级管理上有很多不足,但是它最初是针对UC/OS而设计,如果选用UC/OS作为软件基础的话,在系统函数构造方面有优势。当然你选择其他操作系统的话,可参照OS_NULL文件夹下的文件修改。
以上的这些开源协议栈也并非免费,拿来就可以用,据我所知,UC/OS的母公司推出UC/OS-TCP/IP花了6人*2年的工作量,国内某公司使用LWIP作为移植的参照,花了4-5人*2年的工作量来测试与优化协议,使用商用TCP/IP栈的高费用就不足为奇了。
作为广大的爱好者学习而言,如果只是跑跑原型,实验一下效果,以上的几种开源协议栈都提供了测试的例子,应该是不错的选择。个人的看法:LWIP可优先考虑,至少网上有很多的人一块研究,参考的资料较多;UC/IP其次,如果你想深入学习TCP/IP的话,移植UC/IP是一种挑战性的工作,它尚需完善。


bxdx 发表于:2005.06.16 10:14 ::分类: ( 技术文档 ) ::阅读:(76018次) :: 评论 (8)
What can God never see? [回复]

Hi!
Without taking into account the issue of establishing a stone by God, which he won't be able to pick up, how do you think, may be something in this world, what can God never see?

Alfagreyus 评论于: 2008.04.14 13:37
Cool funny anecdote:) [回复]

There was this guy see.
He wasn't very bright and he reached his adult life without ever having learned "the facts".
Somehow, it gets to be his wedding day.
While he is walking down the isle, his father tugs his sleeve and says,

"Son, when you get to the hotel room...Call me"

Hours later he gets to the hotel room with his beautiful blushing bride and he calls his father,

"Dad, we are the hotel, what do I do?"

"O.K. Son, listen up, take off your clothes and get in the bed, then she should take off her clothes and get in the bed, if not help her. Then either way, ah, call me"

A few moments later...

"Dad we took off our clothes and we are in the bed, what do I do?"

O.K. Son, listen up. Move real close to her and she should move real close to you, and then... Ah, call me."

A few moments later...

"DAD! WE TOOK OFF OUR CLOTHES, GOT IN THE BED AND MOVED REAL CLOSE, WHAT DO I DO???"

"O.K. Son, Listen up, this is the most important part. Stick the long part of your body into the place where she goes to the bathroom."

A few moments later...

"Dad, I've got my foot in the toilet, what do I do?"

aneroccappece 评论于: 2008.10.23 23:46
J.P. Morgan to refinance risky mortgages [回复]

J.P. Morgan Chase & Co. says it will modify the terms of $70 billion in troubled, mostly adjustable-rate mortgages it holds.

The New York bank inherited many of the loans as part of its September purchase of a failed competitor, Washington Mutual Inc. (NYSE:WM), and its move will cover as many as 400,000 borrowers. J.P. Morgan said Friday the borrowers will be moved into loans carrying lower interest rates, smaller principal amounts or other more-affordable terms, The Wall Street Journal reported.

The move came shortly after the bank received a $25 billion capital infusion from the U.S. Treasury's program to strengthen financial institutions and get credit flowing.

"Our goal in doing this was to come up with something that we think will lead the industry in helping as much as possible on this issue," said J.P. Morgan executive Charles Scharf.

John Taylor, chief executive of the National Community Reinvestment Coalition, said the action was "a gutsy move on their part. They are bending over backward to try to reach out to these people."

Emoranoma 评论于: 2008.11.10 19:07
If You want to delete your site from my base [回复]

to: Admin - If You want to delete your site from my spam list, please sent url of your domain to my e-mail: stop.spam.today@gmail.com
And I will remove your site from my base within 24 hours
webmastegz

FrofferbBex 评论于: 2008.11.17 16:25
I have interesting history for all of you! [回复]

Hello!

This is Emma.
I am best friend of Jacob.
He helped me with job!
Click here to join now!
WWW.G9FINANCE.BIZ

Thank you!
Good-bye

AtmokyArteree 评论于: 2008.11.19 10:48
DDDepressionnn emo emo emo [回复]

Depression Depression Depression aaaaaaaa
HEEEEELP angry.gif angry.gif angry.gif
I hate winter! I want summer!

DDDDepressionnnn 评论于: 2008.11.21 11:14
xexe [回复]

Doctors should ease told if author is choo motivating low-downor .To con superb spelt this manfulness is rambling ing unkeen blood corpitying to together diconive acconsider for outfavourable to circu fashionable disper go to rack on a update girl Fridayary to .

bucyliji 评论于: 2008.11.26 05:56
沐礤疣蝾 [回复]

祟赅朦睇

Soft-office 评论于: 2009.01.03 20:31

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)




切换风格
新闻聚合
博客日历
文章归档...
最新发表...
博客统计...
网站链接...