On Apr 29, 5:50*am, Maxwell Lol <nos...@com.invalid> wrote:
> My point is that while the TCP protocol can a mechanism to slow down
> congestion at the routers, UDP does not.
Right, but we're not talking about using UDP. We're talking about
using a protocol layered on top of UDP. In general, routers don't
handle TCP packets any different from UDP packets, and to the extent
they do, I know of no difference that's critical to denial of service
attack mitigation.
> So while both TCP and UDP connections can both overload servers and
> routers, a router cannot tell a UDP client to slow down.
Yes, it can. It can delay or drop the UDP packets, just as it does
with TCP packets.
> If the Distributed Denial of Service attack's purpose was to consume
> incoming bandwidth, a TCP-based attack can be addressed by the
> routers, and the server.
So can a UDP attack the same way.
> However, a UDP-based attack would not be automatically blocked by the
> routers.
Neither would a TCP-based attack. I don't know what automatic router
blocking technique you're thinking of, but I don't think it actually
exists. Service providers don't treat TCP packets any differently from
UDP packets and once you get to the server, it's too late to stop an
attack that congests inbound bandwidth.
> I still don't know what you are proposing. I understand and have used
> DCCP, which is like UDP with congestion control. But it's not reliable.
If you don't know the proposal, how can you conclude that it will be
vulnerable to denial of service attacks then?
> Now ASSUMING you solved the reliability problems with a new
> application layer on top of UDP, (and since I haven't seen any of your
> ideans on this, so I think the whole thought experiment is silly) you
> also have the problem that the client can ask a server for bandwidth
> and CPU consuming requests using UDP.
And the server can simply drop the UDP packets. That's much cheaper
than TCP that requires session establishment and tear down.
> EVen if the incoming connection is not saturated, the CPU and outgoing
> connection can easily be saturated, because the query costs nearly
> nothing. It's the response that matters.
Then, duh, you DON'T RESPOND TO THE QUERY. See how simple it is?
Whereas with TCP, it's too late. Once you've established a connection,
you have to tear it down.
> > Perhaps you're thinking that the server would get overwhelmed by the
> > requests if they were TCP. Sure, because the server has to create
> > state and has to send tear down packets and so on. But they're UDP.
> > The server just has to inspect and drop them. It's quick and
> > efficient.
> TCP has state, AND sequence numbers. That's wht the server can inspect
> and drop bogus packets.
> But UDP does not have these characteristics.
So what?
> So HOW can a server decide if this UDP request is legit or not?
> And if an attacker can generate one authorized UDP packet,
> it can generate a million more.
Simple, you put a sequence number in the UDP packet. If the sequence
number is not valid, the server drops it. Dropping a packet in user
space is cheap.
> > So what? The server OS would have to process the packet even if the
> > server weren't listening. And the server's processing of the packet
> > can consist simply of dropping it. During an attack scenario, the net
> > cost of a UDP packet is way less than the net cost of a TCP packet.
> You still haven't describe a mechanism that allows a web server to
> decide that this UDP packet is legit, but a million other nearly
> packets are fake.
You put a token in the beginning of the packet. If the token is
invalid or abused, you drop the UDP packet. It's really that simple.
> In fact, the packets could even be identical. Web servers don't reject
> duplicate requests.
We're not talking about a web server, we're talking about *THIS*
protocol. If this protocol says "drop duplicate requests", then a
proper implementation will drop duplicate requests.
You are, again, assuming a completely broken specification and then
complaining that the specification is completely broken. Try assuming
a non-idiotic specification.
> > But they're not even if it's not listening for UDP. Just hit it with
> > UDP packets anyway, say on its DNS port. The relative cost of a
> > listened-to UDP packet and a user-space dropped UDP packet is just a
> > bit of server CPU, and the server CPU typically vastly outpaces the
> > network connection.
> Sigh....
>
> Let me repeat my point.
>
> Assuming someone can create UDP-based mechanism to fetch web pages
> (and since this is nonsense, I don't know why I am continuing to
> debate this point), using UDP-based web services makes it easier to
> overload the server.
How? The network treats them the same. Once you get to the server
machine, it's a non-issue. You're not going to overwhelm the machine.
At least with UDP, you can spare the network and the server kernel the
overhead of session setup and tear down.
> Yes, UDP-based attacks exist, But your proposal requires a legitimate
> UDP-based web request. *Once you do that, all the problems I am
> talking about occur, and so far you have not explained how a web
> server will accept one UDP-based web request, and reject a million
> other requests.
Right, that's because we don't have the protocol specification yet.
You are claiming it's not possible to develop such a specification
because of inherent problems with UDP. But all of your complaints are
trivially solvable.
The solution to this one is simple: if the server detects it is under
attack, it switches to a mode in which each UDP query must contain a
valid, unabused token. Queries without one are simply dropped.
Legitimate clients are programmed to send one UDP request, and if it's
not replied to, they send a TCP request that includes a request for a
token.
Dropping a UDP packet with no valid token is no more expensive than
dropping a TCP packet. There are advantages and disadvantages on both
sides. With TCP, if the server drops it, the kernel has to tear down
the TCP session. With UDP, it doesn't. But with UDP, the drop has to
take place in user space. More or less, it's a wash.
> > Actually, that's not quite true. Router can tell UDP clients to slow
> > down by delaying their packets.
> Not true.
How do you figure?
> Clients don't know unless an application on the receiving side
> notifies them. And the clients decide to be nice and slow down.
Right. If you assume an attacker will be nice, then this will work for
both TCP and UDP. If you don't, it won't work for either TCP or UDP.
And, again, someone can flood you with UDP whether or not you are
listening for it.
> >And in practice, routers don't
> > mutilate TCP packets. Even though ECN is available, it's not very
> > widely supported and there's no evidence it's a critical part of
> > protecting against attacks. In any event, UDP can use ECN as well as
> > TCP.
> Theoretically, and if the client wants to use it.
> Evil clients would not want to use it.
For both TCP and UDP. So this is not an issue.
> >> Given an attacker can send a millions requests to download an ISO
> >> image with zero overhead, and the server has to process each one, it
> >> seems likely the server would fail first. Especially if the client
> >> isn't listening. (or the client targets the server to send to a third party)
> > If the packets were hurting the server, it can simply drop them. If it
> > did that to TCP, it would have to tear down the connection. The
> > benefits of UDP being connectionless easily make up for the slight
> > extra cost of having to drop the packet in user space.
> The benefits also make it easier to create connections on the client side..
That's a negligible difference since compromised clients will find it
plenty easy and uncompromised clients can still flood you with UDP
even if you're not listening for it. Once the packet reaches the
server, the damage is all already done.
> And since the cost to the server is much greater than the cost to the client,
> it's much easier for clients to overload a server.
Except it won't overload the server. A typical server will barely
break a sweat dropping a full pipe of bogus UDP requests. So long as
the application provides a way to easily detect bogus requests (which
is trivial as I've explained), it doesn't matter.
> > Any sensible server would have a fast path to drop suspicious packets
> > during an attack. The protocol could specify, for example, that you
> > send one UDP packet and if you get no reply, you must use a TCP
> > request to obtain a validation token. Then each subsequent UDP request
> > can contain that token. A packet with an invalid or abused token can
> > be dropped immediately.
> So an evil client can
> * *request a token using TCP
> * *Get a token
> * *Generate 10,000 UDP requests using that token.
> * *repeat
>
> Now consider 10,000 evil clients.
This is *NO* different from the following scenario:
1) An evil client issues a web request using TCP.
2) The client then floods the server with 10,000 UDP packets to a
random port.
3) Repeat for 10,000 evil clients.
You think the server CPU won't be able to drop the UDP packets?!
Seriously?
> First of all, these UDP requests have to handled by the server.
> And they have to be examined individually.
So what? A CPU is way faster than the Internet.
> An attacker can also create arbitrate UDP packets with random source
> addresses and ports.
> So we have a stream of datagrams, and the server has to examine each
> and every one. How will it determine which packets are legitimate?
It looks at the token. If it's valid and unabused, it answers the
request if it wants to. It can always drop the packet if it wants, the
client will try again using TCP if it's legitimate.
> > You're just imagining a poor implementation and then blaming the
> > protocol for the poor implementation.
> Excuse me? Perhaps you can explain how your algorithm will work?
The same way TCP does. Honestly, this is really not complicated.
Layering reliable protocols on top of TCP with special characteristics
is really not all that complicated.
You are the one arguing that no implementation is possible that
doesn't have a defect. You have the burden of proof.
> > A UDP request with an invalid or abused token can be immediately
> > dropped by the server.
> Immediately? Explain how.
Check token in table. If not issued or abused, drop packet. That
simple.
> >The overhead of setting up and tearing down a
> > TCP session is avoided.
> By creating state that allows a "valid" UDP packet to arrive.
> So you exchange TCP state with UDP state.
Exactly. The difference is, with the UDP state, you can avoid the
session overhead if you can tell an illegitimate request. This stops
an attacker from consuming as much outbound bandwidth. This will work
so well that attackers will attack you with TCP instead, because most
web servers have more inbound bandwidth to spare than outbound, and
even with TCP SYN cookies, they can consume about as much outbound
bandwidth as their flood of inbound packets.
> >No kernel state need be kept. An attack on
> > such a protocol would be harder than a TCP SYN flood.
> If one UDP packet is legit, then why not a million more identical UDP
> packets?
Because a million identical packets has no legitimate purpose. Duh.
> How can you handle this without retaining state? *Or would you rather
> let me request downloading ubuntu 9.04 a million times simulaneously?
The same way TCP handles this without retaining state. If I get, say,
a TCP RST request, I check it in my table. If it matches no TCP
session I know of, I can detect this and ignore the packet. Note that
I didn't need to retain *ANY* state about *THIS* packet. This attack
packet required no state to be silently discarded. Same way.
DS