Lines Matching full:is

7 The uIP TCP/IP stack is intended to make it possible to communicate
11 with peers running a similarly light-weight stack. The code size is on
30 a global standard for communication. TCP/IP is the underlying protocol
46 The uIP implementation is designed to have only the absolute minimal
49 protocols. uIP is written in the C programming language.
54 assumption, it is possible to remove certain TCP/IP mechanisms that
56 essential, however, if the embedded device is to communicate with
58 peer-to-peer services and protocols. uIP is designed to be RFC
60 network citizens. The uIP TCP/IP implementation that is not tailored
68 addresses, to application level protocols such as SMTP that is used to
69 transfer e-mail. The uIP is mostly concerned with the TCP and IP
77 segment is sent in its own IP packet. The IP packets are sent out on
78 the network by the network device driver. If the destination is not on
79 the physically connected network, the IP packet is forwarded onto
80 another network by a router that is situated between the two
81 networks. If the maximum packet size of the other network is smaller
82 than the size of the IP packet, the packet is fragmented into smaller
84 chosen so that fragmentation is minimized. The final recipient of the
88 The formal requirements for the protocols in the TCP/IP stack is
90 Engineering Task Force, IETF. Each of the protocols in the stack is
97 example of the first kind is "A TCP MUST be able to receive a TCP
98 option in any segment" and an example of the second kind is "There
141 architecture on which uIP is intended to run. These functions should
149 this checksum is made over all bytes in every packet being sent and
150 received it is important that the function that calculates the
151 checksum is efficient. Most often, this means that the checksum
165 the normal protocol processing. Since 32-bit arithmetic is not
166 natively available on many of the platforms for which uIP is intended,
171 While uIP implements a generic 32-bit addition, there is support for
178 In the architectures for which uIP is intended, RAM is the most
187 packet buffer is large enough to contain one packet of maximum
196 arrive when the application is processing the data must be queued,
202 buffers are full, the incoming packet is dropped. This will cause
204 running in parallel. This is because uIP advertises a very small
208 In uIP, the same global packet buffer that is used for incoming
209 packets is also used for the TCP/IP headers of outgoing data. If the
216 out on the network. The data is not queued for
218 data if a retransmission is necessary.
227 simple Telnet server. It is possible to run the uIP implementation
237 used API for TCP/IP is the BSD socket API which is used in most Unix
243 architectures, the BSD socket interface is not suitable for our
248 event-based API that is nore low-level than protosockets but uses less
257 The "raw" uIP API uses an event driven interface where the application is
259 of uIP is implemented as a C function that is called by uIP in
260 response to certain events. uIP calls the application when data is
263 has to be retransmitted. The application is also periodically polled
265 function; it is up to the application to deal with mapping different
267 application is able to act on incoming data and connection requests as
271 uIP is different from other TCP/IP stacks in that it requires help
273 buffer the transmitted data in memory until the data is known to be
288 that a retransmission is required. The application checks the
291 is not different from how the data originally was sent. Therefore the
292 application can be written in such a way that the same code is used
293 both for sending data and retransmitting data. Also, it is important
294 to note that even though the actual retransmission operation is
295 carried out by the application, it is the responsibility of the stack
304 test function that is used to distinguish between different
308 time as data is acknowledged).
312 When the application is called by uIP, the global variable uip_conn is
314 currently is handled, and is called the "current connection". The
317 which IP address the connection is connected. One typical use would be
321 uip_conn->lport is equal to 80 and act as a TELNET server if the value
322 is 23.
326 If the uIP test function uip_newdata() is non-zero, the remote host of
328 actual data. The size of the data is obtained through the uIP function
329 uip_datalen(). The data is not buffered by uIP, but will be
339 TCP window advertised by the receiver. The amount of buffer space is
340 dictated by the memory configuration. It is therefore possible that
352 connection and it is not possible to call uip_send() more than once
359 periodic timer is invoked, the retransmission timer for each
360 connection is decremented. If the timer reaches zero, a retransmission
365 retransmitted, the application function is called with the
366 uip_rexmit() flag set, indicating that a retransmission is
371 performing a retransmission is not different from how the data
373 a way that the same code is used both for sending data and
374 retransmitting data. Also, it is important to note that even though
375 the actual retransmission operation is carried out by the application,
376 it is the responsibility of the stack to know when the retransmission
390 uip_closed() is true. The application may then do any necessary
404 When a connection is idle, uIP polls the application every time the
406 uip_poll() to check if it is being polled by uIP.
408 The polling event has two purposes. The first is to let the
409 application periodically know that a connection is idle, which allows
411 long. The other purpose is to let the application send new data that
413 uIP, and therefore the poll event is the only way to send data on an
418 uIP maintains a list of listening TCP ports. A new port is opened for
421 the application function. The test function uip_connected() is true if
433 the next time the connection is polled by uIP. The uip_connect()
446 and the current connection is aborted by uip_abort().
480 The implementation of this application is shown below. The application
481 is initialized with the function called example1_init() and the uIP
482 callback function is called example1_app(). For this application, the
505 example actually shows a complete uIP application. It is not required
511 This second example is slightly more advanced than the previous one,
512 and shows how the application state field in the uip_conn structure is
515 This application is similar to the first application in that it
517 to it with a single "ok". The big difference is that this application
522 the application is implemented. The reason for the increase in
523 complexity is that if data should be lost in the network, the
526 one of the "ok" messages is lost, the application must send a new
540 welcome message is acknowledged, the application moves to the
544 If the application is requested to retransmit the last message, it
545 looks at in which state the application is. If the application is in
548 the application is in the WELCOME-ACKED state, it knows that the last
551 The implementation of this application is seen below. This
552 configuration settings for the application is follows after its
606 differentiate between them is to use the TCP port number of either the
663 When the connection has been established, an HTTP request is sent to
664 the server. Since this is the only data that is sent, the application
665 knows that if it needs to retransmit any data, it is that request that
666 should be retransmitted. It is therefore possible to combine these two
667 events as is done in the example.
670 this data to the device by using the function device_enqueue(). It is
675 If the device's queue is full, the application stops the data from the
678 uip_restart() is called. The application polling event is used to
679 check if the device's queue is no longer full and if so, the data flow
680 is restarted with uip_restart().
732 sent and the size of the data that is left to send. When a remote host
733 connects to the application, the local port number is used to
734 determine which file to send. The first chunk of data is sent using
735 uip_send(). uIP makes sure that no more than MSS bytes of data is
738 The application is driven by incoming acknowledgments. When data has
739 been acknowledged, new data can be sent. If there is no more data to
740 send, the connection is closed using uip_close().
744 When writing larger programs using uIP it is useful to be able to
748 showed here. The program is divided into an uIP event handler function
754 the protocol that is being implemented.
756 The uIP event handler function is shown below.
790 true. If so, the appropriate error function is called. Also, if the
791 connection has been closed, the closed() function is called to the it
795 by checking if uip_connected() is true. The connected() function is
796 called and is supposed to do whatever needs to be done when the
797 connection is established, such as intializing the application state
799 out, the senddata() function is called to deal with the outgoing data.
805 develop an application state machine, this message is sent in two
871 that the application is waiting for data to arrive from the network,
872 "STATE_HELLO", in which the application is sending the "Hello" part of
873 the message, or "STATE_WORLD", in which the application is sending the
883 there is no message to be sent out.
887 check if the connection is in the "STATE_WAITING" state, and if so
892 The acked() function is called whenever data that previously was sent
894 first reduces the amount of data that is left to send, by subtracting
897 accordingly. It then checks if the "textlen" variable now is zero,
905 data that is to be sent. It is called by the event handler function
907 a new connection has been established, when the connection is polled
909 purpose of the senddata() function is to optionally format the data
910 that is to be sent, and to call the uip_send() function to actually
912 calls uip_send() with the appropriate arguments if data is to be sent,
916 It is important to note that the senddata() function never should
925 the layered approach is a good way to design protocols, it is not
934 When incoming packets are processed by uIP, the IP layer is the first
944 IP fragment reassembly is implemented using a separate buffer that
945 holds the packet to be reassembled. An incoming fragment is copied
946 into the right place in the buffer and a bit map is used to keep track
948 fragment is aligned on an 8-byte boundary, the bit map requires a
950 resulting IP packet is passed to the transport layer. If all fragments
951 have not been received within a specified time frame, the packet is
965 addresses. Broadcast is used heavily in many UDP based protocols such
966 as the Microsoft Windows file-sharing SMB protocol. Multicast is
968 RTP. TCP is a point-to-point protocol and does not use broadcast or
971 receiving non-local multicast packets is not currently supported.
975 The ICMP protocol is used for reporting soft error conditions and for
976 querying host parameters. Its main use is, however, the echo mechanism
977 which is used by the "ping" program.
979 The ICMP implementation in uIP is very simple as itis restricted to
983 Echo-Reply message type. The ICMP checksum is adjusted using standard
986 Since only the ICMP echo message is implemented, there is no support
987 for Path MTU discovery or ICMP redirect messages. Neither of these is
993 The TCP implementation in uIP is driven by incoming packets and timer
995 data that is to be delivered to the application, the application is
997 packet acknowledges previously sent data, the connection state is
998 updated and the application is informed, allowing it to send out new
1004 uIP, a listening connection is identified by the 16-bit port number
1006 listening connections. This list of listening connections is dynamic
1016 because 32-bit arithmetic is fairly expensive on most 8-bit CPUs, uIP
1023 It is important to note that even though most TCP implementations use
1024 the sliding window algorithm, it is not required by the TCP
1034 The RTT estimation in uIP is implemented using TCP's periodic
1037 acknowledgment is received, the current value of the counter is used
1038 as a sample of the RTT. The sample is used together with Van
1040 estimate of the RTT. Karn's algorithm is used to ensure that
1046 periodic timer is invoked, the retransmission timer for each
1047 connection is decremented. If the timer reaches zero, a retransmission
1055 that a retransmission is required. The application checks the
1058 is not different from how the data originally was sent. Therefore the
1059 application can be written in such a way that the same code is used
1060 both for sending data and retransmitting data. Also, it is important
1061 to note that even though the actual retransmission operation is
1062 carried out by the application, it is the responsibility of the stack
1069 The purpose of TCP's flow control mechanisms is to allow communication
1077 bytes it is allowed to send by the receiving host. If the remote host
1097 stream. It is up to the receiving application to interpret the meaning
1109 In TCP/IP implementations for high-end systems, processing time is
1114 the TCP/IP stack is run in the kernel, data has to be copied between
1119 numerous active connections, packet demultiplexing is also an
1124 multitasking operating system. Therefore there is no need to copy
1126 event based API there is no context switch between the TCP/IP stack
1129 In such limited systems, the TCP/IP processing overhead is dominated
1144 other received segment. If no segment is received within a specific
1145 time-frame, an acknowledgment is sent. The time-frame can be as high
1146 as 500 ms but typically is 200 ms.
1151 time, it will wait as much as 500 ms before an acknowledgment is
1152 sent. This means that the maximum possible throughput is severely
1156 be $p = s / (t + t_d)$ where $s$ is the segment size and $t_d$ is the
1157 delayed acknowledgment timeout, which typically is between 200 and
1171 The maximum throughput when uIP acts as a receiver is not affected by