17.07.2015 Views

Implement a simulator, in Java, for evaluating AntNet routing protocol

Implement a simulator, in Java, for evaluating AntNet routing protocol

Implement a simulator, in Java, for evaluating AntNet routing protocol

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Carleton University95.495 Honors Project<strong>Implement</strong> a <strong>simulator</strong>, <strong>in</strong> <strong>Java</strong>, <strong>for</strong> evaluat<strong>in</strong>g<strong>AntNet</strong> rout<strong>in</strong>g <strong>protocol</strong>Chunyan Ma # 277210Supervised by Professor Tony WhiteSchool of Computer ScienceDecember 31, 2002


AbstractThis project is to implement a <strong>simulator</strong>, <strong>in</strong> <strong>Java</strong>, <strong>for</strong> evaluat<strong>in</strong>g the <strong>AntNet</strong> rout<strong>in</strong>g<strong>protocol</strong>.CuRS, the <strong>simulator</strong> implemented <strong>in</strong> this project is a discrete-event simulation testbed<strong>for</strong> develop<strong>in</strong>g rout<strong>in</strong>g algorithm <strong>for</strong> wide-area computer networks. It was developed as amodified and extended <strong>Java</strong> version of an exist<strong>in</strong>g <strong>simulator</strong>, MaRS (Maryland Rout<strong>in</strong>gSimulator)-Version 1.0. CuRS is more portable <strong>for</strong> different plat<strong>for</strong>ms, and it extended to<strong>in</strong>clude <strong>AntNet</strong> algorithm. It allow user to def<strong>in</strong>e a network configuration consist<strong>in</strong>g ofphysical network, rout<strong>in</strong>g algorithm and workload. The user can control its simulation, logthe values of parameters, and save, load and modify network configurations. It alsoprovides per<strong>for</strong>mance to assist compar<strong>in</strong>g rout<strong>in</strong>g <strong>protocol</strong>s. But the Graphical userInterface is not yet implemented <strong>in</strong> this project. This is a part of work needed to beextended <strong>in</strong> the next phase.<strong>AntNet</strong> is an adaptive, distributed, mobile-agents-based algorithm <strong>for</strong> communicationsnetworks. It was <strong>in</strong>spired by recent work on the ant colony metaphor <strong>for</strong> solv<strong>in</strong>goptimization problems. I compare <strong>AntNet</strong> algorithm with Shortest Path First rout<strong>in</strong>galgorithm (SPF) based on CuRS. Actually, we should compare more rout<strong>in</strong>g algorithms toevaluate <strong>AntNet</strong> algorithm. This is the work needed to done further.


AcknowledgmentsI gratefully acknowledge the use of the structur<strong>in</strong>g concepts of MaRS, the user andprogrammer manuals of MaRS which helped me <strong>in</strong> writ<strong>in</strong>g user manual <strong>for</strong> CuRS. And Ialso acknowledge the use of the <strong>AntNet</strong> rout<strong>in</strong>g algorithm from Gianni Di Caro and MarcoDorigo.I thank my supervisor- Professor Tory White very much <strong>for</strong> help whenever I need. I alsothank Dario Accornero <strong>for</strong> answer<strong>in</strong>g the question about MaRS.


Table of Contents1 Introduction ……………………………………………………....62 Design and <strong>Implement</strong>ation of the Simulator …………………..62.1 Features and <strong>Implement</strong>ation considerations …………………....72.2 Structure of CuRS……………………………………………….....72.3 Parameters and packets…………………………………………..142.4 Interface design and <strong>Implement</strong>ation……………………………143 <strong>AntNet</strong>: An adaptive Agent-based Rout<strong>in</strong>g Algorithm………..154 Experiments and Results………………………………………...165 Conclusion………………………………………………………...176 Future Work……………………………………………………...187 User Manual……………………………………………………....187.1 CuRS Directory Structure…………………………………………187.2 Start CuRS………………………………………………………….187.3 Example……………………………………………………………..198 References………..………………………………………….........199 Appendix…………………………………………………………..20Source code…………………………………………………….………..20


Figure and Table ListFigure 1: the relationship between Events and EventLsiteners……………8Figure 2: the relationship between EventLsiteners and Component………9Figure 3: The relationship between Components………………………….9Figure 4: The example network…………………………………………..11Figure 5: NSFNET………………………………………………………..17Table 1: Measures with different rout<strong>in</strong>g algorithms and seeds………….16


