• Like
  • Save
Zrp manual 2
Upcoming SlideShare
Loading in...5
×
 

Zrp manual 2

on

  • 2,392 views

zrp manual book instalation

zrp manual book instalation

Statistics

Views

Total Views
2,392
Views on SlideShare
2,392
Embed Views
0

Actions

Likes
0
Downloads
49
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Zrp manual 2 Zrp manual 2 Document Transcript

    • ZRP Agent for NS2 (NS-2 v2.33)(Implementation Documentation) By Brijesh Patel MAGNeT Group, DA-IICT, Gandhinagar April 2009
    • Contents1 Introduction 1 1.1 How to patch ZRP agent in the NS2? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 How to run simulations using this agent? . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 How to use this Manual? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.4 Referrence Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Module Index 5 2.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Class Index 7 3.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Module Documentation 9 4.1 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.2 NDP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3 IARP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.4 IERP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.5 ZRP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Class Documentation 19 5.1 DetectedQuery Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.2 DetectedQueryList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.3 hdr_zrp Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.4 IARPAgent Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.5 IARPExpirationTimer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.6 IARPPeriodicUpdateTimer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.7 IARPUpdate Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.8 IARPUpdateDetectedList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.9 IERPAgent Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.10 IERPExpirationTimer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
    • ii CONTENTS 5.11 InnerRoute Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 5.12 InnerRouteList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 5.13 LinkState Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.14 LinkStateList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.15 LSU Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.16 NDPAckTimer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.17 NDPAgent Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 5.18 NDPBeaconTransmitTimer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 62 5.19 Neighbor Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 5.20 NeighborList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 5.21 PacketUtil Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 5.22 PeripheralNode Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 5.23 PeripheralNodeList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 5.24 SendBuffer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5.25 SendBufferEntry Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 5.26 SentQuery Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 5.27 SentQueryList Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 5.28 ZRPAgent Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • Chapter 1IntroductionThis document provides implementation documentation of ZRP agent for NS v2.33. It provides the answersfor following ’how to’ questions: 1. How to patch ZRP agent in the NS2? 2. How to run simulations using this agent? 3. How to use this Manual?1.1 How to patch ZRP agent in the NS2?In order to patch the ZRP agent, first you must have following files with you. 1. PatchZRP.patch • This file contains the changes needed for ZRP agent in the following NS files. (a) ∼/tcl/lib/ns-agent.tcl (b) ∼/tcl/lib/ns-default.tcl (c) ∼/tcl/lib/ns-lib.tcl (d) ∼/tcl/lib/ns-packet.tcl (e) ∼/common/packet.h (f) ∼/trace/cmu-trace.h (g) ∼/trace/cmu-trace.cc (h) ∼/Makefile 2. ns-allinone-2.33_ZRP.tar.gz • This zip file contains the actual code of the ZRP Agent. It must be unzipped in such a way so that it should be placed in NS home directory. 3. patchmyZRP.sh • Once you do the aforementioned tasks, then you need to rebuild the NS2. All these operations are scripted in this shell script. So, for patching ZRP agent, only you need to do is run this shell script in NS home directory. (Please go through the README file for the instructions.)
    • 2 Introduction1.2 How to run simulations using this agent?Following is one of the simulation tcl script in which nodes run ZRP as a routing agent. You must befamiliar with the most of the code if you have run some simulations in NS2. But one thing you shouldnotice is - you need to write a following code-line in the tcl script to set the default zone radius value."Agent/ZRP set radius_ 2"# ======================================================================# 1. Define options# ======================================================================set val(chan) Channel/WirelessChannel ;Channel Typeset val(prop) Propagation/TwoRayGround ;# radio-propagation modelset val(netif) Phy/WirelessPhy ;# network interface typeset val(mac) Mac/802_11 ;# MAC typeset val(ifq) Queue/DropTail/PriQueue ;# interface queue typeset val(ll) LL ;# link layer typeset val(ant) Antenna/OmniAntenna ;# antenna modelset val(ifqlen) 50 ;# max packet in ifqset val(nn) 25 ;# number of mobilenodesset val(rp) ZRP ;# routing protocol <—————————————-ZRP Agentset val(x) 600 ;# X dimension of the topographyset val(y) 600 ;# Y dimension of the topographyset val(stop) 30.0 ;# simulation timeAgent/ZRP set radius_ 2 ;# Setting ZRP radius=2# ======================================================================# 2. Main Program# ======================================================================# 2.0 Removing Packet Headers[Adding only necessary for ZRP]...remove-all-packet-headersadd-packet-header Common Flags IP RTP ARP GAF LL LRWPAN Mac ZRP# 2.1 Initialize Global Variables...# 2.1.1 create simulator instanceset ns_ [new Simulator]# 2.1.2 Use New trace format...$ns_ use-newtraceset tracefd [open Grid_TC1.tr w]$ns_ trace-all $tracefdset namtrace [open Grid_TC1.nam w]$ns_ namtrace-all-wireless $namtrace $val(x) $val(y) Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 1.2 How to run simulations using this agent? 3# 2.1.3 set up topography objectset topo [new Topography]# define topology$topo load_flatgrid $val(x) $val(y)# 2.1.4 Create Godset god_ [create-god $val(nn)]# 2.2 All About Nodes [Node Config + Location Info]...# 2.2.1 configure node, please note the change below. ;# [Originaly macTrace=ON]$ns_ node-config -adhocRouting $val(rp) -llType $val(ll) -macType $val(mac) -ifqType $val(ifq) -ifqLen $val(ifqlen) -antType $val(ant) -propType $val(prop) -phyType $val(netif) -channelType $val(chan) -topoInstance $topo -agentTrace ON -routerTrace ON -macTrace OFF -movementTrace OFF # 2.2.2 Create the specified number of nodes [$val(nn)] and "attach" them to the channel.for {set i 0} {$i < $val(nn) } {incr i} {set node_($i) [$ns_ node]$node_($i) random-motion 0 ;# disable random motion}# 2.2.3 Node locationsfor {set i 0} {$i < 5} {incr i} {for {set j 0} {$j < 5} {incr j} {set id [expr $i∗5 + $j]set X [expr $j∗140+20]set Y [expr $i∗140+20]$node_($id) set X_ [expr $j∗140+20]$node_($id) set Y_ [expr $i∗140+20]$node_($id) set Z_ 0.0Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 4 Introductionputs "CO-ORD of Node $id = ($X, $Y)"}}# 2.3 Traffic Profile [Only One connection]...# You can define traffic profile here# 2.4 Events...# 2.4.1 Tell nodes when the simulation endsfor {set i 0} {$i < $val(nn) } {incr i} {$ns_ at $val(stop).0 "$node_($i) reset";}$ns_ at $val(stop).0002 "puts "NS EXITING..." ; $ns_ halt"puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(rp)"puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"proc stop {} {global ns_ tracefd$ns_ flush-traceclose $tracefd}puts "Starting Simulation..."$ns_ run1.3 How to use this Manual?This manual is organnized in two ways. First it represents the code in five separate modules. Each modulecontaines a component of ZRP. New reader is adviced to go through the module section first to get the ideaof ZRP implementation design. Second it represents the the code according to the class definitions and itsdetailed documentation in terms of its data and member functions.1.4 Referrence DocumentsFollowing are some of the documents which may help to understand the code better. 1. NS2 Documentation (Available at: http://www.isi.edu/nsnam/ns/ns-documentation.html) 2. ZRP IETF Drafts (Available at: http://tools.ietf.org/html/draft-ietf-manet-zone-zrp-04) 3. Creating agents in NS2 (Available at: http://masimum.inf.um.es/nsrt-howto/pdf/nsrt-howto.pdf) Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • Chapter 2Module Index2.1 ModulesHere is a list of all modules: Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 NDP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 IARP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 IERP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 ZRP Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
    • 6 Module Index Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • Chapter 3Class Index3.1 Class ListHere are the classes, structs, unions and interfaces with brief descriptions: DetectedQuery (It is a struct to hold single entry in the Detected Query Table ) . . . . . . . . . . 19 DetectedQueryList (It keeps all the received route-requests for control flooding ) . . . . . . . . . 21 hdr_zrp (It defines the ZRP Packet Header ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 IARPAgent (This class implements the IntrAzone Routing Protocol (IARP) ) . . . . . . . . . . 27 IARPExpirationTimer (It implements a timer who checks periodically for the expiry of various entries in IARP tables ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 IARPPeriodicUpdateTimer (This class implements a timer who sends the IARP updates period- ically ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 IARPUpdate (It is a struct to hold single entry in the Detected Update Table ) . . . . . . . . . . 35 IARPUpdateDetectedList (This class implements Detected Update Table ) . . . . . . . . . . . . 37 IERPAgent (This class implements the IntEr Routing Protocol (IERP) ) . . . . . . . . . . . . . 39 IERPExpirationTimer (It implements a timer who checks periodically for the expiry of various entries in IERP tables ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 InnerRoute (It is a struct to hold single entry in the Route Table ) . . . . . . . . . . . . . . . . . 46 InnerRouteList (This class implements the Routing Table ) . . . . . . . . . . . . . . . . . . . . 48 LinkState (It is a struct to hold single entry in the Link State Table ) . . . . . . . . . . . . . . . 50 LinkStateList (This class implements Topology (Link State) Table ) . . . . . . . . . . . . . . . 52 LSU (It defines the Link-State-Update structure embedded in packet ) . . . . . . . . . . . . . . 55 NDPAckTimer (This class implements a Acknoledgement TimeOut Timer, who checks that ACK is received or not for sent beacon ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 NDPAgent (This class implements the Neighbor Discovery Protocol (NDP) ) . . . . . . . . . . 59 NDPBeaconTransmitTimer (This class implements a BEACON Transmit Timer, who periodi- cally sends beacons to NEIGHBOR nodes ) . . . . . . . . . . . . . . . . . . . . . . . 62 Neighbor (This class contains NEIGHBOR NODE information ) . . . . . . . . . . . . . . . . . 64 NeighborList (It implements the Neighbor Table ) . . . . . . . . . . . . . . . . . . . . . . . . . 66 PacketUtil (This class implements packet utilities needed by various classes ) . . . . . . . . . . 69 PeripheralNode (It is a struct to hold single entry in the Peripheral Node Table ) . . . . . . . . . 75 PeripheralNodeList (This class implements Peripheral Node Table ) . . . . . . . . . . . . . . . 77 SendBuffer (This class implements the buffer to store the incoming packets from the upper layer ) 79 SendBufferEntry (This class implements the struct to hold one send buffer entry ) . . . . . . . . 81 SentQuery (It is a struct to hold single entry in the Sent Query Table ) . . . . . . . . . . . . . . 83 SentQueryList (It keeps all the sent route-requests ) . . . . . . . . . . . . . . . . . . . . . . . . 85 ZRPAgent (This class implements the Zone Routing Protocol (ZRP) ) . . . . . . . . . . . . . . 87
    • 8 Class Index Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • Chapter 4Module Documentation4.1 ConstantsThis module defines various parameters by which ZRP can be tuned.Defines • #define DEBUG 0 This constant is to enable or disable the printing of various events and tables on the console. • #define ROUTER_PORT 0xff It is a default routing port for ZRP packets. • #define TRUE 1 It is a logical TRUE. (Integer value 1). • #define FALSE 0 It is a logical FALSE. (Integer value 0). • #define LINKUP 1 It suggests link status UP. (Integer value 1). • #define LINKDOWN 0 It suggests link status DOWN. (Integer value 0). • #define DEFAULT_STARTUP_JITTER 1 This constant is for the startup jitter for starting various timers. • #define DEFAULT_EXPIRATION_CHECK_PERIOD 1 This constant is for the time elapsed between two consecutive expiration check events. • #define MAX_SEQUENCE_ID 1000000 This constant is for the range of sequence ids. • #define IERP_TTL 50
    • 10 Module Documentation This constant is for the bound on the ierp packet ttl. • #define DEFAULT_BEACON_PERIOD 3 This constant is for the inter beacon transmit time. • #define DEFAULT_BEACON_PERIOD_JITTER 1 This constant is for the start time variations of beacon transmit timers for different nodes. • #define DEFAULT_NEIGHBOR_ACK_TIMEOUT 2 This constant is for the verification of whether ACK is received or not after sending the beacon. • #define DEFAULT_MAX_ACK_TIMEOUT 2 This constant is to decide after how many timeouts the neighbor should be marked down. • #define DEFAULT_MIN_IARP_UPDATE_PERIOD 3 This constant is the time elapsed between two consecutive iarp update sent. Here, the update can be missed. • #define DEFAULT_MAX_IARP_UPDATE_PERIOD 10 This constant is the time elapsed between two consecutive iarp update sent. Here, the update cannot be missed. • #define DEFAULT_LINK_LIFETIME 10 This constant is for the value of the residence time of the linkstate in the linkstate list. • #define DEFAULT_UPDATE_LIFETIME 30 This constant is for the value of the residence time of the update in the detected update list. • #define DEFAULT_BRP_XMIT_POLICY 0 This constant is to decide which transmit policy should be applied to send the route request. (1: BRP_- MULTICAST, 0: BRP_UNICAST). • #define IERP_REPLY_SNOOP 1 This constant is to enable or disable the route reply message snooping. • #define IERP_ERROR_SNOOP 1 This constant is to enable or disable the route error message snooping. • #define IERP_XMIT_JITTER 1 This constant is for the calculating jitter for transmitting route request messages. • #define DEFAULT_QUERY_LIFETIME 30 This constant is for the value of the residence time of the query in the detected query list. • #define DEFAULT_QUERY_RETRY_TIME 5 This constant is for the value of the residence time of the query in the sent query list. • #define DEFAULT_ROUTE_LIFETIME 120 This constant is for the value of the residence time of the route in the route table. • #define DEFAULT_MAX_IERP_REPLY 3 Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 4.1 Constants 11 This constant is the maximum allowed route replies from the destination. • #define DEFAULT_ZONE_RADIUS 2 This constant is for the default value of zone radius. • #define DEFAULT_SEND_BUFFER_SIZE 100 This constant is for the size of the send buffer. • #define DEFAULT_PACKET_LIFETIME 20 This constant is for the value of the residence time of packet in send buffer. • #define DEFAULT_INTERPKT_JITTER 1 The default value of the inter packet jitter is uniformly distributed value in [0,1).Typedefs • typedef double Time In NS2, the time is kept in a double variable. • typedef int32_t Query_ID Query_ID is an integer variable.Enumerations • enum ZRPTYPE { NDP_BEACON, NDP_BEACON_ACK, IARP_UPDATE, IARP_DATA, IERP_REPLY, IERP_REQUEST, IERP_ROUTE_ERROR, IERP_DATA } This enumeration defines various ZRP packet types. • enum BRP_XMIT_POLICY { BRP_UNICAST, BRP_MULTICAST } This enumeration defines two policies for Bordercasting - 1. using Unicast; 2. using multicast.4.1.1 Detailed DescriptionThis module defines various parameters by which ZRP can be tuned. This module defines following pa-rameters of following categories: 1. General Constants 2. NDP Constants 3. IARP Constants 4. IERP Constants 5. ZRP ConstantsGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 12 Module Documentation4.2 NDP AgentThis module implements the NDP Agent.Classes • class Neighbor This class contains NEIGHBOR NODE information. • class NeighborList It implements the Neighbor Table. • class NDPBeaconTransmitTimer This class implements a BEACON Transmit Timer, who periodically sends beacons to NEIGHBOR nodes. • class NDPAckTimer This class implements a Acknoledgement TimeOut Timer, who checks that ACK is received or not for sent beacon. • class NDPAgent This class implements the Neighbor Discovery Protocol (NDP).4.2.1 Detailed Description#) This module implements the NDP Agent. This module consists of following things: 1. Neighbor Table: It keeps a list of Neighbors with their link-status. 2. Beacon Transmit Timer: This timer broadcasts beacon messages periodically. 3. ACK Timeout Timer: This timer checks which neighbor(s) has not send the ACK in response to beacon. 4. NDP Agent: It implements the NDP Agent functionalities.#) Tables: 1. NEIGHBOR_TABLE: (Attributes are listed below) (a) Node_ID (b) Link_Status (c) Last_ACK_Time (d) ACK_TO_Count#) Constants: 1. DEFAULT_BEACON_PERIOD 2. DEFAULT_BEACON_PERIOD_JITTER 3. DEFAULT_NEIGHBOR_ACK_TIMEOUT [Within this much time ACK should come to me] 4. DEFAULT_MAX_ACK_TIMEOUT [How many ACK Timeout is needed to declare a Neighbor DOWN] Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 4.3 IARP Agent 134.3 IARP AgentThis module implements the IARP Agent.Classes • class LinkState It is a struct to hold single entry in the Link State Table. • class LinkStateList This class implements Topology (Link State) Table. • class PeripheralNode It is a struct to hold single entry in the Peripheral Node Table. • class PeripheralNodeList This class implements Peripheral Node Table. • class InnerRoute It is a struct to hold single entry in the Route Table. • class InnerRouteList This class implements the Routing Table. • class IARPUpdate It is a struct to hold single entry in the Detected Update Table. • class IARPUpdateDetectedList This class implements Detected Update Table. • class IARPPeriodicUpdateTimer This class implements a timer who sends the IARP updates periodically. • class IARPExpirationTimer It implements a timer who checks periodically for the expiry of various entries in IARP tables. • class IARPAgent This class implements the IntrAzone Routing Protocol (IARP).4.3.1 Detailed Description#) This module implements the IARP Agent. This module consists of following things: 1. Link State Table: It keeps the view of network topology. 2. Peripheral Node Table: It keeps the list of peripheral nodes of the zone. 3. Routing Table: It implements the common routing table for both IARP and IERP. (Metric: Shortest path)Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 14 Module Documentation 4. Detected Update Cache: It keeps all received IARP_UPDATEs for control flooding. 5. Periodic Update Timer: It sends IARP_UPDATEs periodically to its zone. 6. Expiration Check Timer: It checks the expiration of the entries in various IARP tables. 7. IARP Agent: It implements the IARP Agent.#) Tables: 1. LINK_STATE_TABLE: (Attributes are listed below) (a) Source (b) Dest (c) Seq (d) Link-Status (e) Expiry-Time 2. UPDATE_DETECT_TABLE: (Attributes are listed below) (a) Source (b) Seq (c) Expiry-Time 3. INNER_ROUTING_TABLE: (Attributes are listed below) (a) Destination (b) Next-Hop(Route) (c) Number-of-Hops 4. PERIPHERAL_NODE_TABLE: (Attributes are listed below) (a) Node-ID#) Constants: 1. DEFAULT_MIN_IARP_UPDATE_PERIOD [T_lsu] 2. DEFAULT_MAX_IARP_UPDATE_PERIOD [T_lsu] 3. DEFAULT_LINK_LIFETIME [For expiration of Link-states] 4. DEFAULT_UPDATE_LIFETIME [For Control Flooding-expiration of Detected-Updates] 5. DEFAULT_EXPIRATION_CHECK_PERIOD [Running the expiration-event] Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 4.4 IERP Agent 154.4 IERP AgentThis module implements the IERP Agent.Classes • class DetectedQuery It is a struct to hold single entry in the Detected Query Table. • class DetectedQueryList It keeps all the received route-requests for control flooding. • class SentQuery It is a struct to hold single entry in the Sent Query Table. • class SentQueryList It keeps all the sent route-requests. • class IERPExpirationTimer It implements a timer who checks periodically for the expiry of various entries in IERP tables. • class IERPAgent This class implements the IntEr Routing Protocol (IERP).4.4.1 Detailed DescriptionThis module implements the IERP Agent. This module consists of following things: 1. Detected Request Table: It keeps all the received route-request for control flooding. 2. Sent Request Table: It keeps all sent route-requests. 3. Expiration Check Timer: It checks periodically for expired entries in different tables. 4. IERP Agent: It implements varoius functionalities associated with IERP Agent.#) Tables: 1. QUERY_DETECT_TABLE: (Attributes are listed below) (a) Source (b) Dest (c) QID (d) Covered-PN-List (e) Expiry-Time 2. QUERY_SENT_TABLE: (Attributes are listed below) (a) Source (b) DestGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 16 Module Documentation (c) Expiry-Time#) Constants: 1. DEFAULT_BRP_XMIT_POLICY [1: MULTICAST, 0: UNICAST] 2. IERP_XMIT_JITTER [Uniformly distributed in interval [a,b)] 3. DEFAULT_QUERY_LIFETIME [For Control Flooding] 4. DEFAULT_ROUTE_LIFETIME [IERP Route Reliability] Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 4.5 ZRP Agent 174.5 ZRP AgentThis module implements the ZRP Agent interface to the upper and lower layers.Classes • struct hdr_zrp It defines the ZRP Packet Header. • class LSU It defines the Link-State-Update structure embedded in packet. • class PacketUtil This class implements packet utilities needed by various classes. • class SendBufferEntry This class implements the struct to hold one send buffer entry. • class SendBuffer This class implements the buffer to store the incoming packets from the upper layer. • class ZRPAgent This class implements the Zone Routing Protocol (ZRP).4.5.1 Detailed DescriptionThis module implements the ZRP Agent interface to the upper and lower layers. This module consists offollowing things: 1. Zrp Header Structure - It defines the Packet header of ZRP packet. 2. Packet Utility Class - It implements various Packet utility finctions. 3. Send Buffer - It implements the routing layer buffer for packets coming from upper-layer. 4. ZRP Agent - It implements the ZRP Agent.#) Tables: 1. SEND BUFFER: (Attributes are listed below) (a) Packet (b) Destination (c) Expiry#) Constants: 1. DEFAULT_ZONE_RADIUS 2. DEFAULT_SEND_BUFFER_SIZE 3. DEFAULT_PACKET_LIFETIME 4. DEFAULT_INTERPKT_JITTERGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 18 Module Documentation Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • Chapter 5Class Documentation5.1 DetectedQuery Class ReferenceIt is a struct to hold single entry in the Detected Query Table.#include <zrp.h>Public Member Functions • DetectedQuery () Default Constructor. • DetectedQuery (nsaddr_t src, nsaddr_t dest, int queryID, Time expiry, PeripheralNodeList ∗curPNLst) This constructor initializes the detected query entry with passed parameter values.Public Attributes • nsaddr_t src_ Source of the detected query. • nsaddr_t dest_ Destination of the detected query. • int queryID_ Query ID of the route-request. • Time expiry_ Expiry of this detected Entry. • PeripheralNodeList pnLst_ Query-Coverage Info (Not Used). • int querySentFlag_
    • 20 Class Documentation Whether the query is Sent/Forwarded or Not. • int totalReplySent_ How many replies has been sent for this query. • DetectedQuery ∗ next_ Pointer to Next detected query.5.1.1 Detailed DescriptionIt is a struct to hold single entry in the Detected Query Table.Definition at line 1222 of file zrp.h.5.1.2 Constructor & Destructor Documentation5.1.2.1 DetectedQuery::DetectedQuery () [inline]Default Constructor. Never called from anywhere in the code. Initialized with invalid entries.Definition at line 1241 of file zrp.h.5.1.2.2 DetectedQuery::DetectedQuery (nsaddr_t src, nsaddr_t dest, int queryID, Time expiry, PeripheralNodeList ∗ curPNLst) [inline]This constructor initializes the detected query entry with passed parameter values.Parameters: src Source of the detected query. dest Destination of the detected query. queryID Query ID of the route-request. expiry Expiry of this detected Entry. curPNLst Pointer to current peripheral node list.Definition at line 1254 of file zrp.h.The documentation for this class was generated from the following file: • zrp.h Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.2 DetectedQueryList Class Reference 215.2 DetectedQueryList Class ReferenceIt keeps all the received route-requests for control flooding.#include <zrp.h>Public Member Functions • DetectedQueryList () Default Constructor. • void addQuery (nsaddr_t src, nsaddr_t dest, int queryID, Time expiry, PeripheralNodeList ∗curPNLst) It adds the query to the detected query table. • int findQuery (nsaddr_t src, nsaddr_t dest, int queryID, DetectedQuery ∗∗handle) It finds the query with matching parameters from the detected query table. • void removeQuery (nsaddr_t src, nsaddr_t dest, int queryID) It removes the query with matching parameters from the detected query table. • void purgeExpiredQueries () It removes all expired queries from the detected query table. • void freeList () It removes all queries from the detected query table.Public Attributes • DetectedQuery ∗ head_ Head element in the linked list. • int numQueries_ Size of the list.5.2.1 Detailed DescriptionIt keeps all the received route-requests for control flooding.Definition at line 1278 of file zrp.h.5.2.2 Constructor & Destructor Documentation5.2.2.1 DetectedQueryList::DetectedQueryList () [inline]Default Constructor. Initialized with default values.Definition at line 1291 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 22 Class Documentation5.2.3 Member Function Documentation5.2.3.1 void DetectedQueryList::addQuery (nsaddr_t src, nsaddr_t dest, int queryID, Time expiry, PeripheralNodeList ∗ curPNLst)It adds the query to the detected query table.Parameters: src Source of the detected query. dest Destination of the detected query. queryID Query ID of the route-request. expiry Expiry of this detected Entry. curPNLst Pointer to current peripheral node list.Definition at line 1184 of file zrp.cc.5.2.3.2 int DetectedQueryList::findQuery (nsaddr_t src, nsaddr_t dest, int queryID, DetectedQuery ∗∗ handle)It finds the query with matching parameters from the detected query table. And if found, returns 1)TRUE& 2) pointer to found entry; Else returns FALSE.Parameters: src Source of the detected query. dest Destination of the detected query. queryID Query ID of the route-request. handle Pointer to the found entry (If Found).Definition at line 1197 of file zrp.cc.5.2.3.3 void DetectedQueryList::removeQuery (nsaddr_t src, nsaddr_t dest, int queryID)It removes the query with matching parameters from the detected query table.Parameters: src Source of the detected query. dest Destination of the detected query. queryID Query ID of the route-request.Definition at line 1219 of file zrp.cc.5.2.3.4 void DetectedQueryList::purgeExpiredQueries ()It removes all expired queries from the detected query table.Definition at line 1251 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.2 DetectedQueryList Class Reference 235.2.3.5 void DetectedQueryList::freeList ()It removes all queries from the detected query table.Definition at line 1287 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.ccGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 24 Class Documentation5.3 hdr_zrp Struct ReferenceIt defines the ZRP Packet Header.#include <zrp.h>Static Public Member Functions • static int & offset () Returns the offset value. • static hdr_zrp ∗ access (const Packet ∗p) Returns the pointer to the ZRP Header segment in the Packet.Public Attributes • int zrptype_ Packet type - see ZRPTYPE enumeration. • Time pktsent_ Packet Sending time. • int radius_ Sender’s Zone Radius (Maybe Useful in Future). • int seq_ Sequence number of a packet. • int forwarded_ TRUE if forwarded before. • nsaddr_t src_ Source Node Address. • nsaddr_t dest_ Destination Node Address. • LSU ∗ links_ Pointer to link state list (Used in IARP_UPDATE). • int numlinks_ Number of links in packet (Used in IARP_UPDATE). • nsaddr_t ∗ mcLst_ List of addresses to relay(Multicast) the route-request query. • int mcLstSize_ Size of Multicast list. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.3 hdr_zrp Struct Reference 25 • nsaddr_t lastbc_ Address of Last Bordercaster. • nsaddr_t ∗ route_ Pointer to Source Route. • int routelength_ Route Length of IERP route stored in route_. • int routeindex_ Pointer to a current route node in route_. • int queryID_ IERP query id. • int enc_dport_ Preserved dport of Upper-Layer packet. • int enc_daddr_ Preserved daddr of Upper-Layer packet. • packet_t enc_ptype_ Preserved ptype of Upper-Layer packet.Static Public Attributes • static int offset_ Offset to the ZRP Header segment in the Packet.5.3.1 Detailed DescriptionDefinition at line 1690 of file zrp.h.5.3.2 Member Function Documentation5.3.2.1 static int & hdr_zrp::offset () [inline, static]Returns the offset value.Definition at line 1727 of file zrp.h.5.3.2.2 static hdr_zrp ∗ hdr_zrp::access (const Packet ∗ p) [inline, static]Returns the pointer to the ZRP Header segment in the Packet.Definition at line 1734 of file zrp.h.The documentation for this struct was generated from the following files:Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 26 Class Documentation • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.4 IARPAgent Class Reference 275.4 IARPAgent Class ReferenceThis class implements the IntrAzone Routing Protocol (IARP).#include <zrp.h>Public Member Functions • IARPAgent (ZRPAgent ∗agent) It initializes the attributes with the default values. • void startUp () This is called by ZRPAgent::startUp() method. • void buildRoutingTable () This function creates Inner-Route-List & Peripheral-Node-List based on Link-State-List. • void addRouteInPacket (nsaddr_t dest, Packet ∗p) This function adds the Inner-route for node ’dest’ in packet ’p’ if available. • void recv_IARP_UPDATE (Packet ∗p) This function is called whenever ZRP receives an IARP_UPDATE packet. • void recv_IARP_DATA (Packet ∗p) This function is called whenever ZRP receives an IARP_DATA packet. • void print_tables () This function prints Peripheral-Node-List & Inner-Route-List.Public Attributes • ZRPAgent ∗ agent_ Pointer to ZRP-Agent. • int updateSendFlag_ Intialized with TRUE [periodic update is sent if this flag is TRUE; After sending each update, this flag is set FALSE]. • LinkStateList lsLst_ Topology Table. • PeripheralNodeList pnLst_ Peripheral-Node Table. • InnerRouteList irLst_ Proactive-Routing Table. • IARPUpdateDetectedList upLst_Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 28 Class Documentation Detected-Update Cache. • int linkLifeTime_ DEFAULT_LINK_LIFETIME. • int updateLifeTime_ DEFAULT_UPDATE_LIFETIME. • IARPPeriodicUpdateTimer PeriodicUpdateTimer_ Periodic Update Send Timer. • IARPExpirationTimer ExpirationTimer_ Expiration Check Timer. • int startup_jitter_ For starting the Timers.5.4.1 Detailed DescriptionThis class implements the IntrAzone Routing Protocol (IARP).Definition at line 1074 of file zrp.h.5.4.2 Constructor & Destructor Documentation5.4.2.1 IARPAgent::IARPAgent (ZRPAgent ∗ agent) [inline]It initializes the attributes with the default values.Parameters: agent Pointer to the ZRP Agent.Definition at line 1100 of file zrp.h.5.4.3 Member Function Documentation5.4.3.1 void IARPAgent::startUp ()This is called by ZRPAgent::startUp() method. It does following tasks: • Starts the Periodic-Update-Timer & Expiration-Timer. • Clears the LinkState-List, PeripheralNode-List, Inner-Route-List & Detected-Update-List.Definition at line 912 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.4 IARPAgent Class Reference 295.4.3.2 void IARPAgent::buildRoutingTable ()This function creates Inner-Route-List & Peripheral-Node-List based on Link-State-List. The followingsteps are performed. 1. Clear the existing Inner-Route-List & Peirpheral-Node-List. 2. Purge the expired links & DOWN links. 3. Generate a BFS tree from existing Link-State list. 4. Generate Inner-Routing-List based on that BFS tree. Insert all leaf nodes in Peripheral-Node-List.Definition at line 930 of file zrp.cc.5.4.3.3 void IARPAgent::addRouteInPacket (nsaddr_t dest, Packet ∗ p)This function adds the Inner-route for node ’dest’ in packet ’p’ if available.Parameters: dest Destination Address. p Pointer to the packet.Definition at line 988 of file zrp.cc.5.4.3.4 void IARPAgent::recv_IARP_UPDATE (Packet ∗ p)This function is called whenever ZRP receives an IARP_UPDATE packet. On receiving IARP_UPDATE,following tasks are performed - • If it’s a new iarp_update then, – node updates its ’LINK_STATE_TABLE’, – If ’LINK_STATE_TABLE’ is changed then, it rebuilds the ’INNER_ROUTING_TABLE’ and ’PERIPHERAL_NODE_TABLE’, – caches this update in ’UPDATE_DETECT_TABLE’ for control flooding, – re-broadcasts it if TTL is not equal to zero. • If it’s an already received iarp_update then, – node discards this update. Parameters: p Pointer to the packet.Definition at line 1009 of file zrp.cc.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 30 Class Documentation5.4.3.5 void IARPAgent::recv_IARP_DATA (Packet ∗ p)This function is called whenever ZRP receives an IARP_DATA packet. On receiving IARP_DATA, fol-lowing tasks are performed - • If it’s destination matches with this node, – send it to upper layer. • Else – forward it to along the route contained in the packet. Parameters: p Pointer to the packet.Definition at line 1079 of file zrp.cc.5.4.3.6 void IARPAgent::print_tables ()This function prints Peripheral-Node-List & Inner-Route-List.Definition at line 1130 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.5 IARPExpirationTimer Class Reference 315.5 IARPExpirationTimer Class ReferenceIt implements a timer who checks periodically for the expiry of various entries in IARP tables.#include <zrp.h>Public Member Functions • IARPExpirationTimer (ZRPAgent ∗agent) It checks the expiration of entries in various tables. • void handle (Event ∗) In this routine, all the expired entries are removed. • void start (double thistime) It starts the Expiration Timer.Public Attributes • ZRPAgent ∗ agent_ Pointer to ZRP-Agent. • Event intr_ Event object. • int expiration_check_period_ Expiration-Check-Interval.5.5.1 Detailed DescriptionIt implements a timer who checks periodically for the expiry of various entries in IARP tables.Definition at line 1029 of file zrp.h.5.5.2 Constructor & Destructor Documentation5.5.2.1 IARPExpirationTimer::IARPExpirationTimer (ZRPAgent ∗ agent) [inline]It checks the expiration of entries in various tables.Parameters: agent Pointer to the ZRP Agent.Definition at line 1044 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 32 Class Documentation5.5.3 Member Function Documentation5.5.3.1 void IARPExpirationTimer::handle (Event ∗ e)In this routine, all the expired entries are removed. It also schedules the next expiration check event.Parameters: e Event object.Definition at line 886 of file zrp.cc.5.5.3.2 void IARPExpirationTimer::start (double thistime)It starts the Expiration Timer by scheduling the event.Parameters: thistime The delay from the current time after which the event is schedule.Definition at line 880 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.6 IARPPeriodicUpdateTimer Class Reference 335.6 IARPPeriodicUpdateTimer Class ReferenceThis class implements a timer who sends the IARP updates periodically.#include <zrp.h>Public Member Functions • IARPPeriodicUpdateTimer (ZRPAgent ∗agent) It initializes the attributes with the default values. • void handle (Event ∗) It implements the code for transmiting iarp updates periodically. • void start (double thistime) This function is called to start this Timer.Public Attributes • ZRPAgent ∗ agent_ Pointer to ZRP-Agent. • Event intr_ Event object. • int min_iarp_update_period_ Min-Update Interval. • int max_iarp_update_period_ Max-Update Interval. • Time lastUpdateSent_ Last-Update Sent Time.5.6.1 Detailed DescriptionThis class implements a timer who sends the IARP updates periodically.Definition at line 973 of file zrp.h.5.6.2 Constructor & Destructor Documentation5.6.2.1 IARPPeriodicUpdateTimer::IARPPeriodicUpdateTimer (ZRPAgent ∗ agent) [inline]It initializes the attributes with the default values.Parameters: agent Pointer to the ZRP Agent.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 34 Class DocumentationDefinition at line 990 of file zrp.h.5.6.3 Member Function Documentation5.6.3.1 void IARPPeriodicUpdateTimer::handle (Event ∗ e)It implements the code for transmiting iarp updates periodically. The following scheme is implemented: • If any link-change is detected in last ’DEFAULT_MIN_IARP_UPDATE_PERIOD’ seconds then, – node broadcasts an ’IARP_UPDATE’ to its zone (by keeping TTL = zoneradius-1). • If no link-change is detected then, – NO update is sent. • If node has not sent any ’IARP_UPDATE’ in last ’DEFAULT_MAX_IARP_UPDATE_PERIOD’ seconds then, -it broadcasts an ’IARP_UPDATE’ to its zone. Here, IARP_UPDATE = Neighbor list with link-status. Parameters: e Event object.Definition at line 798 of file zrp.cc.5.6.3.2 void IARPPeriodicUpdateTimer::start (double thistime)This function is called to start this Timer. It schedules the first transmit event.Parameters: thistime Delay after which this event should be scheduled.Definition at line 792 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.7 IARPUpdate Class Reference 355.7 IARPUpdate Class ReferenceIt is a struct to hold single entry in the Detected Update Table.#include <zrp.h>Public Member Functions • IARPUpdate () Default Constructor. • IARPUpdate (nsaddr_t updateSrc, int seq, Time expiry) This constructor initializes the iarp update entry with passed parameter values.Public Attributes • nsaddr_t updateSrc_ Address of the sender. • int seq_ Sequence Number. • Time expiry_ Expiry Time. • IARPUpdate ∗ next_ Pointer to the Next Element.5.7.1 Detailed DescriptionIt is a struct to hold single entry in the Detected Update Table.Definition at line 878 of file zrp.h.5.7.2 Constructor & Destructor Documentation5.7.2.1 IARPUpdate::IARPUpdate () [inline]Default Constructor. Never called from anywhere in the code. Initialized with invalid entries.Definition at line 893 of file zrp.h.5.7.2.2 IARPUpdate::IARPUpdate (nsaddr_t updateSrc, int seq, Time expiry) [inline]Parameters: updateSrc Update source. seq Sequence number.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 36 Class Documentation expiry Time of expiration.Definition at line 901 of file zrp.h.The documentation for this class was generated from the following file: • zrp.h Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.8 IARPUpdateDetectedList Class Reference 375.8 IARPUpdateDetectedList Class ReferenceThis class implements Detected Update Table.#include <zrp.h>Public Member Functions • IARPUpdateDetectedList () Default Constructor. • void addUpdate (nsaddr_t updateSrc, int seq, Time expiry) It adds the update to the detected update table. • int findUpdate (nsaddr_t updateSrc, int seq) It finds the update with matching parameters from the detected update table. • void purgeExpiredUpdates () It removes all expired updates from the detected update table. • void freeList () It removes all updates from the detected update table.Public Attributes • IARPUpdate ∗ head_ Head element in the detected update list. • int numUpdates_ Total entries in the list.5.8.1 Detailed DescriptionThis class implements Detected Update Table.Definition at line 914 of file zrp.h.5.8.2 Constructor & Destructor Documentation5.8.2.1 IARPUpdateDetectedList::IARPUpdateDetectedList () [inline]Default Constructor. Initialized with default values.Definition at line 927 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 38 Class Documentation5.8.3 Member Function Documentation5.8.3.1 void IARPUpdateDetectedList::addUpdate (nsaddr_t updateSrc, int seq, Time expiry)It adds the update to the detected update table.Parameters: updateSrc Update source. seq Sequence number. expiry Time of expiration.Definition at line 704 of file zrp.cc.5.8.3.2 int IARPUpdateDetectedList::findUpdate (nsaddr_t updateSrc, int seq)It finds the update with matching parameters from the detected update table. And if found, returns TRUEand FALSE otherwise.Parameters: updateSrc Update source. seq Sequence number.Definition at line 717 of file zrp.cc.5.8.3.3 void IARPUpdateDetectedList::purgeExpiredUpdates ()It removes all expired updates from the detected update table.Definition at line 733 of file zrp.cc.5.8.3.4 void IARPUpdateDetectedList::freeList ()It removes all updates from the detected update table.Definition at line 767 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.9 IERPAgent Class Reference 395.9 IERPAgent Class ReferenceThis class implements the IntEr Routing Protocol (IERP).#include <zrp.h>Public Member Functions • IERPAgent (ZRPAgent ∗agent) It initializes the attributes with the default values. • void startUp () This is called when the node is initialized from the ZRPAgent::startUp() method. • void recv_IERP_ROUTE_REQUEST_UNI (Packet ∗p) It is called when node receives a route-request message. • void recv_IERP_ROUTE_REQUEST_MC (Packet ∗p) It is called when node receives a route-request message. • void recv_IERP_ROUTE_REPLY (Packet ∗p) It is called when node receives a route-reply message. • void recv_IERP_ROUTE_ERROR (Packet ∗p) It is called when node receives a route-error message. • void recv_IERP_DATA (Packet ∗p) It is called when the node receives a DATA packet. • int addLinkStateFromRoute (nsaddr_t ∗route, int size) This function is called when for extracting link-state information from the route-reply messages. • int removeLinkStateFromBrokenRoute (nsaddr_t lnkSrc, nsaddr_t lnkDest) This function is called when for extracting broken link-state information from the route-error messages. • void print_tables () This prints all the IERP tables. (Not used).Public Attributes • ZRPAgent ∗ agent_ Pointer to the ZRP Agent. • int brpXmitPolicy_ Bordercasting policy. (0: UNICAST, 1: MULTICAST). • DetectedQueryList dqLst_ Object of Detected Query Table.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 40 Class Documentation • SentQueryList sqLst_ Object of Sent Query Table. • int queryLifeTime_ Intialized with DEFAULT_QUERY_LIFETIME. • int routeLifeTime_ Intialized with DEFAULT_ROUTE_LIFETIME. • int queryRetryTime_ Intialized with DEFAULT_QUERY_RETRY_TIME. • IERPExpirationTimer ExpirationTimer_ Object of Expiration Timer. • int startup_jitter_ For starting the Timers.5.9.1 Detailed DescriptionThis class implements the IntEr Routing Protocol (IERP). It is used by ZRPAgent class.Definition at line 1499 of file zrp.h.5.9.2 Constructor & Destructor Documentation5.9.2.1 IERPAgent::IERPAgent (ZRPAgent ∗ agent) [inline]It initializes the attributes with the default values.Parameters: agent Pointer to the ZRP Agent.Definition at line 1542 of file zrp.h.5.9.3 Member Function Documentation5.9.3.1 IERPAgent::startUp ()This is called when the node is initialized from the ZRPAgent::startUp() method. It does the followingthings: • Clears the detected query list. • Clears the sent query list.Definition at line 1468 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.9 IERPAgent Class Reference 415.9.3.2 void IERPAgent::recv_IERP_ROUTE_REQUEST_UNI (Packet ∗ p)It is called when node receives a route-request message. On receiving route-request, • It adds the query into the detected query table. • If node itself is an intended destination then, it creates a ’ROUTE_REPLY’ and sends it back to route-request-originator. • If destination lies in node’s zone then, it unicasts the route-request towards the destination. • Node bordercasts the query by following steps: – If this query is received before then Do Nothing & return. – It generates a neighbor-set through which all peripheral nodes can be reached. – It forwards the query to all these neighbors. [Multiple Messages] Parameters: p Pointer to the packet.Definition at line 1518 of file zrp.cc.5.9.3.3 void IERPAgent::recv_IERP_ROUTE_REQUEST_MC (Packet ∗ p)It is called when node receives a route-request message. On receiving route-request, • It adds the query into the detected query table. • If node itself is an intended destination then, it creates a ’ROUTE_REPLY’ and sends it back to route-request-originator. • If destination lies in node’s zone then, it unicasts the route-request towards the destination. • Node bordercasts the query by following steps: – Mark all peripheral nodes covered by the query. – If node is NOT in the ’MULTICAST_RECEIVER_LIST’ then, Do nothing and return. – If node is in the ’MULTICAST_RECEIVER_LIST’ then, – It generates a neighbor-set through which all uncovered-peripheral-nodes can be reached. – It forwards the query to all these neighbors. [Single Message] Parameters: p Pointer to the packet.5.9.3.4 void IERPAgent::recv_IERP_ROUTE_REPLY (Packet ∗ p)It is called when node receives a route-reply message. On receiving route-reply, • If node itself is an intended destination then, it fetches the route from the packet and adds into route table. • Otherwise, it snoops the packet for stored route and updates its own route table and then it forwards the route-reply.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 42 Class DocumentationParameters: p Pointer to the packet.Definition at line 1956 of file zrp.cc.5.9.3.5 void IERPAgent::recv_IERP_ROUTE_ERROR (Packet ∗ p)It is called when node receives a route-error message. On receiving route-error, • If node itself is an intended destination then, it finds out which route is broken and removes it from the route-table. • Otherwise, it snoops the packet for broken link info and updates its own routing table and then it forwards the route-error. Parameters: p Pointer to the packet.Definition at line 2015 of file zrp.cc.5.9.3.6 void IERPAgent::recv_IERP_DATA (Packet ∗ p)It is called when the node receives a DATA packet. On receving DATA_PACKET, • If the node is destination then, it gives it to upper-layer. • If the node is not destination then, – It fetches next-hop from source-route in data_packet, and – sends data_packet to next-hop. Parameters: p Pointer to the packet.Definition at line 2056 of file zrp.cc.5.9.3.7 int IERPAgent::addLinkStateFromRoute (nsaddr_t ∗ route, int size)This function is called when for extracting link-state information from the route-reply messages. Thelink-state information is extracted from the source route and added to the linkstate table.Parameters: route Pointer to the source route. size Size of the source route.Definition at line 1908 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.9 IERPAgent Class Reference 435.9.3.8 int IERPAgent::removeLinkStateFromBrokenRoute (nsaddr_t lnkSrc, nsaddr_t lnkDest)This function is called when for extracting broken link-state information from the route-error messages.The broken link-state information is extracted from the source route and added to the linkstate table.Parameters: lnkSrc Link Source address. lnkDest Link Destination address.Definition at line 1939 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.ccGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 44 Class Documentation5.10 IERPExpirationTimer Class ReferenceIt implements a timer who checks periodically for the expiry of various entries in IERP tables.#include <zrp.h>Public Member Functions • IERPExpirationTimer (ZRPAgent ∗agent) It checks the expiration of entries in various tables. • void handle (Event ∗) In this routine, all the expired entries are removed. • void start (double thistime) It starts the Expiration Timer.Public Attributes • ZRPAgent ∗ agent_ Pointer to ZRP-Agent. • Event intr_ Object of Event. • int expiration_check_period_ Expiration check time period.5.10.1 Detailed DescriptionIt implements a timer who checks periodically for the expiry of various entries in IERP tables.Definition at line 1454 of file zrp.h.5.10.2 Constructor & Destructor Documentation5.10.2.1 IERPExpirationTimer::IERPExpirationTimer (ZRPAgent ∗ agent) [inline]It checks the expiration of entries in various tables.Parameters: agent Pointer to the ZRP Agent.Definition at line 1469 of file zrp.h. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.10 IERPExpirationTimer Class Reference 455.10.3 Member Function Documentation5.10.3.1 void IERPExpirationTimer::handle (Event ∗)In this routine, all the expired entries are removed. It also schedules the next expiration check event.Parameters: e Event object.Definition at line 1447 of file zrp.cc.5.10.3.2 void IERPExpirationTimer::start (double thistime)It starts the Expiration Timer by scheduling the event.Parameters: thistime The delay from the current time after which the event is schedule.Definition at line 1441 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.ccGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 46 Class Documentation5.11 InnerRoute Class ReferenceIt is a struct to hold single entry in the Route Table.#include <zrp.h>Public Member Functions • InnerRoute () Default Constructor. • InnerRoute (nsaddr_t addr, nsaddr_t nextHop, InnerRoute ∗predecessor, int numHops) This constructor initializes the route table entry with passed parameter values.Public Attributes • nsaddr_t addr_ Destination Address. • nsaddr_t nextHop_ Next hop to reach that destination. • int numHops_ Number of hops to the Destination. • InnerRoute ∗ next_ Next entry in the Routelist. • InnerRoute ∗ predecessor_ To construct bordercast tree.5.11.1 Detailed DescriptionIt is a struct to hold single entry in the Route Table.Definition at line 780 of file zrp.h.5.11.2 Constructor & Destructor Documentation5.11.2.1 InnerRoute::InnerRoute () [inline]Default Constructor. Never called from anywhere in the code. Initialized with invalid entries.Definition at line 796 of file zrp.h. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.11 InnerRoute Class Reference 475.11.2.2 InnerRoute::InnerRoute (nsaddr_t addr, nsaddr_t nextHop, InnerRoute ∗ predecessor, int numHops) [inline]This constructor initializes the route table entry with passed parameter values.Parameters: addr Destination Address. nextHop Route towards the destination. predecessor Predecessor in the route to this destinaion. numHops The route length.Definition at line 808 of file zrp.h.The documentation for this class was generated from the following file: • zrp.hGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 48 Class Documentation5.12 InnerRouteList Class ReferenceThis class implements the Routing Table.#include <zrp.h>Public Member Functions • InnerRouteList () Default Constructor. • void addRoute (nsaddr_t addr, nsaddr_t nextHop, InnerRoute ∗predecessor, int numHops) It adds the route to the Routing table. • int findRoute (nsaddr_t addr, InnerRoute ∗∗handle) It finds the route with matching parameters from the routing table. • void freeList () It removes all routes from the routing table.Public Attributes • InnerRoute ∗ head_ Head element in the routing list. • int numRoutes_ Total routes in the list.5.12.1 Detailed DescriptionThis class implements the Routing Table.Definition at line 822 of file zrp.h.5.12.2 Constructor & Destructor Documentation5.12.2.1 InnerRouteList::InnerRouteList () [inline]Default Constructor. Initialized with default values.Definition at line 837 of file zrp.h.5.12.3 Member Function Documentation5.12.3.1 void InnerRouteList::addRoute (nsaddr_t addr, nsaddr_t nextHop, InnerRoute ∗ predecessor, int numHops)It adds the route to the Routing table. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.12 InnerRouteList Class Reference 49Parameters: addr Destination Address. nextHop Route towards the destination. predecessor Predecessor in the route to this destinaion. numHops The route length.Definition at line 631 of file zrp.cc.5.12.3.2 int InnerRouteList::findRoute (nsaddr_t addr, InnerRoute ∗∗ handle)It finds the route with matching parameters from the routing table. And if found, returns 1)TRUE & 2)pointer to found entry; Else returns FALSE.Parameters: addr Destination Address. handle Handle to the route. (If found)Definition at line 651 of file zrp.cc.5.12.3.3 void InnerRouteList::freeList ()It removes all routes from the routing table.Definition at line 676 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.ccGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 50 Class Documentation5.13 LinkState Class ReferenceIt is a struct to hold single entry in the Link State Table.#include <zrp.h>Public Member Functions • LinkState () Default Constructor. • LinkState (nsaddr_t src, nsaddr_t dest, int seq, int isup, Time expiry) This constructor initializes the link state entry with passed parameter values.Public Attributes • nsaddr_t src_ 32 bits • nsaddr_t dest_ 32 bits • int seq_ sequence number • int isup_ Link State LINKUP[1]/LINKDOWN[0]. • Time expiry_ Link Expiry Time. • LinkState ∗ next_ Pointer to Next Element.5.13.1 Detailed DescriptionIt is a struct to hold single entry in the Link State Table.Definition at line 562 of file zrp.h.5.13.2 Constructor & Destructor Documentation5.13.2.1 LinkState::LinkState () [inline]Default Constructor. Never called from anywhere in the code. Initialized with invalid entries.Definition at line 579 of file zrp.h. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.13 LinkState Class Reference 515.13.2.2 LinkState::LinkState (nsaddr_t src, nsaddr_t dest, int seq, int isup, Time expiry) [inline]This constructor initializes the link state entry with passed parameter values.Parameters: src Source of link state dest Destination of link state seq Sequence number of link state isup Link status expiry Expiry time of the link stateDefinition at line 592 of file zrp.h.The documentation for this class was generated from the following file: • zrp.hGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 52 Class Documentation5.14 LinkStateList Class ReferenceThis class implements Topology (Link State) Table.#include <zrp.h>Public Member Functions • LinkStateList () Default Constructor. • void addLink (nsaddr_t src, nsaddr_t dest, int seq, int isup, Time expiry) It adds the link to the link state table. • int findLink (nsaddr_t src, nsaddr_t dest, LinkState ∗∗handle) It finds the link with matching parameters from the link state table. • int isEmpty () It checks for whether the table is empty or not. • void removeLink (LinkState ∗prev, LinkState ∗toBeDeleted) It removes the link from the linkstate table. • int purgeLinks () It removes all expired links from the link state table. • void printLinks () It prints all the links on the console. • void freeList () It removes all links from the link state table.Public Attributes • LinkState ∗ head_ Head element in the linked list. • int numLinks_ Total links in the list.5.14.1 Detailed DescriptionThis class implements Topology (Link State) Table.Definition at line 607 of file zrp.h. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.14 LinkStateList Class Reference 535.14.2 Constructor & Destructor Documentation5.14.2.1 LinkStateList::LinkStateList () [inline]Default Constructor. Initialized with default values.Definition at line 620 of file zrp.h.5.14.3 Member Function Documentation5.14.3.1 void LinkStateList::addLink (nsaddr_t src, nsaddr_t dest, int seq, int isup, Time expiry)It adds the link to the link state table.Parameters: src Source of link state dest Destination of link state seq Sequence number of link state isup Link status expiry Expiry time of the link stateDefinition at line 410 of file zrp.cc.5.14.3.2 int LinkStateList::findLink (nsaddr_t src, nsaddr_t dest, LinkState ∗∗ handle)It finds the link with matching parameters from the link state table. And if found, returns 1)TRUE & 2)pointer to found entry; Else returns FALSE.Parameters: src Source of link state dest Destination of link state handle Handle to the link state (If found)Definition at line 423 of file zrp.cc.5.14.3.3 int LinkStateList::isEmpty ()It checks for whether the table is empty or not. Returns TRUE if empty, and returns FASLE otherwise.Definition at line 448 of file zrp.cc.5.14.3.4 void LinkStateList::removeLink (LinkState ∗ prev, LinkState ∗ toBeDeleted)It removes the link from the linkstate table.Parameters: prev Pointer to previous element in the list. toBeDeleted Pointer to the element that should be deleted.Definition at line 458 of file zrp.cc.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 54 Class Documentation5.14.3.5 int LinkStateList::purgeLinks ()It removes all expired links from the link state table.Definition at line 479 of file zrp.cc.5.14.3.6 void LinkStateList::printLinks ()It prints all the links on the console. Used for debugging purpose.Definition at line 519 of file zrp.cc.5.14.3.7 void LinkStateList::freeList ()It removes all links from the link state table.Definition at line 539 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.15 LSU Class Reference 555.15 LSU Class ReferenceIt defines the Link-State-Update structure embedded in packet.#include <zrp.h>Public Member Functions • LSU () Default constructor. Never used directly in the code. Intialized with invalid entries. • LSU (nsaddr_t src, nsaddr_t dest, int isUp) Parameterized constructor. Intialized the attributes with parameteres.Public Attributes • nsaddr_t src_ Link Source Node Address. • nsaddr_t dest_ Link Destination Node Address. • int isUp_ Link Status.5.15.1 Detailed DescriptionIt defines the Link-State-Update structure embedded in packet.Definition at line 1744 of file zrp.h.5.15.2 Constructor & Destructor Documentation5.15.2.1 LSU::LSU () [inline]Default constructor. Never used directly in the code. Intialized with invalid entries.Definition at line 1757 of file zrp.h.5.15.2.2 LSU::LSU (nsaddr_t src, nsaddr_t dest, int isUp) [inline]Parameterized constructor. Intialized the attributes with parameteres.Parameters: src Link Source Node Address. dest Link Destination Node Address. isUp Link Status.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 56 Class DocumentationDefinition at line 1767 of file zrp.h.The documentation for this class was generated from the following file: • zrp.h Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.16 NDPAckTimer Class Reference 575.16 NDPAckTimer Class ReferenceThis class implements a Acknoledgement TimeOut Timer, who checks that ACK is received or not for sentbeacon.#include <zrp.h>Public Member Functions • NDPAckTimer (ZRPAgent ∗agent) It initializes the attributes with the default values. • void handle (Event ∗) It implements the code for checking ACK timeout. • void start () This function is called to start this Timer.Public Attributes • ZRPAgent ∗ agent_ Pointer to ZRP-Agent. • Event intr_ Event Object. • int neighbor_ack_timeout_ Time before a neighbor must send ACK.5.16.1 Detailed DescriptionThis class implements a Acknoledgement TimeOut Timer, who checks that ACK is received or not for sentbeacon.Definition at line 399 of file zrp.h.5.16.2 Constructor & Destructor Documentation5.16.2.1 NDPAckTimer::NDPAckTimer (ZRPAgent ∗ agent) [inline]It initializes the attributes with the default values.Parameters: agent Pointer to the ZRP Agent.Definition at line 413 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 58 Class Documentation5.16.3 Member Function Documentation5.16.3.1 void NDPAckTimer::handle (Event ∗ e)It implements the code for checking ACK timeout. If node doesn’t receive ACK from an existing neigh-bor within ’DEFAULT_NEIGHBOR_ACK_TIMEOUT’ seconds & ’DEFAULT_MAX_ACK_TIMEOUT’times then, node removes(marks the linkstatus = LINKDOWN) the neighbor from its ’NEIGHBOR_-TABLE’ and notifies IARP to rebuild the ’INNER_ROUTING_TABLE’ and ’PERIPHERAL_NODE_-TABLE’.Parameters: e Event Object.Definition at line 222 of file zrp.cc.5.16.3.2 void NDPAckTimer::start ()This function is called to start this Timer.Definition at line 216 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.17 NDPAgent Class Reference 595.17 NDPAgent Class ReferenceThis class implements the Neighbor Discovery Protocol (NDP).#include <zrp.h>Public Member Functions • NDPAgent (ZRPAgent ∗agent) It initializes the attributes with the default values. • void startUp () It does the start up tasks. • void recv_NDP_BEACON (Packet ∗p) This function is called whenever ZRP receives an NDP_BEACON packet. • void recv_NDP_BEACON_ACK (Packet ∗p) This function is called whenever ZRP receives an NDP_BEACON_ACK packet. • void print_tables () This function prints the neighbor table.Public Attributes • ZRPAgent ∗ agent_ Pointer to ZRP agent. • NeighborList neighborLst_ Neighbor List. • NDPBeaconTransmitTimer BeaconTransmitTimer_ Beacon transmit timer. • NDPAckTimer AckTimer_ ACK timeout timer. • int startup_jitter_ For starting the timers.5.17.1 Detailed DescriptionThis class implements the Neighbor Discovery Protocol (NDP). It is used by ZRP Agent class.Definition at line 441 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 60 Class Documentation5.17.2 Constructor & Destructor Documentation5.17.2.1 NDPAgent::NDPAgent (ZRPAgent ∗ agent) [inline]This constructor is called by the constructor of ZRP. It initializes different compenents in NDP.Parameters: agent Pointer to ZRP Agent.Definition at line 459 of file zrp.h.5.17.3 Member Function Documentation5.17.3.1 void NDPAgent::startUp ()This is called by ZRPAgent::startUp() method. It does following tasks:1) Starts the Beacon-Transmit-Timer.2) Clears the Neighbor-List.This is called by ZRPAgent::startUp() method. It does following tasks: • Starts the Beacon-Transmit-Timer. • Clears the Neighbor-List.Definition at line 284 of file zrp.cc.5.17.3.2 void NDPAgent::recv_NDP_BEACON (Packet ∗ p)This function is called whenever ZRP receives an NDP_BEACON packet. On receving ’NDP_BEACON’,node sends ’NDP_BEACON_ACK’ to the sender. But it does not add this neighbor, because node storesonly symmetric links.Parameters: p Pointer to packet.Definition at line 298 of file zrp.cc.5.17.3.3 void NDPAgent::recv_NDP_BEACON_ACK (Packet ∗ p)This function is called whenever ZRP receives an NDP_BEACON_ACK packet. • If it’s a new neighbor, node adds the neighbor to its ’NEIGHBOR_TABLE’ and notifies IARP to rebuild the ’INNER_ROUTING_TABLE’ and ’PERIPHERAL_NODE_TABLE’. • If it’s an existing neighbor, it updates ’LAST_ACK_TIME’ for that neighbor. Parameters: p Pointer to packet.Definition at line 326 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.17 NDPAgent Class Reference 615.17.3.4 void NDPAgent::print_tables ()This function prints the Neighbor List. It also prints which Neighbors are UP and which are DOWN.Definition at line 374 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.ccGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 62 Class Documentation5.18 NDPBeaconTransmitTimer Class ReferenceThis class implements a BEACON Transmit Timer, who periodically sends beacons to NEIGHBOR nodes.#include <zrp.h>Public Member Functions • NDPBeaconTransmitTimer (ZRPAgent ∗agent) It initializes the attributes with the default values. • void handle (Event ∗) It implements the code for transmiting beacons periodically. • void start (double thistime) This function is called to start this Timer.Public Attributes • ZRPAgent ∗ agent_ Pointer to ZRP-Agent. • Event intr_ Event object. • int beacon_period_ Inter-Beacon-Time. • int beacon_period_jitter_ Jitter added to Inter-Beacon-Time. • int neighbor_ack_timeout_ Used only for Logging.5.18.1 Detailed DescriptionThis class implements a BEACON Transmit Timer, who periodically sends beacons to NEIGHBOR nodes.Definition at line 351 of file zrp.h.5.18.2 Constructor & Destructor Documentation5.18.2.1 NDPBeaconTransmitTimer::NDPBeaconTransmitTimer (ZRPAgent ∗ agent) [inline]It initializes the attributes with the default values. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.18 NDPBeaconTransmitTimer Class Reference 63Parameters: agent Pointer to the ZRP Agent.Definition at line 368 of file zrp.h.5.18.3 Member Function Documentation5.18.3.1 void NDPBeaconTransmitTimer::handle (Event ∗ e)It implements the code for transmiting beacons periodically. It sends ’NDP_BEACON’ every ’DEFAULT_-BEACON_PERIOD’ seconds. And it starts ACK_TIME_OUT Timer to verify neighbor-link-status aftertime-out event.Parameters: e Event Object.Definition at line 188 of file zrp.cc.5.18.3.2 void NDPBeaconTransmitTimer::start (double thistime)This function is called to start this Timer. It schedules the first transmit event.Parameters: thistime Delay after which this event should be scheduled.Definition at line 182 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.ccGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 64 Class Documentation5.19 Neighbor Class ReferenceThis class contains NEIGHBOR NODE information.#include <zrp.h>Public Member Functions • Neighbor () Default Constructor. • Neighbor (nsaddr_t addr, Time lastack, int linkStatus) It initializes the neighbor with passed parameter values.Public Attributes • nsaddr_t addr_ Neighbor Address. • Time lastack_ Last ACK received Time. • int linkStatus_ Link-Status with this neighbor. • int AckTOCount_ No-of-times ACK-TO has occurred with this neighbor. • Neighbor ∗ next_ Pointer to Next neighbor.5.19.1 Detailed DescriptionThis class contains NEIGHBOR NODE information.Definition at line 233 of file zrp.h.5.19.2 Constructor & Destructor Documentation5.19.2.1 Neighbor::Neighbor () [inline]Default Constructor. Never called from anywhere in the code. Initializes with invalid entries.Definition at line 248 of file zrp.h. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.19 Neighbor Class Reference 655.19.2.2 Neighbor::Neighbor (nsaddr_t addr, Time lastack, int linkStatus) [inline]It initializes the neighbor with passed parameter values.Parameters: addr Neighbor address. lastack Last ACK Time. linkStatus Link status with neighbor.Definition at line 259 of file zrp.h.The documentation for this class was generated from the following file: • zrp.hGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 66 Class Documentation5.20 NeighborList Class ReferenceIt implements the Neighbor Table.#include <zrp.h>Public Member Functions • NeighborList () Default constructor. Initializes the list by startup values. • void addNeighbor (nsaddr_t addr, Time lastack, int linkStatus) It adds the new neighbor in the neighbor table. • int findNeighbor (nsaddr_t addr, Neighbor ∗∗handle) It finds the neighbor from the neighbor table. • int isEmpty () Checks if neighbor table is empty or not. • void removeNeighbor (Neighbor ∗prev, Neighbor ∗toBeDeleted) It removes the neighbor from the neighbor table. • void purgeDownNeighbors () It removes all neighbors whose link status is LINKDOWN from the neighbor table. • void freeList () It removes all neighbors from the neighbor table. • void printNeighbors () It prints all neighbors in the neighbor table.Public Attributes • Neighbor ∗ head_ Pointer to head element. • int numNeighbors_ Number of neighbors.5.20.1 Detailed DescriptionIt implements the Neighbor Table. This class is the linked-list of Neighbor class.Definition at line 269 of file zrp.h. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.20 NeighborList Class Reference 675.20.2 Constructor & Destructor Documentation5.20.2.1 NeighborList::NeighborList () [inline]Default constructor. Initializes the list by startup values.Definition at line 281 of file zrp.h.5.20.3 Member Function Documentation5.20.3.1 void NeighborList::addNeighbor (nsaddr_t addr, Time lastack, int linkStatus)It adds the new neighbor in the neighbor table. It appends this newly created node at the head of the list.Parameters: addr Neighbor address. lastack Last ACK Time. linkStatus Link status with neighbor.Definition at line 23 of file zrp.cc.5.20.3.2 int NeighborList::findNeighbor (nsaddr_t addr, Neighbor ∗∗ handle)It finds the neighbor from the neighbor table. If found, it returns 1) TRUE and 2) handle to found entry;Else it returns FALSE.Parameters: addr Neighbor address. handle Handle to found entry. (If found)Definition at line 36 of file zrp.cc.5.20.3.3 int NeighborList::isEmpty ()Checks if neighbor table is empty or not. Returns TRUE if empty; FALSE if not.Definition at line 61 of file zrp.cc.5.20.3.4 void NeighborList::removeNeighbor (Neighbor ∗ prev, Neighbor ∗ toBeDeleted)It removes the neighbor from the neighbor table. The pointer of the neighbor is passed as a parameter. Theprevious pointer must also be passed since it is a singly linked list.Parameters: prev Pointer to previous element in the list. toBeDeleted Pointer to the element who should be removed.Definition at line 71 of file zrp.cc.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 68 Class Documentation5.20.3.5 void NeighborList::purgeDownNeighbors ()It removes all neighbors whose link status is LINKDOWN.Definition at line 92 of file zrp.cc.5.20.3.6 void NeighborList::freeList ()It removes all neighbors from the neighbor table.Definition at line 125 of file zrp.cc.5.20.3.7 void NeighborList::printNeighbors ()It prints all neighbors in the neighbor table.Definition at line 143 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.21 PacketUtil Class Reference 695.21 PacketUtil Class ReferenceThis class implements packet utilities needed by various classes.#include <zrp.h>Public Member Functions • PacketUtil (ZRPAgent ∗agent) This constructor passes the pointer to the agent. • Packet ∗ pkt_create (ZRPTYPE zrp_type, nsaddr_t addressee, int ttl) Creates the packet giving default values to header attributes. • void pkt_copy (Packet ∗pfrom, Packet ∗pto) Copies the packet from ’pfrom’ to ’pto’. • void inc_seq () It increments the sequence number of the packet. • void pkt_send (Packet ∗p, nsaddr_t addressee, Time delay) Schedules the packet for transmission with delay specified by parameter. • void pkt_broadcast (Packet ∗p, Time randomJitter) Schedules the packet to broadcast with delay specified by parameter. • void pkt_add_LSU_space (Packet ∗p, int size) Alloactes the memory to hold the link-states. • void pkt_free_LSU_space (Packet ∗p) Frees the memory allocated to hold link-states. • void pkt_add_ROUTE_space (Packet ∗p, int size) Allocates memory to hold the source route. • void pkt_free_ROUTE_space (Packet ∗p) Frees the memory allocated to hold source route. • void pkt_add_ADDRESS_space (Packet ∗p, int size) Allocates memory to hold the multicast address list. • void pkt_free_ADDRESS_space (Packet ∗p) Frees the memory allocated to hold multicast address list. • int pkt_AmIMultiCastReciver (Packet ∗p, nsaddr_t addressToCheck) Checks for the address if it is in the Multicast address list or not. • int pkt_AmIOnTheRoute (Packet ∗p, nsaddr_t addressToCheck) Checks for the address if it is in the source route or not.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 70 Class Documentation • void pkt_print_links (Packet ∗p) Prints all links contained in the packet. • void pkt_print_route (Packet ∗p) Prints the source route contained in the packet. • void pkt_drop (Packet ∗p) Drops the packet.Public Attributes • int seq_ Sequence Number Counter. • ZRPAgent ∗ agent_ Pointer to the ZRP Agent. • int startup_jitter_ Startup Jitter (Not used, may be used for some timer in future).5.21.1 Detailed DescriptionThis class implements packet utilities needed by various classes. The utilities include - • Packet Creation and Deletion(Freeing) • Packet Copy • Packet Send/Broadcast • Adding and freeing Link-State/Route/Multicast-list space • Printing Route-data/Link-State-DataDefinition at line 1785 of file zrp.h.5.21.2 Constructor & Destructor Documentation5.21.2.1 PacketUtil::PacketUtil (ZRPAgent ∗ agent) [inline]This constructor passed the pointer to the agent.Parameters: agent Pointer to the ZRP Agent.Definition at line 1799 of file zrp.h. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.21 PacketUtil Class Reference 715.21.3 Member Function Documentation5.21.3.1 Packet ∗ PacketUtil::pkt_create (ZRPTYPE zrp_type, nsaddr_t addressee, int ttl)Creates the packet giving default values to header attributes.Parameters: zrp_type Type of ZRP packet - see ZRPTYPE enumeration. addressee The intended destination of the packet. ttl TTL value of the packet.Definition at line 2187 of file zrp.cc.5.21.3.2 void PacketUtil::pkt_copy (Packet ∗ pfrom, Packet ∗ pto)Copies the packet from ’pfrom’ to ’pto’.Parameters: pfrom The source of copy. pto The destination of copy.Definition at line 2233 of file zrp.cc.5.21.3.3 void PacketUtil::inc_seq () [inline]It increments the sequence number of the packet.Definition at line 1827 of file zrp.h.5.21.3.4 void PacketUtil::pkt_send (Packet ∗ p, nsaddr_t addressee, Time delay)Schedules the packet for transmission with delay specified by parameter.Parameters: p Pointer to the Packet. addressee The destination. delay The delay after which the packet should be transmitted.Definition at line 2296 of file zrp.cc.5.21.3.5 void PacketUtil::pkt_broadcast (Packet ∗ p, Time randomJitter)Schedules the packet to broadcast with delay specified by parameter.Parameters: p Pointer to the Packet. randomJitter The delay after which the packet should be broadcasted.Definition at line 2312 of file zrp.cc.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 72 Class Documentation5.21.3.6 void PacketUtil::pkt_add_LSU_space (Packet ∗ p, int size)Alloactes the memory to hold the link-states.Parameters: p Pointer to packet. size Number of link-states to be hold.Definition at line 2325 of file zrp.cc.5.21.3.7 void PacketUtil::pkt_free_LSU_space (Packet ∗ p)Frees the memory allocated to hold link-states.Parameters: p Pointer to the packet.Definition at line 2344 of file zrp.cc.5.21.3.8 void PacketUtil::pkt_add_ROUTE_space (Packet ∗ p, int size)Allocates memory to hold the source route.Parameters: p Pointer to the packet. size Length of the source route.Definition at line 2355 of file zrp.cc.5.21.3.9 void PacketUtil::pkt_free_ROUTE_space (Packet ∗ p)Frees the memory allocated to hold source route.Parameters: p Pointer to the packet.Definition at line 2374 of file zrp.cc.5.21.3.10 void PacketUtil::pkt_add_ADDRESS_space (Packet ∗ p, int size)Parameters: p Pointer to the packet. size Size of multicast address list.Definition at line 2385 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.21 PacketUtil Class Reference 735.21.3.11 void PacketUtil::pkt_free_ADDRESS_space (Packet ∗ p)Frees the memory allocated to hold multicast address list.Parameters: p Pointer to the packet.Definition at line 2404 of file zrp.cc.5.21.3.12 int PacketUtil::pkt_AmIMultiCastReciver (Packet ∗ p, nsaddr_t addressToCheck)Checks for the address if it is in the Multicast address list or not.Parameters: p Pointer to packet. addressToCheck The address to check.Definition at line 2415 of file zrp.cc.5.21.3.13 int PacketUtil::pkt_AmIOnTheRoute (Packet ∗ p, nsaddr_t addressToCheck)Checks for the address if it is in the source route or not.Parameters: p Pointer to the packet. addressToCheck The address to check.Definition at line 2434 of file zrp.cc.5.21.3.14 void PacketUtil::pkt_print_links (Packet ∗ p)Prints all links contained in the packet.Parameters: p Pointer to the packet.Definition at line 2452 of file zrp.cc.5.21.3.15 void PacketUtil::pkt_print_route (Packet ∗ p)Prints the source route contained in the packet.Parameters: p Pointer the the packet.Definition at line 2471 of file zrp.cc.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 74 Class Documentation5.21.3.16 void PacketUtil::pkt_drop (Packet ∗ p)Drops the packet. Frees the packet memory. but not dynamically allocated attributes.Parameters: p Pointer the the packet.Definition at line 2490 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.22 PeripheralNode Class Reference 755.22 PeripheralNode Class ReferenceIt is a struct to hold single entry in the Peripheral Node Table.#include <zrp.h>Public Member Functions • PeripheralNode () Default Constructor. • PeripheralNode (nsaddr_t addr, int coveredFlag) This constructor initializes the peripheral node entry with passed parameter values.Public Attributes • nsaddr_t addr_ Address of the Node. • int coveredFlag_ Only For IERP. • PeripheralNode ∗ next_ Pointer to the next element.5.22.1 Detailed DescriptionIt is a struct to hold single entry in the Peripheral Node Table.Definition at line 692 of file zrp.h.5.22.2 Constructor & Destructor Documentation5.22.2.1 PeripheralNode::PeripheralNode () [inline]Default Constructor. Never called from anywhere in the code. Initialized with invalid entries.Definition at line 706 of file zrp.h.5.22.2.2 PeripheralNode::PeripheralNode (nsaddr_t addr, int coveredFlag) [inline]This constructor initializes the peripheral node entry with passed parameter values.Parameters: addr Address of the node. coveredFlag Only used for IERP query coverage info.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 76 Class DocumentationDefinition at line 715 of file zrp.h.The documentation for this class was generated from the following file: • zrp.h Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.23 PeripheralNodeList Class Reference 775.23 PeripheralNodeList Class ReferenceThis class implements Peripheral Node Table.#include <zrp.h>Public Member Functions • PeripheralNodeList () Default Constructor. • void addPerNode (nsaddr_t addr, int coveredFlag) It adds the node to the peripheral node table. • int findPerNode (nsaddr_t addr) It finds the node from the peripheral node table. • void copyList (PeripheralNodeList ∗newList) It copies the peripheral node list into ’newlist’. • void freeList () It removes all nodes from the peripheral node table.Public Attributes • PeripheralNode ∗ head_ Head element in the linked list. • int numPerNodes_ Total nodes in the list.5.23.1 Detailed DescriptionDefinition at line 722 of file zrp.h.5.23.2 Constructor & Destructor Documentation5.23.2.1 PeripheralNodeList::PeripheralNodeList () [inline]Default Constructor. Initialized with default values.Definition at line 735 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 78 Class Documentation5.23.3 Member Function Documentation5.23.3.1 void PeripheralNodeList::addPerNode (nsaddr_t addr, int coveredFlag)It adds the node to the peripheral node table.Parameters: addr Address of the node. coveredFlag Only used for IERP query coverage info.Definition at line 566 of file zrp.cc.5.23.3.2 int PeripheralNodeList::findPerNode (nsaddr_t addr)It finds the node from the peripheral node table. It returns TRUE if found and FALSE otherwise.Parameters: addr Address of the node to be found.Definition at line 579 of file zrp.cc.5.23.3.3 void PeripheralNodeList::copyList (PeripheralNodeList ∗ newList)It copies the peripheral node list into ’newlist’.Parameters: newList Pointer to the new peripheral node list.Definition at line 595 of file zrp.cc.5.23.3.4 void PeripheralNodeList::freeList ()It removes all nodes from the peripheral node table.Definition at line 606 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.24 SendBuffer Class Reference 795.24 SendBuffer Class ReferenceThis class implements the buffer to store the incoming packets from the upper layer.#include <zrp.h>Public Member Functions • SendBuffer (ZRPAgent ∗agent) It initializes the the object with default values. • void addPacket (Packet ∗pkt, nsaddr_t dest, Time expiry) Adds packet to the head of the list. • void purgeExpiredPackets () It removes the expired entries from the buffer. • void freeList () It removes all the entries from the list.Public Attributes • ZRPAgent ∗ agent_ Pointer to the ZRP Agent. • SendBufferEntry ∗ head_ Pointer to the head of the list(buffer). • int numPackets_ Size of send buffer.5.24.1 Detailed DescriptionThis class implements the buffer to store the incoming packets from the upper layer. If the route forincoming packet is not found then they are pushed into this buffer. It is implemented as singly linked-list.Definition at line 1981 of file zrp.h.5.24.2 Constructor & Destructor Documentation5.24.2.1 SendBuffer::SendBuffer (ZRPAgent ∗ agent) [inline]It initializes the the object with default values.Parameters: agent Pointer to the ZRP Agent.Definition at line 1994 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 80 Class Documentation5.24.3 Member Function Documentation5.24.3.1 void SendBuffer::addPacket (Packet ∗ pkt, nsaddr_t dest, Time expiry)Adds packet to the head of the list.Parameters: pkt Pointer to the packet. dest Address of the destination. expiry Expiration time of the entry.Definition at line 2513 of file zrp.cc.5.24.3.2 void SendBuffer::purgeExpiredPackets ()It removes the expired entries from the buffer.Definition at line 2526 of file zrp.cc.5.24.3.3 void SendBuffer::freeList ()It removes all the entries from the list.Definition at line 2568 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.25 SendBufferEntry Class Reference 815.25 SendBufferEntry Class ReferenceThis class implements the struct to hold one send buffer entry.#include <zrp.h>Public Member Functions • SendBufferEntry () Default Constructor. Not called anywhere in the code. • SendBufferEntry (Packet ∗pkt, nsaddr_t dest, Time expiry) Parameterized constructor. Intializes the Send Buffer Entry with parameter values.Public Attributes • Packet ∗ pkt_ Packet to Send from Upper-Layer. • nsaddr_t dest_ Address of Destination. • Time expiry_ Time to expire the packet. • SendBufferEntry ∗ next_ Link to next entry in the list.5.25.1 Detailed DescriptionThis class implements the struct to hold one send buffer entry.Definition at line 1949 of file zrp.h.5.25.2 Constructor & Destructor Documentation5.25.2.1 SendBufferEntry::SendBufferEntry () [inline]Default Constructor. Not called anywhere in the code. Intialized with invalid entries.Definition at line 1962 of file zrp.h.5.25.2.2 SendBufferEntry::SendBufferEntry (Packet ∗ pkt, nsaddr_t dest, Time expiry) [inline]Parameterized constructor. Intializes the Send Buffer Entry with parameter values.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 82 Class DocumentationParameters: pkt Pointer to the packet. dest Address of destination. expiry Expration time of the packet from sendbuffer.Definition at line 1972 of file zrp.h.The documentation for this class was generated from the following file: • zrp.h Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.26 SentQuery Class Reference 835.26 SentQuery Class ReferenceIt is a struct to hold single entry in the Sent Query Table.#include <zrp.h>Public Member Functions • SentQuery () Default Constructor. • SentQuery (nsaddr_t src, nsaddr_t dest, Time expiry) This constructor initializes the sent query entry with passed parameter values.Public Attributes • nsaddr_t src_ Source of the Sent Query. • nsaddr_t dest_ Destination of the Sent Query. • Time expiry_ Expiry of this sent Entry. • SentQuery ∗ next_ Pointer to Next query.5.26.1 Detailed DescriptionIt is a struct to hold single entry in the Sent Query Table.Definition at line 1349 of file zrp.h.5.26.2 Constructor & Destructor Documentation5.26.2.1 SentQuery::SentQuery () [inline]Default Constructor. Never called from anywhere in the code. Initialized with invalid entries.Definition at line 1364 of file zrp.h.5.26.2.2 SentQuery::SentQuery (nsaddr_t src, nsaddr_t dest, Time expiry) [inline]Parameters: src Source of the Sent Query. dest Destination of the Sent Query.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 84 Class Documentation expiry Expiry of this sent Entry.Definition at line 1372 of file zrp.h.The documentation for this class was generated from the following file: • zrp.h Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.27 SentQueryList Class Reference 855.27 SentQueryList Class ReferenceIt keeps all the sent route-requests.#include <zrp.h>Public Member Functions • SentQueryList () Default Constructor. • void addQuery (nsaddr_t src, nsaddr_t dest, Time expiry) It adds the sent query in the sent query table. • int findQuery (nsaddr_t src, nsaddr_t dest, SentQuery ∗∗handle) It finds the query from the sent query table. • void removeQuery (nsaddr_t src, nsaddr_t dest) It removes the query from the sent query table. • void purgeExpiredQueries () It removes all the expired queries from the sent query table. • void freeList () It removes all the queries from the sent query table.Public Attributes • SentQuery ∗ head_ First element in the list. • int numQueries_ Size of the list.5.27.1 Detailed DescriptionIt keeps all the sent route-requests. These entries are removed when corresponding route-reply messagescome OR they expire.Definition at line 1385 of file zrp.h.5.27.2 Constructor & Destructor Documentation5.27.2.1 SentQueryList::SentQueryList () [inline]Default Constructor. Initialized with default values.Definition at line 1398 of file zrp.h.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 86 Class Documentation5.27.3 Member Function Documentation5.27.3.1 void SentQueryList::addQuery (nsaddr_t src, nsaddr_t dest, Time expiry)It adds the sent query in the sent query table.Parameters: src Source of the Sent Query. dest Destination of the Sent Query. expiry Expiry of this sent Entry.Definition at line 1314 of file zrp.cc.5.27.3.2 int SentQueryList::findQuery (nsaddr_t src, nsaddr_t dest, SentQuery ∗∗ handle)It finds the query from the sent query table. And if found, returns 1) TRUE & 2) handle to found entry;Else returns FALSE.Parameters: src Source of the Sent Query. dest Destination of the Sent Query. handle Pointer to the found entry (If Found).Definition at line 1328 of file zrp.cc.5.27.3.3 void SentQueryList::removeQuery (nsaddr_t src, nsaddr_t dest)It removes the query from the sent query table.Parameters: src Source of the Sent Query. dest Destination of the Sent Query.Definition at line 1350 of file zrp.cc.5.27.3.4 void SentQueryList::purgeExpiredQueries ()It removes all the expired queries from the sent query table.Definition at line 1380 of file zrp.cc.5.27.3.5 void SentQueryList::freeList ()It removes all the queries from the sent query table.Definition at line 1414 of file zrp.cc.The documentation for this class was generated from the following files: • zrp.h • zrp.cc Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.28 ZRPAgent Class Reference 875.28 ZRPAgent Class ReferenceThis class implements the Zone Routing Protocol (ZRP).#include <zrp.h>Public Member Functions • ZRPAgent () It is just a default consturctor. • ZRPAgent (nsaddr_t id) Through this constructor, the node address is passed to agent. • void startUp () This is called when the node is initialized. • int command (int argc, const char ∗const ∗argv) It implements the interface to the tcl script. • void recv (Packet ∗p, Handler ∗) It receives the packet. • void route_pkt (Packet ∗p, nsaddr_t dest) It routes the upper-layer packets. • void route_SendBuffer_pkt () It routes the packes in the sendbuffer if the route is available for respective destinations. • void sendPacketUsingIARPRoute (Packet ∗p, nsaddr_t dest, Time delay) This function adds the source route into the packet and routes it to the next hop. • int initialized () • void print_tables () It calls the print_tables() functions of sub-agents (NDP, IARP, IERP). • void mac_failed (Packet ∗p) It reports a mac failure event for all the packets who couldn’t be sent on MAC layer. • Packet ∗ Myallocpkt () It’s just a wrapper function on Agent::allocpkt(). Basically, it allocates the memory for the packet. • void Mydrop (Packet ∗p, const char ∗s) It’s just a wrapper function on Agent::drop(Packet ∗p, const char ∗s). It drops the packet for the reason given in the parameter ’s’. • void XmitPacket (Packet ∗p, Time randomJitter) It schedules the packet transmission with the delay given in the parameter.Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 88 Class DocumentationPublic Attributes • char ∗ myid_ • PriQueue ∗ ll_queue • Trace ∗ tracetarget • MobileNode ∗ node_ • NsObject ∗ port_dmux_ • nsaddr_t myaddr_ It’s my own Node Address. • int radius_ It’s my Zone Radius. • int tx_ It counts total packets transmitted by agent. • int rx_ It count total packets received by agent. • int queryID_ It is query-id counter. • SendBuffer sendBuf_ The packets from the upper-layer is kept in this buffer. • PacketUtil pktUtil_ All packet related functions are handled by this object. • NDPAgent ndpAgt_ Object of Neighbor Discovery Protocol. • IARPAgent iarpAgt_ Object of IntrAzone Routing Protocol. • IERPAgent ierpAgt_ Object of IntErzone Routing Protocol.5.28.1 Detailed DescriptionThis class implements the Zone Routing Protocol (ZRP). Notice that the ZRPAgent class is inherited fromthe ’Agent’ class.Definition at line 2032 of file zrp.h.5.28.2 Constructor & Destructor Documentation5.28.2.1 ZRPAgent::ZRPAgent ()It is just a default consturctor.Definition at line 2597 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.28 ZRPAgent Class Reference 895.28.2.2 ZRPAgent::ZRPAgent (nsaddr_t id)Through this constructor, the node address is passed to agent. ZRP Agent is initialized with default valuesin this constructor. Don’t forget the put the following line in the tcl script to initialize the zone radius forthis node.Agent/ZRP set radius_ 2 [Here, Zone Radius is set to 2.]Parameters: id Address of the Node.Definition at line 2614 of file zrp.cc.5.28.3 Member Function Documentation5.28.3.1 ZRPAgent::startUp ()This is called when the node is initialized. It does the following things. • Clears the Send Buffer. • Calls the startUp() methods for all sub-agents - NDP, IARP and IERP.Definition at line 2640 of file zrp.cc.5.28.3.2 ZRPAgent::command (int argc, const char ∗const ∗ argv)It implements the interface to the tcl script.Parameters: argc contains the number of arguments passed. argv contains argument.Definition at line 2651 of file zrp.cc.5.28.3.3 ZRPAgent::recv (Packet ∗ p, Handler ∗ h)It receives the packet. Here, the packet is classified into following categories and sub-categories. Then, itis passed to appropriate function for handling it. 1. Upper Layer Packet [Passed to route_pkt(Packet∗ p, nsaddr_t dest)] 2. ZRP Packet (a) NDP_BEACON [Passed to NDPAgent::recv_NDP_BEACON(Packet∗ p)] (b) NDP_BEACON_ACK [Passed to NDPAgent::recv_NDP_BEACON_ACK(Packet∗ p)] (c) IARP_UPDATE [Passed to IARPAgent::recv_IARP_UPDATE(Packet∗ p)] (d) IARP_DATA [Passed to IARPAgent::recv_IARP_DATA(Packet∗ p)] (e) IERP_REPLY [Passed to IERPAgent::recv_IERP_ROUTE_REPLY(Packet∗ p)] (f) IERP_REQUEST [Passed to IERPAgent::recv_IERP_ROUTE_REQUEST_XXX(Packet∗ p)]Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 90 Class Documentation (g) IERP_ROUTE_ERROR [Passed to IERPAgent::recv_IERP_ROUTE_ERROR(Packet∗ p)] (h) IERP_DATA [Passed to IERPAgent::recv_IERP_DATA(Packet∗ p)]Parameters: p pointer to the packet.Definition at line 2766 of file zrp.cc.5.28.3.4 ZRPAgent::route_pkt (Packet ∗ p, nsaddr_t dest)It routes the upper-layer packets.If [the route to destination exists]∼ It sends the packet using that route.Else∼ It initiates the route-discovery process of IERP by sending route-requests.Parameters: p Packet from Upper Layer. dest Node address of the destination.Definition at line 2838 of file zrp.cc.5.28.3.5 ZRPAgent::route_SendBuffer_pkt ()It routes the packes in the sendbuffer if the route is available for respective destinations. This function iscalled whenever the Route Table is changed. So, if there are packets destined in Send Buffer towards newlydiscovered destination, then they are immediately sent using that new route.Definition at line 2902 of file zrp.cc.5.28.3.6 ZRPAgent::sendPacketUsingIARPRoute (Packet ∗ p, nsaddr_t dest, Time delay)This function adds the source route into the packet and routes it to the next hop.Parameters: p Pointer to the packet. dest Destination of the packet. delay The amount of time after which the packet should be sent.Definition at line 2943 of file zrp.cc.5.28.3.7 ZRPAgent::print_tables ()It calls the print_tables() functions of sub-agents (NDP, IARP, IERP). It can be used for debugging purpose.It prints the Neighbor table, Routing Table and Peripheral Node Table.Definition at line 3007 of file zrp.cc. Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 5.28 ZRPAgent Class Reference 915.28.3.8 ZRPAgent::mac_failed (Packet ∗ p)It reports a mac failure event for all the packets who couldn’t be sent on MAC layer. Currently, this is usedfor reporting ROUTE-ERROR message towards the sender in case of any IERP_DATA packet is dropped.In future, it can be used for salvaging dropped ROUTE_REPLY packets and many other things.Parameters: p Pointer to the packet.Definition at line 3015 of file zrp.cc.5.28.3.9 ZRPAgent::Myallocpkt () [inline]It’s just a wrapper function on Agent::allocpkt(). Basically, it allocates the memory for the packet.Definition at line 2167 of file zrp.h.5.28.3.10 ZRPAgent::Mydrop (Packet ∗ p, const char ∗ s) [inline]It’s just a wrapper function on Agent::drop(Packet ∗p, const char ∗s). It drops the packet for the reasongiven in the parameter ’s’.Parameters: p Pointer to the packet. s Reason of dropping the packet.Definition at line 2179 of file zrp.h.5.28.3.11 ZRPAgent::XmitPacket (Packet ∗ p, Time randomJitter) [inline]It schedules the packet transmission with the delay given in the parameter.Parameters: p Pointer to the Packet. randomJitter Delay after the packet should be scheduled.Definition at line 2190 of file zrp.h.The documentation for this class was generated from the following files: • zrp.h • zrp.ccGenerated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • Indexaccess PeripheralNodeList, 78 hdr_zrp, 25 findQueryaddLink DetectedQueryList, 22 LinkStateList, 53 SentQueryList, 86addLinkStateFromRoute findRoute IERPAgent, 42 InnerRouteList, 49addNeighbor findUpdate NeighborList, 67 IARPUpdateDetectedList, 38addPacket freeList SendBuffer, 80 DetectedQueryList, 22addPerNode IARPUpdateDetectedList, 38 PeripheralNodeList, 78 InnerRouteList, 49addQuery LinkStateList, 54 DetectedQueryList, 22 NeighborList, 68 SentQueryList, 86 PeripheralNodeList, 78addRoute SendBuffer, 80 InnerRouteList, 48 SentQueryList, 86addRouteInPacket IARPAgent, 29 handleaddUpdate IARPExpirationTimer, 32 IARPUpdateDetectedList, 38 IARPPeriodicUpdateTimer, 34 IERPExpirationTimer, 45buildRoutingTable NDPAckTimer, 58 IARPAgent, 28 NDPBeaconTransmitTimer, 63 hdr_zrp, 24command access, 25 ZRPAgent, 89 offset, 25Constants, 9copyList IARP Agent, 13 PeripheralNodeList, 78 IARPAgent, 27DetectedQuery, 19 addRouteInPacket, 29 DetectedQuery, 20 buildRoutingTable, 28DetectedQueryList, 21 IARPAgent, 28 addQuery, 22 print_tables, 30 DetectedQueryList, 21 recv_IARP_DATA, 29 findQuery, 22 recv_IARP_UPDATE, 29 freeList, 22 startUp, 28 purgeExpiredQueries, 22 IARPExpirationTimer, 31 removeQuery, 22 handle, 32 IARPExpirationTimer, 31findLink start, 32 LinkStateList, 53 IARPPeriodicUpdateTimer, 33findNeighbor handle, 34 NeighborList, 67 IARPPeriodicUpdateTimer, 33findPerNode start, 34
    • INDEX 93IARPUpdate, 35 Mydrop IARPUpdate, 35 ZRPAgent, 91IARPUpdateDetectedList, 37 addUpdate, 38 NDP Agent, 12 findUpdate, 38 NDPAckTimer, 57 freeList, 38 handle, 58 IARPUpdateDetectedList, 37 NDPAckTimer, 57 purgeExpiredUpdates, 38 start, 58IERP Agent, 15 NDPAgent, 59IERPAgent, 39 NDPAgent, 60 addLinkStateFromRoute, 42 print_tables, 60 IERPAgent, 40 recv_NDP_BEACON, 60 recv_IERP_DATA, 42 recv_NDP_BEACON_ACK, 60 recv_IERP_ROUTE_ERROR, 42 startUp, 60 recv_IERP_ROUTE_REPLY, 41 NDPBeaconTransmitTimer, 62 recv_IERP_ROUTE_REQUEST_MC, 41 handle, 63 recv_IERP_ROUTE_REQUEST_UNI, 40 NDPBeaconTransmitTimer, 62 removeLinkStateFromBrokenRoute, 42 start, 63 startUp, 40 Neighbor, 64IERPExpirationTimer, 44 Neighbor, 64 handle, 45 NeighborList, 66 IERPExpirationTimer, 44 addNeighbor, 67 start, 45 findNeighbor, 67inc_seq freeList, 68 PacketUtil, 71 isEmpty, 67InnerRoute, 46 NeighborList, 67 InnerRoute, 46 printNeighbors, 68InnerRouteList, 48 purgeDownNeighbors, 67 addRoute, 48 removeNeighbor, 67 findRoute, 49 freeList, 49 offset InnerRouteList, 48 hdr_zrp, 25isEmpty LinkStateList, 53 PacketUtil, 69 NeighborList, 67 inc_seq, 71 PacketUtil, 70LinkState, 50 pkt_add_ADDRESS_space, 72 LinkState, 50 pkt_add_LSU_space, 71LinkStateList, 52 pkt_add_ROUTE_space, 72 addLink, 53 pkt_AmIMultiCastReciver, 73 findLink, 53 pkt_AmIOnTheRoute, 73 freeList, 54 pkt_broadcast, 71 isEmpty, 53 pkt_copy, 71 LinkStateList, 53 pkt_create, 71 printLinks, 54 pkt_drop, 73 purgeLinks, 53 pkt_free_ADDRESS_space, 72 removeLink, 53 pkt_free_LSU_space, 72LSU, 55 pkt_free_ROUTE_space, 72 LSU, 55 pkt_print_links, 73 pkt_print_route, 73mac_failed pkt_send, 71 ZRPAgent, 90 PeripheralNode, 75Myallocpkt PeripheralNode, 75 ZRPAgent, 91 PeripheralNodeList, 77Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • 94 INDEX addPerNode, 78 recv copyList, 78 ZRPAgent, 89 findPerNode, 78 recv_IARP_DATA freeList, 78 IARPAgent, 29 PeripheralNodeList, 77 recv_IARP_UPDATEpkt_add_ADDRESS_space IARPAgent, 29 PacketUtil, 72 recv_IERP_DATApkt_add_LSU_space IERPAgent, 42 PacketUtil, 71 recv_IERP_ROUTE_ERRORpkt_add_ROUTE_space IERPAgent, 42 PacketUtil, 72 recv_IERP_ROUTE_REPLYpkt_AmIMultiCastReciver IERPAgent, 41 PacketUtil, 73 recv_IERP_ROUTE_REQUEST_MCpkt_AmIOnTheRoute IERPAgent, 41 PacketUtil, 73 recv_IERP_ROUTE_REQUEST_UNIpkt_broadcast IERPAgent, 40 PacketUtil, 71 recv_NDP_BEACONpkt_copy NDPAgent, 60 PacketUtil, 71 recv_NDP_BEACON_ACKpkt_create NDPAgent, 60 PacketUtil, 71 removeLinkpkt_drop LinkStateList, 53 PacketUtil, 73 removeLinkStateFromBrokenRoutepkt_free_ADDRESS_space IERPAgent, 42 PacketUtil, 72 removeNeighborpkt_free_LSU_space NeighborList, 67 PacketUtil, 72 removeQuerypkt_free_ROUTE_space DetectedQueryList, 22 PacketUtil, 72 SentQueryList, 86pkt_print_links route_pkt PacketUtil, 73 ZRPAgent, 90pkt_print_route route_SendBuffer_pkt PacketUtil, 73 ZRPAgent, 90pkt_send PacketUtil, 71 SendBuffer, 79print_tables addPacket, 80 IARPAgent, 30 freeList, 80 NDPAgent, 60 purgeExpiredPackets, 80 ZRPAgent, 90 SendBuffer, 79printLinks SendBufferEntry, 81 LinkStateList, 54 SendBufferEntry, 81printNeighbors sendPacketUsingIARPRoute NeighborList, 68 ZRPAgent, 90purgeDownNeighbors SentQuery, 83 NeighborList, 67 SentQuery, 83purgeExpiredPackets SentQueryList, 85 SendBuffer, 80 addQuery, 86purgeExpiredQueries findQuery, 86 DetectedQueryList, 22 freeList, 86 SentQueryList, 86 purgeExpiredQueries, 86purgeExpiredUpdates removeQuery, 86 IARPUpdateDetectedList, 38 SentQueryList, 85purgeLinks start LinkStateList, 53 IARPExpirationTimer, 32 Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen
    • INDEX 95 IARPPeriodicUpdateTimer, 34 IERPExpirationTimer, 45 NDPAckTimer, 58 NDPBeaconTransmitTimer, 63startUp IARPAgent, 28 IERPAgent, 40 NDPAgent, 60 ZRPAgent, 89XmitPacket ZRPAgent, 91ZRP Agent, 17ZRPAgent, 87 command, 89 mac_failed, 90 Myallocpkt, 91 Mydrop, 91 print_tables, 90 recv, 89 route_pkt, 90 route_SendBuffer_pkt, 90 sendPacketUsingIARPRoute, 90 startUp, 89 XmitPacket, 91 ZRPAgent, 88Generated on Tue Apr 21 16:25:45 2009 for ZRP Agent for NS2 (NS-2 v2.33) by Doxygen