Subject: Re: kern/25844: NAT router with current and 2.0_BETA suddenly
To: None <gnats-bugs@gnats.NetBSD.org>
From: Takahiro Kambe <taca@back-street.net>
List: netbsd-bugs
Date: 06/12/2004 19:36:30
I want to add some more detail.

	 Internet
	     |
	     |
       +--- vr0 --+
       |	  |
       |NetBSD 2.0|
       |	  |
       +--- rtk0 -+
	     |
	     |
	My local network.

vr0 has IP address  221.250.131.194/29 and rtk0 has 192.168.128.0/24.

I've recorded IP packets for both side using:

# tcpdump -p -i vr0 -w file.vr0 host 204.152.184.172
# tcpdump -p -i rtk0 -w file.rtk0 host 204.152.184.172

After that, 

% tcpdump -ntS -r file.vr0 > vr0.txt
% tcpdump -ntS -r file.rtk0 > rtk0.txt

I've merge remote => local and local => remote TCP/IP stream and
looked into it.

This is merged vr0.txt and rtk0.txt:

vr0  204.152.184.172.22 > 221.250.131.194.30001: . ack 1721049457 win 32850
vr0  204.152.184.172.22 > 221.250.131.194.30001: . ack 1721052353 win 32126
vr0  204.152.184.172.22 > 221.250.131.194.30001: . ack 1721053801 win 32850
rtk0 204.152.184.172.22 > 192.168.128.5.61859: R 3631398540:3631398540(0) win 33580
vr0  204.152.184.172.22 > 221.250.131.194.30001: . ack 1721056697 win 32126
vr0  204.152.184.172.22 > 221.250.131.194.30001: . ack 1721058145 win 32850
rtk0 204.152.184.172.22 > 192.168.128.5.61859: . ack 1721049457 win 32850
rtk0 204.152.184.172.22 > 192.168.128.5.61859: . ack 1721052353 win 32126
rtk0 204.152.184.172.22 > 192.168.128.5.61859: . ack 1721053801 win 32850
rtk0 204.152.184.172.22 > 192.168.128.5.61859: . ack 1721056697 win 32126
rtk0 204.152.184.172.22 > 192.168.128.5.61859: . ack 1721058145 win 32850

Each line except forth one is mapped one to one (vr0 and rtk0).

It seems that fr_tcpinwindow() judge TCP segment is out of range.  So
I put some debug statement end of fr_tcpinwindow() before return 0.

	seq = 1721079865
	end = 1721081313
	win = 33580
	maxwin = 32850
	fdata->td_end = 1721079865
	fdata->td_maxend = 1721080135
	ackskew = 0
	tdata->td_winscale = 0

I don't printed other variables.

Last, I put those tcpdump recorded files to below URL.

      ftp://ftp.back-street.net/hidden/files.tar.bz2

-- 
Takahiro Kambe <taca@back-street.net>