Every VANET tutorial simulates the same German town

A step by step walkthrough for turning an OpenStreetMap bounding box into a working Veins + SUMO + OMNeT++ simulation of your own city, with real connected cars, buildings as radio obstacles, and an accident warning that actually propagates. Built on downtown Orlando, and every step works for your city too.

chaotictoejamNovember 8, 2026

Every Veins tutorial on the internet, mine included, runs the same map. Erlangen, Germany. It is a great example. It is also a small university town that most of us have never been to, and when you are trying to explain to somebody why connected cars matter, "imagine a street you have never seen in a country you have never visited" is kind of a rough opening.

So I rebuilt the whole thing on downtown Orlando. Lake Eola, Orange Avenue, I-4 cutting through the middle. Every street and every building came out of OpenStreetMap. Every car has a simulated 802.11p radio. When one of them breaks down on Robinson Street it warns the cars behind it, a roadside unit repeats the warning, and the traffic reroutes around it.

This article is the whole build, from an empty folder to that running simulation. It also works for your city. You change one bounding box and four other things, and I will tell you exactly which four.

Everything here was built and verified on Fedora with OMNeT++ 6.3.0, Veins 5.3.1 and SUMO 1.22.0, all from the opp_env nix store. The numbers you see in the screenshots are from that run.

What you need first#

This picks up from two earlier videos, so if you do not have a working toolchain yet, start there:

The short version of what you need: an opp_env workspace containing omnetpp-6.3.0, inet-4.6.0 and veins-5.3.1, and a shell where opp_env shell veins-5.3.1 puts netconvert, polyconvert, sumo-gui, veins_launchd and opp_run on your PATH. Everything below runs inside that shell.

The five things you need#

The Erlangen example in Veins is really five things, and we are going to build our own version of each.

  1. A map. Raw OpenStreetMap data for the area.
  2. A road network. SUMO cannot drive on raw map data. netconvert turns it into lanes, junctions and connections.
  3. Buildings. polyconvert pulls the building footprints out of the same map. Veins uses them as radio obstacles.
  4. Traffic. Who drives where, and when.
  5. The OMNeT++ side. A NED network, an omnetpp.ini, and the radio config that ties it all to Veins.

The pipeline looks like this:

downtown_orlando.osm.xml
   ├── netconvert ──────────────► orlando.net.xml
   ├── polyconvert ─────────────► orlando.poly.xml
   └── randomTrips + duarouter ─► orlando.rou.xml
                                        │
                              orlando.sumo.cfg
                                        │
                     Veins (omnetpp.ini + OrlandoScenario.ned)

One rule for the whole build: every step goes into a config file or a script, never a one-off command. When you want to tweak something later you rerun one file. You will see exactly why that matters around step five, when I had to rerun the traffic generator about five times in a row.

Step 1: a new project in the workspace#

We are adding a sibling project next to veins-5.3.1, not editing Veins itself.

cd ~/omnetpp-6.1/vanet-workspace
mkdir -p orlando_downtown/simulations/osm-src
cd orlando_downtown

An OMNeT++ project needs three small files. A .project, so the IDE recognizes it and knows it depends on Veins:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>orlando_downtown</name>
	<comment>Veins 5.3.1 RSU/accident demo on a downtown Orlando, FL road network (OpenStreetMap)</comment>
	<projects>
		<project>veins-5.3.1</project>
	</projects>
	<buildSpec>
	</buildSpec>
	<natures>
		<nature>org.omnetpp.main.omnetppnature</nature>
	</natures>
</projectDescription>

A .nedfolders that says where the NED files live:

echo simulations > .nedfolders

And a simulations/package.ned:

package orlando_downtown.simulations;

@license(LGPL);

Notice there is no src folder and nothing to compile. We are not writing any C++ here. Every module we use (the cars, the roadside unit, the radios) already exists in Veins. Our project is just a scenario.

Step 2: get the map#

Go to openstreetmap.org, pan to your area, and click Export. The panel gives you four numbers: west, south, east, north.

The OpenStreetMap Export panel showing downtown Orlando with the bounding box coordinates in four input fields, I-4 on the left and Lake Eola on the right

For downtown Orlando I used:

Edge Value
West -81.3880
South 28.5340
East -81.3690
North 28.5480

