Sunday, June 2, 2019

Routing Protocol Simulation With NS2

Routing protocol Simulation With NS2Network feigning is a method of investigation in vane technology. In the subroutine of investigating a in the raw technology, due to various reasons, it is costly and unrealistic to physic whollyy establish a web clay. In such situation, modelling becomes bingle of the best available solutions in testing, evaluation and validation. Network mannikin has the features of sm solely cycle and low cost, and it is easier for researchers to phthisis others research, in order to concentrate on the particular part and no need to waste too much time on other part of the system.NS2 is a simulation platform that is developed in free open source for profits technologies. Researchers can easily use it for the instruction of communicate technology. Until today, NS2 contains rich modules that are almost related to all aspects of cyberspace technology.Wireless intercommunicate communicatings obtained a rapid development in recent years. Ad hoc cy berspaces do not need the contain of cable stand the communication is achieved by free spry network hosts. The emergence of ad hoc network has promoted the achievement of the process of free communication at any environment, at the kindred time it has also tryd an effective communication solution of military, disaster relief and temporary communication theory.Considering the ad hoc network is constantly moving, and the network network topology is changing, wherefore the traditional earnings routing protocols (e.g. RIP, OSPF) are not be able to adapt into the actual need of ad hot networks. Therefore there are many a(prenominal) specialised routing protocols are twisted for the ad hoc network, the aim of this paper is to differentiate, analyse and evaluate the most popular routing protocols for ad hoc networks by running the simulation test with NS2.IntroductionA mobile ad hoc network (MANET), sometimes called a mobile mesh network, is a self-configuring network of mob ile devices connected by radio receiver bonds.Along with the desire of get rid of the wired network constraints and be able to communicate at any time and any place, wireless network communications obtained a rapid development in recent years. Mobile communications can be achieved by portable computers with wireless interface furnished and PDAs. Most current mobile communications require a wired infrastructure, e.g. base station. To be able to communicate without fix infrastructure, a new network technology Ad Hoc network technology arises at the historic moment. Ad hoc networks do not need the support of cable infrastructure the communication is achieved by free mobile network hosts. The emergence of ad hoc network has promoted the achievement of the process of free communication at any environment, at the aforesaid(prenominal) time it has also provided an effective communication solution of military, disaster relief and temporary communications.Each device in a MANET is free t o move independently in any direction, and pass on therefore change its marrys to other devices frequently. Each must forward traffic unrelated to its own use, and therefore be a bridle-pathr. The primary challenge in building a MANET is equipping individually device to continuously put forward the development compulsory to properly road traffic. such networks may operate by themselves or may be connected to the larger Internet.Ad-hoc network was originally use in the military field. With the developments of wireless networks, it has begun the development in the civilian fields. A mobile ad-hoc network does not need any infrastructures, any lymph node can quickly and semiautomatically form the network, and distributively node can move freely and is able to join or leave the network at any time. The characteristics and advantages of fast deployment, invulnerability makes mobile ad-hoc neat more and more widely utilize in either military or civilian fields.In recent years , as the emerging wireless communication network, Ad-hoc is gradually attracting more attention of the industry and become a research hotspot. Ad-hoc networking supports flexible and comfortable communication without the support of infrastructure, this technique broadens the fields of mobile communications and has a bright future.Ad hoc network can be regarded as the cross of mobile communication and computer network. In ad hoc networks, computer network packet exchange mechanism is employ rather than circuit switching mechanism. Communication hosts are usually portable computer, personal digital assistants (PDA) and other mobile devices. Ad Hoc network is different from mobile IP network in the current Internet environment. In mobile IP networks, mobile hosts can link and access the network through resolved wired network, wireless link and dial up link, and in ad hoc network, these is hardly a wireless link connection. In mobile IP networks, the communication need to be support ed by adjacent base stations and still using the traditional cyberspace routing protocol, however, ad hoc networks do not have the support of these facilities. In addition, a mobile host in the mobile IP network is whole an average end device which does not have routing function. When the mobile host moves from one zone to another does not change the network topology, and in Ad Hoc networks the achievement of mobile hosts would lead to topology change.The thesis is to research on the Ad-hoc networking mode and its network layer through simulation with NS2, mainly foc employ on the coincidence and analysis of the popular ad-hoc routing protocols. The aim of this article is to research and develop on the key technology of self-configuring network routing protocols, based on ad-hoc network structure.Wireless Ad-Hoc network twist and CharacteristicsAd Hoc wireless network has its own particularity, in the formation of actual use of the working network, the application size, scal ability and the reliability and real-time requirements must be taken full account.In addition, due to the unique structure of the ad hoc network, the characteristics of ad hoc network should be fully considered when design and build the network, which give service of process us to design a routing protocol that is suitable for particular network structure in order to maximise the performance across the network.Ad-hoc network StructureAd Hoc wireless network topology can be divided into two kinds Flat structure and vertical structure, in flat network structure, all network nodes have equal status.However, in the hierarchical structure of the Ad Hoc wireless network topology, the whole network is composed of clusters for the subnet, apiece cluster consists of a cluster head and sevenfold cluster members, the cluster heads forms a higher take network. Each cluster head and cluster members are propellent and automatic networking. The hierarchy is based on different hardware confi gu balancens, and hierarchical structure can be divided into single-band and multi-band classification structure. Single band hierarchy use single oftenness in communication, all nodes use the same frequency. But in multi-band hierarchy, if there are two networks in different levels exist, the lower level network has a smaller communication range and higher level network has a larger communication range, cluster members use the same frequency to communicate, cluster head nodes uses one frequency to communicate with cluster members and another frequency to maintain the communication with cluster heads.There are advantages and disadvantages exist in either flat or hierarchical network structures the structure of flat structure network is simple, each node has an equal status, there are multiple paths exist in communication of the source node and savoir-faire node, therefore no network bottlenecks, and the network is comparatively safe. However, the biggest drawback is the limited n etwork size, when the network descale expanding, routing maintenance overhead exponential growth and consume the limited bandwidth Hierarchical network structure is not limited by the scale of network, the scalability is good, and because of clustering, routing overhead is relatively smaller, although there is the need of complex cluster head selection algorithm in hierarchical structure, but because of hierarchical network structure with high system throughput, node localisation is simple, therefore ad hoc network is now increasingly showing grading trend, many network routing algorithms proposed are based on the hierarchical network structure model.Ad-Hoc network CharacteristicsWireless ad hoc network is a combination of mobile communications and computer networks, each node in the network have both router and host functions. The characteristics of ad hoc networks in mainly in the following(a) areasDynamically changing network topologiesAd Hoc networks have no fixed infrastruct ure and central management communications equipment, network nodes can randomly move to any direction in any speed rate, coupled with the supply change of wireless transmitter device, the environment impact and the signal mutual interference between each other, which all will result in dynamic changes of the network topology.Limited resourcesthe working energy provided to the mobile hosts in Ad Hoc networks are limited, and the mobile host with more energy loss, will reduce the Ad Hoc network functions on the other hand, the network itself provides limited bandwidth and signal conflicts and Interference, which results the mobile host with limited available bandwidth which is normally far less than the theoretical level best bandwidth.Multi-hop communicationif two network nodes are not in the same network coverage due to the limited resources available, multi-hop may be used in Ad Hoc network communication, in order to achieve the communication between the source host and terminat ion host which are not in the same network coverage.Limited physical securitythe communication of Ad Hoc network nodes are through the wireless channel, the instruction transmitted is very vulnerable, and eavesdropping, retransmission, falsify or forgery attack can be achieved easily, If routing protocol once suffered the malicious attacks, the whole self-organizing networks will not work properly.These features of the Ad Hoc network have do a special request in the routing algorithm design. A reasonable routing algorithm must take the factors of limited network resources, dynamic network topology changes and improve the network throughput into account.Ad-Hoc Wireless network routing protocolsThe key issue in ad hoc network design is to develop a routing protocol that is able to provide high quality and high efficient communication between two nodes. The mobility characteristic in the network makes the network topology constantly changing, the traditional internet based routing pr otocol is unable to adapt to these characteristics therefore the routing protocol that is specialised for ad hoc networks is needed, According to earlier on the Ad Hoc network architecture and features described, the design of the routing protocol must meet the following conditionsThe need of rapid response capability for dynamic network topology, and try to avoid routing loops from occurring, and provide simple and convenient network node localise method.Must be efficiently use of the limited bandwidth resources, and try to compress unnecessary overhead.Limit the number of intermediate absent during the implementation of multi-hop, generally not more than 3 times.Must minimise the launch time and amount of launch entropy, in order to save limited working energy.In possible conditions, make the design of routing protocol with securities to reduce the possibility of being attacked.Routing ProtocolsAccording to the specific characteristics of ad hoc wireless network routing protocol s, in recent years, there are a variety of ad hoc network routing protocols have been proposed. IETFs MANET working group is currently focused on research Ad Hoc network routing protocols, and protocols many protocol drafts, such as DSR, AODV, ZRP etc. in addition, the professional researchers also published a extensively amount of articles related to Ad hoc network routing protocols and proposed many network routing protocols for the ad hoc networks, such as DSDV, WRP etc. According to the routing trigger principle, the current routing protocols can be divided into three fictional characters proactive Routing protocol, Reactive routing protocol and Hybrid routing protocols.Proactive Routing protocolProactive routing protocol is also known as Table-driven routing protocol, each node maintains a routing table that contains the routing information to reach the other node, and updates the routing table constantly according the network topology changes, and therefore the routing table can accurately reflect the topology structure of the network. in one case the source code needs to entrust marrows, the route to the end point node can be immediately obtained. This type of routing protocol is usually modified from the live wired network routing protocol to adapt to the wireless ad hoc network requirements, such as the Destination-Sequenced Distance sender protocol, which is modified from the Routing Information Protocol (RIP). Therefore, this type of routing protocol has a small delay, but requires a lot of control message, the overhead is large. Commonly used proactive routing protocols include DSDV, HSR, GSR, WRP etc.Destination-Sequenced Distance Vector (DSDV)DSDV avoids the generation of routing loops by mark serial number for each route, using time-driven and event-driven technology to control the transfer of routing table, i.e. a routing table is kept in each moving node locally, it contains valid points, routing hops and stopping point routing serial number etc. close routing serial number is used to distinguish old and new route to avoid routing loops.Each node periodically sends the local routing table to the neighbour nodes, or when the routing table changes, the information will also be passed to neighbouring nodes, when there is no moving nodes, use a larger packet with longer interval to update the route. When the neighbouring node receives the information contains modified routing table, it will first compare the serial number of destination node, the routing with larger serial number will be used and the one with smaller serial number will be eliminated, and if the serial number are the same, the best optimised route (e.g. shortest path) will be used.Each node must periodically exchange the routing information with adjacent nodes, the routing information update is also can be triggered by the changes in routing table. There are two ways to update the routing table, Full dump, i.e. the topology update message will includ e the entire routing table, which is mainly applied to the case of fast changing network. Another way is Incremental update, in which update message contains only the changed part in routing, such way is usually used in a network with slower changes.Hierarchical State Routing (HSR)HSR is a routing protocol that is used in hierarchical network, nodes at a higher level saves all the location information of its peers, logical sequence address is assigned along from the rout node at the highest level to the leaf node at the lowest level, node address can be used by sequence address. world(prenominal) State Routing (GSR)GSR protocol works similar with the DSDV mechanism, it uses link-state routing algorithm, but avoids the flooding of routing packets, which includes an adjacent node table, network topology table, next hop routing table and the surmount table.Wireless Routing Protocol (WRP)WRP is a distance-vector routing protocol, each node maintains a distance table, routing table, li nk overhead table and packet retransmission table, through the Short Path Spanning channelize (SST) of the neighbouring node to generate its own SST, and then transmit updates. When there is no any change in the network routing, the receiver node must drop dead an idle message to show the connection, otherwise modify the distance table to look for better route. The feature of this algorithm is that when any changes of the neighbouring node is detected, and then checks the sturdiness of all adjacent nodes in order to eliminate the loop, has a faster convergence.Reactive Routing ProtocolReactive Routing protocol is also known as on-demand routing protocol, it remarks the route only when needed. Nodes do not need to maintain routing information constantly, it will initiate route look up only when the packet is need to be sent. canvass with proactive routing protocols, the overhead of reactive routing protocol is smaller, but the packet transmission delay is larger, which means it i s not suitable for real time applications. Commonly used reactive routing protocols include AODV, DSR, TORA and so on.2.2.2 Dynamic Source Routing (DSR)DSR is designed to restrict the bandwidth consumed by control packets in ad hoc wireless networks by eliminating the periodic table-update messages required in table-driven approach.DSR is composed of two main mechanisms Route Discovery and Route Maintenance. The Route Discovery mechanism is used when the source node needs to send a packet to the destination node but does not know the route.When the source node is using a source route to reach the destination node, source node uses the route maintenance mechanism to identify the route that cannot be used due to the topology changes.In DSR, route discovery and route maintenance mechanisms are fully on-demand operation, DSR does not require any periodic routing broadcast packets and link state detection packets.2.2.3 Temporally Ordered Routing Algorithm (TORA)TORA is an adjustive dis tributed routing algorithm based on link reversal method, which is mainly used for high-speed dynamic multi-hop wireless network. As a source initiated on-demand routing protocol, it is able to find multi-paths from the source to the destination node. The main characteristics of TORA are, when topology changes, the control message transmission in local area of topology changes only. Therefore, the node only needs to maintain the information of adjacent nodes. The protocol consists of three parts route generation, route maintenance and route deletion. In the initialisation stage, the transmission sequence number of the destination node is enclothe to 0. The QRY packet which contains the destination node ID broadcast by the source end and a node with a transmission sequence number that is not 0 responses to the UDP packet. The node that receives UDP packet has the sequence number higher than the source node by 1, and the node with higher sequence number is perform as the up flow rat e node. Through this method, a Directed Acyclic Graph (DAG) from the source to the destination node can be created. When nodes move, routes need to be rebuilt. In the route deletion phase, TORA removes the invalid route by broadcasting a CLR. There is one problem that exists with TORA, which is when multiple nodes proceeds to route selection and deletion, routing quivering will be produced.2.2.4 Ad-hoc On-Demand Distance Vector Routing (AODV)AODV is an improvement to the DSDV algorithm, but the difference with DSDV is that it is a Reactive routing protocol. In order to find the route leading to the destination node, the source end will broadcast a routing request packet, and adjacent in turn broadcast the packet to the surrounding nodes until the packet was sent to the destination node, or, to the intermediate node which has the routing information to the destination node. A node will discard duplicated request packet received, the serial number of routing request packet is to bar routing loops, and is able to determine whether the intermediate node has responses to the corresponding routing requests. When a node forwards a route request packet, it will mark the ID of its upstream node into the routing table, in order to build a reverse route from the destination node to the source node. When the source end moves, it will re-initiate route discovery algorithm if the intermediate nodes move, then the adjacent node will find the link failure and send the link failure message to its upstream node and break up the message all the way to the source node, laterwards the source node re-launches the route discovery process according to the circumstances.The achievement of AODV is a combination of DSR and DSDV protocols. It has the features of route discovery and route maintenance in DSR, and at the same time use by-hop routing, sequence number and Beacon messages that adopted in DSDV.Hybrid Routing ProtocolIn wireless ad hoc networks, neither proactive nor reactiv e routing protocols alone can solve the routing problem completely, therefore hybrid routing protocols which combines the advantage of both proactive and reactive protocols have been proposed by the researchers, such as the Zone Routing Protocol (ZRP). ZRP is a combination of proactive and reactive routing protocols, all nodes within the network to themselves as the contract of a virtual zone, the number of nodes in the area is related to the radius cast of the zone, and the areas overlap, this is the difference with clustering routing. It uses proactive routing algorithm within the zone, the centre node uses Intrazone Routing protocol to maintain in the zone.Literature ReviewNetwork Simulation ToolThe platform that will be used in simulation is Windows XP Professional + Cygwin + NS2.NS2 is a simulation platform that is developed in free open source for network technologies. Researchers can easily use it for the development of network technology. Until today, NS2 contains rich mod ules that are almost related to all aspects of network technology. Since the release 2.26, NS2 has stopped support with Windows platforms, therefore to get the latest NS2 running on the Windows XP, Cygwin is needed. Cygwin is an UNIX aper on Windows platform.ImplementationConfigure simulation platformNormally, NS2 simulation can be divided into the following steps1. Compose necessary components i.e. add or remove new components2. Testing test whether the component composed is validated. When the component in the library satisfies the simulation needs (e.g. simulation process based on existing protocols in the library),then the simulation starts from the third step.3. Compose Otcl script point configure the topology structure of the simulating network, and identify the basic link features, protocols that have been used by moving nodes, and number of nodes etc, and binding the terminal device protocol, put the scene and traffic load of simulation (TCP stream or cosmic background ra diation stream), stigmatizeting simulation start and end time etc, and set trace butts of the script saddle, trace file is the file that records all of the events of simulation process, and also can set the nam object at the same time, nam is the tool to demonstrate the network running lifetime.4. Use NS command to execute script file once executed, *.tr file will be generated in the same directory of the script file, to record the simulation results. if nam object is set in the script file, *.nam file will be generated in the same directory.5. Analyse trace file due to the large size of trace file, we will need to compose gawk program to process the data after simulation (calculate packet delivery date, routing overload, and throughput etc), then use the drawing tools to produce the graph for direct analysis.In NS2 the classic routing protocols such as DSDV, DSR, TAORA and AODV are already integrated the source code of routing protocols is located in CcygwinhomeAdministratorns- allinone-2.34ns-2.34, show in figure 1.1Take AODV as an example (fig. 1.2), within the ADOV folder, aodv.cc and aodv.h are the most important files, they defines the main functional features. Under general circumstances, we do not need to modify the source code of the protocols.Fig.1.2 AODV Routing ProtocolSimulation scriptingAccording to the simulation model designed, each routing protocol (DSDV, DSR, AODV, and TORA) will be compared in small (20 nodes) and medium (50 nodes) ad hoc wireless network. The corresponding scripts composed are dsdv.tcl, dsr.tcl, aodv.tcl and tora.tcl (see appendix).Taking aodv.tcl as an example, the coding is show in fig.3.2.1Partial scripts in aodv.tclSome script explanation of most important codes in aodv.tclset val(ifq)Queue/DropTail/PriQueueInterface queueset val(nn)50Number of nodes in simulation scenarioset val(rp)AODVRouting protocol to be simulatedset val(stop)300Simulation time lengthset val(x)500Length of sceneset val(y)500Width of sceneset val (tr) out50.trOutput trace fileset val(nam) out50.namOutput nam fileset opt(cp) cbr50Stream fileset opt(sc) scen50Scene fileIn addition, write the following statement in script head to generate a simulation ns_ objectset ns_new SimulatorTracking the file object is used to specify the Trace file (with .tr extension) in recording of the simulation data. NS2 supports record application layer, routing layer, MAC layer and node movement those four types of data in difference layers. The data that needs to be recorded can be specified in settings in the simulation process. The data in of each layer that trace object specified are all recorded in the trace file, labels are added to distinguish them. In addition, NS2 also supports NAM tool simulation process visualisation, such function needs to generate the NAM trace file object to specify the trace file of records of simulation data. The following statements are used to generate those two trace file object described.Generate trace file$ns_ use-newtraceset tracefdopen out50.tr w$ns_trace-all$tracefdGenerate NAM trace file objectset namtracefdopen out50.nam w$ns_namtrace-all-wireless$namtracefd$val(x)$val(y) data Stream Generation ToolData stream generation tool cbrgen is used to generate traffic loads, which can generate the TCP steam and CBR steam. Cbrgen.tcl file (see appendix) can be used as followingCodes are defined as following-typeTCP stream or CBR stream-nnNumber of nodes-seedSpecify number of random seeds-mcupper limit connection of each node-rateOverload of each stream connectionThe format is used as followingns cbrgen.tcl -type cbrtcp -nn nodes -seed seed -mc connections -rate rateMovement Scene./setdest is used to randomly generate the nodes movement scene needed form wireless network, used as following (2 versions)./setdest -v -n -p -M -t time -x -y or./setdest -v -n -s -m -M -t -P -p -x -y Which speed type set to uniform/normalpause type set to constant/uniform.NAM animationThe NAM function i s used to run the animation of specific trace end product format, the output file can be based on real or simulated environment. For example, the trace file that is from the output of NS simulator.The commands to control to control NAM animation in NS2 as following nam out.nam1. Node$node change color displace the colour of node$node shape shape stage setting shape of node$node label labelSetting name of node$node label-color lcolorSetting display colour of node name$node label-at ldirectionSetting display location of node name$node add-mark name color shapeAdd annotation$node delete-mark nameDelete annotation2. Link and Queue$ns duplex-link attribute orientcolorqueuePoslabel3.AgentUse the following commands to make the agent you wish to display appears as AgentName in the box.$ns add-agent-trace$Agent AgentNameThe parameters of movement scene and node flow are in the tables shown belowParameter of node movement sceneParameterNumber of nodesMoving rangeResting timeSimulation time Values set20, 50500 x 500 m1 s300 sParameter of node movement sceneParameterMaximum moving speedPacket sizeNode communication distanceType of serviceValues set5, 10, 15, 10, 25, 30-50512 byte250 mCBRTrace file analysisPerformance parameter analysis modelThe index to measure the performance of ad hoc network routing protocol is commonly including qualitative index and denary indicator. Qualitative indicator describes the overall performance of a particular aspect of the network, such as the security, distribution operation, provide loop free route and whether to support single channel etc. and quantitative indicators can describe the performance of a certain aspect of the network in more details. The quantitative indicator of packet delivery ratio, average end to end delay and throughput etc are often used to measure the performance of network routing protocols.a. Packet delivery ratio is a ratio of the number of packet sent from the source node and the number of packet that have been received by destination node in the application layer, which not only describes the loss rate observed in the application layer, but also reflect the maximum throughput supported by the network. It is the indicator of routing protocol completeness and correctness.End to end average delayit can be calculated with the following equation, which N represent the packets successfully delivered, rt represents the time that packet reached the destination node, and st represent packet sending time.Routing overheadRouting overhead is the total number of control packets of all routes, in a multi-hop routing each hop transmission is equivalent to one packet transmission. Routing overhead can be used to compare the scalability, the ability to adapt to network congestion and the efficiency of different routing protocols. It can be calculated with the following formulaRouting overhead = The Total number of routing control packetsGawk codeThe output file out.tr generated in simulation analysis will be filtered by selecting all of the packets in Agent layer, calculate all the number of data packets sent by this layer and the number of data packets that has been successfully received, and then divide the number

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.