1. IntroductionIn worldwide demand about computer network such like Internet. Rout<strong>in</strong>g <strong>protocol</strong>s playsthe core role <strong>in</strong> the whole network control system. Which are responsible <strong>for</strong> choos<strong>in</strong>g thebest way <strong>for</strong> deliver<strong>in</strong>g data packets <strong>in</strong> conjunction with per<strong>for</strong>mance <strong>in</strong> term of delay,throughput, etc. The per<strong>for</strong>mance of a route changes with the difference of network trafficcondition (<strong>for</strong> example, the amount of the data flow through the l<strong>in</strong>ks), so the rout<strong>in</strong>galgorithm should consider those facts and adapt the <strong>in</strong><strong>for</strong>mation store <strong>in</strong> the route.The rout<strong>in</strong>g algorithms implemented <strong>in</strong> this project, SPF and <strong>AntNet</strong> are both Next-hoprout<strong>in</strong>g. Each node ma<strong>in</strong>ta<strong>in</strong>s <strong>for</strong> each dest<strong>in</strong>ation a neighbor node id (next-hop). Each datapacket stores <strong>in</strong><strong>for</strong>mation about dest<strong>in</strong>ation node id. When a node receives a packet it<strong>for</strong>wards the packet to dest<strong>in</strong>ation node. But how to choose an optimal path to <strong>for</strong>ward thepacket is the key po<strong>in</strong>t to evaluate the rout<strong>in</strong>g algorithm. To achieve this, next-hop rout<strong>in</strong>gdo the follow<strong>in</strong>g functions: (1) each node keeps a topology table <strong>for</strong> its outgo<strong>in</strong>g l<strong>in</strong>ks, adynamic l<strong>in</strong>k cost is updated regularly accord<strong>in</strong>g to the traffic flow<strong>in</strong>g through the l<strong>in</strong>k. (2)l<strong>in</strong>k cost <strong>in</strong><strong>for</strong>mation is spread regularly to nodes of the network; (3) each node updatetopology table regularly based on the l<strong>in</strong>k cost <strong>in</strong><strong>for</strong>mation. The testbed built is calledCuRS, which is developed as a modified and extended version of MaRS.<strong>AntNet</strong>, the adaptive and distributed rout<strong>in</strong>g algorithm we evaluated <strong>in</strong> this project is amobile agent-based, onl<strong>in</strong>e Monte Carlo technique which takes <strong>in</strong>spiration from real ants'behavior <strong>in</strong> f<strong>in</strong>d<strong>in</strong>g the shortest paths us<strong>in</strong>g magic chemical substance deposited by otherants, and this technique been applied to optimization problems. The amaz<strong>in</strong>g rout<strong>in</strong>galgorithm, <strong>AntNet</strong> is us<strong>in</strong>g a set of concurrent distributed agents to collect <strong>in</strong><strong>for</strong>mation andupdate the previous <strong>in</strong><strong>for</strong>mation to create a more optimal solution <strong>for</strong> the adaptive rout<strong>in</strong>gproblem while agents explor<strong>in</strong>g the network. We compare <strong>AntNet</strong> with SPF algorithmus<strong>in</strong>g the CuRS (Carleton University Rout<strong>in</strong>g Simulator) as testbed to evaluate. <strong>AntNet</strong>shows the better per<strong>for</strong>mance.The paper is organized as follows.Section 2 describes the design and implementation of CuRS. It <strong>in</strong>cludes features andimplementation considerations, structure of CuRS, parameters and packets, the user<strong>in</strong>terface of CuRS.Section 3 describes the <strong>AntNet</strong> <strong>in</strong> detail and briefly describes SPF used <strong>for</strong> comparison.Section 4 reports the experiment result.Section 5 is conclusion.Section 6 discusses future work.2. Design and <strong>Implement</strong>ation of the Simulator2.1 Features and <strong>Implement</strong>ation ConsiderationsThe dynamics of the network is very complex. A testbed is essential to understand<strong>in</strong>g thecomplex dynamics of rout<strong>in</strong>g systems. Ideally, we would like the testbed to accurately


model features that are important to rout<strong>in</strong>g per<strong>for</strong>mance. However, it is not clear whichfeatures are important <strong>for</strong> rout<strong>in</strong>g per<strong>for</strong>mance. So CuRS still keeps the capabilities of theMaRS by hav<strong>in</strong>g easily extendible modules to represent these features.a) The testbed should be modular. That is, add<strong>in</strong>g new rout<strong>in</strong>g algorithms or new k<strong>in</strong>ds ofworkload nodes, l<strong>in</strong>ks should be easy. Such additions require programm<strong>in</strong>g.b) It is easy <strong>for</strong> user to build k<strong>in</strong>ds of network topologies and def<strong>in</strong>e different workloaddistributions without programm<strong>in</strong>g.c) The user can specify k<strong>in</strong>ds of topology changes such like be able to fail and repair a l<strong>in</strong>kat a specified time and see if and how it affect the system and how the system converges toa new steady state.d) It provides standard per<strong>for</strong>mance measures such as average delay, average throughput,average load, and so on. It also has average and <strong>in</strong>stantaneous versions of these measures.CuRS is a discrete-event <strong>simulator</strong>. The target system is characterized by discrete statesand by state transitions (events) occurr<strong>in</strong>g at discrete time <strong>in</strong>stants. For every class events,there is a correspond<strong>in</strong>g eventListener. When an event fires, the correspond<strong>in</strong>g method ofthe associated eventListener is called. Which updates the system state and cause otherevent occur. Discrete-event simulation is more flexible than other simulation (<strong>for</strong> exampleprocess emulation), so it can offer the greatest flexibility <strong>in</strong> model<strong>in</strong>g the target system.After check<strong>in</strong>g the available discrete-event <strong>simulator</strong> MaRS <strong>for</strong> a while, I found MaRS issuitable <strong>for</strong> the purposes of my project. So I consider to develop my <strong>Java</strong> <strong>simulator</strong> basedon the MaRS-Version 1.0 (C language), and extend to <strong>in</strong>clude <strong>AntNet</strong>.2.2 Structure of CuRSCuRS has the same structure as MaRS: a simulation eng<strong>in</strong>e, user <strong>in</strong>terface (GUI,command l<strong>in</strong>e options and files), and a set of components that simulate physical network,workload, and transport <strong>protocol</strong>s. But current version of CuRS is implemented GUI.The simulation eng<strong>in</strong>e manages the event list and user <strong>in</strong>terface. (GUI is notimplemented <strong>in</strong> this project). When the CuRS starts, the simulation eng<strong>in</strong>e processescommand l<strong>in</strong>e options (<strong>in</strong>clud<strong>in</strong>g read<strong>in</strong>g any files), and then goes <strong>in</strong>to the <strong>simulator</strong> loop.If GUI was added <strong>in</strong> the future, the simulation eng<strong>in</strong>e will process <strong>in</strong>puts from thekeyboard and mouse, execute the next event from the event list, and update the graphicaluser display.I use Observer/Observable design pattern (which is Object Oriented design) to designthis testbed. I let Event as Observable which ma<strong>in</strong>ta<strong>in</strong>s an eventListener <strong>in</strong>stance variable.There are four k<strong>in</strong>ds of eventListener, all of then are Observers. All Observer objects watchthe Observable object. If the specific event is fired, the associated Observer object’s relatedmethod will be called. There are four different classes of event occurr<strong>in</strong>g <strong>in</strong> the CuRS:command type events EV_CLASS_CMD, event type events EV_CLASS_EVENT, privatetype events EV_CLASS_PRIVATE, and record type events EV_CLASS_RECORD. Idef<strong>in</strong>ed an Event class as an Abstract class, which hasenqueueEvent(<strong>in</strong>t type, Component src,Component dest,long time,Packet pkt,Object arg)method to create a new event and places it <strong>in</strong> the event queue to be fired at the proper time.And also has fire () method. The four classes events are four concrete classes, and each ofthem has its own eventListener and its fire() method which <strong>in</strong>vokes the eventListener's


