diff -u -r ns-2.1b9-ref/Makefile ns-2.1b9/Makefile
--- ns-2.1b9-ref/Makefile	Wed Jun 26 14:14:28 2002
+++ ns-2.1b9/Makefile	Mon Jul  1 14:16:18 2002
@@ -248,7 +248,7 @@
 	diffserv/dsEdge.o diffserv/dsCore.o \
 	diffserv/dsPolicy.o diffserv/ew.o\
 	queue/red-pd.o queue/pi.o queue/vq.o queue/rem.o \
-	queue/gk.o \
+	queue/gk.o queue/drop-expired.o queue/lib-atp.o \
 	pushback/rate-limit.o pushback/rate-limit-strategy.o \
 	pushback/ident-tree.o pushback/agg-spec.o \
 	pushback/logging-data-struct.o \
diff -u -r ns-2.1b9-ref/Makefile.in ns-2.1b9/Makefile.in
--- ns-2.1b9-ref/Makefile.in	Wed Jun 26 14:13:36 2002
+++ ns-2.1b9/Makefile.in	Mon Jul  1 14:15:56 2002
@@ -248,7 +248,7 @@
 	diffserv/dsEdge.o diffserv/dsCore.o \
 	diffserv/dsPolicy.o diffserv/ew.o\
 	queue/red-pd.o queue/pi.o queue/vq.o queue/rem.o \
-	queue/gk.o \
+	queue/gk.o queue/drop-expired.o queue/lib-atp.o \
 	pushback/rate-limit.o pushback/rate-limit-strategy.o \
 	pushback/ident-tree.o pushback/agg-spec.o \
 	pushback/logging-data-struct.o \
diff -u -r ns-2.1b9-ref/apps/udp.cc ns-2.1b9/apps/udp.cc
--- ns-2.1b9-ref/apps/udp.cc	Wed Jun 26 14:13:36 2002
+++ ns-2.1b9/apps/udp.cc	Mon Jul  1 11:55:40 2002
@@ -28,6 +28,9 @@
 #include "ip.h"
 
 
+//AG
+#include "../queue/lib-atp.h"
+
 static class UdpAgentClass : public TclClass {
 public:
 	UdpAgentClass() : TclClass("Agent/UDP") {}
@@ -82,6 +85,7 @@
 		if (flags && (0 ==strcmp(flags, "NEW_BURST")))
 			rh->flags() |= RTP_M;
 		p->setdata(data);
+		//             atp_set_ttl(p, (u_int32_t)local_time+LIFETIME);
 		target_->recv(p);
 	}
 	n = nbytes % size_;
@@ -97,12 +101,14 @@
 		if (flags && (0 == strcmp(flags, "NEW_BURST")))
 			rh->flags() |= RTP_M;
 		p->setdata(data);
+		//             atp_set_ttl(p, (u_int32_t)local_time+LIFETIME);
 		target_->recv(p);
 	}
 	idle();
 }
 void UdpAgent::recv(Packet* pkt, Handler*)
 {
+	atp_log_ttl(pkt); //AG
 	if (app_ ) {
 		// If an application is attached, pass the data to the app
 		hdr_cmn* h = hdr_cmn::access(pkt);
diff -u -r ns-2.1b9-ref/tcp/tfrc-sink.cc ns-2.1b9/tcp/tfrc-sink.cc
--- ns-2.1b9-ref/tcp/tfrc-sink.cc	Wed Jun 26 14:14:27 2002
+++ ns-2.1b9/tcp/tfrc-sink.cc	Mon Jul  1 11:51:34 2002
@@ -41,6 +41,9 @@
 #include "formula-with-inverse.h"
 #include "flags.h"
 
+//AG
+#include "../queue/lib-atp.h"
+
 static class TfrcSinkClass : public TclClass {
 public:
   	TfrcSinkClass() : TclClass("Agent/TFRCSink") {}
@@ -341,6 +344,8 @@
 		last_report_sent = now; 
 		rcvd_since_last_report = 0;
 		losses_since_last_report = 0;
+		//AG FIXME first rtt is zero until measured
+		atp_set_ttl(pkt, Scheduler::instance().clock() + rtt_ + 3); 
 		send(pkt, 0);
 	}
 }
diff -u -r ns-2.1b9-ref/tcp/tfrc.cc ns-2.1b9/tcp/tfrc.cc
--- ns-2.1b9-ref/tcp/tfrc.cc	Wed Jun 26 14:14:27 2002
+++ ns-2.1b9/tcp/tfrc.cc	Mon Jul  1 11:51:23 2002
@@ -41,6 +41,9 @@
 #include "formula.h"
 #include "flags.h"
 
+//AG
+#include "../queue/lib-atp.h"
+
 int hdr_tfrc::offset_;
 int hdr_tfrc_ack::offset_;
 
@@ -435,6 +438,10 @@
 		tfrch->UrgentFlag=UrgentFlag;
 		tfrch->round_id=round_id;
 		ndatapack_++;
+
+		//AG
+		atp_set_ttl(p, Scheduler::instance().clock() + t_rtxcur_); 
+
 		send(p, 0);
 	}
 }
diff -u -r ns-2.1b9-ref/trace/trace.cc ns-2.1b9/trace/trace.cc
--- ns-2.1b9-ref/trace/trace.cc	Wed Jun 26 14:14:27 2002
+++ ns-2.1b9/trace/trace.cc	Mon Jul  1 11:46:06 2002
@@ -190,6 +190,7 @@
 	hdr_rtp *rh = hdr_rtp::access(p);
         hdr_rap *raph = hdr_rap::access(p);
 	hdr_tfrc *tfrch = hdr_tfrc::access(p);
+	hdr_tfrc_ack *tfrch_ack = hdr_tfrc_ack::access(p); 
 	packet_t t = th->ptype();
 	int seqno;
 
@@ -204,6 +205,8 @@
 		seqno = tcph->seqno();
 	else if (t == PT_TFRC)
 		seqno = tfrch->seqno;
+	else if (t == PT_TFRC_ACK)
+                seqno = tfrch_ack->seqno;
 	else
 		seqno = -1;
  	return seqno;

