Sara Install | Network Packet | Routing

10 pages
13 views
of 10
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Description
sara protocol installation steps
Tags
Transcript
  Simple Ant Routing Algorithm - SARANS2 install procedures Fernando Jorge Ribeiro Correiafcorreia@tagus.inesc-id.ptJanuary 5, 2012 1 Introduction The Simple Ant Routing Algorithm  (SARA) offers a low overhead solution, by optimizing the routingprocess. Three complementary strategies were used in our approach: during the route discovery we haveused a new broadcast mechanism, called the Controlled Neighbor Broadcast  (CNB), in which each nodebroadcasts a control message (FANT) to its neighbors, but only one of them broadcast this messageagain. During the route maintenance phase, we further reduce the overhead, by only using data packetsto refresh the paths of active sessions. Finally, the route repair phase is also enhanced, by using a deepsearch procedure as a way of restricting the number of nodes used to recover a route. Thus, instead of discovering a new path from the source to the destination, we start by trying the discovery of a new pathbetween the two end-nodes of the broken link. A broadest search is only executed when the deeper onefails to succeed.SARA can be tested with different types of traffic. However, due the route refresh requirements,in which the pheromones are re-enforced by the packets that goes through the links between nodes,when is used traffic with asymmetric behavior, i.e., the packet flow rate is different in both directions(from source to destination and from destination to source), the pheromone value can supply a wronginformation about the link quality. This situation can be experimented when is simulated Constant BitRate traffic (CBR). To overcame this situation, it was created a simple data packet class called TX CBR.The TX CBR is a CBR service in which when a packet arrives at the destination node is re-transmittedto the source node. This way is ensured a symmetric kind of data traffic. This TX CBR class can alsosupport connection to multiple sources.The next section, the user will be guided through the procedures to install SARA and TX CBR inNS2. This two classes must be installed. 2 Install procedure For SARA works properly in NS2 it must expanded in your NS2 working directory the following files: ã sara.Vrs2.2.8.A.tar.gz1  ã tx cbr.V1.tar.gz ã aux obj.tar.gzThese three files must create three folders named as sara , tx-cbr and ara . In these folder will beplaced the sara core files, the tx cbr core files and the auxiliary classes required by sara. The named ara is related to an early sara developments. This files are responsible to do the following procedures: Files Description sara/sara.cc main class which includes all procedures to discover, select, maintain, andrepair the routes.sara/sara ngh.cc creates an object for each node in the neighborhood. Has ara base as rootobject.sara/sara rt.cc creates an object for each route found by each network node. sara rt has apointer to a list of the sara rotas object. Has ara base as root object.sara/sara rotas.cc for each known route, sara rotas object indicate which is the link for thenext hop. Has ara base as root object.sara/sara seq num.cc creates an object for each route discovery procedures. This object will keeptrack of the FANT agents sent to the network. Has ara base as root object.sara/sara session.cc it is used identify which are the route repair procedure active. Has ara baseas root object.sara/sara pkt.h definitions used in the SARA control agents - FANT, BANT, RFANT,RBANT, RRERRORara/ara base.cc this is the top class for this architecture. It works with ara vector, in whichis implemented a list of ara base object.ara/ara vector.cc this class that implements a list of ara base objects, i.e., it can hold differentlist, one for each sara class.ara/ara alg.cc this class has several general purpose function.ara/ara rqueue.cc this class implements a temporay queue to keep the data packets trans-ported by TCP while SARA is discovering / repairing the routeara/ara path.cc this is used to record information about the path used just for statisticalinformation. Has ara base as root object.tx cbr/tx cbr.cc the tx cbr class allows SARA to implement CBR traffic in both directions.The tx cbr works directly over IP. It allows to connect multiple sources toone destination node on a wireless environment. 3 Things to change This code was developed to work with NS2.31. There are some changes we need to do in order to integratethis code inside simulator. 3.1 Packet type declaration The packet type declaration is defined inside the file common/packet.h . In here we must include thename of our packet type. Find the packet t enumeration and add the following lines (2 and 3):2  common/packet.h  1 // insert new packet types here 2 PT SARA, 3 PT TXCBR, 4 PT NTYPE // This MUST be the LAST one 5 } ; Just below in same file, there is the definition of  p info class. Inside the constructor we will providea textual name for these packet type (lines 4 and 5). common/packet.h  1 class p info { 2 public: 3 p info() { 4 name_[PT TXCBR]= strdup( tx cbr ); 5 name_[PT SARA]= strdup( sara ); 6 name_[PT TCP]= strdup( tcp ); 7 name_[PT UDP]= strdup( udp ); Also in file common/packet.h is required to add the following lines to hdr cmn . Look for structhdr cmn and insert: common/packet.h  1 struct hdr cmn { 2 enum dir t { DOWN= -1, NONE= 0, UP= 1 } ; 3 packet t ptype ; // packet type (see above) 4 // change by: Fernando Correia 5 int pid ; // path ID 6 int psn ; // packet serial number 7 int pts ; // packet time stamp 8 inline int& pid() return (pid_); 9 // change by: Fernando Correia 10 int size ; // simulated packet size 11 int uid ; // unique id 12 int error ; // error flag 13 ... 14 } These variables don’t change SARA’s behaviour, it is just control information for my simulations.You can check the proposed changes in sara.cc .3  3.2 Tracing support The simulations aim is to get a trace file describing what happended during execution. To write informa-tion about the protocol state it is necessary to use the Trace object. To log information regarding ourpacket type we implement the format protoname() function inside the CMUTrace class. For do that wemust edit the trace/cmu-trace.h/cc and add the proper code. First we change the trace/cmu-trace.h by adding lines 6 and 7. trace/cmu-trace.h  1 class CMUTrace : public Trace { 2 public: 3 CMUTrace(const char *s, char t); 4 /* ... */ 5 void format_aodv(Packet *p, int offset); 6 void format_txcbr(Packet *p, int offset); 7 void format_sara(Packet *p, int offset); 8 } ; and in the trace/cmu-trace.cc , we must add lines above: trace/cmu-trace.cc 1 #include <sara/sara pkt.h> 2 #include <tx cbr/tx cbr.h> 3 /* ... */ 4 void 5 CMUTrace::format txcbr(Packet *p, int offset) 6 { 7 struct hdr cbr* cbrh = HDR CBR(p); 8 sprintf(pt ->buffer() + offset, -P TxCBR SRC=%d DST=%d SN=%d LEN=%d NHOPS=%d , 9 cbrh->saddr, cbrh->daddr, cbrh->id, cbrh->len, cbrh->nhop); 10 } 11 void 12 CMUTrace::format sara(Packet *p, int offset) 13 { 14 struct hdr sara* ah = HDR SARA(p); 15 if(pt ->tagged()) { 16 sprintf(pt ->buffer() + offset, 17 -sara:s %d -sara:d %d -sara:t %d -sara:l %d , 18 ah->sara src(), 4
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks