xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3][xen-netback][toolstack] add a pseudo pps limit to netback
@ 2013-07-09 12:24 William Dauchy
  2013-07-09 12:24 ` [PATCH v3 1/3][xen-netback] add a pseudo pps rate limit William Dauchy
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: William Dauchy @ 2013-07-09 12:24 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Wei Liu, xen-devel

VM traffic is already limited by a throughput limit, but there is no
control over the maximum packet per second (PPS).
In DDOS attack the major issue is rather PPS than throughput.
With provider offering more bandwidth to VMs, it becames easy to
coordinate a massive attack using VMs. Example: 100Mbits ~ 200kpps using
64B packets.
This patch provides a new option to limit VMs maximum packets per second
emission rate.
It follows the same credits logic used for throughput shaping. For the
moment we have considered each "txreq" as a packet.
PPS limits is passed to VIF at connection time via xenstore.
PPS credit uses the same usecond period used by rate shaping check.

known limitations:
- by using the same usecond period, PPS shaping depends on throughput
  shaping.
- it is not always true that a "txreq" correspond to a paquet
  (fragmentation cases) but as this shaping is meant to avoid DDOS
  (small paquets) such an pproximation should not impact the results.
- Some help on burst handling will be appreciated.

v2:
- fix some typo

v3:
- fix some typo 
- add toolstack patch

Ahmed Amamou (1):
  xen-netback: add a pseudo pps rate limit

 drivers/net/xen-netback/common.h    |    2 ++
 drivers/net/xen-netback/interface.c |    1 +
 drivers/net/xen-netback/netback.c   |   46 +++++++++++++++++++++++++++++++++++
 drivers/net/xen-netback/xenbus.c    |   25 ++++++++++++++++---
 4 files changed, 70 insertions(+), 4 deletions(-)

[toolstack]
This patch will update the libxl in order to provide the new pps limit
new pps limit can be defined as follow
YYMb/s&XXKpps@ZZms
or
YYMb/s@ZZms&XXKpps
or
YYMb/s&XXKpps in such case default 50ms interval will be used

Ahmed Amamou (2):
  add a pseudo pps rate limit
  netif documentation

 tools/libxl/libxl.c           |    3 ++
 tools/libxl/libxl_types.idl   |    1 +
 tools/libxl/libxlu_vif.c      |   69 +++++++++++++++++++++++++++++++++++++++--
 xen/include/public/io/netif.h |   27 ++++++++++++++++
 4 files changed, 97 insertions(+), 3 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: [PATCH v3 1/3][xen-netback] add a pseudo pps rate limit
@ 2014-12-18  8:13 Jian Wen
  2014-12-18 10:00 ` Sander Eikelenboom
  0 siblings, 1 reply; 15+ messages in thread
From: Jian Wen @ 2014-12-18  8:13 UTC (permalink / raw)
  To: xen-devel

>On Tue, 2013-07-09 at 16:01 +0200, William Dauchy wrote:
>> On Jul09 15:48, Sander Eikelenboom wrote:
>> > Just wondering, why should this be done in the drivers ?
>> > Couldn't this also be achieved with netfilter and the recent/limit modules ?
>> > The limit module can already handle bursts.
>>
>> We indeed forgot to talk about it since we already got the question from
>> Wei.
>> The first thing is that your comment is also true for bandwidth which is
>> already present. Moreover PPS is linked to bandwidth.
>> By using netfilter, PPS shaping is done on backend level, once packet
>> has left the VM; which means after using an additional memory transaction
>> to copy packet from frontend. IMHO, at scale, shaping in this way should
>> save some memory transactions comparing to netfilter.
>
>Have you tried the netfilter approach and found it to be insufficient in
>practice?
>
>I'm not sure how netfilter recent/limit is implemented but if it queues
>rather than drops you would naturally find that you end up with back
>pressure onto the netback device where the ring would fill with
>in-progress requests and therefore netback would have to stop processing
>more packets.
>
>Ian.
>

The maximum limit rate of the netfilter limit module is 10000/s that is too
 small nowadays. Even if the size of the packet is 1500, the bandwidth is
as small as 14 MiB. So it is not a good practise to use the limit module.

$  sudo iptables -I INPUT -m limit --limit 10001/s --limit-burst 100 -j RETURN
iptables v1.4.19.1: Rate too fast "10001/s"


-- 
Best,

Jian

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-12-18 10:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-09 12:24 [PATCH v3 0/3][xen-netback][toolstack] add a pseudo pps limit to netback William Dauchy
2013-07-09 12:24 ` [PATCH v3 1/3][xen-netback] add a pseudo pps rate limit William Dauchy
2013-07-09 13:48   ` Sander Eikelenboom
2013-07-09 14:01     ` William Dauchy
2013-07-09 14:42       ` Sander Eikelenboom
2013-07-09 15:19         ` William Dauchy
2013-07-10 12:50       ` Ian Campbell
2013-07-10 13:59         ` Sander Eikelenboom
2013-07-10  8:51   ` Wei Liu
2013-07-09 12:24 ` [PATCH v3 2/3] handle pps limit parameter William Dauchy
2013-07-10  8:32   ` Wei Liu
2013-07-09 12:24 ` [PATCH v3 3/3] netif documentation William Dauchy
  -- strict thread matches above, loose matches on Subject: below --
2014-12-18  8:13 [PATCH v3 1/3][xen-netback] add a pseudo pps rate limit Jian Wen
2014-12-18 10:00 ` Sander Eikelenboom
2014-12-18 10:16   ` Jian Wen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).