The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

nmlab.korea.ac.kr
from nmlab.korea.ac.kr More from this publisher
12.07.2015 Views

Type ofTag Object Other values CommentsQDETECTQ INTERVALS C1 〈C1_〉 C2 〈C2_〉 dist 〈distance〉 i 〈backoff_〉Q NTIMER at 〈time〉 Time the request timer will fireQSENDNACKQ NACK IGNORE-BACKOFF 〈time〉 Receive NACK, ignore other NACKsuntil 〈time〉Q REPAIR IGNORES 〈time〉 Receive REPAIR, ignore NACKs until〈time〉Q DATA Agent receives data instead of repair.Possibly indicates out of order arrival ofdata.P NACK from 〈requester〉 Receive NACK, initiate repairP INTERVALS D1 〈D1_〉 D2 〈D2_〉 dist 〈distance〉P RTIMER at 〈time〉 Time the repair timer will firePSENDREPP REPAIR IGNORES 〈time〉 Receive REPAIR, ignore NACKs until〈time〉P DATA Agent receives data instead of repair. Indicatespremature request by an agent.S SESSION logs session message sentThe following illustrates a typical trace for a single loss and recovery.3.5543 n 1 m r 0 Q DETECT3.5543 n 1 m r 1 Q INTERVALS C1 2.0 C2 0.0 d 0.0105 i 13.5543 n 1 m r 1 Q NTIMER at 3.575273.5685 n 2 m r 0 Q DETECT3.5685 n 2 m r 1 Q INTERVALS C1 2.0 C2 0.0 d 0.021 i 13.5685 n 2 m r 1 Q NTIMER at 3.610533.5753 n 1 m r 1 Q SENDNACK3.5753 n 1 m r 2 Q INTERVALS C1 2.0 C2 0.0 d 0.0105 i 23.5753 n 1 m r 2 Q NTIMER at 3.617273.5753 n 1 m r 2 Q NACK IGNORE-BACKOFF 3.596273.5828 n 3 m r 0 Q DETECT3.5828 n 3 m r 1 Q INTERVALS C1 2.0 C2 0.0 d 0.032 i 13.5828 n 3 m r 1 Q NTIMER at 3.64683.5854 n 0 m r 0 P NACK from 2573.5854 n 0 m r 1 P INTERVALS D1 1.0 D2 0.0 d 0.01053.5854 n 0 m r 1 P RTIMER at 3.595863.5886 n 2 m r 2 Q INTERVALS C1 2.0 C2 0.0 d 0.021 i 23.5886 n 2 m r 2 Q NTIMER at 3.672623.5886 n 2 m r 2 Q NACK IGNORE-BACKOFF 3.630623.5959 n 0 m r 1 P SENDREP3.5959 n 0 m r 1 P REPAIR IGNORES 3.627363.5971 n 4 m r 0 Q DETECT3.5971 n 4 m r 1 Q INTERVALS C1 2.0 C2 0.0 d 0.0425 i 13.5971 n 4 m r 1 Q NTIMER at 3.682073.5971 n 5 m r 0 Q DETECT3.5971 n 5 m r 1 Q INTERVALS C1 2.0 C2 0.0 d 0.042 i 13.5971 n 5 m r 1 Q NTIMER at 3.681073.6029 n 3 m r 2 Q INTERVALS C1 2.0 C2 0.0 d 0.032 i 2313

3.6029 n 3 m r 2 Q NTIMER at 3.730893.6029 n 3 m r 2 Q NACK IGNORE-BACKOFF 3.666893.6102 n 1 m r 2 Q REPAIR IGNORES 3.641713.6172 n 4 m r 2 Q INTERVALS C1 2.0 C2 0.0 d 0.0425 i 23.6172 n 4 m r 2 Q NTIMER at 3.787153.6172 n 4 m r 2 Q NACK IGNORE-BACKOFF 3.702153.6172 n 5 m r 2 Q INTERVALS C1 2.0 C2 0.0 d 0.042 i 23.6172 n 5 m r 2 Q NTIMER at 3.785153.6172 n 5 m r 2 Q NACK IGNORE-BACKOFF 3.701153.6246 n 2 m r 2 Q REPAIR IGNORES 3.687563.6389 n 3 m r 2 Q REPAIR IGNORES 3.734923.6533 n 4 m r 2 Q REPAIR IGNORES 3.780773.6533 n 5 m r 2 Q REPAIR IGNORES 3.77927The logging of request and repair traces is done by SRM::evTrace{}. However, the routine SRM/Session::evTrace{},overrides the base class definition of srm::evTrace{}, and writes out nothing. Individual simulation scripts can overridethese methods for greater flexibility in logging options. One possible reason to override these methods might to reduce theamount of data generated; the new procedure could then generate compressed and processed output.Notice that the trace filoe contains sufficient information and details to derive most of the statistics written out in the log file,or is stored in the statistics arrays.36.2 Architecture and InternalsThe SRM agent implementation splits the protocol functions into packet handling, loss recovery, and session message activity.Packet handling consists of forwarding application data messages, sending and receipt of control messages. Theseactivities are executed by C++ methods.Error detection is done in C++ due to receipt of messages. However, the loss recovery is entirely done through instanceprocedures in OTcl.The sending and processing of messages is accomplished in C++; the policy about when these messages should be sentis decided by instance procedures in OTcl.We first describe the C++ processing due to receipt of messages (Section 36.3). Loss recovery and the sending of sessionmessages involves timer based processing. The agent uses a separate class SRM to perform the timer based functions. Foreach loss, an agent may do either request or repair processing. Each agent will instantiate a separate loss recovery object forevery loss, as is appropriate for the processing that it has to do. In the following section we describe the basic timer basedfunctions and the loss recovery mechanisms (Section 36.5). Finally, each agent uses one timer based function for sendingperiodic session messages (Section 36.6).36.3 Packet Handling: Processing received messagesThe recv() method can receive four type of messages: data, request, repair, and session messages.Data Packets The agent does not generate any data messages. The user has to specify an external agent to generate traffic.The recv() method must distinguish between locally originated data that must be sent to the multicast group, and data314

