[NTLUG:Discuss] Routing BROADCAST messages.
Steve Baker
sjbaker1 at airmail.net
Fri Aug 18 13:21:31 CDT 2000
Rusty Haddock wrote:
> Steve,
> Sounds like the broadcast address you're using in your program might
> not be correct. I'm almost thinking that might be '0.0.0.0' or
> '255.255.255.255'. I've attached a UDP broadcaster, in C, that I wrote
> many moons ago. It's intention was to broadcast small packets of data
> and, any machine on the net that wanted to listen would simply listen on
> the pre-arranged IP port and soak up the data. Maybe it'll help.
OK - so I looked at your code - and the network-related parts are indeed
identical to my own code *except* for the choice of broadcast address.
#define APRS_BRDCST_ADDR 0xc0a806ff /* 192.168.6.255 */
...which seems awfully like something special on your own network...
apart from the '255' on the end.
OK - so I know why you chose 192.168.xx.xx - that's the right choice
for an internal network - which is what I have. I guess the '255'
at the end means "Broadcast" - so does the '6' have any special
significance?
All my machines have 192.168.0.xx addresses.
If I run my code with 192.168.6.255, I don't get any errors - but
my program doesn't see it's own messages reflected back on the same
port - and no packets are being sent out on the 10baseT port.
If I hang up the modem so PPP shuts down, I get a "Network is
unreachable" error from 'sendto' - which makes sense - none of
my machines are on a 192.168.6.xx sub-net and we are (hopefully)
on a class C network here.
If I change it to use 192.168.0.255 (which makes some kind of
sense because all my machines have 192.168.0.xx local addresses)
then the machine can see it's own messages being reflected back
at it - but there are still no messages going down the local
10baseT lines - and (of course) none of the other machines
can see those messages. This behavior is the same whether
the modem is connected to my ISP or not. I know the 10baseT
stuff is working because my home network is functioning perfectly
and I routinely run NFS from the same computer.
I've been looking at the 'ifconfig' output - and I notice that
both 'dummy0' and 'eth0' mention 'Bcast:192.168.0.255'. Is this
dummy0' thing swallowing correctly broadcast packets or something?
ifconfig (with the modem hung up) says:
dummy0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.0.97 Bcast:192.168.0.255 Mask:255.255.255.255
inet6 addr: fe80::/10 Scope:Link
inet6 addr: fe80::200:ff:fe00:0/10 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1228 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
eth0 Link encap:Ethernet HWaddr 00:50:BA:A2:99:6E
inet addr:192.168.0.97 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::50:baa2:996e/10 Scope:Link
inet6 addr: fe80::250:baff:fea2:996e/10 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:56128 errors:0 dropped:0 overruns:0 frame:0
TX packets:59594 errors:0 dropped:0 overruns:0 carrier:0
collisions:497 txqueuelen:100
Interrupt:12 Base address:0xe000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:2874 errors:0 dropped:0 overruns:0 frame:0
TX packets:2874 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
...and when PPP is up and running, it adds:
ppp0 Link encap:Point-to-Point Protocol
inet addr:207.136.61.123 P-t-P:208.21.224.5 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:552 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
What the heck is 'dummy0' anyway?
--
Steve Baker HomeEmail: <sjbaker1 at airmail.net>
WorkEmail: <sjbaker at link.com>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
More information about the Discuss
mailing list