specific method depend<strong>in</strong>g on what k<strong>in</strong>d of event type it is.All CuRS objects have to react to the command class events. These events establish thebasic operations of the <strong>simulator</strong> and execute <strong>in</strong> the <strong>simulator</strong> eng<strong>in</strong>e. Event class eventsare def<strong>in</strong>ed globally <strong>in</strong> a central location. Send<strong>in</strong>g of a packet from a node to a l<strong>in</strong>k is k<strong>in</strong>dof event type event. Private class events are only def<strong>in</strong>ed <strong>in</strong>ternally with<strong>in</strong> an object, andthey are called with<strong>in</strong> that component. Record class events are used to record events <strong>in</strong> arecord file. Each class event has different types of events. For specific mean<strong>in</strong>g of eachtype of event, the reader can f<strong>in</strong>d them <strong>in</strong> the programmer or user's manual ofMaRS-Version 1.0.EventenqueueEvent()fire()dequeueEventBy...()CommandEventEventEventPrivateEventRecordEventfire()fire()fire()fire()CommandEventListenerreset()create()delete()start()stop()neighbor()uneighbor()makePeer()opname()EventEventListenerl<strong>in</strong>kSend()nodeReceive()nodeProduce()routeProcess<strong>in</strong>g()aptrReceive()aptrRetransmit()<strong>in</strong>stantRate()PrivateEventListenerl<strong>in</strong>kReceive()aptrProduce()aptrComsume()aptrSend()perfUpdate()utilUpdate()RecordEventListeneraptrConnOn()l<strong>in</strong>kFailure()l<strong>in</strong>kRepair()nodeFailure()nodeRepair()Figure 1: the relationship between Events and EventLsiteners


CommandEventListenerEventEventListenerPrivateEventListenerRecordEventListenerreset()create()delete()start()stop()neighbor()uneighbor()makePeer()opname()l<strong>in</strong>kSend()nodeReceive()nodeProduce()routeProcess<strong>in</strong>g()aptrReceive()aptrRetransmit()<strong>in</strong>stantRate()l<strong>in</strong>kReceive()aptrProduce()aptrComsume()aptrSend()perfUpdate()utilUpdate()aptrConnOn()l<strong>in</strong>kFailure()l<strong>in</strong>kRepair()nodeFailure()nodeRepair()ComponentFigure 2: the relationship between EventLsiteners and ComponentComponentAbstractComponentNodeeFtpLCostFcnStopperL<strong>in</strong>kPmtProcess<strong>in</strong>gTimeEsitmatorRoutetSpf<strong>AntNet</strong>Figure 3: The relationship between Components


The components are used <strong>for</strong> model<strong>in</strong>g the target system and certa<strong>in</strong> simulationfunctions. Each component is object which has its states and behaviors. In MaRS everycomponent has its action rout<strong>in</strong>e associated with different events specified <strong>in</strong> the MaRSversion 1.0. When an event occurs, each component's action rout<strong>in</strong>e is <strong>in</strong>voked <strong>for</strong> thatevent. Actually it uses function po<strong>in</strong>t <strong>in</strong> C to achieve this. While there is not function po<strong>in</strong>tavailable In <strong>Java</strong>. So <strong>in</strong> CuRS I use Observer/Observable Pattern to achieve this. Figure 1,2, 3 shows the relationship of components Diagrams. Component was designed asInterface to represent all components <strong>in</strong> the target system. Such as Node, L<strong>in</strong>k,L<strong>in</strong>kCostFunction component, Rout<strong>in</strong>g component, Workload component (FTP) andper<strong>for</strong>mance monitor. Component Interface extends four k<strong>in</strong>ds of EventListener Interfacewhich has different methods <strong>for</strong> different types events and also has association with one offour classes’ event. Every concrete component implements its associated methods tooverride the methods def<strong>in</strong>ed <strong>in</strong> the AbstractComponent. Each component is an Object.The target system consists of a set of objects. By <strong>in</strong>terconnect<strong>in</strong>g multiple objects ofvarious types of components, a target system of arbitrary topology, rout<strong>in</strong>g <strong>protocol</strong>, andworkload can be obta<strong>in</strong>ed.The components schedule events <strong>for</strong> each other. Also, a component can schedule anevent <strong>for</strong> itself. The time of this event to happen depends on the l<strong>in</strong>k propagation delay.Each component has methods to update system state and may schedule other eventsdepend<strong>in</strong>g on the type of the event received by the component.


