Strange: Cannot recieve UDP packets that are broadcast on the network.

Discussion in 'C++' started by sreehari, Nov 14, 2006.

  1. sreehari

    sreehari Guest

    Hi All,

    I have this problem,

    I have developed a Master - Slave kinda appliacation , were the slave
    is generally a device.when i broadcast a message from my application,
    the Device seems to recieve the message and responds correctly, and
    replies with a broadcast frame. Here is where i face the problem, what
    happens is that my application seems to Time out even if Ethereal (
    Network Sniffer ) detects and shows all the frames that were
    broadcasted.

    I have used a Event based approach for the sockets ( Winsock 1.1 for
    UDP ) in C++ . I never faced this problem when it was being simulated
    here ( Windows 2000 machine ) , using another computer on the same
    network, that ran a Third part server. But when i went on site and
    tested it with a actualy device ( ran My application on a Xp Machine ),
    i noticed this problem.

    Thank you in Advance...
     
    sreehari, Nov 14, 2006
    #1
    1. Advertising

  2. sreehari

    VJ Guest

    Re: Strange: Cannot recieve UDP packets that are broadcast on thenetwork.

    sreehari wrote:
    > I have developed a Master - Slave kinda appliacation , were the slave
    > is generally a device.when i broadcast a message from my application,
    > the Device seems to recieve the message and responds correctly, and
    > replies with a broadcast frame. Here is where i face the problem, what
    > happens is that my application seems to Time out even if Ethereal (
    > Network Sniffer ) detects and shows all the frames that were
    > broadcasted.


    Ethereal detects all packets on the hardware, therefore it means your
    packet was received, but blocked by a higher layer

    > I have used a Event based approach for the sockets ( Winsock 1.1 for
    > UDP ) in C++ . I never faced this problem when it was being simulated
    > here ( Windows 2000 machine ) , using another computer on the same
    > network, that ran a Third part server. But when i went on site and
    > tested it with a actualy device ( ran My application on a Xp Machine ),
    > i noticed this problem.


    Can be anything, most likely blocked ports...

    Anyway, if it works on one machine and not another - most likely not a
    c++ problem :d
     
    VJ, Nov 14, 2006
    #2
    1. Advertising

  3. sreehari

    sreehari Guest

    VJ wrote:
    > Ethereal detects all packets on the hardware, therefore it means your
    > packet was received, but blocked by a higher layer
    >

    so do u suggest that implementing somethin in Raw Sockets, ( tho have
    never done that befo ) would be helpful in such case ?

    > Can be anything, most likely blocked ports...
    >
    > Anyway, if it works on one machine and not another - most likely not a
    > c++ problem :d


    Yup , has nothin to do with C++, but i just wanted to confirm if it had
    to do with enabling if any socket flags while implementation. Well but
    again like ya said, since it works on One machine , why not the other ?
    :(
     
    sreehari, Nov 14, 2006
    #3
  4. sreehari

    VJ Guest

    Re: Strange: Cannot recieve UDP packets that are broadcast on thenetwork.

    sreehari wrote:
    > VJ wrote:
    >
    >>Ethereal detects all packets on the hardware, therefore it means your
    >>packet was received, but blocked by a higher layer
    >>

    >
    > so do u suggest that implementing somethin in Raw Sockets, ( tho have
    > never done that befo ) would be helpful in such case ?
    >
    >
    >>Can be anything, most likely blocked ports...
    >>
    >>Anyway, if it works on one machine and not another - most likely not a
    >>c++ problem :d

    >
    >
    > Yup , has nothin to do with C++, but i just wanted to confirm if it had
    > to do with enabling if any socket flags while implementation. Well but
    > again like ya said, since it works on One machine , why not the other ?
    > :(
    >


    Yes, the socket is wrongly configured. You can check next things:
    1) wrong server and client names provided
    2) blocked ports
    Most likely one these 2 (or both)
     
    VJ, Nov 14, 2006
    #4
  5. sreehari

    sreehari Guest

    > Yes, the socket is wrongly configured. You can check next things:
    > 1) wrong server and client names provided
    > 2) blocked ports
    > Most likely one these 2 (or both)


    Not sure what you ment by wrong server and client names ? cos AFAIK
    using UDP , when one broadcasts a message , there is no specific
    recipient, and hence it has to be recieved by all open ports on that
    network.

    Another thing regarding blocked ports,
    the device that i am talking about, sends me two kinds of messages,
    one it sends directly to my computers Ip address, which i recieve with
    out any problem, and the second, it broadcasts to the whole network for
    which my application fails to read and times out.

    The same setup when i run it with a 3rd party application ( instead of
    my application i run the 3rd party application on my comp and
    communicate it with the device, so the remaining set up is the same )
    the third party application seems to read all the packets with out any
    problem, when both my application and the 3rd party application send
    and recieve the same kind of frames from and to the device.
     
    sreehari, Nov 14, 2006
    #5
  6. sreehari

    Zara Guest

    On 14 Nov 2006 03:39:00 -0800, "sreehari" <>
    wrote:

    >> Yes, the socket is wrongly configured. You can check next things:
    >> 1) wrong server and client names provided
    >> 2) blocked ports
    >> Most likely one these 2 (or both)

    >
    >Not sure what you ment by wrong server and client names ? cos AFAIK
    >using UDP , when one broadcasts a message , there is no specific
    >recipient, and hence it has to be recieved by all open ports on that
    >network.
    >
    >Another thing regarding blocked ports,
    > the device that i am talking about, sends me two kinds of messages,
    >one it sends directly to my computers Ip address, which i recieve with
    >out any problem, and the second, it broadcasts to the whole network for
    >which my application fails to read and times out.
    >
    >The same setup when i run it with a 3rd party application ( instead of
    >my application i run the 3rd party application on my comp and
    >communicate it with the device, so the remaining set up is the same )
    >the third party application seems to read all the packets with out any
    >problem, when both my application and the 3rd party application send
    >and recieve the same kind of frames from and to the device.


    Although this is OffTopic, I will try to give you a hint: are you
    using socket function "connect"? If it is so, please read connect
    description and you will see why all this is happening to your
    porgram.

    Regards,

    Zara
     
    Zara, Nov 14, 2006
    #6
  7. sreehari

    sreehari Guest

    On Nov 14, 5:09 pm, Zara <> wrote:
    > Although this is OffTopic, I will try to give you a hint: are you
    > using socket function "connect"? If it is so, please read connect
    > description and you will see why all this is happening to your
    > porgram.
    >
    > Regards,
    >
    > Zara


    Have not used the "connect" function as its an UDP , datagram, and is
    a connection less sockets, also when doing a broadcast , not sure which
    Ip to connect to ?

    regarding the Off topic post, did not get any response from the correct
    groups, programmer.winsock, and so on, also since its coded in C++,
    posted it here.
     
    sreehari, Nov 14, 2006
    #7
  8. sreehari

    VJ Guest

    Re: Strange: Cannot recieve UDP packets that are broadcast on thenetwork.

    sreehari wrote:
    >
    > On Nov 14, 5:09 pm, Zara <> wrote:
    >
    >>Although this is OffTopic, I will try to give you a hint: are you
    >>using socket function "connect"? If it is so, please read connect
    >>description and you will see why all this is happening to your
    >>porgram.

    >
    > Have not used the "connect" function as its an UDP , datagram, and is
    > a connection less sockets, also when doing a broadcast , not sure which
    > Ip to connect to ?
    >


    When you use UDP, you do not connect. When broadcasting, all computers
    in a network gets a message, therefore no need to supply an IP.

    I havent used broadcasting, so cant tell more :(

    Tried looking other newsgroups? Or googling for UDP broadcast?
     
    VJ, Nov 14, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    5,791
  2. Replies:
    0
    Views:
    463
  3. Adam Balgach
    Replies:
    4
    Views:
    379
    John Harrison
    Sep 28, 2004
  4. Grant Edwards

    Problem receiving UDP broadcast packets.

    Grant Edwards, Apr 19, 2011, in forum: Python
    Replies:
    34
    Views:
    3,205
    Grant Edwards
    Apr 21, 2011
  5. Joel VanderWerf

    how to broadcast UDP packets

    Joel VanderWerf, Jan 22, 2004, in forum: Ruby
    Replies:
    8
    Views:
    250
    Florian Frank
    Jan 25, 2004
Loading...

Share This Page