Shell Eco-Marathon FAMU-FSU 2014 Solar Car Milestone #2 Presentation Team #2
FAMU-FSU COLLEGE OF ENGINEERING Department of Electrical and Computer Engineering
description
Transcript of FAMU-FSU COLLEGE OF ENGINEERING Department of Electrical and Computer Engineering
FAMU-FSU COLLEGE OF ENGINEERINGDepartment of Electrical and Computer Engineering
Students: Hung Khong – Derek VollmerStudents: Hung Khong – Derek VollmerInstructor: Dr Ming YuInstructor: Dr Ming Yu
04-200804-2008
Computer Network Project
The Dynamic Source Routing Protocol for Ad Hoc Networks
Description of DSR routing protocols Description of DSR routing protocols
Simulation ResultSimulation Result
Simulation Summary & Implementation Simulation Summary & Implementation
ContentContent
Lessons Learned & ConclusionLessons Learned & Conclusion
• DSR Definition: – A send packets to E, the router to E is embedded in A’s header. Intermediate node uses this source route
to determine to whom the packet should be forwarded.– Different packets may have different routers.
• All nodes are willing to forward packets for other nodes in the network
• The diameter of a network will not be too large
• The node’s speed is moderate and nodes may move at any time without notice
• All nodes are overhearing (promiscuous) increase power consumption.
Description of DSR routing protocols Description of DSR routing protocols
1- Introduction to DSR 1- Introduction to DSR
• Every RREQ packet contains (initiator & target address, route record, request ID)• Each node maintains a list of (initial add. & request id)• When an intermediate node X receives a RREQ:
Discard RREQ if RREQ’s (initial add. & request id) is in node’s list Returns a route reply packet which contains a route from initiator to target
• If X is the target node• If X has an entry in its route cache for the route to target
Appends itself address to the route record in RREQ and re-broadcast RREQ
• Uses exponential back-off algorithm to limit the rate of RREQ to reduce the overhead
Description of DSR routing protocols Description of DSR routing protocols
2- Route Discovery (RREQ & RREP)2- Route Discovery (RREQ & RREP)
• E on receiving the first RREQ, sends a Route Reply (RREP) including the route from A to E
• RREP packet is sent to A by: – Route Reply can be sent by reversing the route in RREQ If links are bi-directional – If unidirectional (asymmetric) links are allowed, then a route to A is needed
Local route cache has a route to A Piggybacking Route Reply in Route Request packet for A
– Perform its own RREQ for target node A
• If IEEE 802.11 MAC is used, then links have to be bi-directional• Route Caching : each node caches a new route it learns by all means
Description of DSR routing protocols Description of DSR routing protocols
3- Route Discovery (RREQ & RREP)3- Route Discovery (RREQ & RREP)
• E sends a route error to A along route E-D-B-A when it finds link [E-F] broken• Nodes hearing RERR update their route cache to remove all invalid routes related
with link E-F• How to find link [E-F] is down:
– MAC level ack – Passive acknowledge (overhearing neighbor node transmission)– Insert a bit in packet’s header to request a DSR specific ack returned by next hop.
• How to send RRER packet to A:– Use reverse route– Use intermediate node ‘s route cache to get to node A– Piggybacking RRER packet in route discovery packet A
Description of DSR routing protocols Description of DSR routing protocols
4- Route Maintenance4- Route Maintenance
• Simulation Topology: Ad-hoc network of 50 mobile nodes moving randomly within flat rectangular 1500x300m
• Simulation time: 900 seconds• Data traffic : CBR UDP traffic source with 20 sources• Data rate: 4 256-byte packets/s• Radio channel: Lucent WaveLAN • Node movement velocity: 1 m/s and 20 m/s• Node Pause time: 0:100:900 (s)
Simulation Summary & Implementation Simulation Summary & Implementation
1- Simulation Summary1- Simulation Summary
Traffic models• Random traffic connections of TCP or CBR can be setup between mobile nodes
using a traffic-scenario generator script.
ns cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed seed] [-mc connections][-rate rate]
Mobility models• The node-movement generator is available under
~ns/indep-utils/cmu-scen-gen/setdest directory and consists of setdest{.cc,.h} and Makefile.
./setdest [-n num_of_nodes] [-p pausetime] [-M maxspeed] [-t simtime] [-x maxx] [-y maxy] > [outdir/movement-file]
Simulation trace files s 606.210364161 _39_ RTR - 1306 DSR 44 [13a a 27 800] ----[39:255 8:255 255 8] 2 [0 0] [0
0 0 0->0] [1 1 8 39->10]
Simulation Summary & Implementation Simulation Summary & Implementation
2- Simulation Implementation2- Simulation Implementation
#------- TESTCBR1.TCL----------------------------------------------------------------------------------set randNum [expr 1000*rand()]set nodes 50set connections 20set bytesPerSecond 4.0set pause 0set speed 20.0set x 1500set y 300set runTime 900set version 2for {set pause 0} {$pause <= 900} {incr pause 50} {
set handle1 [open dsrRatio$version.txt a+]set handle2 [open dsrOver$version.txt a+]puts $handle1 "pause = $pause"puts $handle2 "pause = $pause"close $handle1close $handle2
for {set i 0} { $i<10} {incr i} {
exec ./ns indep-utils/cmu-scen-gen/cbrgen.tcl -type cbr -nn $nodes -seed $randNum -mc $connections -rate $bytesPerSecond > tcl/mobility/scene/cbr-$nodes-$connections-$bytesPerSecond-2
exec indep-utils/cmu-scen-gen/setdest/setdest -n $nodes -p $pause -M $speed -x $x -y $y -t $runTime > tcl/mobility/scene/scen-$x-$y-$nodes-$connections-$speed
if {[catch {exec ./ns run.tcl -x $x -y $y -sc tcl/mobility/scene/scen-$x-$y-$nodes-$connections-$speed -cp tcl/mobility/scene/cbr-$nodes-$connections-$bytesPerSecond-2 >> runOut.txt} result]} {
#exec ./ns run.tcl -x $x -y $y -sc tcl/mobility/scene/scen-$x-$y-$nodes-$connections-$speed -cp tcl/mobility/scene/cbr-$nodes-$connections-$bytesPerSecond
exec awk -f awkcode1.awk runOut1.tr >> dsrRatio$version.txtexec awk -f macoverhead.awk runOut1.tr
>>dsrOver$version.txt } } }
#-----------AWK file to count the received packet/sent packet-------------------BEGIN {counter1 = 0; counter2 = 0;} $1~/s/ && /AGT/ { counter1 ++ } $1~/r/ && /AGT/ { counter2 ++ } END { print ( counter1, counter2) }#----------------------------------------------------------------------------------------------------
#---------- MACOVERHEAD File to find the overhead -----------------------------BEGIN {dsrpktno = 0; dsrbyte = 0; cbrpktno = 0; cbrbyte = 0; } $1~/s/ && /DSR/ && /MAC/ { dsrpktno ++ ; dsrbyte+=$8 ;} $1~/s/ && /cbr/ && /MAC/ { cbrpktno ++ ; cbrbyte+=$8; } END { print ( dsrpktno, dsrbyte , cbrpktno, cbrbyte) }#-----------------------------------------------------------------------------------------------------
Simulation Summary & Implementation Simulation Summary & Implementation
3- Simulation Code3- Simulation Code
def dsrPacketRatio(testNum, speed):speed = str(speed)testNum = str(testNum)fileRead = 'c:/dsrRatio%s.txt'%testNumfileWrite = 'c:/dsrRatioAvg%s.m'%testNum
fileHandle = open(fileRead, 'r');file2 = open(fileWrite, 'w');pauseTimes = [];avgRatio = [];ratio = [];while 1:
line = fileHandle.readline();if not line:
break;line = line[:-1];items = line.split(' ')if items[0] == "pause":
pauseTimes.append(int(items[2]));else:
percentRatio = int(items[1])/float(items[0]);
ratio.append(percentRatio);if len(ratio) == 10:
sum = 0;
for item in ratio:
sum = sum+item;
average = sum/10;ratio
= [];
avgRatio.append(average);file2.write('avgRatio = %s;\n' % str(avgRatio));file2.write('pauseTimes = %s;\n' %str(pauseTimes))file2.write("plot(pauseTimes, avgRatio)\ntitle('Packet Delivert Ratio
(%sm/s)')\nxlabel('Pause Time (secs)')\nylabel('#data packets received/ #data packets sent')\n"%speed)
file2.write('axis([0 900 0 1])\n');
fileHandle.close()file2.close()
def routingOverhead(testNum, speed):testNum = str(testNum);speed = str(speed)fileRead = 'c:/dsrOver%s.txt' % testNum;fileWrite = 'c:/dsrOverHead%s.m'%testNum;fileHandle = open(fileRead, 'r');file2 = open(fileWrite, 'w');pauseTimes = [];avgOverhead = [];overhead = [];totalPackets = []while 1:
line = fileHandle.readline();if not line:
break;line = line[:-1];items = line.split(' ')if items[0] == "pause":
pauseTimes.append(int(items[2]));else:
overhead.append(int(items[0]));packets = int(items[0])
+int(items[2]);
totalPackets.append(packets);if len(overhead) == 10:
sum = 0;
for item in overhead:
sum = sum+item;
average = sum/10;
overhead = [];
avgOverhead.append(average);sum = 0;for item in totalPackets:
sum = sum+item;packetAvg = sum/len(totalPackets);file2.write('avgOverhead = %s;\n' % str(avgOverhead));file2.write('pauseTimes = %s;\n' %str(pauseTimes))file2.write("plot(pauseTimes, avgOverhead)\ntitle('Routing
Overhead (%sm/s)')\nxlabel('Pause Time (secs)')\nylabel('Routing Overhead (Packets)')\n"% speed)
file2.write('axis([0 900 0 %s])\n'%str(packetAvg));fileHandle.close()file2.close()
Simulation Summary & Implementation Simulation Summary & Implementation
3- Simulation Code (cont)3- Simulation Code (cont)
Simulation ResultSimulation Result
Scenario- 1500x300, 50 nodes, 20 sources, 1m/s, 4 512-byte packets/s.
Scenario- 1500x300, 50 nodes, 20 sources, 1m/s, 4 512-byte packets/s.
0 100 200 300 400 500 600 700 800 9000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Packet Delivert Ratio (1m/s)
Pause Time (secs)
#dat
a pa
cket
s re
ceiv
ed/
#da
ta p
ack
ets
sent
0 100 200 300 400 500 600 700 800 9000
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2x 10
5 Routing Overhead (1m/s)
Pause Time (secs)
Rou
ting
Ove
rhe
ad
(P
ack
ets
)
Simulation ResultSimulation Result
Scenario- 1500x300, 50 nodes, 20 sources, 1m/s, 1 512-byte packet/s.
Scenario- 1500x300, 50 nodes, 20 sources, 1m/s, 1 512-byte packet/s.
0 200 400 600 8000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Packet Delivert Ratio (1m/s)
Pause Time (secs)
#da
ta p
ack
ets
re
ceiv
ed/
#da
ta p
ack
ets
se
nt
0 100 200 300 400 500 600 700 800 9000
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5x 10
4 Routing Overhead (1m/s)
Pause Time (secs)
Rou
ting
Ove
rhe
ad (
Pa
cke
ts)
Simulation ResultSimulation Result
Desperate Measures Desperate Measures
• Tried changing the CMUPriQueue length from 50 to 50000. No effect.
• Changed the send_buffer size from 64 to 512 to 65535. No effect
• Changed the ARP_buffer from 64 to 65535. No effect.
• Modified the cbrgen.tcl file to only allow one node to communicate to one other node. No effect.
• Modified the packet size in cbrgen.tcl to generate 256 byte packets then 128 byte packets. This helped.
• Lowering the packet/s rate also helped.
Simulation ResultSimulation Result
Scenario- 1500x300, 50 nodes, 20 sources,20 m/s, 4 256-byte packet/s.
Scenario- 1500x300, 50 nodes, 20 sources,20 m/s, 4 256-byte packet/s.
0 100 200 300 400 500 600 700 800 9000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Packet Delivert Ratio (20m/s)
Pause Time (secs)
#da
ta p
acke
ts r
ece
ive
d/ #
data
pa
cket
s se
nt
0 100 200 300 400 500 600 700 800 9000
0.5
1
1.5
2
x 105 Routing Overhead (20m/s)
Pause Time (secs)R
outin
g O
verh
ead
(P
acke
ts)
Simulation ResultSimulation Result
Scenario- 1500x300, 50 nodes, 20 sources,20 m/s, 4 128-byte packet/s.
Scenario- 1500x300, 50 nodes, 20 sources,20 m/s, 4 128-byte packet/s.
0 100 200 300 400 500 600 700 800 9000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Packet Delivert Ratio (20m/s)
Pause Time (secs)
#da
ta p
ack
ets
re
ceiv
ed/
#da
ta p
ack
ets
sen
t
0 100 200 300 400 500 600 700 800 9000
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
x 105 Routing Overhead (20m/s)
Pause Time (secs)
Rou
ting
Ove
rhe
ad (
Pa
cke
ts)
Simulation ResultSimulation Result
Scenario- 1500x300, 50 nodes, 20 sources,1 m/s, 4 128-byte packet/s.
Scenario- 1500x300, 50 nodes, 20 sources,1 m/s, 4 128-byte packet/s.
0 100 200 300 400 500 600 700 800 9000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Packet Delivert Ratio (1m/s)
Pause Time (secs)
#da
ta p
acke
ts r
ece
ived
/ #
data
pa
cket
s se
nt
0 100 200 300 400 500 600 700 800 9000
2
4
6
8
10
12
14
16
18
x 104 Routing Overhead (1m/s)
Pause Time (secs)
Rou
ting
Ove
rhe
ad
(P
ack
ets
)
17
ConclusionConclusion
• Given a certain packet size, the protocol performs as expected.
• DSR on-demand protocol has low routing-overhead.
• Conduct further investigation of packet size influencing delivery ratio and the effect of denser topologies.
18
Lessons LearnedLessons Learned
• The cbrgen read-me file claims argument –s is max speed when it is speed type. –M is for max speed.
• When simulating DSR, one must use CMUPriQueue or a segmentation fault will occur.
• The send rate parameter at the top of the scenario file is the inverse of the rate argument in the command. When looking at other people’s results, we noticed they claimed 4 packets/s, but sent the same number of packets corresponding to a send rate of 4 (0.25 Packets/s).
19
Thank you !!!Thank you !!!