Figure 4: The example networkFigure 4 shows a target system of seven nodes and eight l<strong>in</strong>ks objects. Each l<strong>in</strong>k isconnected to exactly two nodes. A node models the physical aspects of a store and <strong>for</strong>wardentity such as a host or a switch. Each node is connected to an SPF rout<strong>in</strong>g algorithm andzero or more workload components. Each workload component is either a source or a s<strong>in</strong>kof FTP. For each source object, there is a correspond<strong>in</strong>g "peer" s<strong>in</strong>k object. There is onel<strong>in</strong>k-cost function object which is not connected to any one.I briefly describe each type of object <strong>in</strong> the follow<strong>in</strong>g.L<strong>in</strong>kA l<strong>in</strong>k object models a bidirectional transmission channel between two node objects. I usethe same data structure to implement L<strong>in</strong>k class as L<strong>in</strong>k Component <strong>in</strong> the MaRS. Eachl<strong>in</strong>k object conta<strong>in</strong>s two L<strong>in</strong>kedLists of packets, each represent<strong>in</strong>g the packets <strong>in</strong> the transit<strong>in</strong> one direction. A l<strong>in</strong>k can be subject to failure and fails. When a l<strong>in</strong>k fails, all packets thatare <strong>in</strong> transit are lost.The <strong>in</strong>put parameters of l<strong>in</strong>k are Propagation delay[microseconds], Bandwidth


[bytes/second], Distribution of <strong>in</strong>terfailure times, Distribution of repair times; The outputparameters are L<strong>in</strong>k status(up/down), Instantaneous workload utilization <strong>for</strong> each direction,Instantaneous rout<strong>in</strong>g utilization <strong>for</strong> each direction.L<strong>in</strong>k cost functionThe l<strong>in</strong>k cost function is used to ma<strong>in</strong>ta<strong>in</strong> and periodically update a cost <strong>for</strong> each l<strong>in</strong>k <strong>in</strong> thenetwork. When the cost is updated, the l<strong>in</strong>k cost value is calculated by apply<strong>in</strong>g atrans<strong>for</strong>mation to a statistic cost "raw cost" which is obta<strong>in</strong>ed on the l<strong>in</strong>k dur<strong>in</strong>g theprevious update period. Hop-count, utilization, delay, and hop-normalized delay are therow cost supported by CuRS.There should be only one LCostFcn object. So I use S<strong>in</strong>gleton pattern to ensure only one<strong>in</strong>stance of L<strong>in</strong>k cost function exist <strong>in</strong> the target system. There is a static variable costFcnand a static method named "getCostFcn()" <strong>in</strong> the LcostFcn.java. L<strong>in</strong>k cost function is not apart of the network so do not connect it to a component <strong>in</strong> the network. If an <strong>in</strong>teraction isneeded between l<strong>in</strong>k cost function and components, l<strong>in</strong>k cost function object obta<strong>in</strong>ed fromLcostFcn.getCostFcn ()".Rout<strong>in</strong>gI def<strong>in</strong>e Routet as abstract class to represent the common th<strong>in</strong>gs of each rout<strong>in</strong>g algorithm;Routet is also a k<strong>in</strong>d of component. Every specific rout<strong>in</strong>g object is the concrete class ofRoutet and executes a rout<strong>in</strong>g algorithm. At each node, the attached rout<strong>in</strong>g object buildsand ma<strong>in</strong>ta<strong>in</strong>s a rout<strong>in</strong>g table, which specifies a next-hop <strong>for</strong> each dest<strong>in</strong>ation.The rout<strong>in</strong>g object exchanges <strong>in</strong><strong>for</strong>mation by rout<strong>in</strong>g packets, more precisely, a rout<strong>in</strong>gobject passes a rout<strong>in</strong>g packet to its local node, which then sends it to a neighbor<strong>in</strong>g node,which then passes it to its local rout<strong>in</strong>g object. In the current version, I just implementedtwo types of rout<strong>in</strong>g components correspond<strong>in</strong>g to two rout<strong>in</strong>g algorithms: SPF and<strong>AntNet</strong>.The <strong>in</strong>put parameters of SPF are Mean and standard deviation of topology broadcast period[milliseconds]; The output parameters are Global topology table (adjacency matrix), localtopology table, and Rout<strong>in</strong>g table.WorkloadThe workload component model the user traffic <strong>in</strong> the target system. In each workloadsource-s<strong>in</strong>k pair, the source component produces workload packets and passes them to itsnode component. These packets are then <strong>for</strong>warded by the node components until theyreach their dest<strong>in</strong>ation node, where they are consumed by the s<strong>in</strong>k component.Input parameters of FTP_Source and FTP_S<strong>in</strong>k are Initial source-s<strong>in</strong>k status (on/off),Number of connections between the specified FTP_Source and FTP_S<strong>in</strong>k, Averagenumber of packets per connection, Packet length [bytes], Average delay betweenconnections [milliseconds], Delay between packets [milliseconds], Produce w<strong>in</strong>dow size[packets], Send w<strong>in</strong>dow size [packets]; The output parameters are Source-s<strong>in</strong>kstatus(on/off), Number of the current connection, Number of packets <strong>in</strong> the currentconnection, Number of the current packet <strong>in</strong> the current connection, Number of packetsproduced, Number of packets sent, Number of packets acknowledged, Number of packetsreceived, Number of packets retransmitted, Roundtrip time estimate [microseconds],Instantaneous sent rate, Instantaneous acked rate, Instantaneous retransmission rate,Instantaneous delay per packet [milliseconds].NodeA node has a separate L<strong>in</strong>kedList to store packets <strong>for</strong> each outgo<strong>in</strong>g l<strong>in</strong>k, and a s<strong>in</strong>gle


