37.1.1.0.2 Application Data Handling

The agent does not generate any application data on its own; instead, the simulation user can connect any traffic generation module to any SRM agent to generate data. The following code demonstrates how a traffic generation agent can be attached to an SRM agent:
        set packetSize 210
        set exp0 [new Application/Traffic/Exponential]    # configure traffic generator;
        $exp0 set packetSize_ $packetSize
        $exp0 set burst_time_ 500ms 
        $exp0 set idle_time_ 500ms
        $exp0 set rate_ 100k 

        {\bfseries{}$exp0 attach-agent $srm0} # attach application to SRM agent;
        {\bfseries{}$srm0 set packetSize_ $packetSize} # to generate repair packets of appropriate size;
        $srm0 set tg_ $exp0 # pointer to traffic generator object;
        $srm0 set app_fid_ 0 # fid value for packets generated by traffic generator;
The user can attach any traffic generator to an SRM agent. The SRM agent will add the SRM headers, set the destination address to the multicast group, and deliver the packet to its target. The SRM header contains the type of the message, the identity of the sender, the sequence number of the message, and (for control messages), the round for which this message is being sent. Each data unit in SRM is identified as sender's id, message sequence number.

The SRM agent does not generate its own data; it does not also keep track of the data sent, except to record the sequence numbers of messages received in the event that it has to do error recovery. Since the agent has no actual record of past data, it needs to know what packet size to use for each repair message. Hence, the instance variable packetSize_ specifies the size of repair messages generated by the agent.

Tom Henderson 2011-11-05