tcptrace-bugs Re: tcptrace BUG: ns.c doesn't correctly read ack and seqnr in 18 values of FullTCP

From: Angelos Stavrou (angelos@ee.columbia.edu)
Date: 08/09/02


Message-ID: <000a01c23f8e$8651d110$3496a740@bluebird>
From: "Angelos Stavrou" <angelos@ee.columbia.edu>
Subject: tcptrace-bugs Re: tcptrace BUG: ns.c  doesn't correctly read ack and seqnr in 18 values of FullTCP
Date: Fri, 9 Aug 2002 11:21:27 +0100

Hello all,
I think that this is a correct change since this was probably a left over
from a copy paste operation that I did from the SingleTCP code to prevent
SACKs from being detected as transmitted data (that is what the comment
says...). Of course in FullTCP this piece of code will cause trouble as Data
packets act as acknowledgements (ACKs) also.

regards,
Angelos Stavrou

----- Original Message -----
From: <R.Schramp@kpn.com>
To: <tcptrace@tcptrace.org>
Sent: Friday, August 09, 2002 8:14 AM
Subject: tcptrace BUG: ns.c doesn't correctly read ack and seqnr in 18
values of FullTCP

> Hello All,
>
> I think the "ns" reading code contains a small bug: Reading the FullTCP
data
> lines only the ack seqnr or the seqnr are filled in but never both.
> I think as both elements are available in the trace file they should be
> filled in as well. (At least correcting the code gave me better results in
> tcp-trace)
>
> Best regards,
>
> Ruud Schramp
>
>
> FAULTY CODE:
>
> int pread_ns_fulltcp(
> struct timeval *ptime,
> int *plen,
> int *ptlen,
> void **pphys,
> int *pphystype,
> struct ip **ppip,
> void **pplast)
> {
> ......
> if (is_tcp && (*plen > hdrlen)) { /*for empty tcp packets acting as
> acks*/
> tcpb->th_seq = htonl(seqno);
> tcpb->th_ack = 0;
> } else {
> tcpb->th_seq = 0;
> tcpb->th_ack = htonl(ackno);
> }
> ......
> }
>
>
> Corrected CODE:
>
> int pread_ns_fulltcp(
> struct timeval *ptime,
> int *plen,
> int *ptlen,
> void **pphys,
> int *pphystype,
> struct ip **ppip,
> void **pplast)
> {
> ......
> if (is_tcp && (*plen > hdrlen)) { /*for empty tcp packets acting as
> acks*/
> tcpb->th_seq = htonl(seqno);
> tcpb->th_ack = htonl(ackno);
> } else {
> tcpb->th_seq = htonl(seqno);
> tcpb->th_ack = htonl(ackno);
> }
> ......
> }
>
> or perhaps even better code
>
> int pread_ns_fulltcp(
> struct timeval *ptime,
> int *plen,
> int *ptlen,
> void **pphys,
> int *pphystype,
> struct ip **ppip,
> void **pplast)
> {
> ......
> tcpb->th_seq = htonl(seqno);
> tcpb->th_ack = htonl(ackno);
> ......
> }
>
>
> --------------------------------------------------------------------------

--
> To unsubscribe, send a message with body containing "unsubscribe tcptrace"
to
> majordomo@tcptrace.org.



This archive was generated by hypermail 2b30 : 08/10/02 EDT