common L<strong>in</strong>kedList <strong>for</strong> all rout<strong>in</strong>g packets received on its <strong>in</strong>com<strong>in</strong>g l<strong>in</strong>ks. The node passesthe rout<strong>in</strong>g packets to the local rout<strong>in</strong>g object. For the <strong>in</strong>com<strong>in</strong>g workload packet that is notdest<strong>in</strong>ed <strong>for</strong> a local s<strong>in</strong>k, the node consults the local rout<strong>in</strong>g table and appends the packet toappropriate outgo<strong>in</strong>g L<strong>in</strong>kedList. A node can also be subject to failure and repair. When anode fails, all packets stored are lost.The <strong>in</strong>put parameters of node are Delay to process a packet [microseconds], Total availablebuffer space [bytes], Distribution of <strong>in</strong>terfailure times, Distribution of repair times; Theoutput parameters are Node status 9up/down), Amount of buffer space currently used[bytes], Maximum amount of occupied node buffer space so far <strong>in</strong> the simulation, Numberof workload and rout<strong>in</strong>g packets dropped by the node <strong>in</strong> the simulation, Instantaneouspacket drop rate, Current buffer utilization, Queue length [packets].Per<strong>for</strong>mance monitorThe per<strong>for</strong>mance monitor is used to collect and evaluate statistics about the network. Thereare two ways to update the per<strong>for</strong>mance measures: periodically-updated and event-updated.Updat<strong>in</strong>g periodically at time <strong>in</strong>stants called "update period" is periodically-updatedper<strong>for</strong>mance measure. An event-updated per<strong>for</strong>mance measure is updated whenever arelated event occurs. A per<strong>for</strong>mance measure can be either an average measure or an<strong>in</strong>stantaneous measure. An average measure is computed based on statistics collected aftera specified "startup <strong>in</strong>terval" from the beg<strong>in</strong>n<strong>in</strong>g of the simulation. An <strong>in</strong>stantaneousmeasure is computed based on current state or statistics collected dur<strong>in</strong>g the last updateperiod.When a target system is built to evaluate one rout<strong>in</strong>g algorithm, there should be only oneper<strong>for</strong>mance monitor object. So I use S<strong>in</strong>gleton pattern to ensure only one <strong>in</strong>stance ofPer<strong>for</strong>mance Monitor exist <strong>in</strong> the target system. There is a static variableper<strong>for</strong>manceMonitor and a static method named "getPmt()" <strong>in</strong> the Pmt.java. Per<strong>for</strong>mancemonitor not a part of the network so do not connect it to a component <strong>in</strong> the network. If an<strong>in</strong>teraction is needed between per<strong>for</strong>mance monitor and components, Per<strong>for</strong>manceMonitor object obta<strong>in</strong>ed from Pmt.getPmt() is called <strong>in</strong> an event driven way like pm(l<strong>in</strong>k,LINK, LINK_DOWN,0,0,0) or poll at start time the component should issuepm(component, compTtype, NEW_COMPONENT), so the pm knows the component.The output parameters of the per<strong>for</strong>mance monitor are Average network throughput,Instantaneous network throughput, Average delay per packet, Instantaneous delay perpacket, Maximum packet delay, Current number of connections <strong>in</strong> the network, Averagenumber of packets per FTP connection, Average life-time of an FTP connection, Currentnumber of failed l<strong>in</strong>ks, Total number of dropped workload packets, Total number ofrout<strong>in</strong>g packets, Average data load, Instantaneous data load, Average rout<strong>in</strong>g load,Instantaneous rout<strong>in</strong>g load, Buffer usage statistics.StopperThe stopper component enables the user to def<strong>in</strong>e a term<strong>in</strong>ation condition <strong>for</strong> thesimulation, based on the <strong>in</strong>put parameters and the statistics collected by per<strong>for</strong>mancemonitor.The <strong>in</strong>put parameters of the stopper are Number of <strong>in</strong>tervals, Interval length[microseconds], Error bound [percentage].


2.3 Parameters and packetsParameter is an object used to store any <strong>in</strong><strong>for</strong>mation about a component that needs to bedisplayed on the screen, logged to disk, or saved <strong>in</strong> a network file. The <strong>in</strong>stance variables ofa Parameter object are as follows:Private Str<strong>in</strong>g name;private <strong>in</strong>t displayType;private <strong>in</strong>t flags;private double scale;private <strong>in</strong>t logType;private Object value;The actual value of a parameter object is stored <strong>in</strong> the value variable. Because it is Objecttype, so it can be an Integer, Double, a L<strong>in</strong>kedList, a Str<strong>in</strong>g or someth<strong>in</strong>g else depend<strong>in</strong>g onwhat k<strong>in</strong>d of type value an Component object want to store <strong>in</strong> that parameter. And flagsdescribe how to save and/or display the parameter. It will be used when the GUI was addedto the CuRS. A component object can have as many parameters as needed. They are stored<strong>in</strong> the L<strong>in</strong>kedList named params which is def<strong>in</strong>ed <strong>in</strong> the AbstractComponent class.The target system is a message pass<strong>in</strong>g system. Messages are passed <strong>in</strong> the packets. Thereare two ma<strong>in</strong> types packets <strong>in</strong> the <strong>simulator</strong>: TR_PACKET is the application/transport partof the packet. ROUTE_PACKET is the rout<strong>in</strong>g part of the packet. Rout<strong>in</strong>g packet hashigher priority than the data packet.2.4 Interface design and implementationUser InterfaceCurrently CuRS just provides command l<strong>in</strong>e options and files as user <strong>in</strong>terface. Thegraphical user <strong>in</strong>terface will be added <strong>in</strong> the next stage of this project. The command l<strong>in</strong>eoptions <strong>in</strong>clude the specification of the length of the simulation run, the seed <strong>for</strong> randomnumber generator, the name of the network file, the name of the record file, the length ofthe startup <strong>in</strong>terval, and the per<strong>for</strong>mance monitor update period. The user manual isprovided <strong>in</strong> section 7 of this report.FilesCuRS works with four ASC|| files, they are the network file, the snap file, the record fileand the log file.A network file <strong>in</strong>cludes a description of the network to be simulated. It consists of the threedist<strong>in</strong>ct parts. The first part is a list of all component objects with their <strong>in</strong>put parametervalues; the second part <strong>in</strong>dicates the <strong>in</strong>terconnection of the objects. The third part lists thepeer components. The networkfile is created manually. If the GUI is added <strong>in</strong> the future,then the user can create network us<strong>in</strong>g GUI. The network files <strong>in</strong>clude all <strong>in</strong><strong>for</strong>mationneeded to carry out a simulation.A snap file actually is a networkfile with additional <strong>in</strong><strong>for</strong>mation such like the values of thecurrent output parameters, the seed <strong>for</strong> the random number generator, the time of thesnapshot, and the flags that <strong>in</strong>dicates the parameters logged.CuRS provides record and play options which is specified from the command l<strong>in</strong>e. Withthose options, the record-class events are read and scheduled from the record file. So wecan simulate different rout<strong>in</strong>g algorithms subject to the same sequence of the event andoccurrence times <strong>for</strong> a special set of events.


