UDP broadcast/multicast in wireless environment?

493 views
Skip to first unread message

Aniruddha

unread,
Oct 23, 2009, 1:04:29 PM10/23/09
to omnetpp
Hi folks,

I have been trying to build simulations of different scenarios in an
intelligent transportation system (V2V, V2I). A particular scenario
that I want to build involves a traffic light that will periodically
want to broadcast a message (say UDP) on to the wireless channel. This
message could contain the state of the light (red or green) and
timestamp. A vehicle that is approaching the light, may initially be
out of the range, and hence may not receive the initial broadcast
packet, but as soon as it is in the range, it will get the UDP packet,
and act upon it. Other vehicles may also do the same as and when they
are able to get the packet.

I am not able to figure out how this broadcast/multicast capability is
achieved on a wireless channel. What modules must I use? Do I need
some routing file? Do I need to modify any preexisting compound
modules? What settings are needed?

I have been searching this archive but am not hitting upon something
that will help me. I just saw another exchange of emails between Peter
and Alfonso about Broadcast in INETMANET. Maybe my question is related
to that post. Not sure.

thanks
Aniruddha
(p.s., I have a very recent INETMANET workspace updated just last
evening from git repo)

Peter Staab

unread,
Oct 23, 2009, 1:14:35 PM10/23/09
to omn...@googlegroups.com
Hi,

You do (conceptionally) pretty much the same as I do. What you have to
do is to attach an UDP client/server to each vehicle. When you want to
broadcast a message, you have to send the message/packet to IP
255.255.255.255.
But I do not get it working with the current inetmanet version (with old
versions for omnet 3.3 I could patch inetmanet to get broadcasting to
work). Alfonso and I are currently discussing this issue, hopefully with
a positive results in the near future :).

Regards,



Aniruddha schrieb:

Aniruddha

unread,
Oct 25, 2009, 11:14:23 AM10/25/09
to omnetpp
Hi Peter,

I followed your suggestion and created a simple scenario. I was able
to get multicast over wireless working for this scenario (using UDP).
I have a hypothetical traffic light that is attached to an access
point. The traffic light multicasts a UDP packet to mobile hosts over
a wireless channel. Similarly the hosts send some dummy stuff to the
light. I have attached the *.ned file, *.ini file and the routing
files below.

thanks
Aniruddha

------------------------------------------------------------------------
// file WirelessUDPMCast.ned
//
package ITS.WirelessUDPMCast;

import inet.networklayer.autorouting.FlatNetworkConfigurator;
import inet.nodes.wireless.WirelessAPWithEthSimplified;
import inet.nodes.wireless.WirelessHostSimplified;
import inet.nodes.inet.StandardHost;
import inet.world.ChannelControl;


network WirelessUDPMCast
{
parameters:
int numHosts = default(1); // how many hosts you want in the
system
int playgroundSizeX;
int playgroundSizeY;
string mobilityType = default ("NullMobility")
@display("bgb=403,314");

submodules:
host[numHosts]: WirelessHostSimplified {
parameters:
@display("r=,,#707070;p=55,181");
IPForward = true;
routingFile = "whost.mrt";
}

ap: WirelessAPWithEthSimplified {
parameters:
@display("p=213,174;r=,,#707070");
}

light: StandardHost {
parameters:
IPForward = true;
routingFile = "light.mrt";
@display("p=216,250");
}

channelcontrol: ChannelControl {
playgroundSizeX = playgroundSizeX;
playgroundSizeY = playgroundSizeY;
numChannels = 2;
@display("p=61,46");
}

configurator: FlatNetworkConfigurator {
networkAddress = "192.168.0.0";
netmask = "255.255.0.0";
@display("p=140,50");
}

connections:
light.ethg++ <--> ap.ethg++;
}
--------------------------------------------------------------------------------

# filename: whost.mrt
# routing table for host 1 of the wireless UDP set up
# author: Aniruddha Gokhale


ifconfig:

# WLAN interface to the access point. Actually this static route is
not going to
# work if we have more than one host since they will need to have
their own
# IP addresses (potentially assigned by a DHCP server)
name: wlan
inet_addr: 192.168.0.1
MTU: 1500
Metric: 1
BROADCAST MULTICAST
Groups: 225.0.0.1

ifconfigend.

route:

default: * 0.0.0.0 H 0 wlan
225.0.0.1 * 255.255.255.255 H 0 wlan


routeend.
--------------------------------------------------------------------------------------------------------------------

# filename: light.mrt
# routing table for light of the wireless UDP set up
# author: Aniruddha Gokhale


ifconfig:

# WLAN interface to the access point
name: eth0
inet_addr: 192.168.1.1
Mask: 255.255.255.0
MTU: 1500
Metric: 1
BROADCAST MULTICAST
Groups: 225.0.0.1

ifconfigend.

route:

default: * 0.0.0.0 H 0 eth0
225.0.0.1 * 255.255.255.255 H 0 eth0

routeend.

----------------------------------------------------------------------------------------------------------------------
# omnetpp.ini

[General]
network = WirelessUDPMCast
#debug-on-errors = true
tkenv-plugin-path = ../../../etc/plugins

