22.3 Datagram Truncation


21.8 dg_cli Function Using Multicasting

We modify our dg_cli function from Figure 20.5 by just removing the call to setsockopt . As we said earlier, none of the multicast socket options needs to be set to send a multicast datagram if the default settings for the outgoing interface, TTL, and loopback option are acceptable. We run a modified UDP echo server that joins the allhosts group , then run our program specifying the all- hosts group as the destination address.

macosx % udpcli01 224.0.0.1

 

hi there

 

from 172.24.37.78: hi there

MacOS X

from 172.24.37.94: hi there

FreeBSD

We get a response from both systems on the subnet. They are each running the multicast echo server. Each reply is unicast because the source address of the request, which is used by each server as the destination address of the reply, is a unicast address.

IP Fragmentation and Multicasts

We mentioned at the end of Section 20.4 that most systems do not allow the fragmentation of a broadcast datagram as a policy decision. Fragmentation is fine to use with multicasting, as we can easily verify using the same file with a 2,000-byte line.

 
 macosx %  udpcli01 224.0.0.1 < 2000line  from 172.24.37.78: xxxxxxxxxx[...] from 172.24.37.94: xxxxxxxxxx[...] 


UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net