From owner-freebsd-net@FreeBSD.ORG Sat Jun 13 17:41:22 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63E001065673 for ; Sat, 13 Jun 2009 17:41:22 +0000 (UTC) (envelope-from louie@transsys.com) Received: from ringworld.transsys.com (ringworld.transsys.com [144.202.0.15]) by mx1.freebsd.org (Postfix) with ESMTP id 1F4968FC1F for ; Sat, 13 Jun 2009 17:41:21 +0000 (UTC) (envelope-from louie@transsys.com) Received: from PM-G5.transsys.com (c-69-141-150-106.hsd1.nj.comcast.net [69.141.150.106]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: louie) by ringworld.transsys.com (Postfix) with ESMTP id 53A705C04; Sat, 13 Jun 2009 13:24:26 -0400 (EDT) Message-Id: <865C7FF6-F9DD-4684-8AF3-204941032330@transsys.com> From: Louis Mamakos To: saravana perumal In-Reply-To: <28959.63465.qm@web8313.mail.in.yahoo.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sat, 13 Jun 2009 13:24:25 -0400 References: <28959.63465.qm@web8313.mail.in.yahoo.com> X-Mailer: Apple Mail (2.935.3) Cc: freebsd-net@freebsd.org, sarbalas@gmail.com Subject: Re: TCP Free-BSD setup behaviour. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 17:41:22 -0000 On Jun 10, 2009, at 9:47 AM, saravana perumal wrote: > Hi , > > Have some behaviour change with FREEBSD compared to LINUX . You probably ought to verify the behavior against the protocol specifications, and not what some other TCP implementation happens to to. > > 1. When sending the Same TCP packet once again [ Retranmission of > TCP packet ] Whether the Same Identification field [ IP packet]used > or not . > but when seeing that thru packet capture, Free BSD sending the > differnt one [ increases sequentially IP Identification] The IPID header field is used for reassembly of IP fragments, and is not of consequence to TCP. If the protocol stack absolutely knows that a TCP retransmission is identical to the previous segment, then in theory, it could use the same IPID fields to increase the chance that a previously fragmented TCP segment with a lost segment could get reassembled with fragments from the retransmission. Since there's much work done to avoid fragmentation in the first place (e.g., using Path MTU discovery), this "feature" probably never gets used. This behavior makes more sense if the TCP implementation keeps around a retransmit queue of previously sent packets, rather than simply generating new TCP segments with whatever data happens to be in the TCP send window at the time of the retransmission attempt. > > 2.Retranmission Time is not increasing Linearly with Respect to BSD. > not keeping more time interval . AS per RFC > expecting Retransmission timeout should increase Linearly. Issue is > not seen with Linux Setup Retransmission time is highly dependent on many factors, like the implementation of TCP slow-start, what the TCP stack has estimated as the round-trip time, etc. In the general case, over the span of many retransmissions, the sending TCP stack should back-off the retransmit times. > > 3. Active SYN open state in FREE BSD setup , Does not reach Syn- > received State. When Sending syn packet to DUT but for that FreeBSD > is not sending back > SYN/ACK . Issue is with Free BSD Setup.Linux works fine, If the FreeBSD system is doing a TCP active open (e.g., a connect() system call), then it sends a SYN to the remote TCP, and expects a SYN/ ACK back from the remote system. At that point, since the remote has ACK'd the SYN, it should correctly respond with simply an ACK of the remote TCP's SYN, and perhaps any data that might have been piggybacked in the ACK segment. There's no need to retransmit the SYN. Or is the remote system doing the active open to the FreeBSD system? It's hard to believe that the FreeBSD TCP can't respond to an incoming TCP segment to a listening socket carrying a SYN segment? > > 4.When checking the State - TIME-WAIT > Sending FIN and expecting the ACK ;Getting the ACK properly. > Sending Data Segment and Expecting the RST signal not getting the > RST ; Instead DUT is sending the Last TCP packet. > > Issue seen only in Free BSD. I may be misunderstanding. When in TIME-WAIT state, the local TCP is waiting for a bit in case the "final" ACK of the remote TCP's FIN got lost, and the remote retransmits the FIN (and perhaps any data that might have been in the window along with the FIN). The local TCP shouldn't generate a RST assuming that the remote's retransmitted TCP segment is still within the window. I'm not sure what's in the "Last TCP packet." > > Same issue in FIN-WAIT2 & FIN-WAIT1 State also . > Sending FIN and Expect the ACK : Getting the ACK > Sending Data segment with Data : Expecting the RST signal from > DUT ; but got Last transmitted TCP packet[ FIN -ACK] > Ditto. > Any idea about the above scenario would be helpful > > Thanks, > Saravanan. The TCP in Linux is hardly the reference implementation; with the TCP stack in various 4.xBSD varients preceeding it by many years, not to mention many others implementations in other platforms. I'm not sure looking for variances between some random Linux TCP stack is really the right way to approach testing. louie