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

[ns] hold some time in a node.



hi, 

I have a question as follows:
       1s            1s              1s
node1------->node2---------->node3--------->node4

A packet is sent through this way, I want to hold it at node2 for some
time(hold_time), and forward it to node3. For at node2, the packet will be
processed by server and I need to simulate the service time(hold_time). So
when the packet arrives node4,  Scheduler::instance().clock() will be (3s +
hold_time).

I have tried in two ways:
(1) set a timer and start it at node 2. but the packet is still forwarded to
node3 when the timer operates.
(2) stop the packet forward operation from node2, but the timer never
expire, I think the timer is event-driving, if no event ocurrs, it never
expire.

I remember there's similar question, but cannot find it in the archive.

any help is appeciated. :-)
Yu