Re: raw sockets: question about sending IP + UDP header

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 10/22/05

  • Next message: Henry Townsend: "Re: wait(pid) problem"
    Date: Sat, 22 Oct 2005 12:40:03 -0400
    
    

    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 ***
    

  • Next message: Henry Townsend: "Re: wait(pid) problem"

    Relevant Pages

    • Re: Fw: F_SETSIG broken/changed in 2.6 for UDP and TCP sockets?
      ... >> Under Fedora things work well for raw sockets (much lower latency ... but are inconsistent with udp or tcp sockets. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Sending packet with spoofed IP address
      ... >From XP SP2 you can't use raw sockets for TCP and for UDP only with correct ... > Are these going to be UDP packets? ... > way to create a TCP connection without a correct source IP address. ... >> use a protocol driver. ...
      (microsoft.public.development.device.drivers)
    • Re: Ping abschicken?
      ... - RAW sockets können keine UDP frames senden, ... Da aber die Ping-Frames weder TCP noch UDP sind, ... Next by Date: ...
      (microsoft.public.de.vc)
    • Re: How to use ipfw to restrict a certain user?
      ... No UDP, no ICMP, no RAW ... no other TCP connections than the tunnel described above. ... o raw sockets can only be created as root. ...
      (comp.unix.bsd.freebsd.misc)
    • raw sockets: question about sending IP + UDP header
      ... the UDP datagram through a raw socket client to a UDP socket server. ... to test if my IP header and IP checksum is correct plus of course my UDP ...
      (comp.unix.programmer)

    Loading