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

Re: [ns] Quick question on Queue Mngt



Arun,

I don't follow why exactly u r using the command function. Well if I have
understood ur Q properly.. u basically want x packets to be sent (may be
over a period of time). You could do the following:
1) extend the queue class, have a bound var to the number of packets
2) there are couple of methods all of whom forward packets to the target_:
send, resume, recv.. check for others.
3) in all these functions u need to check if u have already sent x packets
during the interval, if so do nothing else do call the parent method.

hope it helps.

Regards,
Sudhin.


On Thu, 22 Mar 2001, Arun Gandhi wrote:

> Hi,
>
> Thanks for the note. I am sorry I don't understand what you'd mentioned.
>
> In my command function I have,
>
> if (strcmp(argv[1], "do-control-queue")) {
>
> 	blocked_ = 1;
> 	blocked_ = 0;
>
> 	Packet *tp = deque();
> 	if (tp != 0) {
> 		blocked_ = 1;
> 		target_ ->recv(tp, &qh_);
> 	}
>
> 	return (TCL_OK);
> }
>
> So I first block the queue, then by unblocking it I get a packet from the
> queue. If the queue is not empty I again block the queue and forward the
> packet to the destination. What is wrong in my understanding? It may sound
> silly but i have tried this for some time now and nothing seems to work.
>
> Your hellp will be really appreciated.
>
> Thanks,
> Arun
>
> >From: Garetto Michele <[email protected]>
> >Reply-To: [email protected]
> >To: Arun Gandhi <[email protected]>
> >Subject: Re: [ns] Quick question on Queue Mngt
> >Date: Thu, 22 Mar 2001 11:05:50 +0100
> >
> >On Thu, 22 Mar 2001, you wrote:
> > > Hi,
> > >
> > > I've been trying to control the queue. That is, I just want the node to
> >send
> > > only "x" number of packets from the queue of length "z" (where z > x)
> >and
> > > block the rest (z-x packets).
> > >
> > > I am not able to control that. I have been trying blocking/unblocking
> >the
> > > queue but to no success. I'd appreciate quick help.
> > >
> > > Thanks,
> > > Arun
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at http://explorer.msn.com
> >
> >You have to modify the deque function in C++ (file queue.cc): return 0
> >(NULL)
> >with an if condition on the queue lenght.
> >(I suggest to create a new kind of queue of your own, derived from class
> >Queue, but this requires to know how to bind it with tcl. See the manual)
> >Michele
> >--
> >
> >--------------------------------------------------------------
> >Michele Garetto
> >Dipartimento di Elettronica, Politecnico di Torino
> >Corso Duca degli Abruzzi 24, 10129 Torino, Italy
> >e-mail: [email protected]
> >Phone: + 39 011 5644053
> >Fax:   + 39 011 5644099
> >--------------------------------------------------------------
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>

****************** Sudhindra Suresh Bengeri ********************
Graduate Research Assistant   | Home:                          |
to Dr. George N. Rouskas      | 2110, Gorman St.,              |
EGRC 454H, Computer Sci. dept.| Raleigh, NC - 27606            |
NCSU, Raleigh, NC 27695       | Ph. (919) 852-1961             |
(919)515-3655(P) / 515-7925(F)
My web projection: http://www4.ncsu.edu/~ssbenger