Sie sind auf Seite 1von 29

Seminar at GRC 12 December 2012

(12/12/12)

Simulating IEEE 802.11 in VANETs


(using OMNeT++ and SUMO)

Ali Balador
balador@gmail.com
Last modification: 18 December 2012
The picture was extracted from http://www.ccs-labs.org/teaching/c2x-2012s/01-intro.pdf.

Outline

Pre-Simulation (SUMO)

SUMO setup

Simulation (OMNeT++)

NED file(s)

Ini file(s)

Running simulation

Post simulation&initial results

Pre-Simulation step
(SUMO setup)
1.Extracting the map from
www.OpenStreetMap.org (*.osm)

Extracted from [8]: Tutorial for Simulating VANET and ITS (using OMNeT++ and SUMO), MJ 3
(Thinus) Booysen, july 2012.

Pre-Simulation
(SUMO setup)
2. Creating road network file (convert *.osm to net.xml with
netconvertor)
netconvert --osm rc.osm
3. Generating random trips for road network file (randomTrips.py)
./randomTrips.py -n net.net.xml -l -e 600 -o trips.trips.xml
4. Convert the trips to routes and traffic flows (duarouter)
duarouter -n net.net.xml t trips.trips.xml -o routes.rou.xml
--ignore-errors

Pre-Simulation
(SUMO setup)
Creating config file (sumo.cfg)

Pre-Simulation
(SUMO setup)

Creating obstacles (extract them from osm file by


polyconvert)
polyconvert --net-file net.net.xml --osm-files
map.osm -o map.poly.xml

If the city doesn't include the building layout, it must be drawn with
the JOSM (Java Open Street Map editor) tool.

Referring to obstacles in config file.

<additional-files value="map.poly.xml"/>
6

SUMO overview

Several configuration files needed:

.ned.xml

.edg.xml

.net.xml

.poly.xml

.rou.xml

.sumo.cfg

netconvert

polyconvert

Refers to / Uses

Begin, end time


Simulation time step

Car mobility and road networks

I'm using the pre-defined files that were


prepared by GRC group.

Moscow

Milan

Simulation step

Modeling approach in OMNeT++

Simple vs. compound modules

Messages (can contain arbitrary data)

Gates (input/output)

Connections (within a compound module or between one submodule and compound module)

self-messages

Extracted from [1]: OMNET++ User Manual: http://whale.hit.bme.hu/omnetpp/.

Simulation step

Simulation components:

Behavior

C++ code

Structure

INETMANET package

NED file

Runtime parameters

Omnetpp.ini

10

Simulation step

Simulation components:

Behavior

C++ code

Structure

INETMANET package

NED file

Runtime parameters

Omnetpp.ini

11

Simulation step

Preparing NED file for car:

