UDP
[TCP/IP Base Protocols]


Files

file  udp.h
 UDP Module for Modtronix TCP/IP Stack.

Detailed Description

The UDP layer of the Modtronix TCP/IP stack is implemented by the file "udp.c". The header file "udp.h" defines the services provided by the layer. In this stack architecture, UDP is an active layer. It fetches UDP packets and notifies corresponding UDP socket of data arrival or transmission. The UDP module is implemented as a cooperative task, performing automatic operations without the knowledge of the main application.

"udp.h" provides UDP socket services and hides all UDP packet handling from the caller. The layer allows up to 254 UDP sockets (the number limited only by available memory and compiler used). With more than one socket, higher level applications can maintain multiple simultaneous UDP connections; more than one application could be using this layer. It is important to know that each socket consumes approximately 21 bytes (check 'UDP.h' file for actual consumption) and increases overall UDP processing time.

Unlike other socket implementations, all sockets in the Modtronix TCP/IP Stack share one or more common transmit buffers. This approach reduces overall RAM requirements, but it may create a potential problem, where a few sockets reserve all available transmit buffers and do not release them on time for other sockets to use. Under these circumstances, remote hosts and/or local applications would not be able to contact the stack. To avoid this, users must make sure that there are enough transmit buffers for all sockets. On the receive side, there is only one receive buffer. If a socket receives its data, the owner of that socket must fetch and discard the receive buffer in one task time in order for the other sockets to receive their data. This design mandates that once a task detects a packet it is interested in, it must consume the complete packet in one task time. A task cannot fetch part of a packet during one task time and expect to fetch the rest of the packet later.

The UDP specifications do not mandate that checksum calculation be performed on UDP packets. To reduce overall program and data memory requirements, the Modtronix TCP/IP Stack does not implement UDP checksum calculation; instead, it sets the checksum fields to zero to indicate that no checksum calculation is performed. This design decision requires that all modules utilizing the UDP module ensure their data integrity.


Generated on Wed Feb 3 12:45:36 2010 for SBC65EC Web Server by  doxygen 1.5.8