20.01.2014 Views

Lectures notes for 2010 - KTH

Lectures notes for 2010 - KTH

Lectures notes for 2010 - KTH

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

UDP server design<br />

Stevens, Vol, 1, pp. 162-167 discusses how to program a UDP server<br />

You can often determine what IP address the request was sent to (i.e., the<br />

destination address):<br />

• <strong>for</strong> example: thus ignoring datagrams sent to a broadcast address<br />

You can limit a server to a given incoming IP address:<br />

• thus limiting requests to a given interface<br />

You can limit a server to a given <strong>for</strong>eign IP address and port:<br />

• only accepting requests from a given <strong>for</strong>eign IP address and port #<br />

Multiple recipients per port (<strong>for</strong> implementations with multicasting support)<br />

• setting SO_REUSEADDR socket option ⇒ each process gets a copy<br />

of the incoming datagram<br />

Note: limited size input queue to each UDP port, can result in silent discards<br />

without an ICMP message being sent back (since OS discarded, not the network!)<br />

Maguire Simple UDP client 4: 21 of 74<br />

maguire@kth.se <strong>2010</strong>.03.21 Internetworking/Internetteknik

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!