Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
768 views
in Technique[技术] by (71.8m points)

networking - UDP broadcast packets across subnets

Is it possible to send a UDP broadcast packet to a different subnet through a router? I'm writing an app to discover certain devices on the network, and the PC might be on a different subnet than the devices it's looking for.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, and no.

It's actually do-able, so long as the intervening routers don't have no ip directed-broadcasts or similar configured. However these days that's the default because allowing normal broadcasts to traverse routers is a DoS problem.

If you really want to broadcast across subnets then you should be using IP Multicast instead. That still requires that the intervening routers are configured appropriately, but it is the "right" way to do it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...