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

[ns] calling deque() for a very special queueing strategy



Hello all,

I'm trying to install a concept called "SG-Mix" into ns2.

SG-Mixes are used to provide some kind of anonymity in a network.
The basic idea is to collect some encrypted packets from some senders,
decrypting them and sending them in a different order.
So an attacker is not able to match the sender and the receiver of a packet.

An SG-Mix provides this by holding a received packet for a time that is 
randomly
chosen from an exponential distribution.

I've implemented this concept by defining a new type of queue (class 
Queue/SGMix).
enque() choses the waiting time for every incoming packet and stores the 
pair (Packet,Time-to-send)
into a (time-ordered) data strucure.
deque() gets the current time and compares it with the minimal Time-to-send 
in the structure.
If the Time-to-send has passed, it returns the associated packet, else it 
returns NULL.

My implementation runs quite fine, but one there's one problem left:
deque() is not called often enough !
When deque() is called, the Time-to-send may be past for a while.

The first packet, for example, remains in the first SG-Mix-Queue
until the next packet arrives, because deque() is not called
since the arrival of the first packet.
(deque() is called directly after the first packet is enqueued,
but then the Packet's Time-to-send is certainly not reached.)

So I need a solution to get deque() called more often, at best exactly
at the next Time-to-send, or at least periodicaly every x milliseconds.

Any suggestions how to solve this problem ?

Thanks,
Stefan

--
| Stefan Penz
| Wildbachstr. 4
| 52074 Aachen
| Germany