In article <GuudnRE21oid4izanZ2dnUVZ_sOrnZ2d RemoveThis @comcast.com>,
glen herrmannsfeldt <gah RemoveThis @ugcs.caltech.edu> wrote:
>>>It is usual for UDP to accept packets sent to any interface.
>>>If a program binds to a specific interface when it isn't required,
>>>I would consider it a defect.
>
>> On the contrary, in servers for UDP based applications, failing
>> to bind to specific network interfaces is generally a serious bug,
>> or least evidence that the application is a toy.
>
>> When the server answers a request, it must send with the same source
>> IP address and port number as the client used for its destination IP
>> address and port number. Otherwise the response is quite likely to be
>> discarded by firewalls near near either end of the path.
>
>"Be Liberal in What You Accept, Conservative in What You Send"
>would seem to apply here.
That does not and should not apply to firewalls.
> The server should return using the
>original destination address and port.
That's what I said, and generally the best and often only way to
do that is to bind individual sockets to interfaces. That is why
it Glen Herrmannsfeldt original claim quoted above about it being
a bug for a program to bind to a specific interface is wrong.
> The client should, if
>possible, accept it even with the wrong source address and port.
Safe firewalls should not be (only) on the system running the
application; so called "personal firewalls" run on Windows boxes
are junk, as demonstrated by the malware that turns them off.
A firwall running on a separate system in the path cannot recognize
a UDP packet from a strange source because it doesn't know what
applications are being run. It is thus generally not possible for
a system consisting of an application computer protected by a
separate firewall to accept packets from an unexpected source.
For that matter, even firewalls on the system running the application
generally cannot recognize packets from strange sources.
Of course, authorization checks based on source IP address are
extremely weak, but every little bit helps, particularly when trying
to protect Windows boxes.
You can tell people running your UDP based application to treat
your UDP port like port 53, but that often does not work. People
resist opening ports in their firewalls. See for examples
http://www.google.com/search?q=treat+port+6277+like+port+53
>As I learned accidentally once, binding to a specific address does
>not bind to an interface. If the datagram comes in on a different
>interface, it will still be accepted. Otherwise it would have to
>go out, find another router, and then come back in the other interface.
"Bind to an interface" is almost universally understood as shorthand
for "bind to an IP address configured on a network interface."
>> Even in socket implementations with extensions that tell the application
>> the destination addresses of received UDP datagrams, the application
>> generally wants to have bound the socket from which it sends the response
>> to control the source address of the response. Binding a socket for
>> every response wastes CPU cycles, which argues for having outgoing
>> sockets bound to specific interfaces. Those bound sockets for sending
>> responses may as well be used for receiving requests.
>
>I haven't looked at UDP NAT logic lately.
What's that about "UDP NAT logic" and where would one look at it?
There is no global specification of firewalls or NAT. There are
descriptions of current and previous notions of NAT, but its a moving
target. There obviously should be no global specification of
firewalls...well, except for something like "protect and serve."
> It wouldn't seem hard
>for it to do it based only on the source address of the outgoing
>data, and so the destination address of the incoming data.
Stateful firewalls are not exactly new products. See
http://www.google.com/search?q=udp+stateful+firewall
> The main
>problem I remember with UDP is that there is no way to know when to
>remove a NAT entry. If they don't time out fast enough, there may
>not be enough port numbers for the needed translations. If they
>time out too fast, and the reply comes back slowly, the connection
>might fail.
NAT is not a part of a firewall, although it is often also provided on
boxes that are firewalls. It makes as little sense to talk about NAT
as a firewall as to talk about converting between DLS signalling and
802.3 as a firewall on the grounds that so called "DSL modems" also
include firewall functions
"Port numbers" are not the resource for which there might be too few
in either NAT or a stateful firewall, but table entries. Only some
forms of NAT involve translating port numbers, and for those that don't
there can be no shortage.
Vernon Schryver vjs RemoveThis @rhyolite.com
>> Stay informed about: WakeONLAN did not work for direct cable connection ? (Nics..