* Question about getting counters for transparent terminated flows
@ 2017-03-08 17:37 Tarun Khanna
2017-03-09 9:38 ` Florian Westphal
0 siblings, 1 reply; 3+ messages in thread
From: Tarun Khanna @ 2017-03-08 17:37 UTC (permalink / raw)
To: netfilter-devel
Hi,
I have an application that acts as a transparent proxy for tcp flows. I
need to get packet and byte counters for these tcp flows on both sides
of the proxy application. I looked at pulling the counters from the
kernel using libnetfilter_conntrack. However I noticed that the
conntrack library only shows one entry for flows that are terminated
transparently. This is an issue, as I am not able to see byte and packet
counters for the two sides of the flow separately. Is there a way to get
the separate counters for flows that are transparently terminated?
If the flow is terminated but not transparently, I do get two separate
entries from libnetfilter_conntrack, and the counters are as I would
expect them to be.
Thank you.
Tarun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about getting counters for transparent terminated flows
2017-03-08 17:37 Question about getting counters for transparent terminated flows Tarun Khanna
@ 2017-03-09 9:38 ` Florian Westphal
2017-03-09 15:53 ` Tarun Khanna
0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2017-03-09 9:38 UTC (permalink / raw)
To: Tarun Khanna; +Cc: netfilter-devel
Tarun Khanna <tkhanna@akamai.com> wrote:
> I have an application that acts as a transparent proxy for tcp flows. I need
> to get packet and byte counters for these tcp flows on both sides of the
> proxy application. I looked at pulling the counters from the kernel using
> libnetfilter_conntrack. However I noticed that the conntrack library only
> shows one entry for flows that are terminated transparently. This is an
> issue, as I am not able to see byte and packet counters for the two sides of
> the flow separately. Is there a way to get the separate counters for flows
> that are transparently terminated?
>
> If the flow is terminated but not transparently, I do get two separate
> entries from libnetfilter_conntrack, and the counters are as I would expect
> them to be.
In transparent case conntrack cannot tell the two connections apart as
they use the same addresses.
You could try to place one side into another conntrack zone using
'-j CT --zone $x' in the raw table.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about getting counters for transparent terminated flows
2017-03-09 9:38 ` Florian Westphal
@ 2017-03-09 15:53 ` Tarun Khanna
0 siblings, 0 replies; 3+ messages in thread
From: Tarun Khanna @ 2017-03-09 15:53 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel
> Tarun Khanna <tkhanna@akamai.com> wrote:
>> I have an application that acts as a transparent proxy for tcp flows. I need
>> to get packet and byte counters for these tcp flows on both sides of the
>> proxy application. I looked at pulling the counters from the kernel using
>> libnetfilter_conntrack. However I noticed that the conntrack library only
>> shows one entry for flows that are terminated transparently. This is an
>> issue, as I am not able to see byte and packet counters for the two sides of
>> the flow separately. Is there a way to get the separate counters for flows
>> that are transparently terminated?
>>
>> If the flow is terminated but not transparently, I do get two separate
>> entries from libnetfilter_conntrack, and the counters are as I would expect
>> them to be.
> In transparent case conntrack cannot tell the two connections apart as
> they use the same addresses.
>
> You could try to place one side into another conntrack zone using
> '-j CT --zone $x' in the raw table.
Thank you. That sounds promising. I'll give it a shot.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-03-09 15:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-08 17:37 Question about getting counters for transparent terminated flows Tarun Khanna
2017-03-09 9:38 ` Florian Westphal
2017-03-09 15:53 ` Tarun Khanna
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).