Skip to contentSkip to conversation

Possible problem with tcp-window-tracking

DISCUSSION Martin Josefsson 3 participants 5 messages Jun 21, 2004 – Jun 22, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

Hi Jozsef

I seem to have a small problem with the window-handling in tcp-window-tracking.

I see cases where it thinks ACK from my machine is over the upper bound and SEQ from the remote host is over the upper bound.

I've seen it mostly on irc connections, in other words, long lived connections.
I didn't have ip_conntrack_log_invalid set for tcp the first times so for those cases I only have the output of my ULOG rule for INVALID packets.
Then I set it to log invalid tcp and since then (set it yesterday) I've had one occation where it complained and marked packets as invalid.

The first packet it complained about is originating from my machine in the attached log. X.X.X.X is my machine, it's an normal desktop and tcp-window-tracking is running on it (end host).

Now I've started a tcpdump to see what really happens when it complains. Hopefully I'll have something more substantial that this report soon.

Signature · 1 line
/Martin
Jun 21 14:44:47 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=52 TOS=00 PREC=0x00 TTL=64 ID=13182 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK URGP=0 
Jun 21 14:44:47 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52052 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708765 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:44:47 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1500 TOS=00 PREC=0x00 TTL=49 ID=52053 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196213263 ACK=815708765 WINDOW=2412 ACK URGP=0 
Jun 21 14:44:47 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1500 TOS=00 PREC=0x00 TTL=49 ID=52054 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196214711 ACK=815708765 WINDOW=2412 ACK URGP=0 
Jun 21 14:44:47 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52055 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708765 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:44:48 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52056 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708765 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:44:49 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52057 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708765 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:44:49 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13183 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:44:49 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=52 TOS=00 PREC=0x00 TTL=49 ID=52058 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196216159 ACK=815708785 WINDOW=2412 ACK URGP=0 
Jun 21 14:44:49 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13184 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:44:53 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13187 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:44:57 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13188 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:45:03 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52066 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708785 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:45:20 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52068 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708785 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:45:22 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13190 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:45:22 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=64 TOS=00 PREC=0x00 TTL=49 ID=52069 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196216159 ACK=815708785 WINDOW=2412 ACK URGP=0 
Jun 21 14:45:53 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52070 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708785 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:45:56 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13191 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:45:56 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=64 TOS=00 PREC=0x00 TTL=49 ID=52071 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196216159 ACK=815708785 WINDOW=2412 ACK URGP=0 
Jun 21 14:47:00 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52072 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708785 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:47:02 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13192 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:47:02 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=64 TOS=00 PREC=0x00 TTL=49 ID=52073 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196216159 ACK=815708785 WINDOW=2412 ACK URGP=0 
Jun 21 14:49:00 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52074 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708785 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:49:02 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13193 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:49:02 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=64 TOS=00 PREC=0x00 TTL=49 ID=52075 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196216159 ACK=815708785 WINDOW=2412 ACK URGP=0 
Jun 21 14:51:00 tux ip_ct_tcp: SEQ is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=1076 TOS=00 PREC=0x00 TTL=49 ID=52076 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196212239 ACK=815708785 WINDOW=2412 ACK PSH URGP=0 
Jun 21 14:51:02 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13194 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
Jun 21 14:51:02 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=161.53.160.95 DST=X.X.X.X LEN=64 TOS=00 PREC=0x00 TTL=49 ID=52077 CE DF PROTO=TCP SPT=6667 DPT=32829 SEQ=4196216159 ACK=815708785 WINDOW=2412 ACK URGP=0 
Jun 21 14:53:02 tux ip_ct_tcp: ACK is over the upper IN= OUT= MAC= SRC=X.X.X.X DST=161.53.160.95 LEN=72 TOS=00 PREC=0x00 TTL=64 ID=13195 DF PROTO=TCP SPT=32829 DPT=6667 SEQ=815708765 ACK=4196212239 WINDOW=858 ACK PSH URGP=0 
#1 lore raw

Hi Martin,

Quoted 2 lines · Martin Josefsson

I seem to have a small problem with the window-handling in tcp-window-tracking.

There has been a lot of traffic pumped trough the code but there can be dark corners. Therefore we need active testers in wide variety of environments.

Quoted 5 lines

I see cases where it thinks ACK from my machine is over the upper bound and SEQ from the remote host is over the upper bound.

I've seen it mostly on irc connections, in other words, long lived connections.

[...]

Quoted 2 lines

Now I've started a tcpdump to see what really happens when it complains. Hopefully I'll have something more substantial that this report soon.

Yes, that is required to track down who's faulty where: log from the kernel and a full tcpdump of the traffic. There is no need to capture whole packets if diskspace is critical, full IP/TCP headers are sufficient.

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics

          H-1525 Budapest 114, POB. 49, Hungary
#2 lore raw
Quoted 1 line · Jozsef Kadlecsik

Hi Martin,

Hi Jozsef

Quoted 3 lines

There has been a lot of traffic pumped trough the code but there can be dark corners. Therefore we need active testers in wide variety of environments.

Yup, that's why I'm using it :)

Quoted 7 lines
Quoted 2 lines

Now I've started a tcpdump to see what really happens when it complains. Hopefully I'll have something more substantial that this report soon.

Yes, that is required to track down who's faulty where: log from the kernel and a full tcpdump of the traffic. There is no need to capture whole packets if diskspace is critical, full IP/TCP headers are sufficient.

Yup, only logging the first 96 bytes per packet (default tcpdump snaplength it seems).
No problems so far, we'll see tomorrow if anything is caught.

Signature · 1 line
/Martin
#3 lore raw

Hi Martin,

Quoted 2 lines · Martin Josefsson

Yup, only logging the first 96 bytes per packet (default tcpdump snaplength it seems).

If disk space becomes a problem, you can compress on the fly (I always do this now for long captures and it helps) :

# tcpdump -w - | gzip -c9 > capture.gz

and to stop it and flush the output buffer through gzip :

# killall -INT tcpdump

I've already done this to get several gigabytes of traffic.

Cheers,
Willy

#4 lore raw
Quoted 1 line · Willy Tarreau

Hi Martin,

Hi Willy,

Quoted 10 lines

If disk space becomes a problem, you can compress on the fly (I always do this now for long captures and it helps) :

# tcpdump -w - | gzip -c9 > capture.gz

and to stop it and flush the output buffer through gzip :

# killall -INT tcpdump

I've already done this to get several gigabytes of traffic.

Thanks for the tip but I don't have that much irc traffic :) Only dumping that since it's the only traffic I've seen it happen to.

Signature · 1 line
/Martin