3.6029 n 3 m r 2 Q NTIMER <strong>at</strong> 3.730893.6029 n 3 m r 2 Q NACK IGNORE-BACKOFF 3.666893.6102 n 1 m r 2 Q REPAIR IGNORES 3.641713.6172 n 4 m r 2 Q INTERVALS C1 2.0 C2 0.0 d 0.0425 i 23.6172 n 4 m r 2 Q NTIMER <strong>at</strong> 3.787153.6172 n 4 m r 2 Q NACK IGNORE-BACKOFF 3.702153.6172 n 5 m r 2 Q INTERVALS C1 2.0 C2 0.0 d 0.042 i 23.6172 n 5 m r 2 Q NTIMER <strong>at</strong> 3.785153.6172 n 5 m r 2 Q NACK IGNORE-BACKOFF 3.701153.6246 n 2 m r 2 Q REPAIR IGNORES 3.687563.6389 n 3 m r 2 Q REPAIR IGNORES 3.734923.6533 n 4 m r 2 Q REPAIR IGNORES 3.780773.6533 n 5 m r 2 Q REPAIR IGNORES 3.77927<strong>The</strong> logging of request <strong>and</strong> repair traces is done by SRM::evTrace{}. However, the routine SRM/Session::evTrace{},overrides the base class definition of srm::evTrace{}, <strong>and</strong> writes out nothing. Individual simul<strong>at</strong>ion scripts can overridethese methods for gre<strong>at</strong>er flexibility in logging optio<strong>ns</strong>. One possible reason to override these methods might to reduce theamount of d<strong>at</strong>a gener<strong>at</strong>ed; the new procedure could then gener<strong>at</strong>e compressed <strong>and</strong> processed output.Notice th<strong>at</strong> the trace filoe contai<strong>ns</strong> sufficient inform<strong>at</strong>ion <strong>and</strong> details to derive most of the st<strong>at</strong>istics written out in the log file,or is stored in the st<strong>at</strong>istics arrays.36.2 Architecture <strong>and</strong> Internals<strong>The</strong> SRM agent implement<strong>at</strong>ion splits the protocol functio<strong>ns</strong> into packet h<strong>and</strong>ling, loss recovery, <strong>and</strong> session message activity.Packet h<strong>and</strong>ling co<strong>ns</strong>ists of forwarding applic<strong>at</strong>ion d<strong>at</strong>a messages, sending <strong>and</strong> receipt of control messages. <strong>The</strong>seactivities are executed by C++ methods.Error detection is done in C++ due to receipt of messages. However, the loss recovery is entirely done through i<strong>ns</strong>tanceprocedures in OTcl.<strong>The</strong> sending <strong>and</strong> processing of messages is accomplished in C++; the policy about when these messages should be sentis decided by i<strong>ns</strong>tance procedures in OTcl.We first describe the C++ processing due to receipt of messages (Section 36.3). Loss recovery <strong>and</strong> the sending of sessionmessages involves timer based processing. <strong>The</strong> agent uses a separ<strong>at</strong>e class SRM to perform the timer based functio<strong>ns</strong>. Foreach loss, an agent may do either request or repair processing. Each agent will i<strong>ns</strong>tanti<strong>at</strong>e a separ<strong>at</strong>e loss recovery object forevery loss, as is appropri<strong>at</strong>e for the processing th<strong>at</strong> it has to do. In the following section we describe the basic timer basedfunctio<strong>ns</strong> <strong>and</strong> the loss recovery mechanisms (Section 36.5). Finally, each agent uses one timer based function for sendingperiodic session messages (Section 36.6).36.3 Packet H<strong>and</strong>ling: Processing received messages<strong>The</strong> recv() method can receive four type of messages: d<strong>at</strong>a, request, repair, <strong>and</strong> session messages.D<strong>at</strong>a Packets <strong>The</strong> agent does not gener<strong>at</strong>e any d<strong>at</strong>a messages. <strong>The</strong> user has to specify an external agent to gener<strong>at</strong>e traffic.<strong>The</strong> recv() method must distinguish between locally origin<strong>at</strong>ed d<strong>at</strong>a th<strong>at</strong> must be sent to the multicast group, <strong>and</strong> d<strong>at</strong>a314

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!