Академический Документы
Профессиональный Документы
Культура Документы
increased attention recently. For example, among the topics where papers could be submitted to this years IST Mobile Summit, the area of ad-hoc and sensor networks has received the highest number of submissions. One reason for the current uptake of ad-hoc networks are certainly the great advances in wireless technologies over the last years. Examples are the IEEE 802.11 series (many DSL users have their own hot-spot at home), the recent 802.16 WiMAX specification, which enables a significantly larger range of up to 10 km, or Bluetooth for shorter distances. Another focus of current research are 4G mobile networks. 4G networks aim at integrating the various access and network technologies in order to implement ubiquitous services. Ad-hoc networks are one piece of this concept. The Suburban Ad Hoc (Area) Networking group focuses its research activities on techniques for implementing Suburban Ad Hoc Networks. These are self organizing, quasi-static ad hoc (typically wireless) networks which provide an alternative technology for providing high speed digital connectivity to households, small businesses and distributed campuses. Specific areas of research interest include security, low level routing protocols, access controls and propagation behavior. The ad hoc network is a communication network without a pre-exist network infrastructure. In cellular networks, there is a network infrastructure represented by the base-stations, Radio network controllers, etc. In ad hoc networks every communication terminal (or radio terminal RT) communicates with its partner to perform peer to peer communication. If the required RT is not a neighbor to the initiated call RT (outside the coverage area of the RT), then the other intermediate RTs are used to perform the communication link. This is called multi-hope peer to peer communication. This collaboration between the RTs is very important in the ad hoc networks. In ad hoc networks all the communication network protocols should be distributed throughout the communication terminals (i.e. the communication terminals should be independent and highly cooperative).
passwords to prevent outside access. Windows provides users with a quick way to create ad hoc networks and share their Internet connections in the process 1.Select your central computer. This computer must remain on at all times in order for other computers to connect to the ad hoc network. 2. Click "Start" and press "Connect To." Choose "Show All Connections." If you don't see "Connect To," go to "Control Panel" and select "Network Connections." 3. Click "Set up a connection or network" for Vista operating systems. Choose "Set up an ad hoc network" and click "Next." Follow the steps in the network creation wizard to create your network. For XP systems, continue to Step 4. Vista users continue to Step 6. 4.Right-click your wireless connection under "Network Connections." Choose "Properties." Click the "Wireless Networks" tab. 5. Press "Add" to create a new network. Type a short name for your network in the "Network Name" box. Add a password to your network by choosing "WEP" from the "Network Authentication" drop down box. Type a password into the two password boxes. Check the "This is a computer to computer (ad hoc) network" checkbox at the bottom of the screen. Press "OK" to create the network. Right-click your Internet connection and choose "Properties." Go to "Advanced" and check the "Allow other users to connect through this computer's Internet connection" box. Choose "Wireless" as your connection type. Press "OK" to share your Internet connection. 6. Connect other computers to the ad hoc network. Open the computer's "Network Connections" as stated in Step 2. Right-click the computer's wireless connection and select "View Available Wireless Networks." Select the ad hoc network and press "Connect
1.5 Characteristics
Mobile Ad hoc Network (MANET) is a collection of independent mobile nodes that can communicate to each other via radio waves. The mobile nodes that are in radio range of each other can directly communicate, whereas others need the aid of intermediate nodes to route
their packets. These networks are fully distributed, and can work at any place without the help of any infrastructure. This property makes these networks highly expiable and robust. The characteristics of these networks are summarized as follows: Communication via wireless means. Nodes can perform the roles of both hosts and routers. No centralized controller and infrastructure. Intrinsic mutual trust. Dynamic network topology. Frequent routing updates. Autonomous, no infrastructure needed. Can be set up anywhere. Energy constraints Limited security Generally, the communication terminals have a mobility nature which makes the topology of the distributed networks time varying. The dynamical nature of the network topology increases the challenges of the design of ad hoc networks. Each radio terminal is usually powered by energy limited power source (as rechargeable batteries). The power consumption of each radio terminal could be divided generally into three parts, power consumption for data processing inside the RT, power consumption to transmit its own information to the destination, and finally the power consumption when the RT is used as a router, i.e. forwarding the information to another RT in the network. The energy consumption is a critical issue in the design of the ad hoc networks. The mobile devices usually have limited storage and low computational capabilities. They heavily depend on other hosts and resources for data access and information processing. A reliable network topology must be assured through efficient and secure routing protocols for Ad Hoc networks.
information requires confidentiality. Leakage of in the network. Availability implies that the requested services (e.g. bandwidth and connectivity) are available in a timely manner even though there is a potential problem in the system. Availability of a network can be tempered for example by dropping off packets and by resource depletion attacks. Authenticity is a network service to determine a users identity. Without authentication, an attacker can impersonate any node, and in this way, one by one node, it can gain control over the entire network. finally, non-repudiation ensures that the information originator cannot deny having sent the message. Non-repudiation is useful for detection and isolation of compromised nodes such information to enemies could have devastating consequences. Integrity guarantees that a message being transferred between nodes is never altered or corrupted. Data can be altered either intentionally by malicious nodes in the network or accidentally because of benign failures, such as radio propagation impairment or through hardware glitches.
1.6.1 Passive attacks: A passive attack does not disrupt the normal operation of the
network; the attacker snoops the data exchanged in the network without altering it. Here the requirement of confidentiality gets violated. Detection of passive attack is very difficult since the operation of the network itself doesnt get affected. One of the solutions to the problem is to use powerful encryption mechanism to encrypt the data being transmitted, there by making it impossible for the attacker to get useful information from the data overhead.
1.6.2 Active attacks: An active attack attempts to alter to destroy the data being exchanged
in the network there by disrupting the normal functioning of the network. Active attacks can be internal or external. External attacks are carried out by nodes that do not belong to the network. Internal attacks are from compromised nodes that are part of the network.
Type Of Attacks
Passive Attacks: An attacker stay quietly and listening to the route traffic. The purpose of passive attack is to discover routing information, relationship between nodes, and the network topology. Active Attacks: An attacker performs actions which to cause interruption and congestion to the network traffic by modifying the content of routing packet, broadcasting wrong information or old information.
5
Denial of Service Attacks: An attack on the network that causes a loss of service to other nodes, either by consuming the bandwidth or overloading the system. Impersonation Attacks: An attacker broadcast wrong routing information to other nodes and terminates the traffic for the desired destination node. Military Attacks: An attempt to destruct enemy networks in preparation for battle including intelligence gathering. An attacker use passive attack to gathering information about network topology. To disable some part of the network temporarily by using denial of service attacks
pure reactive approach (through its on-demand route discovery function). This proactive neighbor detection scheme is identity-free (as originally proposed globally by ANODR) and is performed through a pairing-based anonymous handshake [28] between any pair of neighbors. For key exchanges between a given node and its new detected neighbors, MASK relies on a three step handshake. Once the handshake procedure is ended, each pair of nodes shares a chain of secret keys and locally unique link identifiers pair that corresponds to the pseudonyms used during handshake. In the proactive neighbor detection part of MASK, HELLO messages are periodically sent to hold the pairing cryptographic materials. Then, MASK relies on classical pure on-demand route discovery scheme. As for ASR, intermediary forwarding node keeps an information state about previously RREQ message sent by a source node. Once it receives a RREP message, this information is used by each intermediary node to decide whether it should forward the information and to which node. However, MASK presents some drawbacks concerning privacy protection by focusing on the improvement of network capacity, contrary to ASR or SDAR. For example, as summarized by [27], the final destination appeared in plain text in each RREQ. Moreover, MASK relies on a tight synchronization between keys and pseudonyms of neighboring nodes. More recently, ODAR [52] has been proposed to tackle also performance issues at different levels, necessary to design a suitable anonymous routing solution for Ad Hoc networks: storage, processing and communication. This approach is based on a reactive routing approach and relies on Bloom filters, previously used in [44] to provide node, link, path anonymity and efficiency at once. By definition, the wireless environment is constraining because communication performance largely depends on the quality of the radio transmission and on the capacity of the networked device. Errors bits or burst due to this transmission are common in such an environment, the capacity could be weak (50kits/sec) and the mobile devices like PDAs and laptops are not so efficient as an actual fixed computer. This means that such an environment has also to face CPU-related constraints, and it is a difficult, but interesting challenge to propose some solution which may improve or at least not degrade the performance of a given service and which warrants the users privacy. For sensor networks, energy is an additional constraint which is an important factor. In fact, many efficient solutions can be found in the literature but they rarely treat simultaneously privacy in a very constraining context. Traditionally, strong security and communication service are complementary; it is very often a question of trade-off. A strong security is time consuming and needs a large resource which can alter the quality of the services.
demand from additionally activated nodes through reactive flooding. The choice for one or the other method requires predetermination for typical cases. The main disadvantages of such algorithms are: 1. Advantage depends on amount of nodes activated. 2. Reaction to traffic demand depends on gradient of traffic volume. Example: 1. OORP (Order One Routing Protocol 2. TORA (Temporally Ordered Routing Algorithm)
10
2. Any dependence of performance with traffic load thwarting the negligence of distance may occur in overload.
transmission medium. When = 2 (which is the optimal case), transmitting a signal half the distance requires one fourth of the energy and if there is a node in the middle willing to spend another fourth of its energy for the second half, data would be transmitted for half of the energy than through a direct transmission - a fact that follows directly from the inverse square law of physics. The main disadvantages of such algorithms are: 1. This method induces a delay for each transmission. 2. No relevance for energy network powered transmission operated via sufficient repeater infrastructure.
t time of a link failure oid originator id r reflection bit indicates 0=original level 1=reflected level d integer to order nodes relative to reference level i the nodes id that reference level.
The triplet (t, oid, r) is called the reference level. And the tuple (d, i) is said to be an offset within
As with the GB algorithms the heights of the nodes for a given destination to each other determine the direction of the edges of the directed acyclic graph. The DAG is destination
11
oriented (routed at the destination) when the quintuples which represent the heights are maintained in lexicographical order, the destination having the smallest height, traffic always flowing downstream. Heights are however not needed for route discovery, instead a mechanism as in LMR is used. Also nodes which do not currently need to maintain a route for themselves or for others won't change a height value. Each node has a Route-required flag for that purpose; additionally the time since the las UPD (update-) packet was sent is recorded. Each node maintains a neighbor table containing the height of the neighbor nodes. Initially the height of all the nodes is NULL. (This is not zero "0" but NULL "-") so their quintuple is (-,-,-,-,i). The height of a destination neighbor is (0, 0, 0, 0, dest).
if the reflection bit of the neighbors height is not set and its route required flag is set it sets its height for the destination to that of its neighbors but increments d by one. It then deletes the RR flag and sends an UPD message to the neighbors, so they may route through it.
if the neighbors route is not valid (which is indicated by the reflection bit) or the RR flag was unset, the node only updates the entry of the neighbors node in its table. is best in shown the by an example from the that original the RR paper. flag
Park1997
This Circles
pictures
below
signify
is
set
node
requires
route,
so
it
broadcasts
QRY
13
The QRY propagates until it hits a node which has a route to the destination, this node then
14
sends
an
UPD
message
The
UPD
is
also
propagated,
while
node
sends
new
UPD
15
16
17
Case 1 Generate: The node has lost its last downstream link due to a failure. The node defines a new "reference level", so it sets oid (originator id) to its node id and t to the time of the failure. This is done only if the node has upstream neighbors. If not it sets its height to NULL.
Case 2 Propagate: The node has no more downstream link due to a link reversal following the receipt of an update packet and the reference levels (t,oid,r) of its neighbors are not equal. The node then propagates the references level of its highest neighbor and sets the offset to a value which is lower (-1) than the offset of all its neighbors with the maximum level.
Case 3 Reflect: The node has lost its downstream links due to a link reversal following the receipt of an update packet and the reference heights of the neighbors of
18
the node are equal with the reflection bit not set. The node then reflects back the reference height by setting the reflection bit. It's d value is set to 0.
Case 4 Detect: The node has lost its downstream links due to a link reversal following the receipt of an update packet and the reference heights of the neighbors of the node are equal with the reflection bit set. This means that the node has detected a partition and begins the route erasure procedure. The height values are set to NULL.
Case 5 Generate: The node has lost its last downstream link due to a link reversal following the receipt of an update packet and the reference heights of all the neighbors are equal with the reflection bit set and the oid of the neighbors heights isn't the node's id. The node then sets t to the time of the link failure and sets oid to its own id. The d value is set to 0. This means that the link failure required no reaction. The node experienced a link failure between the time it propagated a higher reference (from someone else) and the time this level got reflected from a place further away in the network. Because the node didn't define the new reference level itself this is not necessarily an indication of a partitioning of the network. So the node simply defines a new higher reference level with the time of the link failure.
19
Example
20
21
Node D defines a new reference level. It sets the originator id to his own id since it was node D that defined the new level. The logical time of the link failure is also recorded (t=1). The new reference level is now higher than that of the neighbors, so the update message has as effect the reversal of the links to A and B. This is case 1 of the decision tree.
22
Node B has lost its downstream not because of a link failure, but because of a link reversal. It propagates the reference level that was defined by D. Because the node must have a lower height than the upstream node D it has to set it's sub height (offset) lower than that of D, so d=-1. This is case 2 of the decision tree.
23
Here the link F to G fails, partitioning G from the rest of the network
F defines a new reference level and sends an update message with oid=F and the time of the link failure
24
The
links
D-F
and
E-F
reverse.
Node
propagates
the
reference
level.
Node E now "reflects" the reference level. The reference heights of the neighbors are equal with the reflection bit not set. E sets the reflection bit to indicate the reflection and sets its offset to 0. Node C just propagates the new reference level.
25
Node
now
propagates
the
reference
level.
Now node B reflects the reference level, because all of its neighbors have the same reference height and their reflection bits are not set. The offset (d) is set to 0 to make node B now be higher than its neighbors and the reflection bit is set.
26
The links are now reversed in the opposite direction, but the reflection bit is set.
27
AODV deals with routing table. Every node has a routing table. When a node knows a route to the destination, it sends a route reply to the source node. Its entries are:
28
Next Hop IP Address Lifetime (expiration or deletion time of the route) Hop Count (number of hops to reach the destination) Network Interface Other state and routing flags (e.g., valid, invalid)
Route Requests (RREQs), Route Replies (RREPs) and Route Errors (RERRs) are message types defined by AODV. The next pictures will give an example of AODV.
The node broadcasts a RREQ to find a route to the destination. S generates a Route Request with destination address, Sequence number and Broadcast ID and sent it to his neighbor nodes
29
Each node receiving the route request sends a route back (Forward Path) to the node.
A route can be determined when the RREQ reaches a node that offers accessibility to the destination, e.g., the destination itself).
The route is made available by unicasting a RREP back to D and is written in the routing table from S. After receiving the route reply every node has to update its routing table if the sequence number is more recent.
30
31
Loop free routing Optional multicast Reduced control overhead Delay caused by route discovery process Bidirectional connection needed in order to detect an unidirectional link
Disadvantages
32
DSR is based on the Link-State-Algorithms which mean that each node is capable to save the best way to a destination. Also if a change appears in the network topology, then the whole network will get this information by flooding.
33
36
Dynamic Link
Object that gates traffic depending on whether the link is up or down. It expects to be at the head of the link, and is inserted on the link just prior to simulation start. Its status_ variable control whether the link is up or down. The description of how the Dyna Link object is used is in a separate chapter.
Delay Link
Object that models the links delay and bandwidth characteristics. If the link is not dynamic, then this object simply schedules receive events for the downstream object for each packet it receives at the appropriate time for that packet. However, if the link is dynamic, then it queues the packets internally, and schedules one receives event for itself for the next packet that must be delivered. Thus, if the link goes down at some point, this objects reset () method is invoked, and the object will drop all packets in transit at the instant of link failure. We discuss the specifics of this class in another chapter.
Queues
- Model the output buffers attached to a link in a real router in a network. In ns,
they are attached to, and are considered as part of the link. We discuss the details of queues and different types of queues in nsin another chapter.
TTL Checker
- will decrement the ttl in each packet that it receives. If that ttl then has a positive value, the packet is forwarded to the next element on the link. In the simple links, TTL Checkers are automatically added, and are placed as the last element on the link, between the delay element, and the entry for the next node.
many versions are available current version used for our project is network simulator ns22.34. to work in this platform there are simulation codlings are available thes codings are c++ based codings the main note of it is these program can execute only in linux operating system the procedure for executing in linux os are follows 1)go to the APPLICATION in the task bar of screen select TEXT EDITOR 2) The codings should type there after complete typing the coding save the file as FILE NAME . tcl 3)for executing the coding open the terminal icon this terminal is like a commend window used in xp operating system 5)first commend should be typed is SU this refers to super user then click enter next type cd Desktop This commend refers to change the directory to desktop 6) after click enter type ls this commend stands for listing the items in desktop 7) finally type ns file name.tcl for executing the coding and the output of the coding is executed
Queue/DropTail/PriQueue Antenna/OmniAntenna
set val(x) set val(y) set val(stop) set ns set tracefd set namtrace
#Creating trace file and nam file set windowVsTime2 [open aodv.tr w] $ns trace-all $tracefd $ns namtrace-all-wireless $namtrace $val(x) $val(y) # set up topography object set topo [new Topography]
$topo load_flatgrid $val(x) $val(y) create-god $val(nn) # configure the nodes $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 ON for {set i 0} {$i < $val(nn) } { incr i } { set node_($i) [$ns node]
40
} # Provide initial location of mobilenodes $node_(0) set X_ 5.0 $node_(0) set Y_ 5.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 490.0 $node_(1) set Y_ 285.0 $node_(1) set Z_ 0.0 $node_(2) set X_ 150.0 $node_(2) set Y_ 240.0 $node_(2) set Z_ 0.0 $node_(3) set X_ 250.0 $node_(3) set Y_ 240.0 $node_(3) set Z_ 0.0 $node_(4) set X_ 500.0 $node_(4) set Y_ 500.0 $node_(4) set Z_ 0.0 # Generation of movements $ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0" $ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0" $ns at 110.0 "$node_(0) setdest 480.0 300.0 5.0" # Set a TCP connection between node_(0) and node_(1) set tcp [new Agent/TCP/Newreno] $tcp set class_ 2 set sink [new Agent/TCPSink] $ns attach-agent $node_(0) $tcp $ns attach-agent $node_(1) $sink
41
$ns connect $tcp $sink set ftp [new Application/FTP] $ftp attach-agent $tcp $ns at 10.0 "$ftp start" # Printing the window size proc plotWindow {tcpSource file} { global ns set time 0.01 set now [$ns now] set cwnd [$tcpSource set cwnd_] puts $file "$now $cwnd" $ns at [expr $now+$time] "plotWindow $tcpSource $file" } $ns at 10.1 "plotWindow $tcp $windowVsTime2" # Define node initial position in nam for {set i 0} {$i < $val(nn)} { incr i } { # 30 defines the node size for nam $ns initial_node_pos $node_($i) 30 } # Telling nodes when the simulation ends for {set i 0} {$i < $val(nn) } { incr i } { $ns at $val(stop) "$node_($i) reset"; } # ending nam and the simulation $ns at $val(stop) "$ns nam-end-wireless $val(stop)" $ns at $val(stop) "stop" $ns at 150.01 "puts \"end simulation\" ; $ns halt" proc stop {} { global ns tracefd namtrace $ns flush-trace close $tracefd
42
#Creating trace file and nam file set tracefd set namtrace [open dsr1.tr w] [open dsr.nam w] set windowVsTime2 [open dsr.tr w]
43
$ns trace-all $tracefd $ns namtrace-all-wireless $namtrace $val(x) $val(y) # set up topography object set topo [new Topography]
$topo load_flatgrid $val(x) $val(y) create-god $val(nn) # configure the nodes $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 ON for {set i 0} {$i < $val(nn) } { incr i } { set node_($i) [$ns node] } # Provide initial location of mobilenodes $node_(0) set X_ 5.0 $node_(0) set Y_ 5.0 $node_(0) set Z_ 0.0
44
$node_(1) set X_ 490.0 $node_(1) set Y_ 285.0 $node_(1) set Z_ 0.0 $node_(2) set X_ 150.0 $node_(2) set Y_ 240.0 $node_(2) set Z_ 0.0 $node_(3) set X_ 250.0 $node_(3) set Y_ 240.0 $node_(3) set Z_ 0.0 $node_(4) set X_ 500.0 $node_(4) set Y_ 500.0 $node_(4) set Z_ 0.0 # Generation of movements $ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0" $ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0" $ns at 110.0 "$node_(0) setdest 480.0 300.0 5.0" # Set a TCP connection between node_(0) and node_(1) set tcp [new Agent/TCP/Newreno] $tcp set class_ 2 set sink [new Agent/TCPSink] $ns attach-agent $node_(0) $tcp $ns attach-agent $node_(1) $sink $ns connect $tcp $sink set ftp [new Application/FTP] $ftp attach-agent $tcp $ns at 10.0 "$ftp start" # Printing the window size
45
proc plotWindow {tcpSource file} { global ns set time 0.01 set now [$ns now] set cwnd [$tcpSource set cwnd_] puts $file "$now $cwnd" $ns at [expr $now+$time] "plotWindow $tcpSource $file" } $ns at 10.1 "plotWindow $tcp $windowVsTime2" # Define node initial position in nam for {set i 0} {$i < $val(nn)} { incr i } { # 30 defines the node size for nam $ns initial_node_pos $node_($i) 30 } # Telling nodes when the simulation ends for {set i 0} {$i < $val(nn) } { incr i } { $ns at $val(stop) "$node_($i) reset"; } # ending nam and the simulation $ns at $val(stop) "$ns nam-end-wireless $val(stop)" $ns at $val(stop) "stop" $ns at 150.01 "puts \"end simulation\" ; $ns halt" proc stop {} { global ns tracefd namtrace $ns flush-trace close $tracefd close $namtrace exec nam dsr.nam exit 0 } $ns run
46
Queue/DropTail/PriQueue Antenna/OmniAntenna
$ns trace-all $tracefd $ns namtrace-all-wireless $namtrace $val(x) $val(y) # set up topography object set topo [new Topography] $topo load_flatgrid $val(x) $val(y) create-god $val(nn) # Create nn mobilenodes [$val(nn)] and attach them to the channel. # configure the nodes
47
$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 ON for {set i 0} {$i < $val(nn) } { incr i } { set node_($i) [$ns node] } # Provide initial location of mobilenodes $node_(0) set X_ 5.0 $node_(0) set Y_ 5.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 490.0 $node_(1) set Y_ 285.0 $node_(1) set Z_ 0.0 $node_(2) set X_ 150.0 $node_(2) set Y_ 240.0 $node_(2) set Z_ 0.0 $node_(3) set X_ 250.0 $node_(3) set Y_ 240.0 $node_(3) set Z_ 0.0
48
$node_(4) set X_ 500.0 $node_(4) set Y_ 500.0 $node_(4) set Z_ 0.0 # Generation of movements $ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0" $ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0" $ns at 110.0 "$node_(0) setdest 480.0 300.0 5.0" # Set a TCP connection between node_(0) and node_(1) set tcp [new Agent/TCP/Newreno] $tcp set class_ 2 set sink [new Agent/TCPSink] $ns attach-agent $node_(0) $tcp $ns attach-agent $node_(1) $sink $ns connect $tcp $sink set ftp [new Application/FTP] $ftp attach-agent $tcp $ns at 10.0 "$ftp start" # Printing the window size proc plotWindow {tcpSource file} { global ns set time 0.01 set now [$ns now] set cwnd [$tcpSource set cwnd_] puts $file "$now $cwnd" $ns at [expr $now+$time] "plotWindow $tcpSource $file" } $ns at 10.1 "plotWindow $tcp $windowVsTime2" # Define node initial position in nam for {set i 0} {$i < $val(nn)} { incr i } {
49
# 30 defines the node size for nam $ns initial_node_pos $node_($i) 30 } # Telling nodes when the simulation ends for {set i 0} {$i < $val(nn) } { incr i } { $ns at $val(stop) "$node_($i) reset"; } # ending nam and the simulation $ns at $val(stop) "$ns nam-end-wireless $val(stop)" $ns at $val(stop) "stop" $ns at 150.01 "puts \"end simulation\" ; $ns halt" proc stop {} { global ns tracefd namtrace $ns flush-trace close $tracefd close $namtrace exec nam tora.nam & exec xgraph tora.tr -geometry 800x400 & } $ns run
5.4 TRACING
Tracing in JoBS is handled internally, by the scheduler. Each Jobs queue can generate a trace file containing the following information. Each line of the trace file consists of 17 columns. The first column is the simulation time, columns 2 to 5 represent the loss rates over the current busy period for classes 1 to 4, columns 6 to 9 represent the delays for each class (average over a 0.5 seconds sliding window), columns 10 to 13 represent the average service rates allocated to each class over the last 0.5 seconds, and columns 14 to 17 represent the instantaneous queue length in packets. Additionally, Demarkers can be used to trace endto-end delays.
50
Event
Time
From node
To node
Pakt type
Pakt Size
Flag
Fid
Source add
Dest Add
Sequ No
Pkt id
51
Event
Abbreviation Type double string string string double string string string string double string string string double string string string
Value Time ID Source Destination Time ID Source Destination Route Time ID ID (Should be Source???) Destination Time Use TAP Snoop Source Routes Snoop Forwarded Errors
Send
Have A Route
S$hit
S$miss
52
double Time string Salvage With Cache string Don't Salvage Bad Replies
%.5f grat error: %s grat reply: %s
double Time string Propagate Last Error string Send Grat Replies
%.5f $reply for props: %s ring 0 search: %s
double Time string Reply From Cache On Propagating string Ring Zero Search
%.5f using MOBICACHE
double Time
%.5f using LINKCACHE
53
string ID
%.5f _%s_ sending into dead-link (nest %d) tell %d %d -> %d
double string int int int int double string string int double double string string int double double string string string int double Errors SDFU
Time ID Number Of Route Errors Report To Address From Address To Address Time ID Path Link Type Time Added Time ID Path Link Type Time Added Time ID Path Next Path Link Type Time Added
double Time
54
ID Tell ID From To
ran off the end of a source route non route containing packet given to acceptRouteReply route error beyond end of source route???? route error forwarding route request???? %.9f _%s_ %d [%s -> %s] %d(%d) to %d
Flowstate
SFs
double string int string string int int int double string int string string int int int string double string int string string int int double string int int int int
Time ID Header UID Source Destination Flow ID Flow Header Next Hop Time ID Header UID Source Destination Flow ID Flow Header Next Hop Addresses Time ID Header ID Source Destination Flow ID Amt Time ID Source Flow Destination Flow ID (-1 For Default) Count (-1 For No Flow Index)
Established Flowstate
SFESTs
Flow ARS
SFARS
Flow Error
SFEr
55
Unknown Flow
SFErr
double string int int int double string int string string int int
Time ID Source Flow Destination Flow ID Time ID Header ID Source Destination Flow ID Next Hop
Flow Forward
SFf
Interface Queue
SIFQ
SRC
double string int int int int int double int int int int int int int int
56
Time ID Route Count Route Bad Count Subroute Count Subroute Bad Count Link Bad Count Average Bad Time Per Link Link Bad Tested Link Good Tested Route Add Count Route Add Bad Count Subroute Add Count Subroute Add Bad Count Link Add Tested Route Notice Count
int int int int int int int int int int double double int int int int int int string int int int int int string double int int int int int int string double string string string string
Route Notice Bad Count Subroute Notice Count Subroute Notice Bad Count Link Notice Tested Route Find Count Route Find For Me Route Find Bad Count Route Find Miss Count Subroute Find Count Subroute Find Bad Count Link Good Time (Only In First Format) Time Source Node Primary Cache Current Size Primary Cache Maximum Size Cache Entry Index Cache Entry Length Cache Entry Address Cache Entry Dump Secondary Cache Current Size Secondary Cache Maximum Size Cache Entry Index Cache Entry Length Cache Entry Address Cache Entry Dump Time Source Node Secondary Cache Current Size Secondary Cache Maximum Size Cache Entry Index Cache Entry Length Cache Entry Address Cache Entry Dump Time ID Destination Primary Or Secondary Cache Route
Route Cache - Node Cache Dump, No Primary Cache SRC (only with patch)
57
double string int string string int double double string string int int string double string string int int string double string string string double string int int string double string string string double string string string string
58
Time ID Hardcoded Zero ID (Should Be Source???) Destination Hardcoded Zero Hardcoded Zero Time ID Cache Name (primary, secondary) Path Length Route Length Route Dump Time ID Cache Name (primary, secondary) Path Length Route Length Route Dump Time ID Name Dumped Route Time ID Route Length -1 Number Of Bad Routes Name Time ID Name Added Path Time ID Name Route Owner
%.9f _%s_ to %s %s
SRC
SRC
double Time string ID Operation In Progress (add-route, noticestring route, find-route, dead-link, evictingroute, check-cache) int Route Length int Route Index string Route string Next Route int Link Type double Time Added
%.9f _%s_ dead %d %.9f resurrected-link [%d %d] %s->%s
double string int int string string int double double string string string double string int int int
59
Time ID Route Length Route Index Route Next Route Link Type Time Added Time ID Route From Time ID Destination Index Estimated Shortest Path To Vertex (d)
SRC
int double string int int double string int int int int
Predecessors For Vertex (pi) Time ID Index Link Destination Time ID Expire Stats 0 Expire Stats 1 Expire Stats 2 Expire Stats 3
SRC
60
FIELDS Source id Destination id Unique request id MAC address list ACK bit Trust estimate value Time Security bit
EXPLANATION Address of the source The address of destination A unique id that identify the message A list of address of all intermediate nodes that the message passes before the destination Identify that message has received Identify the node either malicious or friend Estimate Message receive and replay Initially set 1 for rout request and 1 for packet forward
61
62
63
64
65
66
67
68
69
70
71
Fig 6.4 TORA Snap shot 6.4 COMPARISON OF TORA, AODV & DSR ROUTING ALGORITHM
72
As with many other AODV implementations for Linux/winX, it separates functionality into a kernel module and a user space daemon. The kernel module uses hooks in the net filter
73
interface to send packet headers from the wireless interface to the user space daemon. The daemon then determines how to handle the packet. If the packet is a routing control packet, then the daemon processes the packet in accordance with the AODV specification. If instead the packet is a data packet, the daemon determines whether or not a route exists to the necessary destination. If there is a suitable route, the packet is flagged and the kernel module queues it to be sent out. If no route exists, the daemon begins route discovery. Once a route is found, the daemon enters the route into the kernels routing table. It then flags the packet (and any additional packets arriving during discovery) to be queued for transmission. The implementation is written completely in Java. In order to implement SAODV, it was necessary to have a library of cryptographic operations. We used Open SSL for this purpose, and we developed a security library which wrapped much of Open SSL.s functionality into components appropriate for ad-hoc routing purposes. One particularly useful feature of the security library is that it allows easy use of several different Open SSL contexts at once. For SAODV, this was useful as nodes must switch between signing, verifying, and hash chain operations rapidly to both send and receive routing messages. New data structures were added for SAODV.s single signature extension and the necessary code was added to the message processing functions for RREQ, RREP, HELLO, and RERR messages. The design of the AODV implementation allowed SAODV functionality to be implemented while maintaining one binary with the ability to run both protocols.
74