*.playgroundSizeX = 600
*.playgroundSizeY = 400
**.debug = true
**.coreDebug = false
**.channelNumber = 0
**.mobility.x = -1
**.mobility.y = -1

# channel physical parameters
*.channelcontrol.carrierFrequency = 2.4GHz
*.channelcontrol.pMax = 2.0mW
*.channelcontrol.sat = -110dBm
*.channelcontrol.alpha = 2

# nic settings
**.mac.maxQueueSize = 14
**.mac.rtsThresholdBytes = 3000B
**.mac.bitrate = 2Mbps

**.wlan.mac.retryLimit = 7
**.wlan.mac.cwMinData = 7
**.wlan.mac.cwMinBroadcast = 31

# radio settings
**.radio.bitrate = 2Mbps
**.radio.transmitterPower = 2.0mW
**.radio.carrierFrequency = 2.4GHz
**.radio.thermalNoise = -110dBm
#**.radio.sensitivity = -85mW
**.radio.sensitivity = -85dBm
**.radio.pathLossAlpha = 2
**.radio.snirThreshold = 4dB

# access point
**.ap.wlan.mac.address = "10:00:00:00:00:00"
**.ap.relayUnitType = "MACRelayUnitPP"
#**.host[*].wlan4AP.mgmt.accessPointAddress = "10:00:00:00:00:00"
**.mgmt.frameCapacity = 10

# host-specific
**.host*.mobilityType = "MassMobility"
**.host*.mobility.changeInterval = truncnormal(2s, 0.5s)
**.host*.mobility.changeAngleBy = normal(0deg, 30deg)
**.host*.mobility.speed = truncnormal(20mps, 8mps)
**.host*.mobility.updateInterval = 100ms
**.host[*].wlan.mgmt.accessPointAddress = "10:00:00:00:00:00"

# need to make the host associate with the AP right away.
#**.host[*].wlan4AP.mgmtType = "Ieee80211MgmtSTASimplified"

# tcp apps. Let us say each host talks to the stand alone light
**.host[*].numTcpApps = 0 # eventually we may have to support
multiple services
**.host[*].tcpAppType = "TCPBasicClientApp" # http or ftp like
traffic
**.host[*].tcpApp[*].port = -1
# let's say that the 0th appln talks to server
**.host[*].tcpApp[0].connectAddress = "server"
**.host[*].tcpApp[0].connectPort = 5000
**.host[*].tcpApp[0].startTime = 0.2s
**.host[*].tcpApp[0].thinkTime = uniform(1s, 1.5s)
**.host[*].tcpApp[0].idleInterval = uniform(1.5s, 2s)
**.host[*].tcpApp[0].requestLength = 100KB
**.host[*].tcpApp[0].replyLength = 200KB

**.host[*].numUdpApps = 1
**.host[*].udpAppType = "UDPBasicApp"
**.host[*].udpApp[*].localPort = 5000
**.host[*].udpApp[*].destAddresses = "225.0.0.1"
**.host[*].udpApp[*].destPort = 2000 # gets send to light
**.host[*].udpApp[*].messageFreq = 0.5s
**.host[*].udpApp[*].messageLength = 2.48B

# now let us say that the hosts talk to each other in ad hoc fashion
via UDP

**.light.numTcpApps = 0
**.light.tcpAppType = "TCPGenericSrvApp"
**.light.tcpApp[*].port = 5000

**.light.numUdpApps = 1
**.light.udpAppType = "UDPBasicApp"
**.light.udpApp[*].destAddresses = "225.0.0.1"
**.light.udpApp[*].destPort = 5000
**.light.udpApp[*].localPort = 2000
**.light.udpApp[*].messageFreq = 0.1s
**.light.udpApp[*].messageLength = 1024B

# ping app (host[0] pinged by others). Since we don't use it we keep
dest addr as empty
**.pingApp.destAddr = ""
**.pingApp.interval = 10ms
**.pingApp.startTime = uniform(0s, 0.1s)

# tcp settings
#**.tcp.sendQueueClass = "TCPVirtualDataSendQueue"
#**.tcp.receiveQueueClass = "TCPVirtualDataRcvQueue"
## For basic client and generic light classes, we must
## use the following
**.tcp.sendQueueClass = "TCPMsgBasedSendQueue"
**.tcp.receiveQueueClass = "TCPMsgBasedRcvQueue"

# relay unit configuration
#**.relayUnitType = "MACRelayUnitNP"
#**.relayUnit.addressTableSize = 100
#**.relayUnit.agingTime = 120s
#**.relayUnit.bufferSize = 1MB
#**.relayUnit.highWatermark = 512KB
#**.relayUnit.pauseUnits = 300 # pause for 300*512 bit (19200 byte)
time
#**.relayUnit.addressTableFile = ""
#**.relayUnit.numCPUs = 2
#**.relayUnit.processingTime = 2us

#**.wlan4Adhoc.radio.channelNumber = 1

[Config NHosts]
description = "n hosts opening up multiple sessions with light"
# leave numHosts undefined here
*.numHosts = ask
Reply all
Reply to author
Forward
0 new messages