From owner-freebsd-net Wed Aug 2 13:41: 9 2000 Delivered-To: freebsd-net@freebsd.org Received: from css-1.cs.iastate.edu (css-1.cs.iastate.edu [129.186.3.24]) by hub.freebsd.org (Postfix) with ESMTP id 2E6DD37BD3E for ; Wed, 2 Aug 2000 13:40:59 -0700 (PDT) (envelope-from ghelmer@cs.iastate.edu) Received: from popeye.cs.iastate.edu (ghelmer@popeye.cs.iastate.edu [129.186.3.4]) by css-1.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id PAA26521; Wed, 2 Aug 2000 15:40:59 -0500 (CDT) Received: from localhost (ghelmer@localhost) by popeye.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id PAA15978; Wed, 2 Aug 2000 15:40:55 -0500 (CDT) X-Authentication-Warning: popeye.cs.iastate.edu: ghelmer owned process doing -bs Date: Wed, 2 Aug 2000 15:40:55 -0500 (CDT) From: Guy Helmer To: Clinton Xavier Berni Cc: freebsd-net@FreeBSD.ORG Subject: Re: confused about th_ack In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, 2 Aug 2000, Clinton Xavier Berni wrote: > I'm confused about the values for th_ack and th_seq in the tcp header. > > First let me provide some background. I'm working at the ip layer, not > tcp. Therefore in order to obtain tcp header information I use the mtod() > and mpullup() routines. If I have a tcp header and source or dest. port is > 80 then I print out the following packet header information: > ... > ip_id - the ip fragment id > ip_off - the offset of the fragment The fragment offset must be 0 for you to decode a TCP header in the packet. Each of your decodes shows an ip_off of 64... I'd suggest using "tcpdump tcp and port 80" to grab & decode the same packets you are decoding in the kernel. Compare the tcpdump results with your own code to discover whether your code is working properly. th_seq and th_ack are most likely increasing as one would expect... Hope this helps, Guy Guy Helmer, Ph.D. Candidate, Iowa State University Dept. of Computer Science Research Assistant, Dept. of Computer Science --- ghelmer@cs.iastate.edu http://www.cs.iastate.edu/~ghelmer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message