Send a UDP packet through IP raw socket: meaningful? How?

From: WEI QU (wei@cs.dal.ca)
Date: Tue Jun 05 2001 - 15:39:37 EST


Hi, all,

I want to send a UDP packet to another box in the network, I need to
reduce the system cost of sending these UDP packets to as low as possible.
Now my question is:

1) Is it meaningful to send the UDP packet via raw socket rather than
common UDP socket? Because even the UDP software in the network stack do
only a little work on the data I write to the UDP socket.

2) If I need to send the UDP packet through the raw socket without the
IP_HDRINCL option on, how should I fill in the UDP checksum field of UDP
header? The checksum will consider the pesudo header, does it mean I have
to construct the pesudo header by myself just for the checksum
computation?

3) I find a example of sending UDP packet through raw socket with
IP_HDRINCL option set, unfortunately I can not find the *udpiphdr struct*
on Linux, neither can I find it in the sample code of this book.(UNIX
Network Programming, v1,e2, Figure 26.13). Is this structure system
dependent?

Thanks in advance and every feedback will be deeply appreciated!
  

============================================================
Wei Qu
Graduate Student, Research Assistant
Faculty of Computer Science, Dalhousie University
E_Mail: wei@cs.dal.ca
Home : http://www.cs.dal.ca/~wei/
************************************************************
May you have warm words on the cold evening, a full moon on
the dark night, and a smooth road all the way to your door.
============================================================

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org



This archive was generated by hypermail 2b29 : Thu Jun 07 2001 - 21:01:16 EST