title: How does a Linux socket buffer overflow?
body: <p>I have a Java reader application that reads from a multicast socket on a Linux 64-bit platform (2.6.18).  The socket size has been set to 2 MB.  When the reader cannot read fast enough the socket "overflows", i.e. packets are dropped from the buffer.</p>
  
  <p>What I would like to know is how the Linux kernel drops packets out of the socket buffer.  I assume that the socket buffer itself is a FIFO buffer.  However, if it is full what happens?  Will the next packet be discarded (and the buffer content does not change)?  Or will the new packet replace an old packet in the buffer?  If yes, which packet (the oldest?, the youngest?, a randomly chosen packet?)?</p>
  
  <p>Thanks for any insight.</p>