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

S

sreehari

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...
 
V

VJ

sreehari said:
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
 
S

sreehari

VJ said:
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 ?
:(
 
V

VJ

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




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)
 
S

sreehari

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.
 
Z

Zara

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
 
S

sreehari

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.
 
V

VJ

sreehari said:
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top