RSUs, cars and applications in INET 2.4

1,422 views
Skip to first unread message

Márcio Barbosa

unread,
Aug 5, 2014, 5:08:01 PM8/5/14
to omn...@googlegroups.com
Hello,

I'm learning OMNET, INET, Veins and SUMO to be able do simulate a content downloading application (or something like that) on a vehicular network scenario.
I'm using OMNET 4.4, INET 2.4 and SUMO 0.14.

The basic example that comes with INET is about a car transmitting messages in multicast about accidents. Then I began adapting this to my needs.
What I first did was remove the UDP and use TCP from inet.transport.tcp.TCP.
After that, looking at the RSU.ned present in recent versions of veins (3.3a), I designed a similar RSU module. It has the following submodules: NotificationBoard, HostAutoConfigurator, InterfaceTable, StationaryMobility, RoutingTable, TCP, NetworkLayer and Ieee80211Nic.

Now, instead of developing my own application (wich is something I'm not currently capable of doing) or extending TraciDemo, I imported TCPGenericSrvApp and TCPBasicClientApp for the RSU and Car models, respectively, and ran the simulation.

Nothing terrible happens for quite some time, until I get this error:

<!> Error in module (TCPBasicClientApp) scenario.host[1].app (id=46) at event #13, t=4: Cannot schedule message (cMessage)timer to the past, t=1.

Here comes my questions:
- How can I solve this error? I looked TCPBasicClientApp.cc, searching for the code where it schedules the messages, hoping I could just do something like "schedule = sim_time + 1", but I found nothing.

- Should it work? Should these available sample applications present in INET work in a vehicular scenario at all?

- I instantiated a single RSU on my network NED file, scenario.net. In omnetpp.ini I set its position like this:
*.rsu[0].mobility.initialX = 7300m
*.rsu[0].mobility.initialY = 6600m
*.rsu[0].mobility.initialZ = 3m
Now, I can visualize it under OMNeT++/Tkenv window, but, once the simulation starts, it is nowhere near the cars, where I'd like it to be.  I assumed 7300, 6600 would be approriate to put it next to the first batch of cars, because, when I inspected their modules, their lastPositionX (or something like that) variable had a similar value. The coordinates system itself is really confusing, SUMO-GUI shows me a lot of different values for x,y, that seems to have nothing to do with those I can access through Tkenv...

I hope all these questions doesn't overwhelm anyone, I'd really appreciate some help.
Thanks in advance.

Christoph Sommer

unread,
Aug 6, 2014, 3:58:54 AM8/6/14
to omn...@googlegroups.com
Dear Márcio,

Márcio Barbosa wrote:
> /<!> Error in module (TCPBasicClientApp) scenario.host[1].app (id=46) at
> event #13, t=4: Cannot schedule message (cMessage)timer to the past, t=1./
>
> Here comes my questions:
> - How can I solve this error?

I would suggest looking at a stack trace to find out what led to this error.

The Veins FAQ has an entry on debugging and generating stack traces.


>
> - Should it work? Should these available sample applications present in
> INET work in a vehicular scenario at all?

Some sample applications (as you noticed) do not cope well with starting
after t=0 or finishing before the simulation ends. Aside from that they
should work just fine.

> The coordinates system itself is really confusing, SUMO-GUI shows me a lot
> of different values for x,y, that seems to have nothing to do with those
> I can access through Tkenv...

The Veins FAQ has an entry on this as well.

You can find it online at
http://veins.car2x.org/documentation/faq/


Best,

Christoph


--
Dr. Christoph Sommer
Distributed Embedded Systems Group
University of Paderborn, Germany
http://www.ccs-labs.org/~sommer/

Márcio Barbosa

unread,
Aug 18, 2014, 10:39:42 PM8/18/14
to omn...@googlegroups.com
Hi, again, Cristoph

I've managed to debug it and find a problematic line of code that made the simulation crash because of the start time and fix it.

Now, my thought process was, "TCPGenericSrvApp" and "TCPBasicClientApp" are apparently working, so I should just put the RSU near the cars and see if it produces results". And it did not. I think that's because I'm still struggling with the coordinates. Yes, I read the Veins FAQ, and saw that it automatically converts from different coordinates systems, but... it didn't help.

In this screenshot ( http://i.imgur.com/s1WDIDg.png ) I can see, from scenario.rsu[0].mobility and scenario.host[0], InitialX/Y and LastPositionX/Y that they are close. Can I be sure that they really are close? I mean, should I take it for granted and start looking into other possible reasons why information is not being exchanged? Do you happen to know how can I make it so that the RSU shows up on SUMO-GUI, so I can rest assured it's there and be able to sleep at night?

About trying to make it show up in sumo-gui, I thought about modeling it as a car who doesn't move, but something tells me there's gotta be a simpler way...

Well, thanks a lot!
Best,

Márcio Vinícius Barbosa



--
You received this message because you are subscribed to a topic in the Google Groups "omnetpp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/VbsCEfD6V9k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christoph Sommer

unread,
Aug 21, 2014, 9:42:39 AM8/21/14
to omn...@googlegroups.com
Márcio Barbosa wrote:
> In this screenshot ( http://i.imgur.com/s1WDIDg.png ) I can see, from
> scenario.rsu[0].mobility and scenario.host[0], InitialX/Y and
> LastPositionX/Y that they are close.

Looking at the screenshot it seems like rsu[0] is at the top left corner
and all host[*] are in the bottom right corner. It is a bit hard to make
out because all of the names are overlapping.

It also seems like nodes in the top left corner and in the bottom right
corner are not in each others' interference range (the grey circle).

There is no way they can communicate from this far.


> Do you happen to know how can I make it so that the RSU shows up on SUMO-GUI, so I can
> rest assured it's there and be able to sleep at night?

You can manually get the coordinates of the host (if I recall correctly,
by asking the channel control) and add an annotation
(AnnotationManager::drawPoint). The annotation will show up in the SUMO GUI.
Note that the AnnotationManager takes care of transforming the
coordinates you supply from Coord (OMNeT++ coordinate) to TraCICoord
(SUMO coordinate).

Márcio Barbosa

unread,
Aug 25, 2014, 8:58:35 PM8/25/14
to omn...@googlegroups.com
Ok, figured it out.

The "bool initFromDisplayString = default(true)" prevented the InitialX/Y parameters from being used.
After changing it to false, I could, finally, position them where I wanted.


Now, the TCP connection between the RSU and the car gets established, apparently, as seen on this piece of output shown in OMNeT++/Tkenv:
"** Event #121  T=2.005651626442  scenario.rsu[0].tcp (TCP, id=11), on `tcpseg(l=200)' (TCPSegment, id=140)
Connection 10.0.0.4:1000 to 10.0.0.23:1025  on app[0], connId=3  in ESTABLISHED
Seg arrived: .1025 > .1000: [500001..500201) (l=200) ack 500556 win 7504 
TCB: snd_una=500556 snd_nxt=500556 snd_max=500556 snd_wnd=7504 rcv_nxt=500001 rcv_wnd=7504 snd_cwnd=536 rto=3 ssthresh=65535
rcv_nxt changed to 500201, (delayed ACK disabled) sending ACK now
Sending: .1000 > .1025: ack 500201 win 7504 
Staying in state: ESTABLISHED (no FSM event)"

After a few events, this occurs on host[0] (a car):
"** Event #141  T=2.00651385879  scenario.host[0].tcp (TCP, id=30), on `ACK' (TCPSegment, id=157)
Connection 10.0.0.23:1025 to 10.0.0.4:1000  on app[0], connId=2  in ESTABLISHED
Seg arrived: .1000 > .1025: ack 500201 win 7504 
TCB: snd_una=500001 snd_nxt=500201 snd_max=500201 snd_wnd=7504 rcv_nxt=500556 rcv_wnd=7504 snd_cwnd=536 rto=3 ssthresh=65535
Updating send window from segment: new wnd=7504
Round-trip time measured on rtseq=500001: 3ms
Measured RTT=3.413929394ms, updated SRTT=0.426741174ms, new RTO=2627.133705874ms
ACK acks all outstanding segments, cancel REXMIT timer
cwnd <= ssthresh: Slow Start: increasing cwnd by one SMSS bytes to cwnd=1072
Staying in state: ESTABLISHED (no FSM event)"

After that things get really confusing, because more cars enter the scenario, more messages are exchanged, etc...

So, the simulation doesn't crash and runs until the end, but the application is not transmitting data. I think that's because there's a problem with my settings somewhere on the lower layers.

Both, car and rsu, modules have these submodules this:
networkLayer: NetworkLayer {
            parameters:
                proxyARP = false;
                @display("p=304,327;q=queue");
            gates:
                ifIn[1];
                ifOut[1];
        }
        wlan: Ieee80211Nic {
            parameters:
                @display("p=304,461;q=queue");
        }

Also, management type of the Ieee80211Nic for both of them is set to Ieee80211MgmtAdHoc.
Also, TCPBasicClientApp, wich runs on the cars, use the symbolic connectAddress parameter "rsu[*]". and bytecount dataTransferMode.

These are the information that I think may be related to the problem.
Do you have any idea about what might be wrong with the scenario? 
Thanks a lot for the immense help.

Best,
Márcio Vinícius Barbosa


Márcio Barbosa

unread,
Aug 26, 2014, 7:02:44 PM8/26/14
to omn...@googlegroups.com
Completely disregard my previous post, please.

I used the TCPEchoApp application on the RSU, instead of TCPGenericSrvApp and things ran so much better. What I'd need to know, now, is how to make sure cars establish a connection to different RSUs, when not in range of the first one.

In my scenario, they're connecting to the first, transferring information as it should, but the other RSUs are just not being used. I think setting the management type of the IEE80211NIC  on the RSU to IEEE80211MgmtAP  and to IEE80211MgmtSTA on the cars should do it, right? I want to be sure there's no other, simpler, way, because the last time I tried these management types, the simulation ended up crashing because of "unrecognizable packet type on the IP layer", or something like that...

Right now I'm using the symbolic connectAddress parameter  = "rsu[*]", on the cars tcp application. I thought that would make it so that the cars would try to connect to any RSU available, but that is not happening. I'm also using Ieee80211MgmtAdHoc as the NICs management type, for both rsu and cars.

Thanks,
Márcio Vinícius Barbosa

Micah Alexander

unread,
Apr 18, 2016, 6:34:46 PM4/18/16
to OMNeT++ Users
Hi Marcio! I know this thread has been dead for a while, but I'm hoping that you might see this anyway. I am currently in a very similar situation to the one you had, and I also cannot get TCP data to transmit.

I have CAR.ned and RSU.ned, both containing submodules: NotificationBoard, HostAutoConfigurator, InterfaceTable, Mobility, RoutingTable, TCP, NetworkLayer and Ieee80211Nic.

In the CAR.ned, the mobility type is TraCIMobility and in the RSU.ned, the mobility type is LinearMobility with a speed of 0.

I have created one RSU in my own scenario NED file, and I am trying to send TCP traffic from the cars to the RSU. In order to do this, I have imported TCPBasicClientApp to the CAR.ned, and TCPGenericSrvApp to the RSU.ned.

I can see my RSU node, and it is within range of at least some of the cars. I know this because I am running AODVUU routing protocol and the cars that are in range of the RSU will send RREP and RREQ messages to the RSU (they will also send them to each other), but I cannot for the life of me figure out how to send actual TCP data. (I can't even get the "Connection Established" events that you mention above. I get nothing.) When I run the simulation, the only messages that pass are RREP and RREQ messages from AODV. No data is ever passed.

Below I will include the files of interest. Credit goes to https://github.com/chaotictoejam/VANETProject , I started from that base and am trying to adapt it to fit my needs.

My scenario.ned file:

package micahsim.simulations.aodvuu;
import  micahsim.simulations._nodes.RSU;

network AODVUUSim extends micahsim.simulations._nodes.Scenario
{
    submodules:
        rsu[1]: RSU {
            @display("p=150,140;b=10,10,oval");
        }
}


My CAR.ned file:

package micahsim.simulations._nodes;
import inet.applications.tcpapp.TCPSessionApp;
import inet.applications.traci.TraCIDemo;
import inet.base.NotificationBoard;
import inet.linklayer.ieee80211.Ieee80211Nic;
import inet.mobility.contract.IMobility;
import inet.networklayer.IManetRouting;
import inet.networklayer.autorouting.ipv4.HostAutoConfigurator;
import inet.networklayer.common.InterfaceTable;
import inet.networklayer.ipv4.RoutingTable;
import inet.nodes.inet.NetworkLayer;
import inet.transport.tcp.TCP;
import inet.applications.tcpapp.TCPBasicClientApp;

module Car
{
    parameters:
        @node();
        string mobilityType = default("TraCIMobility");
        networkLayer.configurator.networkConfiguratorModule = "";
        string routingProtocol @enum("AODVUU","DYMOUM","DYMO","DSRUU","OLSR","OLSR_ETX","DSDV_2","Batman","GPSR") = default("");  // used mobile routing protocol
    gates:
        input radioIn @directIn;
    submodules:
        notificationBoard: NotificationBoard {
            parameters:
                @display("p=140,462");
        }
        ac_wlan: HostAutoConfigurator {
            @display("p=296,402");
        }
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=140,326");
        }
        routingTable: RoutingTable {
            parameters:
                IPForward = true;
                routerId = "";
                routingFile = "";
                @display("p=60,326");
        }
        tcp: TCP {
            parameters:
                @display("p=384,146");

        }
        networkLayer: NetworkLayer {
            parameters:
                proxyARP = false;
                @display("p=304,327;q=queue");
            gates:
                ifIn[1];
                ifOut[1];
        }
        mobility: <mobilityType> like IMobility {
            parameters:
                @display("p=60,459");

        }
        wlan: Ieee80211Nic {
            parameters:
                @display("p=304,461;q=queue");
        }
        manetrouting: <routingProtocol> like IManetRouting if routingProtocol != "" {
            @display("p=522,307");
        }
        tcpApp: TCPBasicClientApp {
            parameters:
                startTime = simTime() + 1s;
                connectAddress = "rsu[*]";
                connectPort = 1000;
            @display("p=384,58");
        }
    connections allowunconnected:
        tcp.appOut++ --> tcpApp.tcpIn;
        tcp.appIn++ <-- tcpApp.tcpOut;

        tcp.ipOut --> networkLayer.transportIn++;
        tcp.ipIn <-- networkLayer.transportOut++;

        wlan.upperLayerOut --> networkLayer.ifIn[0];
        wlan.upperLayerIn <-- networkLayer.ifOut[0];

        radioIn --> wlan.radioIn;

        networkLayer.transportOut++ --> manetrouting.from_ip if routingProtocol != "";
        networkLayer.transportIn++ <-- manetrouting.to_ip if routingProtocol != "";
}


My RSU.ned file:

package  micahsim.simulations._nodes;

import inet.base.NotificationBoard;
import inet.networklayer.autorouting.ipv4.HostAutoConfigurator;
import inet.networklayer.common.InterfaceTable;
import inet.applications.traci.TraCIDemo;
import inet.mobility.single.LinearMobility;
import inet.networklayer.ipv4.RoutingTable;
import inet.transport.tcp.TCP;
import inet.nodes.inet.NetworkLayer;
import inet.linklayer.ieee80211.Ieee80211Nic;
import inet.networklayer.IManetRouting;
import inet.mobility.contract.IMobility;
import inet.applications.tcpapp.TCPGenericSrvApp;

module RSU
{
    parameters:
        @node();
        string mobilityType;
        networkLayer.configurator.networkConfiguratorModule = "";
        string routingProtocol @enum("AODVUU","DYMOUM","DYMO","DSRUU","OLSR","OLSR_ETX","DSDV_2","Batman", "GPSR", "GPSRU") = default("");  // used mobile routing protocol
    gates:
        input radioIn @directIn;
    submodules:
        notificationBoard: NotificationBoard {
            parameters:
                @display("p=140,462");
        }
        ac_wlan: HostAutoConfigurator {
            @display("p=296,402");
        }
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=140,326");
        }
        mobility: <mobilityType> like IMobility {
            parameters:
                @display("p=60,459");
        }
        routingTable: RoutingTable {
            parameters:
                IPForward = true;
                routerId = "";
                routingFile = "";
                @display("p=60,326");
        }
        tcp: TCP {
            parameters:
                @display("p=384,146");

        }
        networkLayer: NetworkLayer {
            parameters:
                proxyARP = false;
                @display("p=304,327;q=queue");
            gates:
                ifIn[1];
                ifOut[1];
        }
        wlan: Ieee80211Nic {
            parameters:
                @display("p=304,461;q=queue");
        }
        tcpApp: TCPGenericSrvApp {
            parameters:
                localAddress = "rsu[*]";
                localPort = 1000;
            @display("p=384,58");
        }
    connections allowunconnected:
        tcp.appOut++ --> tcpApp.tcpIn;
        tcp.appIn++ <-- tcpApp.tcpOut;

        tcp.ipOut --> networkLayer.transportIn++;
        tcp.ipIn <-- networkLayer.transportOut++;
       
        wlan.upperLayerOut --> networkLayer.ifIn[0];
        wlan.upperLayerIn <-- networkLayer.ifOut[0];

        radioIn --> wlan.radioIn;
}

And my .ini file:

[General]
debug-on-errors = true
cmdenv-express-mode = true
cmdenv-autoflush = true
cmdenv-status-frequency = 2s
record-eventlog = true

#tkenv-default-config = debug
#tkenv-default-run = 1
tkenv-image-path = bitmaps

#ned-path = ../../src/base;../../src/modules;../../examples;
network = AODVUUSim

num-rngs = 3
**.mobility.rng-0 = 1
**.wlan[*].mac.rng-0 = 2

##########################################################
#            Simulation parameters                       #
##########################################################
print-undisposed = false

sim-time-limit = 3000s

**.scalar-recording = true
**.vector-recording = true

**.debug = false
**.coreDebug = false

*.playgroundSizeX = 2500m
*.playgroundSizeY = 2000m
*.playgroundSizeZ = 50m

*.annotations.draw = false
*.obstacles.debug = false
*.world.useTorus = false
*.world.use2D = false

##########################################################
#            Channel Physical Parameters                 #
##########################################################

*.channelControl.carrierFrequency = 2.4GHz
*.channelControl.pMax = 2.0mW
*.channelControl.sat = -110dBm
*.channelControl.alpha = 2
*.channelControl.numChannels = 1
*.channelControl.propagationModel = "NakagamiModel"
*.channelControl.maxInterferenceDistance = 400m

##########################################################
#            TraCIScenarioManager parameters             #
##########################################################
*.manager.updateInterval = 0.1s
*.manager.host = "localhost"
*.manager.port = 9999
*.manager.moduleType = "micahsim.simulations._nodes.Car"
*.manager.moduleName = "vehicle"
*.manager.moduleDisplayString = ""
*.manager.autoShutdown = true
*.manager.margin = 25

##########################################################
#                       RSU SETTINGS                     #
#                                                        #
#                                                        #
##########################################################
*.rsu[*].mobilityType = "LinearMobility"
*.rsu[*].mobility.speed = 0mps
*.rsu[0].mobility.x = 0
*.rsu[0].mobility.y = 0
*.rsu[0].mobility.z = 3
#*.rsu[*].appType = "TraCIDemoRSU11p"
#*.rsu[*].app.headerLength = 256 bit
#*.rsu[*].app.sendBeacons = false
#*.rsu[*].app.dataOnSch = false
#*.rsu[*].app.sendData = false
#*.rsu[*].app.beaconInterval = 1s
#*.rsu[*].app.dataPriority = 2
#*.rsu[*].app.maxOffset = 0.005s

##########################################################
#                                                        #
#                    NIC-Settings                        #
##########################################################
**.wlan.bitrate = 54Mbps
**.wlan.opMode = default
**.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.cwMinMulticast = 15
**.wlan.mac.slotTime = 13us

**.wlan.radio.transmitterPower = 2mW
**.wlan.radio.thermalNoise = -110dBm
**.wlan.radio.sensitivity = -85dBm
**.wlan.radio.pathLossAlpha = 2
**.wlan.radio.snirThreshold = 4dB

##########################################################
#                    WaveAppLayer                        #
##########################################################
#*.vehicle[*].applType = "TraCIDemo11p"
#**.app.debug = false
#**.app.headerLength = 512 bit
#**.app.sendBeacons = false
#**.app.dataOnSch = false
#**.app.sendData = true
#**.app.beaconInterval = 1s
#**.app.beaconPriority = 3
#**.app.dataPriority = 2
#**.app.maxOffset = 0.005s

##########################################################
#                      Mobility                          #
##########################################################

*.vehicle[*].mobilityType = "TraCIMobility"
#*.vehicle[*].mobilityType.debug = true
*.vehicle[*].mobility.x = 0
*.vehicle[*].mobility.y = 0
*.vehicle[*].mobility.z = 1.895

#*.vehicle[*0].mobility.accidentCount = 1
#*.vehicle[*0].mobility.accidentStart = 75s
#*.vehicle[*0].mobility.accidentDuration = 30s

#**.constraintAreaMinX = 0m
#**.constraintAreaMinY = 0m
#**.constraintAreaMinZ = 0m
#**.constraintAreaMaxX = 10699m
#**.constraintAreaMaxY = 7131m
#**.constraintAreaMaxZ = 0m

##########################################################
#                   UDP Apps(off)                         #
##########################################################
#**.vehicle[*].udpApp.destAddresses = moduleListByPath("**.rsu[*]")
#**.vehicle[*].udpApp[*].typename = "UDPBasicBurst"
#**.vehicle[*].numUdpApps = 1
#**.udpApp.localPort = 1234
#**.udpApp.destPort = 1234
#**.udpApp.messageLength = 512B
#**.udpApp.sendInterval = 0.25s + uniform(-0.001s,0.001s)
#**.vehicle[*].udpApp.burstDuration = 0
#**.udpApp.chooseDestAddrMode = "perSend"
#**.udpApp.sleepDuration = 0s
#**.udpApp.burstDuration = 0s
#**.udpApp.delayLimit = 20s
#**.udpApp.startTime = simTime()+1s

######################################################################
# manet routing
######################################################################
**.routingProtocol = "inet.networklayer.manetrouting.AODVUU"
#**.manetrouting.manetmanager.routingProtocol = "AODVUU"
**.manetrouting.interfaces = "prefix(wlan)"
**.active_timeout = 3s
**.hello_jittering = false
**.optimized_hellos = false
**.expanding_ring_search = false
**.local_repair = true
**.rreq_gratuitous = false
**.rt_log_interval = 0
**.unidir_hack = 0
**.internet_gw_mode = 0
**.receive_n_hellos = 1
**.ratelimit = 1000
**.llfeedback = false# //1000
**.wait_on_reboot = 0
**.active_timeout = 1000ms # // time in ms
**.internet_gw_address = "0.0.0.0"
######################################################################

######################################################################
# AODV Config
######################################################################

[Config AODVUU-Simple-100]
description = "AODVUU"
*.manager.launchConfig = xmldoc("..\\_maps\\simple\\sumotest100.launchd.xml")
*.**.nic.phy80211p.decider = xmldoc("..\\_maps\\simple\\config.xml")
*.**.nic.phy80211p.analogueModels = xmldoc("..\\_maps\\simple\\config.xml")
*.playgroundSizeX = 2500m
*.playgroundSizeY = 2000m
*.playgroundSizeZ = 50m
**.roiRects = "0,100-2200,2000"#x,y-X,Y


I am going to make a new post with the same info, I just thought I would try asking you directly, since you faced the same issue. Thanks!

-Micah Alexander
Reply all
Reply to author
Forward
0 new messages