亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? uip-doc.txt

?? 最新版IAR FOR ARM(EWARM)5.11中的代碼例子
?? TXT
?? 第 1 頁 / 共 4 頁
字號:


/**
\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 calculations in those
functions can be written in highly optimized assembler rather than
generic C code.

\subsection longarith 32-bit Arithmetic

The TCP protocol uses 32-bit sequence numbers, and a TCP
implementation will have to do a number of 32-bit additions as part of
the normal protocol processing. Since 32-bit arithmetic is not
natively available on many of the platforms for which uIP is intended,
uIP leaves the 32-bit additions to be implemented by the architecture
specific module and does not make use of any 32-bit arithmetic in the
main code base.

While uIP implements a generic 32-bit addition, there is support for
having an architecture specific implementation of the uip_add32()
function.


\section memory Memory Management

In the architectures for which uIP is intended, RAM is the most
scarce resource. With only a few kilobytes of RAM available for the
TCP/IP stack to use, mechanisms used in traditional TCP/IP cannot be
directly applied.


The uIP stack does not use explicit dynamic memory
allocation. Instead, it uses a single global buffer for holding
packets and has a fixed table for holding connection state. The global
packet buffer is large enough to contain one packet of maximum
size. When a packet arrives from the network, the device driver places
it in the global buffer and calls the TCP/IP stack. If the packet
contains data, the TCP/IP stack will notify the corresponding
application. Because the data in the buffer will be overwritten by the
next incoming packet, the application will either have to act
immediately on the data or copy the data into a secondary buffer for
later processing. The packet buffer will not be overwritten by new
packets before the application has processed the data. Packets that
arrive when the application is processing the data must be queued,
either by the network device or by the device driver. Most single-chip
Ethernet controllers have on-chip buffers that are large enough to
contain at least 4 maximum sized Ethernet frames. Devices that are
handled by the processor, such as RS-232 ports, can copy incoming
bytes to a separate buffer during application processing. If the
buffers are full, the incoming packet is dropped. This will cause
performance degradation, but only when multiple connections are
running in parallel. This is because uIP advertises a very small
receiver window, which means that only a single TCP segment will be in
the network per connection.

In uIP, the same global packet buffer that is used for incoming
packets is also used for the TCP/IP headers of outgoing data. If the
application sends dynamic data, it may use the parts of the global
packet buffer that are not used for headers as a temporary storage
buffer. To send the data, the application passes a pointer to the data
as well as the length of the data to the stack. The TCP/IP headers are
written into the global buffer and once the headers have been
produced, the device driver sends the headers and the application data
out on the network. The data is not queued for
retransmissions. Instead, the application will have to reproduce the
data if a retransmission is necessary.

The total amount of memory usage for uIP depends heavily on the
applications of the particular device in which the implementations are
to be run. The memory configuration determines both the amount of
traffic the system should be able to handle and the maximum amount of
simultaneous connections. A device that will be sending large e-mails
while at the same time running a web server with highly dynamic web
pages and multiple simultaneous clients, will require more RAM than a
simple Telnet server. It is possible to run the uIP implementation
with as little as 200 bytes of RAM, but such a configuration will
provide extremely low throughput and will only allow a small number of
simultaneous connections.

\section api Application Program Interface (API)


The Application Program Interface (API) defines the way the
application program interacts with the TCP/IP stack. The most commonly
used API for TCP/IP is the BSD socket API which is used in most Unix
systems and has heavily influenced the Microsoft Windows WinSock
API. Because the socket API uses stop-and-wait semantics, it requires
support from an underlying multitasking operating system. Since the
overhead of task management, context switching and allocation of stack
space for the tasks might be too high in the intended uIP target
architectures, the BSD socket interface is not suitable for our
purposes.

uIP provides two APIs to programmers: protosockets, a BSD socket-like
API without the overhead of full multi-threading, and a "raw"
event-based API that is nore low-level than protosockets but uses less
memory.

\sa \ref psock
\sa \ref pt


\subsection rawapi The uIP raw API

The "raw" uIP API uses an event driven interface where the application is
invoked in response to certain events. An application running on top
of uIP is implemented as a C function that is called by uIP in
response to certain events. uIP calls the application when data is
received, when data has been successfully delivered to the other end
of the connection, when a new connection has been set up, or when data
has to be retransmitted. The application is also periodically polled
for new data. The application program provides only one callback
function; it is up to the application to deal with mapping different
network services to different ports and connections. Because the
application is able to act on incoming data and connection requests as
soon as the TCP/IP stack receives the packet, low response times can
be achieved even in low-end systems.

uIP is different from other TCP/IP stacks in that it requires help
from the application when doing retransmissions. Other TCP/IP stacks
buffer the transmitted data in memory until the data is known to be
successfully delivered to the remote end of the connection. If the
data needs to be retransmitted, the stack takes care of the
retransmission without notifying the application. With this approach,
the data has to be buffered in memory while waiting for an
acknowledgment even if the application might be able to quickly
regenerate the data if a retransmission has to be made.

In order to reduce memory usage, uIP utilizes the fact that the
application may be able to regenerate sent data and lets the
application take part in retransmissions. uIP does not keep track of
packet contents after they have been sent by the device driver, and
uIP requires that the application takes an active part in performing
the retransmission. When uIP decides that a segment should be
retransmitted, it calls the application with a flag set indicating
that a retransmission is required. The application checks the
retransmission flag and produces the same data that was previously
sent. From the application's standpoint, performing a retransmission
is not different from how the data originally was sent. Therefore the
application can be written in such a way that the same code is used
both for sending data and retransmitting data. Also, it is important
to note that even though the actual retransmission operation is
carried out by the application, it is the responsibility of the stack
to know when the retransmission should be made. Thus the complexity of

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色妹子一区二区| 国产馆精品极品| 国产精品无码永久免费888| 日韩午夜精品电影| 91精品国产麻豆国产自产在线| 色国产综合视频| 色婷婷精品久久二区二区蜜臂av| 91麻豆文化传媒在线观看| av电影在线不卡| 在线观看视频91| 欧美探花视频资源| 欧美肥胖老妇做爰| 日韩一区二区免费高清| 欧美本精品男人aⅴ天堂| 欧美成人一区二区三区在线观看| 欧美电视剧在线看免费| 久久综合久久综合九色| 国产精品嫩草久久久久| 亚洲三级电影全部在线观看高清| 亚洲欧美成人一区二区三区| 26uuu国产电影一区二区| 精品久久久久久久人人人人传媒| 欧美一级高清大全免费观看| 日韩免费在线观看| 国产精品久久一卡二卡| 亚洲精品免费播放| 日韩中文欧美在线| 国产一区不卡精品| 色综合夜色一区| 在线电影国产精品| 国产精品丝袜一区| 午夜电影久久久| 国产精品主播直播| 色播五月激情综合网| 日韩欧美国产一区二区三区 | 99re66热这里只有精品3直播| 99视频超级精品| 91麻豆精品国产91久久久久| 久久久久久久性| 亚洲成人av一区| 国产成人在线电影| 91精品国产综合久久久久久久| 久久精品夜夜夜夜久久| 亚洲电影第三页| 国产精品911| 91精品国产综合久久福利| 欧美国产国产综合| 亚洲成人综合在线| 成人高清伦理免费影院在线观看| 精品视频一区三区九区| 国产欧美日韩麻豆91| 日韩不卡一区二区三区| 色综合久久天天| 国产日韩av一区二区| 日本免费新一区视频| 色婷婷久久一区二区三区麻豆| 2022国产精品视频| 日韩电影在线观看电影| 色婷婷久久久久swag精品| 欧美国产综合一区二区| 蜜臀av一级做a爰片久久| 欧美亚洲国产一区二区三区 | 亚洲综合一二区| 成人18精品视频| 国产婷婷色一区二区三区在线| 免费在线观看视频一区| 欧美精品视频www在线观看| 国产精品白丝在线| 成人av在线资源网| 国产精品网站在线观看| 国产成人鲁色资源国产91色综 | 成人av网站在线观看| www欧美成人18+| 卡一卡二国产精品| 日韩欧美高清在线| 黄色小说综合网站| 久久伊人蜜桃av一区二区| 久久99久久久欧美国产| 日韩视频一区二区在线观看| 天天色综合天天| 日韩视频在线永久播放| 久久精品国产免费看久久精品| 欧美精品 日韩| 美女视频第一区二区三区免费观看网站| 欧美性大战久久久久久久蜜臀| 亚洲狼人国产精品| 欧美挠脚心视频网站| 日韩精品一级中文字幕精品视频免费观看 | 精品裸体舞一区二区三区| 日韩在线卡一卡二| 欧美一二三四区在线| 精品一区二区三区免费播放 | 成人黄色免费短视频| 国产精品高清亚洲| 日本精品一区二区三区高清 | 国产精品99久久久久久宅男| 中文字幕av资源一区| 色婷婷综合久久久久中文 | 日韩欧美一级二级| 国产乱人伦精品一区二区在线观看 | 老司机精品视频一区二区三区| 精品国产sm最大网站免费看| 国产v日产∨综合v精品视频| 亚洲欧美日韩系列| 欧美一级二级三级乱码| 国产成a人亚洲| 亚洲图片欧美色图| ww亚洲ww在线观看国产| 91性感美女视频| 蜜臀久久99精品久久久久宅男| 久久久精品国产免费观看同学| 99精品视频在线观看| 日韩av高清在线观看| 国产嫩草影院久久久久| 欧美日韩一区二区三区高清 | 成人免费在线播放视频| 欧美色综合久久| 国产在线视视频有精品| 亚洲福利视频一区二区| 国产夜色精品一区二区av| 欧美影院午夜播放| 国产激情一区二区三区桃花岛亚洲| 亚洲欧美日韩久久精品| 26uuu国产日韩综合| 欧美偷拍一区二区| aaa亚洲精品| 黄网站免费久久| 亚洲成人一区二区在线观看| 久久亚洲一区二区三区明星换脸| 欧美自拍偷拍一区| 成人午夜伦理影院| 极品少妇xxxx偷拍精品少妇| 亚洲欧美一区二区三区久本道91| 精品国产三级a在线观看| 欧美日韩不卡视频| 在线视频欧美精品| www.亚洲在线| 国产激情视频一区二区三区欧美| 天堂一区二区在线| 亚洲国产欧美日韩另类综合 | 欧美日韩免费一区二区三区| 成人国产在线观看| 国产福利视频一区二区三区| 日本不卡一二三区黄网| 亚洲成人一区二区在线观看| 亚洲精品自拍动漫在线| ●精品国产综合乱码久久久久| 久久婷婷色综合| 精品91自产拍在线观看一区| 日韩亚洲欧美一区二区三区| 在线不卡中文字幕播放| 欧美日韩色一区| 欧美日韩激情在线| 欧美日韩激情在线| 91精品国产综合久久婷婷香蕉| 欧美色综合影院| 67194成人在线观看| 欧美日韩一区二区三区四区五区| 欧美色综合久久| 欧美另类久久久品| 555www色欧美视频| 欧美tk—视频vk| 久久色在线观看| 中文字幕的久久| 国产精品情趣视频| 亚洲伦理在线免费看| 伊人夜夜躁av伊人久久| 亚洲综合精品久久| 午夜精品久久久久久不卡8050| 亚洲成人在线免费| 日韩 欧美一区二区三区| 六月婷婷色综合| 国产精品99久久久久久久vr| 成人小视频在线| 欧美私人免费视频| 亚洲精品在线免费观看视频| 国产亚洲欧美一区在线观看| 国产精品美女一区二区在线观看| 自拍偷拍欧美精品| 亚洲va欧美va天堂v国产综合| 精品一区二区三区蜜桃| 成人av在线一区二区| 欧美视频在线一区| 国产亚洲综合在线| 亚洲一区在线观看视频| 久久精品国产亚洲a| www.成人在线| 欧美综合一区二区| 久久日一线二线三线suv| 国产精品沙发午睡系列990531| 一区二区视频在线| 久久精品99久久久| av不卡免费在线观看| 91精品国产综合久久福利 | 色老头久久综合| 欧美sm极限捆绑bd| 亚洲黄色录像片| 国产一区亚洲一区| 欧美日韩国产一级二级| 久久精品视频在线看|