UDP Sockets

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
UDP Sockets

UDP sockets are somewhat easier to declare than TCP sockets. Since UDP transmissions don't have to be processed in a particular order and responses aren't required by the sender, you don't have to declare separate buffers for these sockets. There are two options to define when using UDP:

#define MAX_UDP_SOCKETS     (10u)
//#define UDP_USE_TX_CHECKSUM

The MAX_UDP_SOCKETS definition defines the size of an array of UDP_SOCKET_INFO structures. These structures contain two sixteen-bit identifiers for the remote node's and local node's UDP port numbers, and a 10-byte structure used to hold the remote node's MAC address and IP address (these structures use the packed attribute, so the actual size of the UDP_SOCKET_INFO structure may very slightly depending on the PIC architecture you use). 

The UDP_USE_TX_CHECKSUM definition will cause the stack to generate checksums for transmitted data, and include them with transmitted packets. This can provide some data integrity verification, but it will also decrease TX performance by nearly 50% unless the ENCX24J600 is used (the ENCX24J600 chips include hardware checksum calculators).

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.