module Car
{
parameters:
string routingProtocol @enum("AODVUU","DYMOUM","DYMO",
"DSRUU","OLSR","OLSR_ETX","DSDV_2","Batman") = default("");
gates:
...
submodules:
app: UDPBasicBurst
mobility: TraCIMobility
udp: UDP

Module Type
Module Interface

networkLayer: NetworkLayer
wlan: Ieee80211Nic {
manetrouting: <routingProtocol> like ImanetRouting
if routingProtocol != ""
connections allowunconnected:
...
}

12

Simulation step(continue)

Preparing NED file for network scenario:

module Highway
{
submodules:
channelControl: ChannelControl {

parameters:

Channel control

@display("p=256,128");
}

manager: TraCIScenarioManagerLaunchd {
parameters:

determines which nodes are within communication or


interference distance

TraCIScenarioManagerLaunchd

control creation and movement of nodes

@display("p=512,128");
}
}

13

Simulation step(continue)

Modifications in order to add obstacles and using VACaMobil

import inet.world.VACaMobil.VACaMobil;
...
import inet.world.obstacles.ObstacleControl;
import inet.world.annotations.AnnotationManager;
module Highway
{
submodules:
...
manager: VACaMobil {
@display("p=430,35");
}
obstacles: ObstacleControl {
@display("p=282,108");
}
annotations: AnnotationManager {
@display("p=144,108");
}
}

14

Simulation step

Simulation components:

Behavior

C++ code

Structure

INETMANET package

NED file

Runtime parameters

Omnetpp.ini

15

Simulation step(continue)

Preparing ini file:

[General]
network = scenario
sim-time-limit = 3000s
#########################################
**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m
**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 10699m
**.constraintAreaMaxY = 7131m
**.constraintAreaMaxZ = 0m
#########################################
# channel physical parameters
*.channelControl.carrierFrequency = 2.4GHz
*.channelControl.pMax = 2.0mW
*.channelControl.sat = -110dBm
*.channelControl.alpha = 2
*.channelControl.numChannels = 1

16

Simulation step(continue)
# udp apps
**.host[*].app.destAddresses = moduleListByPath("**.host[*]")
**.app.localPort = 1234
**.app.destPort = 1234
**.app.messageLength = 512B # Bytes
**.app.sendInterval = 0.25s + uniform(-0.001s,0.001s,0)
**.app.burstDuration = 0s
**.app.sleepDuration = 0s
**.app.chooseDestAddrMode = "perSend"
**.app.delayLimit =20s
**.app.startTime = simTime()+1s
#################################
# nic settings
**.wlan.bitrate = 54Mbps
**.wlan.opMode = "a"
**.wlan.mgmt.frameCapacity = 10
**.wlan.mgmtType = "Ieee80211MgmtAdhoc"
**.wlan.mac.address = "auto"
**.wlan.mac.maxQueueSize = 14
**.wlan.mac.rtsThresholdBytes = 2346B
**.wlan.mac.retryLimit = 7
**.wlan.mac.cwMinData = ${7, 15, 31}
**.wlan.mac.cwMaxData = 1023
**.wlan.mac.cwMinBroadcast = 15
**.wlan.mac.slotTime = 13us #

1. How can we select random connection (destination)?

In application layer, the destination address must be set to

random_name(host) or

moduleListByPath("**.host[*]")

that is causes one node will be chosen randomly among


the network nodes.
2. How can we run the simulation several times with
different parameter values?

In order to do this, we can assign different values to each


parameter in ini file with ${ }.

Notice that the number of simulation must be mentioned in


run configuration window (config name and run number).
Also, this activity cannot run in command line.

17

Simulation step (last step)


SUMO and OMNeT++
SUMO generates car mobility and
road network
OMNeT++ generates car
configuration details
How can we connect these two parts
to have a VANET simulation?
VEINS

OMNeT++ must be configured to look for mobility module

Veins connects the SUMO and OMNET++, it


means every car in sumo are defined as a node
in OMNET++, veins do this and also make
mobility of nodes in OMNE++.
Veins uses a TCP connection and Python
scripts to enable SUMO to act as a mobility
model in OMNeT++.
sumo-launchd listening for event from
omnet++ and if need any change in SUMO, it is
done in XML format.

Python set up to wait for Veins (module in OMNeT++)


sumo-launchd.py -p 9999 -vv -c/c/user/src/sumo/bin/sumo.exe

back to ini file:


# TraCIScenarioManagerLaunchd
*.manager.updateInterval = 1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.moduleType = "inet.examples.traci_launchd.Car"
*.manager.moduleName = "host"
...
*.manager.launchConfig = xmldoc("sumo-launchd.launch.xml")

18

Simulation step

Modifications in order to add obstacles and using VACaMobil

**.meanNumberOfCars = 50
**.carHysteresisValue = 0
#########################################
# annotations
*.annotations.draw = true
#########################################
# obstacles
*.obstacles.obstacles = xmldoc("map.poly.xml")

19

Running simulation

OMNeT++ can be run under different user interfaces such as:

Tkenv: graphical user interface

Cmdenv: command line user interface

Graphical user interface (Tkenv)

20

Post simulation

Result file formats

Output vector

Capture behavior over time.


Contain several output vectors, each being a named series of (timestamp, value) pairs.

vector 470 scenario.host[15].udp sentPk:vector(packetBytes) ETV


1 117 5.005082890525 512
1 165 5.25059449109 512
1 194 5.501521816618 512

Scalar result

Contain summary statistics: number of packets sent, number of packet drops, average end-to-end delay of received packets, peak
throughput.
Every scalar generates one line in the output file like:

scalar scenario.host[186].udp passedUpPk:count 95


scalar scenario.host[186].udp rcvdPk:count 95
scalar scenario.host[186].udp rcvdPk:sum(packetBytes)

49400

scalar scenario.host[186].udp sentPk:count 2136


scalar scenario.host[186].udp sentPk:sum(packetBytes)

1110720

21

Post simulation&Initial results


Throughput

120000

29000

100000

28000

80000

27000
Throughput

Average Number of Collision

Average Number of Collision

60000

26000

40000

25000

20000

24000

23000
5

10

15

20
CWmin

25

30

35

10

15

20

25

30

35

CWmin

22

23

Next steps
1. Simulating vehicular ad hoc networks with obstacles and generated car mobility by
VACaMobil. [it's done/18.12.2012]
2. Creating a script file to extract and draw final graphs automatically.
3. Reading the IEEE 802.11 implementation to know how it behaves.
1.How can I implement my previous works in omnet++.

4. Reading paper about MAC layer implementation(especially IEEE 802.11p), broadcast


communication, and contention window adaptation. [in parallel with step 3]
5. Evaluate performance of my previous protocol(IEEE 802.11 based MAC protocol) in
vehicular ad hoc networks.
1.Idea: Adapting contention window based on local density estimation
2.Try to find a way to change the way of collision detection (channel monitoring) in my previous works.
3.Compare with other IEEE 802.11-based protocols and also IEEE 802.11p.

6. Reading about IEEE 802.11p and it's implementation in OMNeT. [in parallel with 4 and 5]

24

Broadcast communication in
vehicular ad hoc networks

IEEE 802.11 DCF

RTS/CTS handshaking

ACK packets

They cause collision

Due to lack of capability of collision detection

CWmin does not increase

It shows the necessity of adapting CWmin based


on network density.

25

Research questions

How can IEEE 802.11-based protocols


support broadcast services?

How have previous works detected collisions in


MAC layer? (for broadcast communication)

Which one is suitable for broadcast


communications, contention or contention-free
mechanisms?

26

References
1. OMNET++ User Manual: http://whale.hit.bme.hu/omnetpp/.
2. TicToc tutorial: http://www.omnetpp.org/doc/omnetpp/tictoc-tutorial.
3. IDE user guide: http://omnetpp.org/doc/omnetpp/userguide/index.html.
4. OMNeT++ 4.x Wiki page: http://www.omnetpp.org/pmwiki/index.php?n=Main.Omnetpp4.
5. Contributors: Open street map. www.openstreetmap.org. Accessed 11 November 2012
6. Omnet++ (home site). http://www.omnetpp.org/. Accessed 11 November 2012
7. SUMO Simulation of Urban MObility (home page). http://sumo.sourceforge.net/. Accessed 11
November 2012
8. Tutorial for Simulating VANET and ITS (using OMNeT++ and SUMO), MJ (Thinus) Booysen,
july 2012.
9. SUMO overview, University of Innsbruck.
10. OMNeT++ tutorial. http://www.ccs-labs.org/teaching/nwsim-2012w/02-omnetpp.pdf.

27

I have read these papers

Broadcast communication in vehicular ad hoc


network safety applications.

Simulation-based performance evaluation of


enhanced broadcast schemes for IEEE 802.11based vehicular networks.

Physical layer simulations of IEEE 802.11a for vehicleto-vehicle communications.

28

I am going to read these papers

Enhancements of IEEE 802.11p protocol for


access control on a VANET control channel.

Network status detection-based dynamic


adaptation of contention window in IEEE 802.11p.

A collision alleviation scheme for IEEE 802.11p


VANETs.

29

Das könnte Ihnen auch gefallen