CuRS can also log the value of the selected parameters to a log file. For the programmer toimplement GUI or extend CuRS <strong>for</strong> specific purposes, he/she can debug or check error orwarn<strong>in</strong>g <strong>in</strong> the log file. Actually I use Log 4j to log th<strong>in</strong>gs. If the programmer would like tolog specific level log <strong>in</strong><strong>for</strong>mation, he/she can specify the level <strong>in</strong> the log.property file thatis <strong>in</strong> the classes subdirectory.The file <strong>in</strong>terface used <strong>in</strong> the CuRS is same as MaRS.3. <strong>AntNet</strong>: An adaptive Agent-based Rout<strong>in</strong>g AlgorithmThe <strong>AntNet</strong> algorithm implemented <strong>in</strong> this project is come from the <strong>AntNet</strong> described <strong>in</strong>Gianni Di Caro and Marco Dorigo's paper "<strong>AntNet</strong>: Distributed Stigmergetic Control <strong>for</strong>Communications Networks". <strong>AntNet</strong> is used to solve comb<strong>in</strong>atorial optimization problemsand telephone network rout<strong>in</strong>g. The ma<strong>in</strong> ideas of these techniques are us<strong>in</strong>g the repeatedand concurrent simulations carried out by a set of ant agents and the <strong>in</strong><strong>for</strong>mation collectedby the ant agents to generate new solutions to the problem. In an iterative process, each antbuilds a solution by us<strong>in</strong>g problem specific <strong>in</strong><strong>for</strong>mation and <strong>in</strong><strong>for</strong>mation added by otherants, and it can access that <strong>in</strong><strong>for</strong>mation locally. So each ant collects <strong>in</strong><strong>for</strong>mation on theproblem characteristics and on its own per<strong>for</strong>mance, and also use this <strong>in</strong><strong>for</strong>mation andother <strong>in</strong><strong>for</strong>mation got by other ants to modify the representation of the problem, furtherbuilds a better solution.The scheme of the <strong>AntNet</strong> algorithm can be summarized as follows:· Mobile agents (<strong>for</strong>ward ants) are launched asynchronously from each network nodeto the random selected dest<strong>in</strong>ation nodes, and with<strong>in</strong> regular periods and withconcurrently the data traffic.· Agents communicate with each other through the <strong>in</strong><strong>for</strong>mation they read and writelocally to the nodes. They act concurrently and <strong>in</strong>dependently.· Search<strong>in</strong>g a m<strong>in</strong>imum cost path between its source and dest<strong>in</strong>ation is the mission ofeach agent.· Each agent moves step-by-step towards its dest<strong>in</strong>ation node. At each <strong>in</strong>termediatenode, a stochastic policy makes use of local agent-generated and ma<strong>in</strong>ta<strong>in</strong>ed<strong>in</strong><strong>for</strong>mation and local problem-dependent heuristic and agent-private <strong>in</strong><strong>for</strong>mationto help choose the next node <strong>for</strong> the ant agent to move on.· The time length, the congestion status and the node ids of the followed path are the<strong>in</strong><strong>for</strong>mation collected by mov<strong>in</strong>g agents.· Once agents reached the dest<strong>in</strong>ation, they will die and launch backward ants to theirsource nodes by mov<strong>in</strong>g backwards along the same path <strong>in</strong> the opposite directionwhich <strong>for</strong>ward ant traveled.· When agents go backward, local models of the network status and the local rout<strong>in</strong>gtable of each visited node are modified by the agents as a function of the path theyfollowed and of its goodness.· When agents (backward ants) have returned to the source node subject to <strong>for</strong>wardant, they die.<strong>AntNet</strong> has two set of mobile agents: <strong>for</strong>ward and backward ants. They have the same datastructure, but different situation <strong>in</strong> the environment. That is, they sense the different <strong>in</strong>puts


