From owner-freebsd-net@FreeBSD.ORG Fri Aug 18 20:00:22 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A01E016A572 for ; Fri, 18 Aug 2006 20:00:22 +0000 (UTC) (envelope-from amit.freebsd@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBB1043D45 for ; Fri, 18 Aug 2006 20:00:21 +0000 (GMT) (envelope-from amit.freebsd@gmail.com) Received: by py-out-1112.google.com with SMTP id o67so1254699pye for ; Fri, 18 Aug 2006 13:00:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=d6C2WafBPGwCoBkOqKt71nxGyjBdnwQh4hrjPWAqEY6rxa597cZR4nF9Fho1CacPQE4+R6kKR9jC3s5LboR683EPFZZ71k0yJllsl8DjaEuFd86IQqQOcQOVHB8eBdzKVldQvwY985TD1S+FXhU/dWXQ7x4zr4BU+K+UjftTEvQ= Received: by 10.35.61.14 with SMTP id o14mr6587937pyk; Fri, 18 Aug 2006 13:00:21 -0700 (PDT) Received: by 10.35.101.8 with HTTP; Fri, 18 Aug 2006 13:00:20 -0700 (PDT) Message-ID: Date: Fri, 18 Aug 2006 15:00:21 -0500 From: "Amit Mondal" To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Adding new timer in FreeBSD TCP..help 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: Fri, 18 Aug 2006 20:00:22 -0000 Hi all, I am a newbie in FreeBSD. I am modifying TCP to add a new timer for some security ehancement purpose. I stuck with the following issue. For my case, I need to associate a timer for each incoming packet. But adding timer for each incoming packet will significantly degrade the performance of TCP. So what I decided to do, is that whenever a packet is received, i start a timer with the appropriate value. Now when the next packet comes, instead of starting another timer immediately I wanna reuse the earlier time. So, I wanna note down when the packet came and if I had started the timer immediately when would it have expried. Now when the timer associated the first packet expires, I reassociate the timer with the next packet with re-adjusted timer value. Now, the problem is that, in TCP all timer values are in *ticks* and how do I convert the timestamps/duratuion in ticks. Also, my timer value is a function of SRTT (which is in ticks, I guess). Again how do I convert ticks into time duration. I need the time stamp, when the packet is received? Could anyone pls give some insight? Rgds, -Amit