That is about 1.9 by 1.6 kilometers. Keep it small. A bigger map means more cars, more radios and a much slower simulation, and the OSM API caps a single download at 50,000 nodes and 0.25 square degrees anyway.

cd simulations/osm-src
curl -o downtown_orlando.osm.xml \
  "https://api.openstreetmap.org/api/0.6/map?bbox=-81.3880,28.5340,-81.3690,28.5480"

You should get back roughly 7 MB of XML.

First thing that went wrong. My first attempt used the Overpass API, which is what a lot of tutorials point you to, and it handed me back a "406 Not Acceptable" error page instead of data. The main OpenStreetMap API worked on the first try. If one fails, try the other, and if your area is too big for either, the Export panel links out to Geofabrik and the other bulk download mirrors.

One more thing before we move on. This is OpenStreetMap data, so it comes with a license. If you publish anything built from it, credit "© OpenStreetMap contributors" (the data is ODbL).

Step 3: roads, with netconvert#

netconvert turns the raw map into a SUMO network. You can pass it thirty flags on the command line, but you will be rerunning this, so it goes in a config file.

First grab SUMO's OSM type maps, which tell the converters what to do with each kind of OSM way:

cp $SUMO_HOME/data/typemap/osmNetconvert.typ.xml .
cp $SUMO_HOME/data/typemap/osmPolyconvert.typ.xml .

Then osm-src/netconvert.cfg:

<configuration>
    <input>
        <osm-files value="downtown_orlando.osm.xml"/>
        <type-files value="osmNetconvert.typ.xml"/>
    </input>
    <output>
        <output-file value="../orlando.net.xml"/>
        <output.street-names value="true"/>
        <output.original-names value="true"/>
    </output>
    <edge_removal>
        <keep-edges.by-vclass value="passenger"/>
        <remove-edges.by-type value="highway.service,highway.track,highway.unclassified"/>
        <keep-edges.in-geo-boundary value="-81.3880,28.5340,-81.3690,28.5480"/>
        <keep-edges.components value="1"/>
    </edge_removal>
    <processing>
        <geometry.remove value="true"/>
        <roundabouts.guess value="true"/>
        <ramps.guess value="true"/>
        <junctions.join value="true"/>
        <edges.join value="true"/>
        <no-turnarounds.except-deadend value="true"/>
    </processing>
    <tls_building>
        <tls.discard-loaded value="true"/>
        <tls.guess value="false"/>
    </tls_building>
</configuration>

The parts that matter:

Edge removal. OpenStreetMap has every footpath, parking aisle and alley in it. We only want roads a car would drive on, so: keep edges that allow passenger cars, drop service roads, tracks and unclassified ways. keep-edges.components 1 keeps only the largest connected piece of the network, which means no car ever spawns on an island it cannot drive off of.

Processing. Downtown OSM data is full of tiny junctions a few meters apart, from split intersections and divided roads. junctions.join merges them into one real intersection, and that alone removes a pile of weird phantom traffic jams later.

Traffic lights. I am throwing all of them away. That looks like an insane choice for a downtown grid, so hold that thought. I explain it in step five, because that is where I found out I needed it.

Run it:

netconvert -c netconvert.cfg

You will get about a hundred warnings and then, at the end (trimmed):

Warning: 6 total messages of type: Not joining junctions % (%).
Warning: 19 total messages of type: Ignoring restriction relation '%'.
Warning: 79 total messages of type: Removed invalid stop '%' from line '%'.
Warning: 44 total messages of type: Removing pt stop '%' on non existing edge '%'.
Success.

Those are public transport stops and turn restrictions attached to bus and rail data on roads we just deleted. They are safe to ignore. "Success." is the line you care about.

Now look at it:

sumo-gui -n ../orlando.net.xml

sumo-gui showing the downtown Orlando road network as bare black lines, with the I-4 interchange curving through the lower left and the downtown street grid to the right