and produce different, <strong>in</strong>dependent outputs. The detailed description about <strong>AntNet</strong> rout<strong>in</strong>galgorithm is not represented here. Reader can f<strong>in</strong>d it <strong>in</strong> the paper "<strong>AntNet</strong>: DistributedStigmergetic Control <strong>for</strong> Communications Networks" written by Gianni Di Caro andMarco Dorigo <strong>in</strong> 1998. Here I just talk about how to implement the <strong>AntNet</strong> <strong>in</strong> this<strong>simulator</strong>. It also illustrates how to implement a new component <strong>in</strong> the CuRS. As describedabove, <strong>AntNet</strong> rout<strong>in</strong>g algorithm needs ant agents to collect and update the <strong>in</strong><strong>for</strong>mationabout network condition. So each agent was def<strong>in</strong>ed as an Object. Here two k<strong>in</strong>ds of events:LaunchForwardAnt, LaunchBackwardAnt, are added <strong>in</strong> the Event class. <strong>AntNet</strong> is anObject used to deal with rout<strong>in</strong>g process<strong>in</strong>g.To evaluate the per<strong>for</strong>mance of the <strong>AntNet</strong>, SPF (Shortest Path First) rout<strong>in</strong>g algorithm isimplemented <strong>in</strong> this project <strong>for</strong> comparison. Which is l<strong>in</strong>k-state rout<strong>in</strong>g algorithm. Inl<strong>in</strong>k-state rout<strong>in</strong>g algorithms, each node tries to ma<strong>in</strong>ta<strong>in</strong> a database describ<strong>in</strong>g the networktopology and the l<strong>in</strong>k costs. Us<strong>in</strong>g this database, each node <strong>in</strong>dependently calculatesshortest paths, and uses them to decide the next hop <strong>for</strong> any dest<strong>in</strong>ation. Each nodebroadcasts the costs of its entire outgo<strong>in</strong>g l<strong>in</strong>ks to all other nodes <strong>in</strong> the network.For better evaluate the per<strong>for</strong>mance of the <strong>AntNet</strong>, OSPF should also be implemented <strong>for</strong>comparison rout<strong>in</strong>g algorithm.4. Experiments and ResultsWhen evaluat<strong>in</strong>g the rout<strong>in</strong>g algorithm, the most common per<strong>for</strong>mance measures arethroughput and average packet delay. Throughput <strong>in</strong>dicates the quantity of the service thatthe network has been able to offer <strong>in</strong> a certa<strong>in</strong> amount of time; While the average packetdelay is used to measure the quality of the service produced at the same time. We alreadydef<strong>in</strong>ed the per<strong>for</strong>mance monitor <strong>in</strong> the <strong>simulator</strong>. So the user just need create the networktopology with the condition set. After simulat<strong>in</strong>g <strong>for</strong> the specific period, then compares thedifference of the output parameters of the Per<strong>for</strong>mance Monitor us<strong>in</strong>g the different rout<strong>in</strong>galgorithms. then obta<strong>in</strong>s the results.In this project, I just use two network <strong>in</strong>stances to evaluate the per<strong>for</strong>mance of the rout<strong>in</strong>galgorithms. One is the example network <strong>in</strong> the Figure 4, another is the NSFNET <strong>in</strong> theFigure 5.4.1 Example Network (7 nodes, 8 l<strong>in</strong>ks)The example network composed of 7 nodes and 8 bidirectional l<strong>in</strong>ks. In the experimentswith example network, we <strong>in</strong>itialize the random number generator us<strong>in</strong>g the 10 differentvalues of seed which generate 10 different sequences of events. For each sequence ofevents, we collected the measures of both rout<strong>in</strong>g algorithms we try to compare. The otheroption value we used <strong>in</strong> this experiment are: -perfdt 1000000 –skipt5000000 ./etc/example-net 10000000.Rout<strong>in</strong>g seed Time of Total network Average delay/packetAlgorithmSnapshot(ticks) throughputSPF 758596 1000162 76.77512485954551 18.397466666666666ANTNET 758596SPF 98056 1000162 76.77512485954551 18.388720000000003ANTNET 98056


SPF 98 1000022 51.19774729911884 20.04286ANTNET 98SPF 6 1000162 76.77512485954551 18.38612ANTNET 6SPF 666 1000045 76.79308862202402 18.37616ANTNET 666SPF 666898989 1000045 51.19539241468268 20.04538ANTNET 666898989SPF 6899 1000051 51.19477813263047 20.04344ANTNET 6899SPF 16 1000002 76.7996928012288 18.374733333333335ANTNET 16SPF 160 1000141 51.18556567048092 20.04496ANTNET 160SPF 1600 1000096 76.78525723061172 18.385493333333333ANTNET 1600Table 1: Measures with different rout<strong>in</strong>g algorithms and seeds4.2 NSFNET (14 nodes, 21 bidirectional l<strong>in</strong>ks, average degree 3)5. ConclusionFigure 5: NSFNET.CuRS provides a flexible plat<strong>for</strong>m <strong>for</strong> the evaluation and comparison of rout<strong>in</strong>g algorithms.The user do not need to worry what k<strong>in</strong>d environment CuRS can be runnable. The user cancompile and run it on most plat<strong>for</strong>ms such as: W<strong>in</strong>dows, UNIX and L<strong>in</strong>ux. However,MaRS is no that portable. For example, when I downloaded L<strong>in</strong>ux version of MaRS from


the website, it is not runnable <strong>in</strong> L<strong>in</strong>ux 7.x (latest version L<strong>in</strong>ux). I do not want to <strong>in</strong>stall oldversion of L<strong>in</strong>ux aga<strong>in</strong>, so it take me <strong>for</strong> a while to fix the makefile of MaRS to make itwork <strong>in</strong> L<strong>in</strong>ux 7.x. Also <strong>for</strong> the user would like to extend CuRS <strong>for</strong> specific purpose, the<strong>Java</strong> code is easier to modify and test than C. The design of CuRS is k<strong>in</strong>d of ObjectOriented design, and Observer/Observable design pattern is used to design the relationshipbetween event and component, <strong>in</strong>stead of the function po<strong>in</strong>t call used <strong>in</strong> the MaRS. So thecode is more reusable.6. Future WorkThe current version of CuRS does not provide GUI yet. However, the GUI is friendlier <strong>for</strong>user to create the network and efficiently measure the per<strong>for</strong>mance of the different rout<strong>in</strong>galgorithms or workloads. MaRS provides command l<strong>in</strong>e <strong>in</strong>terface and also can be compiledwith one of two optional graphical <strong>in</strong>terfaces: a simple X <strong>in</strong>terface, or an X-Motif <strong>in</strong>terface.The details of how to design and implement the GUI, the programmer can refer to part 6.User Interface of the MaRS Version 1.0 User's Manual which is available on the website Ilisted <strong>in</strong> the reference part. MaRS can also be downloaded from that website. But thatversion of MaRS does not work <strong>in</strong> the L<strong>in</strong>ux 7.x. While I have a modified version of MaRSwhich is runnable <strong>in</strong> the L<strong>in</strong>ux 7.x. I would like share it with the people who enjoyimplement<strong>in</strong>g the GUI <strong>for</strong> CuRS. And also understand<strong>in</strong>g the Motif of the MaRS will bevery helpful to implement GUI <strong>for</strong> CuRS. Because CuRS is implemented <strong>in</strong> <strong>Java</strong>, so it willbe better to implement the GUI us<strong>in</strong>g <strong>Java</strong> AWT or Sw<strong>in</strong>g. And I am glad to answer anddiscuss the questions about CuRS.7. User Manual7.1 CuRS Directory StructureThe CuRS directory conta<strong>in</strong>s subdirectories <strong>for</strong> the source code, class files, libraries files,and properties file. It is organized as follows:READMEclasses Subdirectory <strong>for</strong> the executable files (i.e. .class files)doc Subdirectory <strong>for</strong> the project reportetc Subdirectory <strong>for</strong> the miscellaneous files like example networkslib Subdirectory <strong>for</strong> the library files (i.e. fada-http.jar)src Subdirectory <strong>for</strong> the source code files (i.e. .java files)7.2 Start CuRSAfter CuRS is <strong>in</strong>stalled, it can be started by typ<strong>in</strong>gjava -Dlog.properties=config/Log.properties SimMa<strong>in</strong> [options] networkfile [stoptime]The networkfile conta<strong>in</strong>s the description of the target system. The stoptime value, ifpresent, is used to stop the simulation when the simulated time exceeds this value. In thecurrent version, the option are as follows:-xstart the simulation of the target system immediately, without the GUI. This option


