diff -r edited-ns/ns-2.27/common/packet.h original-ns/ns-2.27/common/packet.h 162,163d161 < //multipath < PT_CPROBE, 254,255d251 < < name_[PT_CPROBE]="CProbe"; diff -r edited-ns/ns-2.27/common/scheduler.cc original-ns/ns-2.27/common/scheduler.cc 882,883d880 < //This is an experimentally found value providing the fastest simulation for big topology used in our experiments. You can delete it < nw=0.0000163748000000; diff -r edited-ns/ns-2.27/queue/queue.cc original-ns/ns-2.27/queue/queue.cc 179,180c179,180 < // while ((p = deque()) != 0) < // drop(p); --- > while ((p = deque()) != 0) > drop(p); diff -r edited-ns/ns-2.27/routing/rtmodule.cc original-ns/ns-2.27/routing/rtmodule.cc 76,87d75 < < //multipath < static class MPSourceRoutingModuleClass : public TclClass { < public: < MPSourceRoutingModuleClass() : TclClass("RtModule/MPSource") {} < TclObject* create(int, const char*const*) { < return (new MPSourceRoutingModule); < } < } class_mp_source_routing_module; < < < 232,269d219 < < < //multipath < < int MPSourceRoutingModule::command(int argc, const char*const* argv) { < Tcl& tcl = Tcl::instance(); < if (argc == 3) { < if (strcmp(argv[1] , "route-notify") == 0) { < Node *node = (Node *)(TclObject::lookup(argv[2])); < if (node == NULL) { < tcl.add_errorf("Invalid node object %s", argv[2]); < return TCL_ERROR; < } < if (node != n_) { < tcl.add_errorf("Node object %s different from n_", argv[2]); < return TCL_ERROR; < } < n_->route_notify(this); < return TCL_OK; < } < if (strcmp(argv[1] , "unreg-route-notify") == 0) { < Node *node = (Node *)(TclObject::lookup(argv[2])); < if (node == NULL) { < tcl.add_errorf("Invalid node object %s", argv[2]); < return TCL_ERROR; < } < if (node != n_) { < tcl.add_errorf("Node object %s different from n_", argv[2]); < return TCL_ERROR; < } < n_->unreg_route_notify(this); < return TCL_OK; < } < } < return (RoutingModule::command(argc, argv)); < } < < diff -r edited-ns/ns-2.27/routing/rtmodule.h original-ns/ns-2.27/routing/rtmodule.h 121,129d120 < //multipath < class MPSourceRoutingModule : public RoutingModule { < public: < MPSourceRoutingModule() : RoutingModule() {} < virtual const char* module_name() const { return "MPSource"; } < virtual int command(int argc, const char*const* argv); < }; < < diff -r edited-ns/ns-2.27/tcl/lib/ns-default.tcl original-ns/ns-2.27/tcl/lib/ns-default.tcl 1271,1325d1270 < < < #multipath < < Queue/DropTail2 set drop_front_ false < Queue/DropTail2 set summarystats_ false < Queue/DropTail2 set queue_in_bytes_ true < Queue/DropTail2 set mean_pktsize_ 1040 < Queue/DropTail2 set RDF_ 0 < Queue/DropTail2 set RIF_ 0 < Queue/DropTail2 set PCR_ 0 < Queue/DropTail2 set SWITCH_MIN_ 0 < Queue/DropTail2 set SWITCH_MAX_ 0 < Queue/DropTail2 set SWITCH_DROP_ 0 < Queue/DropTail2 set SWITCH_DROPM_ 0 < Queue/DropTail2 set DOFLOW_ 0 < < #will be used for single path no aimd sim. < Queue/DropTail set drop_front_ false < Queue/DropTail set summarystats_ false < Queue/DropTail set queue_in_bytes_ true < Queue/DropTail set mean_pktsize_ 1040 < < < Queue/DropTail3 set drop_front_ false < Queue/DropTail3 set summarystats_ false < Queue/DropTail3 set queue_in_bytes_ true < Queue/DropTail3 set mean_pktsize_ 1040 < Queue/DropTail3 set SP_ 0 < < Queue/DropTail4 set drop_front_ false < Queue/DropTail4 set summarystats_ false < Queue/DropTail4 set queue_in_bytes_ true < Queue/DropTail4 set mean_pktsize_ 1040 < < MPDelayLink set bandwidth_ 1.5Mb < MPDelayLink set delay_ 100ms < MPDelayLink set debug_ false < MPDelayLink set avoidReordering_ false ; # Added 3/27/2003. < # Set to true to avoid reordering when < # changing link bandwidth or delay. < < MPDelayLink2 set bandwidth_ 1.5Mb < MPDelayLink2 set delay_ 100ms < MPDelayLink2 set debug_ false < MPDelayLink2 set avoidReordering_ false ; # Added 3/27/2003. < # Set to true to avoid reordering when < # changing link bandwidth or delay. < < Agent/CProbe set packetSize_ 50 < < Agent/TCP set agent_num_ 0 < Agent/TCP set largesim_ 0 < < Agent/MPSRAgent set largesim_ 0 diff -r edited-ns/ns-2.27/tcl/lib/ns-lib.tcl original-ns/ns-2.27/tcl/lib/ns-lib.tcl 1009,1019d1008 < < #multipath < DropTail2 { < set link_($sid:$did) [new MPLink \ < $n1 $n2 $bw $delay $q] < } < DropTail4 { < set link_($sid:$did) [new MPLink2 \ < $n1 $n2 $bw $delay $q] < } < 2209,2245d2197 < #multipath < < Simulator instproc queueparameters { n1 n2 RDF RIF PCR SWITCH_MIN SWITCH_MAX SWITCH_DROP SWITCH_DROPM DOFLOW } { < $self instvar link_ < [$link_([$n1 id]:[$n2 id]) queue] set RDF_ $RDF < [$link_([$n1 id]:[$n2 id]) queue] set RIF_ $RIF < [$link_([$n1 id]:[$n2 id]) queue] AllPCR $PCR < < [$link_([$n1 id]:[$n2 id]) queue] set SWITCH_MIN_ $SWITCH_MIN < [$link_([$n1 id]:[$n2 id]) queue] set SWITCH_MAX_ $SWITCH_MAX < [$link_([$n1 id]:[$n2 id]) queue] set SWITCH_DROP_ $SWITCH_DROP < [$link_([$n1 id]:[$n2 id]) queue] set SWITCH_DROPM_ $SWITCH_DROPM < [$link_([$n1 id]:[$n2 id]) queue] set DOFLOW_ $DOFLOW < < } < < < Simulator instproc queueparameters2 { n1 n2 SP} { < $self instvar link_ < [$link_([$n1 id]:[$n2 id]) queue] set SP_ $SP < [$link_([$n2 id]:[$n1 id]) queue] set SP_ $SP < } < < Simulator instproc queuePCR { n1 n2 path dest PCR} { < $self instvar link_ < [$link_([$n1 id]:[$n2 id]) queue] SetPCR $path $dest $PCR < } < < Simulator instproc queueMCR { n1 n2 path dest MCR} { < $self instvar link_ < [$link_([$n1 id]:[$n2 id]) queue] SetMCR $path $dest $MCR < } < < Simulator instproc Pdelay { n1 n2 path dest RTT} { < $self instvar link_ < [$link_([$n1 id]:[$n2 id]) queue] SetRTT $path $dest $RTT < } diff -r edited-ns/ns-2.27/tcl/lib/ns-packet.tcl original-ns/ns-2.27/tcl/lib/ns-packet.tcl 159,161d158 < MPSrc_rt < MultiP < CProbe diff -r edited-ns/ns-2.27/tcl/lib/ns-queue.tcl original-ns/ns-2.27/tcl/lib/ns-queue.tcl 593,607d592 < < #multipath < < #This link is transporting packets from edge node to core node < Class MPLink -superclass SimpleLink < MPLink instproc init { src dst bw delay q {lltype "MPDelayLink"} } { < $self next $src $dst $bw $delay $q $lltype ; # SimpleLink ctor < } < < #This link is transporting packets from core node to edge node < Class MPLink2 -superclass SimpleLink < MPLink2 instproc init { src dst bw delay q {lltype "MPDelayLink2"} } { < $self next $src $dst $bw $delay $q $lltype ; # SimpleLink ctor < } < diff -r edited-ns/ns-2.27/tcl/lib/ns-rtmodule.tcl original-ns/ns-2.27/tcl/lib/ns-rtmodule.tcl 305,341d304 < < < RtModule/MPSource instproc register { node } { < $self next $node < < $self instvar classifier_ < # Keep old classifier so we can use RtModule::add-route{}. < $self set classifier_ [$node entry] < < # Set up switch to route unicast packet to slot 0 and < # multicast packets to slot 1 < #[$node set switch_] set mask_ [AddrParams McastMask] < #[$node set switch_] set shift_ [AddrParams McastShift] < < # Create a classifier for multicast routing < $node set src_classifier_ [new Classifier/SR] < $node set src_agent_ [new Agent/MPSRAgent] < $node set switch_ [$node set src_classifier_] < < # $node set multiclassifier_ [new Classifier/Multicast/Replicator] < # [$node set multiclassifier_] set node_ $node < < < < # $node set mrtObject_ [new mrtObject $node] < < # Install existing classifier at slot 0, new classifier at slot 1 < $node insert-entry $self [$node set switch_] 1 < < [$node set switch_] install 0 [$node set src_agent_] < $node attach [$node set src_agent_] < < # $self set src_rt 1 < < } < < diff -r edited-ns/ns-2.27/tcl/lib/ns-srcrt.tcl original-ns/ns-2.27/tcl/lib/ns-srcrt.tcl 48,66d47 < < < < #multipath < < Simulator instproc mp_src_rting args { < $self set srcRt_ 1 < # adding the source routing header < add-packet-header Src_rt < Node enable-module MPSource < } < < Simulator instproc src_rting? {} { < $self instvar srcRt_ < if { ![info exists srcRt_] } { < set srcRt_ 0 < } < set < } diff -r edited-ns/ns-2.27/tcp/tcp.cc original-ns/ns-2.27/tcp/tcp.cc 179,185d178 < < < //multipath < //for speed optimization, we are storing the number of this agent < delay_bind_init_one("agent_num_"); < delay_bind_init_one("largesim_"); < 285,290d277 < < //multipath < //for speed optimization, we are storing the number of this agent < < if (delay_bind(varName, localName, "agent_num_", &agent_num_, tracer)) return TCL_OK; < if (delay_bind(varName, localName, "largesim_", &largesim_, tracer)) return TCL_OK; 489,501d475 < < //multipath < //be sure that timer is stopped < //printf("%f largesim_ %d\n",NOW,largesim_); < if(largesim_==1){ < if(rtx_timer_.status() == TIMER_PENDING){ < rtx_timer_.cancel(); < } < } < < starttime=NOW; < did_log=0; < 811,813d784 < //multipath < //log the goodput < 815,831d785 < < if (argc == 2) { < < if (strcmp(argv[1], "logger") == 0) { < < if(did_log==0){ < < logger(); < } < < < return (TCL_OK); < } < < } < < 1388,1399d1341 < < //log the path number assigned to this flow (if flow based routing is used) < if(highest_ack_==0){ < hdr_mp *srh = hdr_mp::access(pkt); < hdr_ip* iph = hdr_ip::access(pkt); < Tcl& tcl1 = Tcl::instance(); < pathnumber_= srh->realpathnumber; < source_=iph->daddr(); < destination_=iph->saddr(); < tcl1.evalf("recordPath %d %d", agent_num_,pathnumber_); < < } 1716,1724d1657 < //multipath < logger(); < if(largesim_==1){ < Tcl& tcl1 = Tcl::instance(); < tcl1.evalf("Ender %d", agent_num_); < } < < //don't allow any other logging until tcp is resetted < did_log=1; 1969,1994d1901 < < //multipath < //write the goodput < void TcpAgent::logger(){ < < FILE *out; < char stbuffer [25]; < sprintf(stbuffer,"out.tr\0"); < out = fopen(stbuffer, "a"); < int hg=highest_ack_; < < //no packet was received. Create a packet and learn source destionation < if(hg==-1){ < Packet* pktret = allocpkt(); < hdr_ip* iph = hdr_ip::access(pktret); < source_=iph->saddr(); < destination_=iph->daddr(); < pathnumber_=0; < drop(pktret); < < } < < fprintf(out, "%d\t%f\t%f\t%d\t%d\t%d\t%d\n",fid_, starttime ,NOW,hg,source_,destination_,pathnumber_); < fclose(out); < < } diff -r edited-ns/ns-2.27/tcp/tcp.h original-ns/ns-2.27/tcp/tcp.h 42,44d41 < //multipath < #include "../multipath/hdr_mp.h" < 403,413d399 < < < < //multipath < //for speed optimization, we are storing the number of this agent < int agent_num_; < int largesim_; < int pathnumber_; < int source_; < int destination_; < 445,451d430 < < < //multipath < double starttime; < char did_log; < < void logger(); diff -r edited-ns/ns-2.27/tcp/tcp-sink.cc original-ns/ns-2.27/tcp/tcp-sink.cc 338,344d337 < //multipath < //return the path number info < hdr_mp *srhn = hdr_mp::access(npkt); < hdr_mp *srho = hdr_mp::access(opkt); < srhn->realpathnumber=srho->pathnumber; < < diff -r edited-ns/ns-2.27/tcp/tcp-sink.h original-ns/ns-2.27/tcp/tcp-sink.h 43,45d42 < //multipath < #include "../multipath/hdr_mp.h" <