xdp-newbies.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using XDP in docker swarm to track outgoing traffic
@ 2021-07-06 15:41 Sebastião Santos Boavida Amaro
  2021-07-06 15:53 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastião Santos Boavida Amaro @ 2021-07-06 15:41 UTC (permalink / raw)
  To: xdp-newbies

Hi everyone,
I am trying to use XDP to track outgoing traffic from docker containers 
deployed using docker swarm and running in a network using the driver 
overlay. I am using a simple xdp program based on [1], and I run this 
program on the network namespace of the container using nsenter and 
attach it to its eth0.
However, I am only able to detect the incoming packets and not the 
outgoing ones. When running tcpdump on the container network namespace I 
can see both incoming and outgoing packets. So I am a bit confused as to 
why XDP would not detect the outgoing ones.
Does anyone know why the reason for this or a general idea as to why 
this might happen?

[1]https://github.com/iovisor/bcc/blob/master/examples/networking/xdp/xdp_drop_count.py

Best Regards,
Sebastião Amaro

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

* Re: Using XDP in docker swarm to track outgoing traffic
  2021-07-06 15:41 Using XDP in docker swarm to track outgoing traffic Sebastião Santos Boavida Amaro
@ 2021-07-06 15:53 ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-07-06 15:53 UTC (permalink / raw)
  To: Sebastião Santos Boavida Amaro, xdp-newbies

Sebastião Santos Boavida Amaro
<sebastiao.amaro@tecnico.ulisboa.pt> writes:

> Hi everyone,
> I am trying to use XDP to track outgoing traffic from docker containers 
> deployed using docker swarm and running in a network using the driver 
> overlay. I am using a simple xdp program based on [1], and I run this 
> program on the network namespace of the container using nsenter and 
> attach it to its eth0.
> However, I am only able to detect the incoming packets and not the 
> outgoing ones. When running tcpdump on the container network namespace I 
> can see both incoming and outgoing packets. So I am a bit confused as to 
> why XDP would not detect the outgoing ones.
> Does anyone know why the reason for this or a general idea as to why 
> this might happen?

Yeah, XDP only works on ingress - you'll need to use the TC hook if you
want to look at egress traffic (or attach to the veth peer outside the
container) :)

-Toke


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

end of thread, other threads:[~2021-07-06 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 15:41 Using XDP in docker swarm to track outgoing traffic Sebastião Santos Boavida Amaro
2021-07-06 15:53 ` Toke Høiland-Jørgensen

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).