should not be used if the networkfile is not present.-s seed<strong>in</strong>itialize the random number generator us<strong>in</strong>g the value of seed.-iwhen the simulated time exceeds th stoptime value specified, the user is asked whetheror not to cont<strong>in</strong>ue the simulation.-recordwrite the occurrence of the record type events to the file sim_event.process_id.-play filenameread and schedule events from the file filename, which should be a file that was createdus<strong>in</strong>g the -record option.-perfdt update_period<strong>for</strong> periodically-updated per<strong>for</strong>mance measure use the value of update_periiod as theupdate period length <strong>in</strong> microseconds.-skipt startup_<strong>in</strong>tervalaverage per<strong>for</strong>mance measures are based on statistics collected after the simulated timeexceeds startup_<strong>in</strong>terval <strong>in</strong> microseconds.The -x option is useful <strong>for</strong> long simulation runs; with this option the <strong>simulator</strong> runs faster.The -record/-play options allows the user to repeat a sequence of record type eventoccurrences across different simulation runs. It is useful when we evaluate differentrout<strong>in</strong>g algorithms subject to the same failure/repair event occurrences. The -perfdt optioncan be used to control the size of the log file, s<strong>in</strong>ce most of the per<strong>for</strong>mance measures areperiodically -updated per<strong>for</strong>mance measures.The current version of the CuRS does not support GUI, so the user need to create thenetworkfile manually. There is a example networkfile <strong>in</strong> the CuRS. When the GUI part isadded <strong>in</strong> the future, the user can create the network us<strong>in</strong>g GUI and save the networkconfiguration by the click<strong>in</strong>g the save button.7.3 ExampleCuRS provides a small networkfile called "example-net" <strong>in</strong> the etc subdirectory. The usercan start CuRS with this networkfile to ga<strong>in</strong> first experience with the <strong>simulator</strong>. Aftergett<strong>in</strong>g familiar with CuRS, the user should try to build his/her own networkfile.8. References• MaRS-L<strong>in</strong>ux Version : http://www.cs.bu.edu/fac/matta/software.html• C. Alaett<strong>in</strong>oglu, A. U. Shankar, K. Dussa-Zieger, and I. Matta. Design and<strong>Implement</strong>ation of MaRS: A Rout<strong>in</strong>g Testbed.http://citeseer.nj.nec.com/update/204312• C. Alaett<strong>in</strong>ouglu, K. Dussa-Zieger, I. Matta, A.U. Shankar, and O. Gudmundsson.Introduc<strong>in</strong>g MaRS, a Rout<strong>in</strong>g Testbed. ACM SIGCOMM ComputerCommunication Review, 95-96 (1992).


• C. Alaett<strong>in</strong>ouglu, K. Dussa-Zieger, I. Matta, A.U. Shankar, and O. Gudmundsson.MaRS (Maryland Rout<strong>in</strong>g Simulator) -User Manual. UMCP CSD CS-TR-2687(1991).• C. Alaett<strong>in</strong>ouglu, K. Dussa-Zieger, I. Matta, A.U. Shankar, and O. Gudmundsson.MaRS (Maryland Rout<strong>in</strong>g Simulator) -Programmer Manual. UMCP CSDCS-TR-2723 (1991).• Dandamudi P Sivarama, Network<strong>in</strong>g courses notes (95.323), 2001 W<strong>in</strong>ter• Gianni Di Caro, Marco Dorigo, <strong>AntNet</strong>: A Mobile Agents Approach to AdaptiveRout<strong>in</strong>g (1997), http://citeseer.nj.nec.com/update/409626• Peterson L Larry & Davie S. Bruce, Computer Networks, Morgan Kaufmann, SanFrancisco, Cali<strong>for</strong>nia, Second Edition, 2000.• Roberts Simon, Heller Philip & Ernest Michael, Complete <strong>Java</strong> 2 CertificationStudy Guide, SYBEX, Alameda, CA, 1999• Waite Mitchell & Prata Stephen, The Waite Group’s New C Primer Plus, SAMS,Carmel, Indiana, Second Edition, 1993• Wall Kurt, L<strong>in</strong>ux Programm<strong>in</strong>g by example, Dean Miller, Indianapolis, Indiana,20009.Appandix

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!