That is downtown Orlando as a drivable road network: 685 road segments. You can count yours with grep -c '<edge id="[^:]' orlando.net.xml (the [^:] skips SUMO's internal junction edges).

Step 4: buildings, with polyconvert#

Here is the reason we are doing this in Veins and not just in SUMO. Radio at 5.9 GHz does not go through buildings well. Veins can model that, but only if it knows where the buildings are.

osm-src/polyconvert.cfg:

<configuration>
    <input>
        <net-file value="../orlando.net.xml"/>
        <osm-files value="downtown_orlando.osm.xml"/>
        <type-file value="osmPolyconvert.typ.xml"/>
    </input>
    <output>
        <output-file value="../orlando.poly.xml"/>
    </output>
    <prunning>
        <prune.in-net value="true"/>
        <prune.in-net.offsets value="0,0,0,0"/>
    </prunning>
</configuration>

Two details matter here. First, we pass in the network file. That makes polyconvert use exactly the same coordinate projection netconvert used, so the buildings line up with the streets instead of sitting a hundred meters off. Second, prune.in-net drops anything outside the road network's boundary.

And yes, it really is spelled prunning in SUMO's config schema. That is not my typo, and fixing it will break your config.

polyconvert -c polyconvert.cfg
grep -c 'type="building"' ../orlando.poly.xml

That prints 691. Every polygon of type building becomes a radio obstacle in Veins, and building is the exact type name the Veins obstacle config looks for. Parks and water get converted too, but those are just for looks.

Load the network with the polygons on top:

sumo-gui -n ../orlando.net.xml -a ../orlando.poly.xml

The same road network in sumo-gui, now with 691 building footprints in pink, parks in green, and Lake Eola clearly visible on the right side

Lake Eola is the green blob on the right. If your buildings show up shifted away from your roads, you forgot the net-file line.

Step 5: traffic, and why I deleted every traffic light#

For this demo I want two kinds of traffic.

A stream of cars on one street. The demo app in Veins makes the very first car in the simulation break down. I want that to happen somewhere interesting, with cars behind it that can actually reroute. So I put a steady flow of cars heading west on Robinson Street, from Lake Eola toward I-4, and I make sure it starts first. The first car of that flow becomes node[0] in OMNeT++.

Background traffic everywhere else, so there are plenty of radios on screen.

To build that corridor flow I need SUMO's IDs for the two ends of Robinson Street. You can click them in sumo-gui, or ask sumolib:

import sumolib
net = sumolib.net.readNet("orlando.net.xml")
for e in net.getEdges():
    if "Robinson" in e.getName():
        print(e.getID(), "|", e.getName(), "|",
              e.getFromNode().getCoord(), "->", e.getToNode().getCoord())

That prints 26 edges. Here are the four that matter:

-73541769#1 | East Robinson Street | (2038.85, 1837.56) -> (1908.1, 1836.86)
-11193647#4 | East Robinson Street | (1166.21, 1832.46) -> (1012.69, 1833.32)
947062713#0 | West Robinson Street | (1012.69, 1833.32) -> (737.97, 1836.84)
215671209#3 | West Robinson Street | (236.53, 1838.57) -> (42.66, 1838.96)

Read the coordinates, not the names. Robinson runs east to west across the map, so westbound means decreasing x. -73541769#1 starts at x=2038 and heads west, so that is my east end. 215671209#3 finishes at x=42, so that is my west end. Note that 215671209#3 and -215671209#3 are the same street in opposite directions, which is why you cannot pick these by name alone. Those two IDs are the only thing in the traffic script that is specific to Orlando.

Then one script generates everything. osm-src/make_routes.sh:

#!/bin/sh
set -e
cd "$(dirname "$0")"
python3 "$SUMO_HOME/tools/randomTrips.py" -n ../orlando.net.xml -o background.trips.xml \
  --seed 42 --begin 2 --end 400 --period 1.5 --fringe-factor 5 --min-distance 600 \
  --edge-permission passenger --prefix bg --trip-attributes 'type="bg"' --validate
cat > corridor.trips.xml <<'XML'
<routes>
    <vType id="car" accel="2.6" decel="4.5" sigma="0.5" length="4.5" minGap="2.5" maxSpeed="14" color="1,1,0"/>
    <vType id="bg"  accel="2.6" decel="4.5" sigma="0.5" length="4.5" minGap="2.5" maxSpeed="14" color="0.3,0.7,1"/>
    <flow id="robinson" type="car" begin="0" end="400" period="8" from="-73541769#1" to="215671209#3" departLane="best" departSpeed="max"/>
</routes>
XML
duarouter -n ../orlando.net.xml --route-files corridor.trips.xml,background.trips.xml \
  -o ../orlando.rou.xml --ignore-errors --no-step-log --no-warnings --seed 42
rm -f ../orlando.rou.alt.xml routes.rou.xml

The corridor cars are yellow, the background cars are blue, and you can tell them apart in every single shot after this. Fixed seeds mean the same traffic every run, which matters enormously when you are trying to record the same moment twice. randomTrips creates trips that have only a start and an end; duarouter turns those into full routes.

Now, the traffic lights.

Here is how the Veins demo app decides there has been an accident: any car whose speed stays under one meter per second for ten seconds broadcasts "this road is blocked."

Any car. Including a car sitting at a red light.

My first version of this map had all 54 of downtown Orlando's traffic signals in it. Every red light longer than ten seconds produced a fake accident report, and the cars around it rerouted away from perfectly good roads. It was an excellent demonstration of why you should not trust unauthenticated broadcast messages, and a terrible demonstration of the thing I was actually trying to show. So the signals are gone and the intersections become priority junctions. That is what those four tls_building lines back in netconvert.cfg are doing.

Then I checked it, because "it should be fine now" is not a measurement. Run SUMO headless, with no OMNeT++ in the picture at all, and log every car's position:

sumo -c ../orlando.sumo.cfg --end 200 --fcd-output fcd.xml

Then count which cars sat under 1 m/s for ten seconds or more. Even with no lights, a few side street cars waiting to cross Robinson still sat long enough to trip the rule. So I tuned the density down: the corridor went from a car every 4 seconds to one every 8, and the background from every 1.2 seconds to every 1.5. After that, nothing stopped for ten straight seconds until 146 seconds into the run, which is well after the breakdown I care about. Zero teleports, too, which is SUMO's term for a car that got so stuck the simulator gave up and relocated it.

That is the "config file, not one-off command" rule paying for itself. I reran that script about five times. You will do the same for your city, and you will be glad it is one command.

Step 6: the SUMO config#

simulations/orlando.sumo.cfg ties the three generated files together:

<configuration>
    <input>
        <net-file value="orlando.net.xml"/>
        <route-files value="orlando.rou.xml"/>
        <additional-files value="orlando.poly.xml"/>
    </input>
    <time>
        <begin value="0"/>
        <end value="1000"/>
        <step-length value="0.1"/>
    </time>
    <report>
        <xml-validation value="never"/>
        <xml-validation.net value="never"/>
        <no-step-log value="true"/>
    </report>
    <gui_only>
        <start value="true"/>
        <gui-settings-file value="orlando.gui.xml"/>
        <window-size value="1920,1080"/>
        <window-pos value="0,0"/>
    </gui_only>
</configuration>

And orlando.gui.xml controls how sumo-gui looks: white background, a starting camera position, and bigger cars.

<viewsettings>
    <scheme name="orlando">
        <opengl antialiase="1"/>
        <background backgroundColor="white" showGrid="0"/>
        <edges laneEdgeMode="0" laneShowBorders="1" showLinkDecals="0" showRails="0"/>
        <vehicles vehicleQuality="2" vehicle_exaggeration="6" vehicle_minSize="1" showBlinker="1" vehicleMode="0"/>
    </scheme>
    <delay value="0"/>
    <viewport zoom="150" x="1230" y="1330"/>
</viewsettings>

That vehicle_exaggeration line matters more than it looks. Zoomed out to a whole city, a real-sized car is about two pixels, and my first recording looked like a completely empty map. Draw them six times bigger and suddenly there is traffic.

The trap: the attribute is vehicle_exaggeration. I first wrote vehicle_size.exaggeration, which looks right, does nothing at all, and produces no error or warning to tell you so.

Here is the whole thing running, 90 seconds in, 54 cars on the map:

sumo-gui running the full simulation: the Orlando street grid with buildings, and dozens of small yellow and blue cars spread across the network

Last SUMO-side file: orlando.launchd.xml. veins_launchd reads it, copies everything into a temp folder, and starts a fresh SUMO for each run.

<?xml version="1.0"?>
<launch>
    <copy file="orlando.net.xml" />
    <copy file="orlando.rou.xml" />
    <copy file="orlando.poly.xml" />
    <copy file="orlando.gui.xml" />
    <copy file="orlando.sumo.cfg" type="config" />
</launch>

Step 7: the OMNeT++ side#

Copy the radio config straight out of the Erlangen example. Nothing in it is specific to a city:

cp ../../veins-5.3.1/examples/veins/config.xml ../../veins-5.3.1/examples/veins/antenna.xml .

config.xml is where obstacle shadowing is turned on: 9 dB lost per building wall crossed, plus 0.4 dB per meter travelled inside one. That is the model that makes our 691 buildings matter instead of just being decoration.

The network, simulations/OrlandoScenario.ned:

package orlando_downtown.simulations;

import org.car2x.veins.nodes.RSU;
import org.car2x.veins.nodes.Scenario;

network OrlandoScenario extends Scenario
{
    submodules:
        rsu[1]: RSU {
            @display("p=150,140;i=veins/sign/yellowdiamond;is=vs");
        }
}

My first run died immediately with:

Declared package '' does not match expected package 'orlando_downtown.simulations'

Once package.ned declares a package, every NED file in that folder has to declare it too. That first line fixes it.

What changes in omnetpp.ini#

Start from a copy of the Erlangen omnetpp.ini. Here is everything that is different, and why.

network = OrlandoScenario
image-path = ../../veins-5.3.1/images

# SUMO network is 2454 m x 2560 m, plus Veins' 25 m margin on each side
*.playgroundSizeX = 2800m
*.playgroundSizeY = 2800m

*.manager.updateInterval = 0.1s
*.manager.launchConfig = xmldoc("orlando.launchd.xml")

# E Robinson St & N Orange Ave
*.rsu[0].mobility.x = 1050
*.rsu[0].mobility.y = 740

*.node[0].veinsmobility.accidentCount = 1
*.node[0].veinsmobility.accidentStart = 60s
*.node[0].veinsmobility.accidentDuration = 50s

Plus one deletion that is easy to miss. The Erlangen ini configures traffic light modules:

*.manager.trafficLightModuleType = "org.car2x.veins.nodes.TrafficLight"
*.tls[*].mobility.x = 0
*.tls[*].applType = "org.car2x.veins.modules.application.traci.TraCIDemoTrafficLightApp"
*.tls[*].logicType ="org.car2x.veins.modules.world.traci.trafficLight.logics.TraCITrafficLightSimpleLogic"

Our network has no traffic lights in it anymore, so all of that goes.

Playground. It has to be bigger than the map. Read the real numbers off the <location> line at the top of your orlando.net.xml:

<location netOffset="..." convBoundary="0.00,0.00,2453.79,2560.26" ... />

So the network is 2453.79 by 2560.26 meters, Veins adds a 25 meter margin on each side, and 2800 square covers it.

Update interval. Erlangen syncs with SUMO once per simulated second. At 14 m/s, that makes cars teleport forward 14 meters at a time in sumo-gui. Matching SUMO's 0.1 second step makes them glide instead.

The roadside unit, and the coordinate flip. I want the RSU at Robinson and Orange. In SUMO that intersection is at x 1013, y 1833 (that is the (1012.69, 1833.32) node from the sumolib output in step five). But OMNeT++ and SUMO disagree about which way y points: SUMO's y goes up, OMNeT++'s goes down. So the conversion is:

x_omnet = x_sumo + 25
y_omnet = (convBoundary_max_y - y_sumo) + 25
  • x: 1013 + 25 = 1038
  • y: 2560.26 - 1833 + 25 = 752

Then I nudged it to 1050, 740 to put it on the northeast corner of the intersection instead of in the middle of the road. Get this wrong and your roadside unit sits in the middle of a lake, broadcasting to nobody, and nothing in the output will tell you that is what happened.

The accident. Erlangen uses node[*0]. That is a wildcard pattern, so it matches node 0, node 10, node 20, node 30 and so on. In our map those would be random background cars breaking down all over downtown at the same moment. node[0] is exactly one car: the first yellow car on the Robinson Street flow. By 60 seconds it is mid-block between Magnolia and Rosalind, one block from the RSU.

Last file. Our project has no binary of its own, so the run script just calls the Veins one:

#!/bin/sh
cd "$(dirname "$0")"
exec ../../veins-5.3.1/bin/veins_run "$@"

Step 8: run it#

Two terminals, both inside the opp_env shell.

In the first, start the launcher and tell it to use sumo-gui so you can watch:

opp_env shell veins-5.3.1
veins_launchd -vv -c sumo-gui

In the second:

cd ~/omnetpp-6.1/vanet-workspace/orlando_downtown/simulations
./run -u Qtenv -c Default

In Qtenv, use Run Until to fast forward to 69 seconds in Express mode, then press Run. node[0] has been stopped since 60 seconds. At about 70 seconds it hits the ten second mark and broadcasts.

OMNeT++ Qtenv at 74.9 seconds: dotted blue lines labelled AirFrame11p fan out from a single stopped car on Robinson Street to node after node across the downtown grid

Every one of those dotted lines is the same message reaching another radio. The RSU at the corner repeats it about two seconds later. Meanwhile over in sumo-gui, the yellow cars that would have continued west on Robinson turn onto Rosalind instead:

sumo-gui zoomed in on Robinson Street near Lake Eola, with yellow corridor cars and blue background cars on the downtown grid

Step 9: check the numbers, not the animation#

The animation is convincing, which is exactly why you should not trust it. The scalar results file has the real answer:

grep -E "node.*appl.*receivedWSMs" results/Default-#0.sca | awk '$4>0' | wc -l
grep -E "rsu.*appl.*receivedWSMs" results/Default-#0.sca

For a run stopped at 130 seconds (./run -u Cmdenv -c Default --sim-time-limit=130s) I get 43 and:

scalar OrlandoScenario.rsu[0].appl receivedWSMs 7

So 43 of the 81 cars that existed in the simulation had heard the warning, directly or through a relay, and the roadside unit had repeated it seven times.

One caveat on those counters: receivedWSMs and generatedWSMs count relays too. Do not read generatedWSMs as "number of accidents," because every car that rebroadcasts bumps it.

Bonus: watch the channel fall over#

Try the WithBeaconing config, where every car and the RSU announce themselves once per second:

./run -u Qtenv -c WithBeaconing

Qtenv showing the whole OMNeT++ playground with the Orlando map inside it, cars beaconing, and a message counter reading 25,475 created

This shot is also the clearest look at what the OMNeT++ side actually is: the grey rectangle is the 2800 by 2800 meter playground, the map sits inside it, and manager up in the corner is the module talking to SUMO over TraCI.

Look at the message counter at the bottom. The accident run had created 1,546 messages by this point in the simulation. The beaconing run has created 25,475. That is channel congestion, and it is a genuinely hard problem in V2X, not a simulation artifact.

Two other things worth knowing while you watch. Qtenv animates every transmission at microsecond scale, so the moment the broadcasts start, the whole simulation slows to a crawl. That is normal. If you would rather watch sumo-gui in something like real time, add --scheduler-class=omnetpp::cRealTimeScheduler and use Express mode.

Doing this for your city#

Here is the whole list of what changes:

  1. The bounding box. In the curl download and in keep-edges.in-geo-boundary in netconvert.cfg.
  2. The two edge IDs for your corridor flow, from the sumolib lookup in step five.
  3. The playground size and the RSU coordinates, from your own convBoundary and that y-flip.
  4. The traffic density. Run SUMO headless, look for cars stopped for ten seconds or more, and raise the period values until they are gone.

Everything else (the type maps, polyconvert, config.xml, antenna.xml, the NED network, the launchd file, the run script) is identical for any city on Earth.

The thing I did not expect going in was how much of the work was traffic tuning rather than radio configuration. The Veins side was basically a copy job. The part that took five iterations was making a road network where cars behave normally enough that a stopped car actually means something.

Credits and what is next#

Map data © OpenStreetMap contributors, licensed under the ODbL.

I am also making this one as a video, with the screen recording of every step and the parts where it went wrong on camera. It will be linked here when it is out. It pairs with a companion video, What Happens When Your Car Talks to Another Car, out November 16, which uses this exact simulation to explain why a car broadcasts instead of calling, what buildings do to a 5.9 GHz signal, and why nobody retransmits.

If you build this for your city, I want to see it. This site does not have comments, so once that video is up the comment section there is the place for it. Drop your bounding box and I will tell you if it is too big.