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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
============================================================

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


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux