Data and communication
// ========================================================================= // Filename: Proj_ThreeNodes.ned // // Purpose: // - GECE 586 Project 1 sample // - Tictoc using packets with sequence numbers // // Revision History // - File created: Oct. 23, 2019, W. Lee // // ========================================================================= // Define modules for a packet source, nodes A, B, & C, each with a queue, and a sink simple mySource { parameters: volatile double sendIaTime @unit(s); @display("i=block/source"); gates: output out; } simple Node_w_Packets { parameters: @display("i=block/routing"); // add a defacult icon gates: input in; output out; } simple mySink { parameters: @display("i=block/sink"); @signal[lifetime](type="simtime_t"); @statistic[lifetime](title="lifetime of arrived jobs"; unit=s; record=vector,mean,max; interpolationmode=none); gates: input in; } // Create a 2-node network using the module defined above network Proj_ThreeNodes { @display("bgb=425.065,162.325"); submodules: // These two submodules act as Node A for the Project 1 scenario ====== gen_pkt: mySource { parameters: @display("p=33.975,39.260002"); } node_A: Node_w_Packets { parameters: @display("i=,cyan;p=92.11,39.260002"); } // -------------------------------------------------------------------- // Node B placed between Node A and Node C ============================ node_B: Node_w_Packets { parameters: @display("i=,gold;p=213.66501,39.260002"); } // -------------------------------------------------------------------- // These two submodules act as Node C for the Project 1 scenario ====== node_C: Node_w_Packets { parameters: @display("i=,blue;p=372.215,39.260002"); } sink_pkt: mySink { parameters: @display("p=372.215,100.415"); } // -------------------------------------------------------------------- connections: // Packet to Node A: gen_pkt.out --> node_A.in; // Packet to Node B: node_A.out --> node_B.in; // Packet to Node C node_B.out --> node_C.in; node_C.out --> sink_pkt.in; }