📄 print2.ps~
字号:
( 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( 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( sprintf\( s, "offset-time: %lf", BurstManager::offsettime\(\) \);) N( Debug::debug\( s \);) N( sprintf\( s, "delta: %lf", BurstManager::delta\(\) \);) N( Debug::debug\( s \);) N( return \(TCL_OK\);) N( }) N( }) N( else if \( argc == 3 \) {) N( /*) N( * $iagent initiagent $numEdgenodes) N( */) N( if\(strcasecmp\(argv[1],"initiagent"\) == 0 \) {) N( maxindx_ = atoi\(argv[2]\);) N( BM_ = new BurstManager[maxindx_];) N() N( for \( int i = 0; i < maxindx_ ; i++ \)) N( BM_[i].init\(this,i\);) N( return\(TCL_OK\);) N( }) N( }) N() N( return\(Agent::command\(argc, argv\)\);) N(}) N() N(// Expire event in the burst timer) 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() N(stdin) (Page 12/25) (Feb 21, 04 14:03) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (6/13) (Saturday February 21, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (13-14) 7%%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 20 15:49 2004 Page: 9) p n() 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( add_method\( "pcntguard" \);) N( add_method\( "offsettime" \);) N( add_method\( "delta" \);) N( add_method\( "bursttimeout" \);) N() N(}) N() N(// method) N(int BurstManagerClass::method\( int ac, const char*const* av \) {) N() N(stdin) (Page 13/25) (Feb 21, 04 14:03) 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 20 15:49 2004 Page: 10) p n() N() S 8 T ( Tcl& tcl = Tcl::instance\(\);) N() N( int argc = ac-2;) N( const char*const* argv = av + 2;) N() N( if\( argc == 2 \) {) N( if\( strcmp\( argv[1], "maxburstsize" \) == 0 \) {) N() S 8 T () S 16 T ( tcl.resultf\( "%d", BurstManager::maxburstsize\(\) \);) N( ) S 8 T () S 16 T (return \(TCL_OK\);) S 40 T () N( } else if\( strcmp\( argv[1], "pcntguard" \) == 0 \) {) N( tcl.resultf\( "%d", BurstManager::pcntguard\(\) \);) N( return \(TCL_OK\);) N( } else if\( strcmp\( argv[1], "offsettime" \) == 0 \) {) N( tcl.resultf\( "%lf", BurstManager::offsettime\(\) \);) N( return \(TCL_OK\);) N( } else if\( strcmp\( argv[1], "delta" \) == 0 \) {) N( tcl.resultf\( "%lf", BurstManager::delta\(\) \);) N( return \(TCL_OK\);) N( } else if\( strcmp\( argv[1], "bursttimeout" \) == 0 \) {) N( tcl.resultf\( "%lf", BurstManager::burst_timeout\(\) \);) N( return \(TCL_OK\);) N( }) N( } else if\( argc == 3 \) {) N( if\( strcmp\( argv[1], "maxburstsize" \) == 0 \) {) N( BurstManager::setMaxburstsize\( atoi\( argv[2] \) \);) N( return \(TCL_OK\);) N( } else if\( strcmp\( argv[1], "pcntguard" \) == 0 \) {) N( BurstManager::setPcntguard\( atoi\( argv[2] \) \);) N( return \(TCL_OK\);) N( } else if\( strcmp\( argv[1], "offsettime" \) == 0 \){) N( BurstManager::offsettime\(\) = atof\( argv[2] \);) N( return \(TCL_OK\);) N( } else if\( strcmp\( argv[1], "delta" \) == 0 \) {) N( BurstManager::setDelta\( atof\( argv[2] \) \);) N( return \(TCL_OK\);) N( } else if\( strcmp\( argv[1], "bursttimeout" \) == 0 \) {) N( BurstManager::setBursttimeout\( atof\( argv[2] \) \);) N( return \(TCL_OK\);) N( } ) S 24 T ( ) S 32 T () S 40 T () S 48 T () S 56 T () N() N( }) N( return TclClass::method\( ac, av \);) N(}) N() N() N() N() N() N() N() N() N() N() N() N() N() N() N(stdin) (Page 14/25) (Feb 21, 04 14:03) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (7/13) (Saturday February 21, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (15-16) 8%%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 20 15:49 2004 Page: 11) p n() N() N() N() N() N() N() N() N() N() N() N() N() N() N(stdin) (Page 15/25) (Feb 21, 04 14:03) 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.h) K( Feb 10 09:27 2004 Page: 12) p n() N(/* Copyright \(c\) University of Maryland, Baltimore County, 2003.) N( * Original Authors: Ramakrishna Shenai, Sunil Gowda and Krishna Sivalingam.) N( *) N( * This software is developed at the University of Maryland, Baltimore County un) N(der) N( * grants from Cisco Systems Inc and the University of Maryland, Baltimore Count) N(y.) N( *) N( * Permission to use, copy, modify, and distribute this software and its) N( * documentation in source and binary forms for non-commercial purposes) N( * and without fee is hereby granted, provided that the above copyright) N( * notice appear in all copies and that both the copyright notice and) N( * this permission notice appear in supporting documentation. and that) N( * any documentation, advertising materials, and other materials related) N( * to such distribution and use acknowledge that the software was) N( * developed by the University of Maryland, Baltimore County. The name of) N( * the University may not be used to endorse or promote products derived from) N( * this software without specific prior written permission.) N( *) N( * Copyright \(C\) 2000-2003 Washington State University. All rights reserved.) N( * This software was originally developed at Alcatel USA and subsequently modifi) N(ed) N( * at Washington State University, Pullman, WA through research work which was) N( * supported by Alcatel USA, Inc and Cisco Systems Inc.) N() N( * The following notice is in adherence to the Washington State University) N( * copyright policy follows.) N( *) N( * License is granted to copy, to use, and to make and to use derivative) N( * works for research and evaluation purposes, provided that Washington) N( * State University is acknowledged in all documentation pertaining to any such) N( * copy or derivative work. Washington State University grants no other) N( * licenses expressed or implied. The Washington State University name) N( * should not be used in any advertising without its written permission.) N( *) N( * WASHINGTON STATE UNIVERSITY MAKES NO REPRESENTATIONS CONCERNING EITHER) N( * THE MERCHANTABILITY OF THIS SOFTWARE OR THE SUITABILITY OF THIS SOFTWARE) N( * FOR ANY PARTICULAR PURPOSE. The software is provided "as is") N( * without express or implied warranty of any kind. These notices must) N( * be retained in any copies of any part of this software.) N( */) N() N(#ifndef integrated_agent_h) N(#define integrated_agent_h) N() N(#include "address.h") N(#include "agent.h") N(#include "object.h") N(#include "config.h") N(#include "ip.h") N(#include "tcp.h") N(#include "packet.h") N(#include "timer-handler.h") N() N(#include "./common/stat-collector.h") N() N(/* The maximum possible burst size \(limit\) */) N(#define MAXBURSTSIZE 41000) N() N(stdin) (Page 16/25) (Feb 21, 04 14:03) titlebordergrestore(Printed by U-GMGPC2\\Geoffrey M. Garner) rhead(stdin) (8/13) (Saturday February 21, 2004) footerend % of iso1dictpagesave restoreshowpage%%Page: (17-18) 9%%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.h) K( Feb 10 09:27 2004 Page: 13) p n() N(/* Maximum possible burst id after which burst id is set to 0 */) N(/*) N(#define MAXBURSTID 4294967296) N(*/) N(#define MAXBURSTID 4294967295 // GMG -- changed to 2^32-1 to avoid compilation) N( error) N() N(class BurstManager;) N(class IPKTAgent;) N() N(typedef unsigned int u_int;) N() N(/* Burst Timer is a timer support class attached to the burst manager) N( * The main function of the timer is to fire the expire method, when) N( * the prespecified time expires. This functionality is used in the) N( * temporal burstification algorithm.) N( */) N(class BurstTimer: public TimerHandler) N({) N( public:) N( /* Constructs a new burst-timer object - intended to be initialized) N( * by the associated BurstManager object instance.) N( * bm - represents the burst-manager instance.) N( */) N( BurstTimer\( BurstManager *bm \): TimerHandler\(\) { bm_ = bm; }) N( protected:) N( /* What needs to be done when the time-out occurs */) N( virtual void BurstTimer::expire\(Event *e\);) N( /* a pointer to the associated burst-manager */) N( BurstManager *bm_;) N(};) N() N() N(/* The burst manager is an integral part of the Integrated Agent present) N( * only at the edge nodes \(or edge routers\). In this implementation, only) N( * one burst-manager \(i.e only one packet queue\) is maintained for every) N( * other edge node.) N( * Example: If the reference network contains N edge nodes, then \(N-1\)) N( * burst-manager references will be maintained at every edge node.) N( *) N( * The primary functionality of this object is to aggregate incoming TCP) N( * or other IP packets and to send them out as bursts, as the temporal) N( * burstification algorithm shown below:) N( *) N( * if\( sizeof\( burst-manager-queue \) > predefined_max_burst_size \) \)) N( * or if\( timeout-event has occured \)) N( * send the burst.) N( *) N( * This implementation does not provide multiple class queues etc.. per-edge) N( * node.) N( */) N(class BurstManager : public NsObject) N({) N( public:) N( /* constructs a new BurstManager object - Note: although the burst) N( * manager can be created via otcl, we intend to create it in the) N( * Integrated agent block in C++ itself. We just use the tcl interface) N() N(stdin) (Page 17/25) (Feb 21, 04 14:03) 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.h) K( Feb 10 09:27 2004 Page: 14) p n() N( * to configure the parameters refer BurstManagerClass implementation) N( * on how-to-configure the burst-manager parameters */) N( BurstManager\(\);) N() N( /* Intended to be called by the associated Edge node's IPKT Agent \(or) N( * Integrated Agent\).) N( * destnodeid -- represents the destination node id of the destination) N( * edge router.) N( */) N( void init\( IPKTAgent* parent, int destnodeid \);) N() N( /* Handles a recv of a packet, when a packet is received it is queued) N( * on a per-destination basis, and a burst is released based on the) N( * temporal burstification algorithm show above. */) N
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -