LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-07-2007, 03:19 AM   #1
estratos
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 85

Rep: Reputation: 15
Broadcast address


Hi all,

After a lot of hours of tests and the great help from Mara (thanks again Mara), I came to the conclusion that Linux (at least for the two systems I tested) only accepts UDP broadcast packets sent to these addresses:

1. 255.255.255.255 (limited bradcast address)
2. The interface broadcast address (ifconfig)

Any other broadcasts are discarded.

I have several machines broadcasting UDP messages to different addresses: 255.255.255.255, 192.168.1.255 and 192.255.255.255. My linux box has these network settings:

IP address: 192.168.1.33
Gateway: 192.168.1.1
Subnet mask: 255.255.255.0 -> Broadcast address = 192.168.1.255

With this config, this machine drops every packet addressed to 192.255.255.255. On the other hand, if I change the broadcast address to 192.255.255.255, then the machine drops broadcasted packets to 192.168.1.255. 255.255.255.255 is the only broadcast address really valid for any config.

Is there any way of accepting any kind of broadcast? Windows XP doesn't have this limitation AFAIK. Why is linux supposed to work in this way?

Thanks,

Daniel.
 
Old 03-07-2007, 05:40 AM   #2
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
That seems like the proper way to do it to me - why would you want to broadcast to a broadcast address outside your network?

Just because Windows does it doesn't mean it's correct in anyway, shape, nor form :P
 
Old 03-07-2007, 06:02 AM   #3
estratos
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 85

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fukawi2
That seems like the proper way to do it to me - why would you want to broadcast to a broadcast address outside your network?

Just because Windows does it doesn't mean it's correct in anyway, shape, nor form :P
I agree with you but many applications broadcast UDP packets to other addresses than the one calculated by the local machine. In theory, a message broadcasted to 10.255.255.255 should be received by any machine within the 10.x.x.x network. Am I wrong?

The 255.255.255.255 address is an exception though. Any packet broadcasted to this address is correctly accepted by any machine, independently of the local broadcast parameter.

Daniel.
 
Old 03-07-2007, 06:10 AM   #4
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
The broadcasts to outside "your" broadcast address will NOT be routed to the other networks.

The only situation I see this working would be when you have multiple IP ranges on the same physical network segment. For Example, 5 computers in the 10.10.10.0/8 range and 5 computers in the 192.168.0.0/24 range, but all 10 computers connected to the same switch.
 
Old 03-07-2007, 06:46 AM   #5
estratos
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 85

Original Poster
Rep: Reputation: 15
A friend is telling me that his Fedora machines (with boradcast=10.20.1.255) see udp packets broadcasted to either 10.20.1.255 and 10.255.255.255. He says that this is not a *nix limitation in his opinion.

Now I'm even more confused...
 
Old 03-07-2007, 07:03 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Maybe the application is wrongly coded?

I checked on Debian and it works, using netcat:

nc -lbvvup 6666 >>>>>>>>> server part

nc -vvbu x.x.x.255 6666 <<<<<<<<<< client part

They talk together. You could do this simple check on your distro.
 
Old 03-08-2007, 02:59 AM   #7
estratos
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 85

Original Poster
Rep: Reputation: 15
You're right, Ethereal is correctly receiving all udp packets (to any broadcast address)... Something is wrong in my application.

Thanks,

Daniel.
 
Old 03-08-2007, 09:02 AM   #8
estratos
Member
 
Registered: Jan 2006
Distribution: Ubuntu
Posts: 85

Original Poster
Rep: Reputation: 15
Sorry, this issue has nothing to do with the application definitely. Ethereal reads all packets, even those not addresses to my machine, so forget my precedent post.

FYI, the same application is running fine (does see any packet sent to any broadcast address) on my friend's computer (FC4).

Why are Ubuntu and FC4/5 treating broadcasted packets differently? Don't they share the same tcp/ip stack? Could my machine be filtering the incoming traffic in some way?

Please, any advice is welcome.

Daniel.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to ping broadcast address blackzone Linux - Networking 1 08-27-2006 09:52 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
-b Allow pinging a broadcast address. suguname Linux - Newbie 2 02-24-2005 07:42 AM
Don't know what broadcast address is? blmartin777 Debian 10 05-07-2004 02:06 PM
question about network address and broadcast address yuzuohong Linux - Networking 1 09-18-2002 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration