Project

General

Profile

Actions

Bug #2100

closed

af_packet: High latency

Added by Igor Novgorodov over 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

Same configuration as in https://redmine.openinfosecfoundation.org/issues/2099

Network topology is simple:

[host1 eno50] <-> [eno50 host2(suricata) eno49] <-> [eno50 host3]

host1# ip addr add 192.168.99.1/24 dev eno50
host3# ip addr add 192.168.99.2/24 dev eno50
host3# ping 192.168.99.1 -c 1000 -q -f 
PING 192.168.99.1 (192.168.99.1) 56(84) bytes of data.

--- 192.168.99.1 ping statistics ---
1000 packets transmitted, 1000 received, 0% packet loss, time 19977ms
rtt min/avg/max/mdev = 23.308/26.272/39.973/0.457 ms, pipe 3, ipg/ewma 19.997/26.274 ms

When using NFQUEUE and routing through Suricata the latency is fine (sub-millisecond)

Actions #1

Updated by Andreas Herz over 5 years ago

  • Assignee set to OISF Dev
  • Target version set to TBD
Actions #2

Updated by Igor Novgorodov over 5 years ago

Testing with latest git confirms that problem still persists, latency is still about 20ms.

Actions #3

Updated by Eric Leblond over 5 years ago

Are you testing with tpacket_v3 ? If yes can you test without it (so with v2) ?

Actions #4

Updated by Igor Novgorodov over 5 years ago

Yep, it was TPACKET_V3.
I've read somewhere that V3 is experimental, but didn't pay much attention to that.
With TPACKET_V2 it's fine - 0.2ms, thanks!

Actions #5

Updated by Eric Leblond over 5 years ago

It is not really experimental regarding to IPS. It will never work correctly: tpacket_v3 is using a block concept that contains a group of packets and deliver block by block so this induce a latency..

Actions #6

Updated by Victor Julien over 5 years ago

Eric should we add a big fat warning or even outright refuse to work in IPS mode with AFPv3?

Actions #7

Updated by Igor Novgorodov over 5 years ago

Yes, the CRIT log message during startup would be very nice and some mention in the docs, so others would not guess the cause of latency.
Sadly, but V2's performance is much worse. I was able to achieve the 0% drop on V2 only with 35% lower PPS than with V3.

Actions #8

Updated by Eric Leblond over 5 years ago

I think it is a good idea to avoid this kind of issue. I'm cooking something to go with the IPS fix.

Actions #9

Updated by Victor Julien over 4 years ago

  • Assignee changed from OISF Dev to Eric Leblond
  • Target version changed from TBD to 4.1rc2
Actions #10

Updated by Victor Julien about 4 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF