📄 printout.ps
字号:
( }) p n( BM_[priority][hdrip->daddr\(\)].recv\( pkt, h \);) N( return;) N() N(stdin) (Page 19/122) (Mar 01, 04 20:25) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K( Feb 29 18:09 2004 Page: 15) p n() N( }) N( else if\( \( ch->ptype\(\) == PT_IPKT \) && \( hdrip->daddr\(\) == addr\(\) \) \) {) N( if \( hdrip->prio_== 2 \) {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "BURSTRCV", sc.getValue\( "BURSTRCV" \) + 1.0 \);) N() N( /* record the end to end delay for the data-burst */ ) N( sc.updateEntry\( "BURSTDLY", sc.getValue\( "BURSTDLY" \) + Scheduler::in) N(stance\(\).clock\(\) - hdr->end_end_delay\(\) \);) N( if\( ch->size\(\) <= 0 \) {) N( Debug::debug\( __FILE__, __LINE__, "Critical error occurred: Burs) N(t of size=0 found" \);) N( exit \(-1\);) N( }) N( deBurst\( pkt \);) N( return;) N( }) N( else if \( hdrip->prio_==1 \) {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "BHPRCV", sc.getValue\( "BHPRCV" \) + 1.0 \);) N( sc.updateEntry\( "BHPDLY", sc.getValue\( "BHPDLY" \) + Scheduler::insta) N(nce\(\).clock\(\) - hdr->end_end_delay\(\) \);) N( }) N( }) N( else {) N() N( }) N( if\( pkt != NULL \) {) N( Packet::free\( pkt \);) N( }) N(}) N() N(// deburstify) N(void IPKTAgent::deBurst\(Packet *pkt\)) N({) N( hdr_ip* hdrip = hdr_ip::access\(pkt\);) N( hdr_IPKT* hdr = hdr_IPKT::access\( pkt \);) N( hdr_cmn* ch = hdr_cmn::access\(pkt\);) N() N( hdr_cmn* tcpch;) N( int npkts = hdr->npkts\(\);) N() N( Packet **p = \(Packet**\)pkt->accessdata\(\);) N() N( while \( npkts--\) {) N( tcpch = hdr_cmn::access\(*p\);) N() N( if \(tcpch->ptype\(\) == PT_TCP\) //GMG -- added TCPRCV, ACKRCV, and UDPRCV) N( // statistics collection) N( {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "TCPRCV", sc.getValue\( "TCPRCV" \) + 1.0 \);) N( sc.updateEntry\( "TCPBYTESRCV", sc.getValue\( "TCPBYTESRCV" \) + tcpch->) N(size\(\) \);) N( sc.updateEntry\( "TCPDLY", sc.getValue\( "TCPDLY" \) + Scheduler::instan) N(ce\(\).clock\(\) - tcpch->timestamp\(\) \);) N() N( }) N( else if \(tcpch->ptype\(\) == PT_UDP\)) N( {) N(stdin) (Page 20/122) (Mar 01, 04 20:25) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (10/61) (Monday March 01, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (21-22) 11%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto( StatCollector &sc = StatCollector::instance\(\);) p n() N(stdin) (Page 21/122) (Mar 01, 04 20:25) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K( Feb 29 18:09 2004 Page: 16) p n() N( sc.updateEntry\( "UDPRCV", sc.getValue\( "UDPRCV" \) + 1.0 \);) N( sc.updateEntry\( "UDPBYTESRCV", sc.getValue\( "UDPBYTESRCV" \) + tcpch->) N(size\(\) \);) N( sc.updateEntry\( "UDPDLY", sc.getValue\( "UDPDLY" \) + Scheduler::instan) N(ce\(\).clock\(\) - tcpch->timestamp\(\) \);) N( }) N( else if \(tcpch->ptype\(\) == PT_ACK\)) N( {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "ACKRCV", sc.getValue\( "ACKRCV" \) + 1.0 \);) N( }) N( else if \(tcpch->ptype\(\) == PT_CBR\)) N( {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "CBRRCV", sc.getValue\( "CBRRCV" \) + 1.0 \);) N( sc.updateEntry\( "CBRBYTESRCV", sc.getValue\( "CBRBYTESRCV" \) + tcpch->) N(size\(\) \);) N( sc.updateEntry\( "CBRDLY", sc.getValue\( "CBRDLY" \) + Scheduler::instan) N(ce\(\).clock\(\) - tcpch->timestamp\(\) \);) N() N( }) N( else if \(tcpch->ptype\(\) == PT_EXP\)) N( {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "EXPRCV", sc.getValue\( "EXPRCV" \) + 1.0 \);) N( sc.updateEntry\( "EXPBYTESRCV", sc.getValue\( "EXPBYTESRCV" \) + tcpch->) N(size\(\) \);) N( sc.updateEntry\( "EXPDLY", sc.getValue\( "EXPDLY" \) + Scheduler::instan) N(ce\(\).clock\(\) - tcpch->timestamp\(\) \);) N( }) N( else if \(tcpch->ptype\(\) == PT_PARETO\)) N( {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "PARRCV", sc.getValue\( "PARRCV" \) + 1.0 \);) N( sc.updateEntry\( "PARBYTESRCV", sc.getValue\( "PARBYTESRCV" \) + tcpch->) N(size\(\) \);) N( sc.updateEntry\( "PARDLY", sc.getValue\( "PARDLY" \) + Scheduler::instan) N(ce\(\).clock\(\) - tcpch->timestamp\(\) \);) N( }) N( else if \(tcpch->ptype\(\) == PT_SELFSIM\)) N( {) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "SSIMRCV", sc.getValue\( "SSIMRCV" \) + 1.0 \);) N( sc.updateEntry\( "SSIMBYTESRCV", sc.getValue\( "SSIMBYTESRCV" \) + tcpch) N(->size\(\) \);) N( sc.updateEntry\( "SSIMDLY", sc.getValue\( "SSIMDLY" \) + Scheduler::inst) N(ance\(\).clock\(\) - tcpch->timestamp\(\) \);) N( }) N() N( send\(*p,0\);) N( p++;) N( }) N( Packet::free\(pkt\);) N(}) N() N(void IPKTAgent::sendBurst\( Packet** pBurst, int bid, int npkts,) N( int burstsize, int destnode, double offsettime, int pcntguard,) N( double delta, int priority \)) N({) N() N(stdin) (Page 22/122) (Mar 01, 04 20:25) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (11/61) (Monday March 01, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (23-24) 12%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto( char s[100];) p n() N( // This block sends a burst header packet BHP //) N( Packet* pkt_bhp = allocpkt\(\);) N( hdr_ip* hdr_ip_bhp = hdr_ip::access\(pkt_bhp\);) N( hdr_IPKT *hdr_IPKT_bhp = hdr_IPKT::access\(pkt_bhp\);) N() N(stdin) (Page 23/122) (Mar 01, 04 20:25) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K( Feb 29 18:09 2004 Page: 17) p n() N( hdr_cmn* cmn_bhp = hdr_cmn::access\(pkt_bhp\);) N() N( hdr_ip_bhp->daddr\(\) = destnode;) N( hdr_ip_bhp->prio_ = 1; // BHP) N( hdr_ip_bhp->fid_ = 1; // BHP; GMG added -- put into IP header flow ID) N( // for use with trace file \(trace file prints flow id but not priority;) N( // need to have indication in trace file of whether IPKT is BHP or DB\)) N() N( // set the values into the individual bhp elements) N( hdr_IPKT_bhp->C_burst_id_ = bid;) N( hdr_IPKT_bhp->C_burst_size_ = size_ + burstsize;) N( hdr_IPKT_bhp->offset_time_ = offsettime;) N( hdr_IPKT_bhp->prio_ = priority;) N( hdr_IPKT_bhp->delta_ = delta;) N( hdr_IPKT_bhp->pcntguard_ = pcntguard;) N( hdr_IPKT_bhp->end_end_delay_ = Scheduler::instance\(\).clock\(\);) N( //GMG -- initialize the fdl_count_ field to zero) N( hdr_IPKT_bhp->fdl_count_ = 0;) N( //GMG -- update the IPKT sequence number, and put into the BHP) N( hdr_IPKT_bhp->seqno = seqno_;) N( send\(pkt_bhp,0\); // send the BHP immediately) N( StatCollector &sc = StatCollector::instance\(\);) N( sc.updateEntry\( "BHPSND", sc.getValue\( "BHPSND" \) + 1.0 \);) N() N( //char s[100];) N( // This is to send the burst pkt //) N( Packet* pkt_burst = allocpkt\(\);) N( hdr_ip* hdr_ip_burst = hdr_ip::access\(pkt_burst\);) N( hdr_IPKT* hdr_IPKT_burst = hdr_IPKT::access\(pkt_burst\);) N() N( hdr_cmn* cmn_burst = hdr_cmn::access\(pkt_burst\);) N( ) N( //copy the payload) N( pkt_burst->allocdata\(npkts*sizeof\(Packet*\)\);) N( // memcpy could be heavy) N( memcpy\(pkt_burst->accessdata\(\),pBurst,npkts*sizeof\(Packet*\)\);) N( ) N( hdr_ip_burst->daddr\(\) = destnode;) N( hdr_ip_burst->prio_ = 2; // Prio=2 indicated burst pkt sent) N( hdr_ip_burst->fid_ = 2; // BHP; GMG added -- put into IP header flow ID) N( // for use with trace file \(trace file prints flow id but not priority;) N( // need to have indication in trace file of whether IPKT is BHP or DB\)) N() N( hdr_IPKT_burst->C_burst_id_ = bid;) N( hdr_IPKT_burst->C_burst_size_ = burstsize;) N( hdr_IPKT_burst->offset_time_ = offsettime;) N( hdr_IPKT_burst->prio_ = priority;) N( hdr_IPKT_burst->end_end_delay_ = Scheduler::instance\(\).clock\(\);) N() N( hdr_IPKT_burst->npkts\(\) = npkts;) N() N( cmn_burst->size\(\) += burstsize;) N( sprintf\( s, "Sending a DB to node : %d", destnode \);) N( // Debug::debug \( s \);) N() N( //GMG -- initialize the fdl_count_ field to zero \(note that) N() N(stdin) (Page 24/122) (Mar 01, 04 20:25) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (12/61) (Monday March 01, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (25-26) 13%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K( Feb 29 18:09 2004 Page: 18) p n() N( // this field is not used in DB, but we set it to zero\)) N( hdr_IPKT_burst->fdl_count_ = 0;) N( //GMG -- put the IPKT sequence number into the DB; note that the DB and) N( //corresponding BHP have the same sequence number) N( hdr_IPKT_burst->seqno = \(seqno_++\);) N( send\(pkt_burst,0\);) N( sc = StatCollector::instance\(\);) N( sc.updateEntry\( "BURSTSND", sc.getValue\( "BURSTSND" \) + 1.0 \);) N(}) N() N(int IPKTAgent::command\(int argc, const char*const* argv\) {) N(int j; // GMG -- changed the invocation of offsettime\(\) to be for each QoS clas) N(s) N( if\( argc == 2 \) {) N( /*) N( * $iagent dumpburstdefaults) N( */) N( if\( strcmp\( argv[1], "dumpburstdefaults" \) == 0 \) {) N( char s[100];) N( sprintf\( s, "maxburstsize: %d", BurstManager::maxburstsize\(\) \);) N( Debug::debug\( s \);) N( sprintf\( s, "pcntguard: %d", BurstManager::pcntguard\(\) \);) N( Debug::debug\( s \);) N( sprintf\( s, "burst-time-out: %lf", BurstManager::burst_timeout\(\) \);) N( Debug::debug\( s \);) N( for \(j = 0; j < nqos_classes; j++\)) N( {) N( sprintf\( s, "QoS Class: %d offset-time: %lf", j, BurstManager) N(::offsettime\(j\) \);) N( Debug::debug\( s \);) N( }) N( sprintf\( s, "delta: %lf", BurstManager::delta\(\) \);) N( Debug::debug\( s \);) N( return \(TCL_OK\);) N( }) N( }) N( else if \( argc == 3 \) { //GMG -- Changed to BM_ initialization to be over Q) N(oS) N( // classes as well as other edge nodes) N( /*) N( * $iagent initiagent $numEdgenodes) N( */) N( if\(strcasecmp\(argv[1],"initiagent"\) == 0 \) {) N( maxindx_ = atoi\(argv[2]\);) N() N( for \(j = 0; j < nqos_classes; j++\)) N( BM_[j] = new BurstManager[maxindx_];) N() N( for \( int i = 0; i < maxindx_ ; i++ \)) N( for \(j = 0; j < nqos_classes; j++\)) N( BM_[j][i].init\(this, i, j\);) N( return\(TCL_OK\);) N( }) N( }) N() N( return\(Agent::command\(argc, argv\)\);) N(}) N() N(// Expire event in the burst timer) N() N(stdin) (Page 25/122) (Mar 01, 04 20:25) titleborder/v 1 store/x0 x v get 3.362408 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(integrated_agent.cc) K( Feb 29 18:09 2004 Page: 19) p n() N(void BurstTimer::expire\(Event* e\)) N({) N( bm_->timeout\(\);) N(}) N() N(// Definition of the IPKT header class) N(static class IPKTHeaderClass : public PacketHeaderClass) N({) N( public:) N( IPKTHeaderClass\(\) : PacketHeaderClass\("PacketHeader/IPKT",) N( sizeof\(hdr_IPKT\)\)) N() N( {) N( bind_offset\(&hdr_IPKT::offset_ipkt_\);) N( }) N(}class_IPKThdr;) N() N(// Defintion of the IPKT Class) N(static class IPKTClass : public TclClass) N({) N(public:) N( IPKTClass\(\) : TclClass\("Agent/IPKT"\){}) N( TclObject * create \(int, const char*const*\) {) N( return \( new IPKTAgent \);) N( }) N(}class_IPKT;) N() N(/*=====================================================================*) N( * *) N( * Implementation of the Burst-Manager class *) N( * *) N( * Definition and Implementation of the Burst manager class. *) N( * derived from the TclClass so that a TCL interface \(or TCL *) N( * instantiation\) of the BurstManager is available. *) N( * Note: the bind and method methods are overriden so as to *) N( * provide tcl access to the static variables. *) N( * ref section 3.0 of the ns-2 manual on more details *) N( * *) N( *=====================================================================*/) N(static class BurstManagerClass : public TclClass) N({) N( public:) N( BurstManagerClass\(\) : TclClass\( "BurstManager" \) {}) N( TclObject *create\( int, const char*const* \) {) N( return \( new BurstManager \);) N( }) N() N( virtual void bind\(\);) N( virtual int method\( int argc, const char*const* argv \);) S 64 T () S 72 T () N(}class_burstmanagerclass;) N() N(// bind) N(void BurstManagerClass::bind\(\) {) N() S 8 T () S 16 T (TclClass::bind\(\);) N( ) S 8 T (add_method\( "maxburstsize" \);) N() N() N(stdin) (Page 26/122) (Mar 01, 04 20:25) titlebordergrestore(Printe
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -