CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: Broadcasting in Networks

  1. #1
    Join Date
    Nov 2007
    Posts
    4

    Broadcasting in Networks

    Hi ,
    I am doing a project in networking.I have some nodes like 20 nodes and i start sending a packet from a node and broadcast that packet to its neighbours.I could implement till sending of packet to first neighbour but i m having a problem with broadcasting..could anyone help me out with this...like could you suggest me how to go about it or if there is any code which i can use...

    thanks,
    aravind

  2. #2
    Join Date
    Jul 2001
    Location
    Otaki, New Zealand
    Posts
    303

    Re: Broadcasting in Networks

    What you are doing is multicasting which requires a UDP connection and special IP address ranges. I suggest you start with a Google search for UDP multicast and see what turns up.

    Regards
    Alan

  3. #3
    Join Date
    Nov 2007
    Posts
    4

    Re: Broadcasting in Networks

    Hi Alan,
    I am actually working on AODV routing protocol....so i tried to implement it in c++ but jus got struck at broadcasting....

    Thanks,
    aravind

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,153

    Re: Broadcasting in Networks

    [ moved thread ]
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  5. #5
    Join Date
    Nov 2007
    Posts
    4

    Re: Broadcasting in Networks

    thank you for moving into network programming...could anyone give me a code for broadcasting a packet in network....

  6. #6
    Join Date
    May 2006
    Location
    Indonesia & Japan
    Posts
    399

    Re: Broadcasting in Networks

    It's simple. You just send packet to broadcast address.
    i.e.
    Your network: 192.168.1.0/24, then
    broadcast address will be 192.168.1.255
    henky
    ----------------------------------
    henky@nok.co.id is not my email address anymore...
    Jangan Pernah Menyerah

  7. #7
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: Broadcasting in Networks

    And set the SO_BROADCAST socket option.

  8. #8
    Join Date
    Nov 2007
    Posts
    4

    Broadcasting in Networks

    Actually i am doing my program in c++

    thanks

  9. #9
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: Broadcasting in Networks

    Quote Originally Posted by jimmy.peyton.v
    Actually i am doing my program in c++

    thanks
    Yes, the information we gave you is for C/C++ programming.

    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)