|
Home > Archive > Unix Programming > October 2005 > raw sockets: question about sending IP + UDP header
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
raw sockets: question about sending IP + UDP header
|
|
| Fernando Barsoba 2005-10-24, 3:48 pm |
| Hi all,
I'm working on a IPSec implementation (raw sockets), and the first stage
that I defined for this project involves the following (conceptually):
- First, build an IP datagram and add a UDP header to it. Try to send
the UDP datagram through a raw socket client to a UDP socket server.
Check with Ethereal if communication between hosts is correct, i.e. the
datagram is correctly formed and correctly send/received. (here I want
to test if my IP header and IP checksum is correct plus of course my UDP
header is correct.. though I will get rid of it eventually and start
working on the IPSec header)
Here's my question: I expect that my UDP datagram will be processed and
sent to my UDP socket server through the raw socket.. but, will the
kernel mess with my UDP packet on the client side? (the kernel doesn't
process anything that doesn't recognize in the protocol field, but in
this case it will recognize it as UDP packet)
I hope my question is not too wordy..
Thanks,
FBM
| |
| Barry Margolin 2005-10-24, 3:48 pm |
| In article <wst6f.10140$Io4.15@trnddc06>,
Fernando Barsoba <fbarsoba@verizon.net> wrote:
> Hi all,
>
> I'm working on a IPSec implementation (raw sockets), and the first stage
> that I defined for this project involves the following (conceptually):
>
> - First, build an IP datagram and add a UDP header to it. Try to send
> the UDP datagram through a raw socket client to a UDP socket server.
> Check with Ethereal if communication between hosts is correct, i.e. the
> datagram is correctly formed and correctly send/received. (here I want
> to test if my IP header and IP checksum is correct plus of course my UDP
> header is correct.. though I will get rid of it eventually and start
> working on the IPSec header)
>
> Here's my question: I expect that my UDP datagram will be processed and
> sent to my UDP socket server through the raw socket.. but, will the
> kernel mess with my UDP packet on the client side? (the kernel doesn't
> process anything that doesn't recognize in the protocol field, but in
> this case it will recognize it as UDP packet)
>
> I hope my question is not too wordy..
There's a chapter on Raw Sockets in Unix Network Programming, Vol.1. It
explains which fields the stack will fill in by itself, and which it
will leave alone.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|
|
|
|
|