Delay and Loss Modules

Each receiver in a group requires a delay module that reflects its delay with respect to the particular source. When the receiver joins a group, []join-group identifies all session helpers in session_. If the destination index matches the group address the receiver are joining, then the following actions are performed.

  1. A new slot of the session helper is created and assigned to the receiver.
  2. The routine computes the accumulated bandwidth and delay between the source and receiver using the SessionSim instance procedures []get-bw and []get-delay.
  3. A constant random variable is created; it will generate random delivery times using the accumulative delay as an estimate of the average delay.
  4. A new delay module is created with the end-to-end bandwidth characteristics, and the random variable generator provides the delay estimates.
  5. The delay module in inserted into the session helper and interposed between the helper and the receiver.
See Section 45.1.2 for similarly inserting a loss module for a receiver.

SessionSim instproc join-group { agent group } {
    $self instvar session_

    foreach index [array names session_] {
        set pair [split $index :]
        if {[lindex $pair 1] == $group} {
            # Note: must insert the chain of loss, delay, 
            # and destination agent in this order:

            $session_($index) insert $agent # insert destination agent into session replicator;

            set src [lindex $pair 0] # find accum. b/w and delay;
            set dst [[$agent set node_] id]
            set accu_bw [$self get-bw $dst $src]
            set delay [$self get-delay $dst $src]

            set random_variable [new RandomVariable/Constant] # set delay variable ;
            $random_variable set avg_ $delay

            set delay_module [new DelayModel] # configure the delay module;
            $delay_module bandwidth $accu_bw
            $delay_module ranvar $random_variable

            $session_($index) insert-module $delay_module $agent # insert the delay module;

Tom Henderson 2011-11-05