From owner-freebsd-net Fri Sep 29 10:12:26 2000 Delivered-To: freebsd-net@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id C5BE137B422 for ; Fri, 29 Sep 2000 10:12:21 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.9.3/1.13) id UAA51234; Fri, 29 Sep 2000 20:12:12 +0300 (EEST) Date: Fri, 29 Sep 2000 20:12:12 +0300 From: Ruslan Ermilov To: Ping Yuan Cc: freebsd-net@freebsd.org Subject: Re: IP header. Message-ID: <20000929201212.A50668@sunbay.com> Mail-Followup-To: Ping Yuan , freebsd-net@freebsd.org References: <007a01c02a33$f910f270$42042a80@teddy.ece.rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <007a01c02a33$f910f270$42042a80@teddy.ece.rice.edu>; from pyuan@ece.rice.edu on Fri, Sep 29, 2000 at 11:40:26AM -0500 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Fri, Sep 29, 2000 at 11:40:26AM -0500, Ping Yuan wrote: > >On Fri, Sep 29, 2000 at 11:04:39AM -0500, Ping Yuan wrote: > >> Hi, > >> > >> I am now writing a traffic generator. I want to write something in the IP > >> header of every packet before I send it out. Is this possible? If yes, > how > >> to implement it? If not, is there any other solutions? > >> > >You can do that by constructing an IP packet with header and sending it to > >raw IP socket with IP_HDRINCL socket option set. See ip(4) page for > details. > > > > Then, will this IP header be the header of the UDP packet I generated? I > mean, if I run tcpdump at the destination host to monitor all the UDP > packets, can the bits I set in the ip header be identified? > Yes, if you set the ip_p field to IPPROTO_UDP. Please also note that ip_id field (if not-zero) should be given in network byte order, while ip_off and ip_len fields in host byte order. -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message