O'Reilly logo

iOS and OS X Network Programming Cookbook by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Constructing a UDP packet with libnet

The User Datagram Protocol (UDP) sends datagrams to other hosts on an IP network without any prior handshaking to set up the communication channel between the devices. A datagram is just a packet (like an ICMP or TCP packet), except that the delivery, arrival time, and sequence are not guaranteed. The UDP protocol is considered to be an unreliable protocol because there is no guarantee of delivery.

The minimalist approach of UDP makes it ideal for real-time applications, such as Voice over IP, online games and streaming media, where dropping of packets is preferred over waiting for delayed packets. If guarantee of delivery is needed so that packets are not dropped, applications should use TCP or SCTP instead ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required