Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #3711
| From | Grant Edwards <invalid@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Problem receiving UDP broadcast packets. |
| Date | 2011-04-20 14:30 +0000 |
| Organization | PANIX Public Access Internet and UNIX, NYC |
| Message-ID | <iomqll$e32$3@reader1.panix.com> (permalink) |
| References | (1 earlier) <4dae172e$0$65870$e4fe514c@news.xs4all.nl> <iol5dm$rdb$2@reader1.panix.com> <4dae1d82$0$81483$e4fe514c@news.xs4all.nl> <iol7bu$ah2$1@reader1.panix.com> <mailman.620.1303282060.9059.python-list@python.org> |
On 2011-04-20, Heiko Wundram <modelnine@modelnine.org> wrote:
> Am 20.04.2011 01:54, schrieb Grant Edwards:
>> I guess the problem is that I expected to receive a packet on an
>> interface anytime a packet was received with a destination IP address
>> that matched that of the the interface. Apprently there's some
>> filtering in the network stack based on the _source_ address as well
>> (that seems very counter-intuitive to me).
>
> Just to pitch in here (because nobody's mentioned it yet AFAICT): yes,
> there's a filtering done (at least under Linux, and I'd guess something
> similar on xBSD too) to packets based on the source address coming in on
> an interface, and it's called the reverse path filter and is on by
> default (the tunable on Linux is /proc/sys/net/ipv4/conf/*/rp_filter).
Brilliant! While I had determined that such filtering took place, I'd
been unable to figure out if it was configurable.
> The idea behind the reverse path filter is that your machine won't
> accept packets coming in over an interface when a return packet (i.e.,
> the presumed response) won't be routed over the same interface, and from
> what I gather, this is what makes the TCP/IP stack drop the packets
> because your machine will not route packets to 192.168.x.x over the same
> interface it sees the packet coming in. This is a _security_ feature,
> because it makes address spoofing harder.
And it's an eminently sensible feature.
> If you need to see the packets regardless, either use a promiscuous mode
> sniffer (i.e., tcpdump, but that's relatively easy to mirror in Python
> using SOCK_RAW, capturing packets at the ethernet level), or add a route
> on your system for the 192.168.x.x network on the same interface.
I've thought about the SOCK_RAW option, but the CPU load of looking
all received Ethernet packets in user-space would be a big down-side.
Adding the route isn't an option since 1) the device doesn't know what
route to add, and 2) adding such a route could break the normal
networking operation.
--
Grant Edwards grant.b.edwards Yow! My haircut is totally
at traditional!
gmail.com
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-19 22:21 +0000
Re: Problem receiving UDP broadcast packets. Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2011-04-20 01:13 +0200
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-19 23:21 +0000
Re: Problem receiving UDP broadcast packets. Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2011-04-20 01:40 +0200
Re: Problem receiving UDP broadcast packets. Dan Stromberg <drsalists@gmail.com> - 2011-04-19 16:52 -0700
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 00:09 +0000
Re: Problem receiving UDP broadcast packets. Chris Angelico <rosuav@gmail.com> - 2011-04-20 10:53 +1000
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 01:15 +0000
Re: Problem receiving UDP broadcast packets. Chris Angelico <rosuav@gmail.com> - 2011-04-20 11:24 +1000
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 03:05 +0000
Re: Problem receiving UDP broadcast packets. Dan Stromberg <drsalists@gmail.com> - 2011-04-19 20:12 -0700
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 14:31 +0000
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 15:42 +0000
Re: Problem receiving UDP broadcast packets. Dan Stromberg <drsalists@gmail.com> - 2011-04-19 20:16 -0700
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 14:21 +0000
Re: Problem receiving UDP broadcast packets. Dan Stromberg <drsalists@gmail.com> - 2011-04-20 18:35 -0700
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-21 14:22 +0000
Re: Problem receiving UDP broadcast packets. Heiko Wundram <modelnine@modelnine.org> - 2011-04-21 08:22 +0200
Re: Problem receiving UDP broadcast packets. Roy Smith <roy@panix.com> - 2011-04-19 23:35 -0400
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 14:23 +0000
Re: Problem receiving UDP broadcast packets. Sherm Pendley <sherm.pendley@gmail.com> - 2011-04-20 06:07 -0400
Re: Problem receiving UDP broadcast packets. Adam Tauno Williams <awilliam@whitemice.org> - 2011-04-20 06:20 -0400
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 15:37 +0000
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-19 23:54 +0000
Re: Problem receiving UDP broadcast packets. Heiko Wundram <modelnine@modelnine.org> - 2011-04-20 08:45 +0200
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 14:30 +0000
Re: Problem receiving UDP broadcast packets. Heiko Wundram <modelnine@modelnine.org> - 2011-04-20 16:53 +0200
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 15:24 +0000
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 15:32 +0000
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 15:50 +0000
Re: Problem receiving UDP broadcast packets. Dan Stromberg <drsalists@gmail.com> - 2011-04-19 16:40 -0700
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 00:00 +0000
Re: Problem receiving UDP broadcast packets. Chris Angelico <rosuav@gmail.com> - 2011-04-20 10:32 +1000
Re: Problem receiving UDP broadcast packets. Thomas Heller <theller@ctypes.org> - 2011-04-20 12:18 +0200
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 14:35 +0000
Re: Problem receiving UDP broadcast packets. Grant Edwards <invalid@invalid.invalid> - 2011-04-20 22:25 +0000
csiph-web