Re: Help Broadcasting a UDP packet on the LAN:URGENT

From: Bruce M Simpson (bms_at_spc.org)
Date: 10/20/03

  • Next message: Barney Wolff: "Re: Help Broadcasting a UDP packet on the LAN:URGENT"
    Date: Mon, 20 Oct 2003 20:00:19 +0100
    To: sarat chandra Annadata <saratchandra_a@yahoo.com>
    
    

    On Mon, Oct 20, 2003 at 10:47:51AM -0700, sarat chandra Annadata wrote:
    > I am need of some urgent techinical help to pull me out of a little problem. I have been
    > trying to broadcast a UDP packet(actually it is a DHCP offer packet) but
    > havent' successfully done it sofar. The following is the descripttion
    > about how I have been trying to do it.
    > 1) I am creating a socket with sock_dgram option.
    > 2)Next I am filling up the sockaddr_in structure, with IP address
    > 255.255.255.255 and port number as DHCP client port number.
    [snip]

    Undirected broadcasts will only work if you do the following:-

     1) Use a version of FreeBSD which supports the IP_ONESBCAST socket
        option. I committed this to HEAD and RELENG_4 branches somewhat over
        a month ago. Backporting the patch shouldn't be too difficult.

     2) Enable the IP_ONESBCAST and SO_BROADCAST ip/socket level options.

     3) Discover the IP broadcast address corresponding to the interface upin
        which you wish to send the datagram.

     4) Use the sendto() or send() socket calls to send the datagram, *with
        the interface's IP broadcast address set as the destination*.

    The directed broadcast address is substituted with 255.255.255.255 at
    send time, after routing takes place, and before the datagram is handed off
    to the lower-layer network card drivers.

    BMS
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"


  • Next message: Barney Wolff: "Re: Help Broadcasting a UDP packet on the LAN:URGENT"

    Relevant Pages

    • Receiving INADDR_BROADCAST packets
      ... Ok, the broadcast sending problem is solved, as far as I'm concerned. ... Possibly conditionalise this interface based on a socket-level option. ... I'm an interface-bound socket and I'd like undirected ... I already cache the interface index in my internal RIB and track RTM_IFINFO, ...
      (freebsd-net)
    • Re: Linux, IO::Socket::INET and recving broadcasted UDP
      ... destination udp port = 68) but my socket never receives it. ... Can you recieve other broadcast datagrams? ... Have you tried using a PF_PACKET socket? ... receive broadcasts a UDP socket has to be bound to the wildcard ...
      (comp.lang.perl.misc)
    • Re: Odd routing problem
      ... >>socket gets closed by the system or by ntpd after $NUM errors. ... > did it) - but while it's one socket per interface, ... So it drops the socket but keeps on sending to the broadcast address ...
      (comp.unix.bsd.freebsd.misc)
    • XP UDP broadcast
      ... and opens a broadcast UDP socket. ... The packets are received ... the sending script on windows2000. ...
      (perl.beginners)
    • Re: System.Net.Sockets.SocketException -UDP
      ... > an deinen Port gesendet werden. ... > Klar muss das der selbe Socket sein. ... > Empfangen in der selben Klasse gruselig? ... UDPs senden als Broadcast an Port 19000 --> klappt ...
      (microsoft.public.de.german.entwickler.dotnet.csharp)