[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Date: Mon, 10 Jul 2000 11:56:55 +0900



Dear ns-users!

I made 3 nodes in ns-allinone-2.1b6 

n0 ------- n1 ------- n2
n0 : FTP-FullTCP-node
n1 : node
n2 : FullTCP-node

I added some codes to the recv() procedure in classifier.cc to get the seqno and ackno of TCP in n1.

void Classifier::recv(Packet* p, Handler*h)
{
	NsObject* node = find(p);
/* ----------------- added ------------------ */	
	hdr_tcp *tcph = (hdr_tcp*)p->access(hdr_tcp::offset());
	hdr_ip *iph = (hdr_ip*)p->access(hdr_ip::offset());
/* ----------------- added ------------------ */

	if (node == NULL) {
		/*
		 * XXX this should be "dropped" somehow.  Right now,
		 * these events aren't traced.
		 */
		Packet::free(p);
		return;
	}
/* ----------------- added ------------------ */
	printf("%g %d %d %d %d %d %2x \n", Scheduler::instance().clock(), iph->flowid(), iph->src_.addr_, iph->dst_.addr_, tcph->seqno(), tcph->ackno(), tcph->flags());    /* OUTPUT */
/* ----------------- added ------------------ */
	node->recv(p,h);
}

Using the added code, I could get the ackno, seqno, etc.
And how can I make the OUTPUT only in n1?(OUTPUT is printf in recv() procedure added by me)
And also I want to generate several packets in n1. How can I do?

Do you have an experiance of this kind of programming?
Could I share your prominent thought?

Kyohong Jin.
[email protected]