/**
\mainpage The uIP TCP/IP stack
\author Adam Dunkels, http://www.sics.se/~adam/
The uIP TCP/IP stack is intended to make it possible to communicate
using the TCP/IP protocol suite even on small 8-bit
micro-controllers. Despite being small and simple, uIP do not require
their peers to have complex, full-size stacks, but can communicate
with peers running a similarly light-weight stack. The code size is on
the order of a few kilobytes and RAM usage can be configured to be as
low as a few hundred bytes.
uIP can be found at the uIP web page: http://www.sics.se/~adam/uip/
\sa \ref apps "Application programs"
\sa \ref uipopt "Compile-time configuration options"
\sa \ref uipconffunc "Run-time configuration functions"
\sa \ref uipinit "Initialization functions"
\sa \ref uipdevfunc "Device driver interface" and
\ref uipdrivervars "variables used by device drivers"
\sa \ref uipappfunc "uIP functions called from application programs"
(see below) and the \ref psock "protosockets API" and their underlying
\ref pt "protothreads"
\section uIPIntroduction Introduction
With the success of the Internet, the TCP/IP protocol suite has become
a global standard for communication. TCP/IP is the underlying protocol
used for web page transfers, e-mail transmissions, file transfers, and
peer-to-peer networking over the Internet. For embedded systems, being
able to run native TCP/IP makes it possible to connect the system
directly to an intranet or even the global Internet. Embedded devices
with full TCP/IP support will be first-class network citizens, thus
being able to fully communicate with other hosts in the network.
Traditional TCP/IP implementations have required far too much
resources both in terms of code size and memory usage to be useful in
small 8 or 16-bit systems. Code size of a few hundred kilobytes and
RAM requirements of several hundreds of kilobytes have made it
impossible to fit the full TCP/IP stack into systems with a few tens
of kilobytes of RAM and room for less than 100 kilobytes of
code.
The uIP implementation is designed to have only the absolute minimal
set of features needed for a full TCP/IP stack. It can only handle a
single network interface and contains the IP, ICMP, UDP and TCP
protocols. uIP is written in the C programming language.
Many other TCP/IP implementations for small systems assume that the
embedded device always will communicate with a full-scale TCP/IP
implementation running on a workstation-class machine. Under this
assumption, it is possible to remove certain TCP/IP mechanisms that
are very rarely used in such situations. Many of those mechanisms are
essential, however, if the embedded device is to communicate with
another equally limited device, e.g., when running distributed
peer-to-peer services and protocols. uIP is designed to be RFC
compliant in order to let the embedded devices to act as first-class
network citizens. The uIP TCP/IP implementation that is not tailored
for any specific application.
\section tcpip TCP/IP Communication
The full TCP/IP suite consists of numerous protocols, ranging from low
level protocols such as ARP which translates IP addresses to MAC
addresses, to application level protocols such as SMTP that is used to
transfer e-mail. The uIP is mostly concerned with the TCP and IP
protocols and upper layer protocols will be referred to as "the
application". Lower layer protocols are often implemented in hardware
or firmware and will be referred to as "the network device" that are
controlled by the network device driver.
TCP provides a reliable byte stream to the upper layer protocols. It
breaks the byte stream into appropriately sized segments and each
segment is sent in its own IP packet. The IP packets are sent out on
the network by the network device driver. If the destination is not on
the physically connected network, the IP packet is forwarded onto
another network by a router that is situated between the two
networks. If the maximum packet size of the other network is smaller
than the size of the IP packet, the packet is fragmented into smaller
packets by the router. If possible, the size of the TCP segments are
chosen so that fragmentation is minimized. The final recipient of the
packet will have to reassemble any fragmented IP packets before they
can be passed to higher layers.
The formal requirements for the protocols in the TCP/IP stack is
specified in a number of RFC documents published by the Internet
Engineering Task Force, IETF. Each of the protocols in the stack is
defined in one more RFC documents and RFC1122 collects
all requirements and updates the previous RFCs.
The RFC1122 requirements can be divided into two categories; those
that deal with the host to host communication and those that deal with
communication between the application and the networking stack. An
example of the first kind is "A TCP MUST be able to receive a TCP
option in any segment" and an example of the second kind is "There
MUST be a mechanism for reporting soft TCP error conditions to the
application." A TCP/IP implementation that violates requirements of
the first kind may not be able to communicate with other TCP/IP
implementations and may even lead to network failures. Violation of
the second kind of requirements will only affect the communication
within the system and will not affect host-to-host communication.
In uIP, all RFC requirements that affect host-to-host communication
are implemented. However, in order to reduce code size, we have
removed certain mechanisms in the interface between the application
and the stack, such as the soft error reporting mechanism and
dynamically configurable type-of-service bits for TCP
connections. Since there are only very few applications that make use
of those features they can be removed without loss of generality.
\section mainloop Main Control Loop
The uIP stack can be run either as a task in a multitasking system, or
as the main program in a singletasking system. In both cases, the main
control loop does two things repeatedly:
- Check if a packet has arrived from the network.
- Check if a periodic timeout has occurred.
If a packet has arrived, the input handler function, uip_input(),
should be invoked by the main control loop. The input handler function
will never block, but will return at once. When it returns, the stack
or the application for which the incoming packet was intended may have
produced one or more reply packets which should be sent out. If so,
the network device driver should be called to send out these packets.
Periodic timeouts are used to drive TCP mechanisms that depend on
timers, such as delayed acknowledgments, retransmissions and
round-trip time estimations. When the main control loop infers that
the periodic timer should fire, it should invoke the timer handler
function uip_periodic(). Because the TCP/IP stack may perform
retransmissions when dealing with a timer event, the network device
driver should called to send out the packets that may have been produced.
\section arch Architecture Specific Functions
uIP requires a few functions to be implemented specifically for the
architecture on which uIP is intended to run. These functions should
be hand-tuned for the particular architecture, but generic C
implementations are given as part of the uIP distribution.
\subsection checksums Checksum Calculation
The TCP and IP protocols implement a checksum that covers the data and
header portions of the TCP and IP packets. Since the calculation of
this checksum is made over all bytes in every packet being sent and
received it is important that the function that calculates the
checksum is efficient. Most often, this means that the checksum
calculation must be fine-tuned for the particular architecture on
which the uIP stack runs.
While uIP includes a generic checksum function, it also leaves it open
for an architecture specific implementation of the two functions
uip_ipchksum() and uip_tcpchksum(). The checksum calculation
没有合适的资源?快使用搜索试试~ 我知道了~
《毕业设计》-物联网工程毕业设计-智能家居项目程序源码.zip
共2000个文件
h:877个
c:822个
html:191个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 174 浏览量
2024-03-04
13:16:06
上传
评论
收藏 51.43MB ZIP 举报
温馨提示
个人花大量时间整理出的真实毕业设计实战成果,内容丰富,文档也很详细。无论做毕业设计还是用于学习技能,或工作中当做参考资料,都能发挥重要作用 亲们下载我任何一个付费资源后,即可私信联系我免费下载其他相关资源哦~ 个人花大量时间整理出的真实毕业设计实战成果,内容丰富,文档也很详细。无论做毕业设计还是用于学习技能,或工作中当做参考资料,都能发挥重要作用 亲们下载我任何一个付费资源后,即可私信联系我免费下载其他相关资源哦~ 个人花大量时间整理出的真实毕业设计实战成果,内容丰富,文档也很详细。无论做毕业设计还是用于学习技能,或工作中当做参考资料,都能发挥重要作用 亲们下载我任何一个付费资源后,即可私信联系我免费下载其他相关资源哦~
资源推荐
资源详情
资源评论
收起资源包目录
《毕业设计》-物联网工程毕业设计-智能家居项目程序源码.zip (2000个子文件)
cc936.c 697KB
cc949.c 546KB
cc950.c 434KB
fsdata.c 400KB
cc932.c 240KB
ff.c 198KB
sockets.c 135KB
mib2.c 103KB
sockets.c 91KB
httpd.c 89KB
httpd.c 85KB
tcp.c 84KB
nd6.c 83KB
tcp_in.c 81KB
snmp_msg.c 75KB
mdns.c 75KB
tcp_out.c 75KB
httpd.c 74KB
dhcp.c 74KB
lcp.c 72KB
lcp.c 72KB
yconf.c 71KB
dhcp.c 70KB
sockets.c 69KB
tcp_in.c 67KB
nd6.c 67KB
api_msg.c 67KB
snmp_msg.c 66KB
tcp.c 66KB
mdns.c 63KB
dhcp.c 63KB
auth.c 63KB
auth.c 63KB
deflate.c 63KB
ipcp.c 62KB
ipcp.c 62KB
eap.c 61KB
eap.c 61KB
ipc.c 61KB
api_msg.c 60KB
tcp_in.c 59KB
lconf.c 58KB
core.c 58KB
ppp.c 57KB
uip.c 57KB
lcp.c 56KB
tcp_out.c 56KB
fs-ecos.c 55KB
ip6.c 53KB
tcp.c 52KB
spi_msd.c 52KB
dns.c 52KB
test_tcp.c 52KB
netif.c 51KB
etharp.c 51KB
dns.c 50KB
tcp_out.c 49KB
wlan_mgnt.c 49KB
pbuf.c 49KB
inflate.c 48KB
mqtt.c 48KB
smtp.c 47KB
ppp.c 47KB
ccp.c 47KB
ccp.c 47KB
ppp.c 47KB
pbuf.c 46KB
uffs_fs.c 45KB
api_msg.c 45KB
etharp.c 45KB
etharp.c 44KB
api_lib.c 43KB
trees.c 43KB
udp.c 43KB
msg_in.c 43KB
uffs_buf.c 43KB
mqtt.c 43KB
gc.c 42KB
snmp_core.c 41KB
ipv6cp.c 41KB
ipv6cp.c 41KB
snmp_core.c 40KB
ip4.c 40KB
makefsdata.c 40KB
ipv4_nat.c 40KB
lowpan6.c 40KB
pppol2tp.c 39KB
test_dhcp.c 39KB
rndis.c 39KB
nconf.c 38KB
gconf.c 38KB
test_dhcp.c 38KB
ip6.c 38KB
pbuf.c 38KB
ip4.c 38KB
ipcp.c 38KB
pppol2tp.c 38KB
udp.c 38KB
vbus.c 37KB
pppoe.c 37KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
季风泯灭的季节
- 粉丝: 601
- 资源: 2920
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Python 程序语言设计模式思路-行为型模式:策略模式:将算法封装成独立的类,并使它们可以互相替换及支付模式数据压缩
- main.py
- Last Loaded Test.DBK
- Screenshot_20240520_163011.jpg
- ubuntu-python3-whisper-tornado docker镜像 Dockerfile
- ubuntu-python3-whisper-tornado docker镜像07
- 新录音 8.m4a
- ubuntu-python3-whisper-tornado docker镜像
- ubuntu-python3-whisper-tornado docker镜像
- ubuntu-python3-whisper-tornado docker镜像09
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功