Hi,
I think you stumbled onto the same bug that is reported here:
http://www.nsnam.org/bugzilla/show_bug.cgi?id=451
Try the patch listed in that bug report; it should clear the problem for
you.
Tom
I looked at this a bit more carefully. First, it helps to increase the
time of the simulation to let OLSR converge. I set the simulation stop
time to 130 seconds, and started the Tcp flow at 100 sec.
Despite this, Olsr is not finding the correct next hop, for some reason.
If I put your program in scratch/test.cc, and turn on logging, such as:
NS_LOG="OlsrRoutingTable" ./waf --run scratch/test
I see in the log:
100s OlsrRoutingTable:RequestRoute(): Olsr node 10.1.1.3: RouteRequest
for dest=10.1.1.1 --> nestHop=10.1.1.1 interface=1
The next hop should be 10.1.1.2, I think. I'll have to look next at
OLSR; will look at it tomorrow.
Global routing will not work in this case; global routing assumes that
everyone is reachable on the link (it does not take into account the
wireless effects). One could conceivably avoid this by putting each
interface on a /32, but this is not supported (see bug 402):
http://www.nsnam.org/bugzilla/show_bug.cgi?id=402
Tom
2.44252s [node 2] OlsrAgent:RecvOlsr(): OLSR node 10.1.1.3 received a OLSR packet from 10.1.1.1 to 10.1.1.3I know the OLSR logging is kind of messy, but basically it says that 10.1.1.3 received a HELLO from 10.1.1.1, and the two nodes at that point are considered symmetric neighbors. So naturally the shortest path from 10.1.1.3 to 10.1.1.1 is a direct hop. Looking at pcap traces confirms this via other means: ARP request/response exchanges happen directly between 10.1.1.1 and 10.1.1.3.
2.44252s [node 2] OlsrAgent:RecvOlsr(): Olsr Msg received with type 1 TTL=1 origAddr=10.1.1.1
2.44252s [node 2] OlsrAgent:RecvOlsr(): 2.44252s OLSR node 10.1.1.3 received HELLO message of size 32
2.44252s [node 2] OlsrAgent:LinkSensing(): @2.44252: Olsr node 10.1.1.3: LinkSensing(receiverIface=10.1.1.3, senderIface=10.1.1.1) BEGIN
2.44252s [node 2] OlsrAgent:LinkSensing(): Existing link tuple already exists => will update it
2.44252s [node 2] OlsrAgent:LinkSensing(): Looking at HELLO link messages with Link Type 1 (ASYM_LINK) and Neighbor Type 0 (NOT_NEIGH)
2.44252s [node 2] OlsrAgent:LinkSensing(): -> Neighbor: 10.1.1.2
2.44252s [node 2] OlsrAgent:LinkSensing(): \-> *neighIfaceAddr (10.1.1.2 != receiverIface (10.1.1.3) => IGNORING!
2.44252s [node 2] OlsrAgent:LinkSensing(): Link tuple updated: 1
2.44252s [node 2] OlsrAgent:LinkSensing(): Looking at HELLO link messages with Link Type 1 (ASYM_LINK) and Neighbor Type 0 (NOT_NEIGH)
2.44252s [node 2] OlsrAgent:LinkSensing(): -> Neighbor: 10.1.1.3
2.44252s [node 2] OlsrAgent:LinkSensing(): LinkTuple(localIfaceAddr=10.1.1.3, neighborIfaceAddr=10.1.1.1, symTime=-882926194ns, asymTime=8442524197ns, expTime=6117073806ns: link is SYM or ASYM => should become SYM now (symTime being increased to 8442524197ns
2.44252s [node 2] OlsrAgent:LinkSensing(): Link tuple updated: 1
2.44252s [node 2] OlsrAgent:LinkTupleUpdated(): 2.44252s: OLSR Node 10.1.1.3 LinkTuple LinkTuple(localIfaceAddr=10.1.1.3, neighborIfaceAddr=10.1.1.1, symTime=8442524197ns, asymTime=8442524197ns, expTime=14442524197ns UPDATED.
2.44252s [node 2] OlsrAgent:LinkTupleUpdated(): NeighborTuple(neighborMainAddr=10.1.1.1, status=SYM, willingness=3)->status = STATUS_SYM; changed:1
2.44252s [node 2] OlsrAgent:LinkSensing(): @2.44252: Olsr node 10.1.1.3: LinkSensing END
2.44252s [node 2] OlsrAgent:ProcessHello(): 2.44252s ** BEGIN dump Link Set for OLSR Node 10.1.1.3
2.44252s [node 2] OlsrAgent:ProcessHello(): LinkTuple(localIfaceAddr=10.1.1.3, neighborIfaceAddr=10.1.1.1, symTime=8442524197ns, asymTime=8442524197ns, expTime=14442524197ns
2.44252s [node 2] OlsrAgent:ProcessHello(): LinkTuple(localIfaceAddr=10.1.1.3, neighborIfaceAddr=10.1.1.2, symTime=8257091202ns, asymTime=8257091202ns, expTime=14257091202ns
2.44252s [node 2] OlsrAgent:ProcessHello(): ** END dump Link Set for OLSR Node 10.1.1.3
2.44252s [node 2] OlsrAgent:ProcessHello(): 2.44252s ** BEGIN dump Neighbor Set for OLSR Node 10.1.1.3
2.44252s [node 2] OlsrAgent:ProcessHello(): NeighborTuple(neighborMainAddr=10.1.1.1, status=SYM, willingness=3)
2.44252s [node 2] OlsrAgent:ProcessHello(): NeighborTuple(neighborMainAddr=10.1.1.2, status=SYM, willingness=3)
2.44252s [node 2] OlsrAgent:ProcessHello(): ** END dump Neighbor Set for OLSR Node 10.1.1.3
What I am seeing is that 10.1.1.3 and 10.1.1.1 are in communication
range for each other, for OLSR and for Arp requests. But the Arp reply
does not make it back.
The OLSR messages and Arp request messages are much more robust than the
Arp reply messages. The Arp reply message range is roughly 40 m, but
the OLSR hello message range and the Arp request message range is
roughly 160 m.
This discrepancy in range is causing the problem. OLSR thinks that
10.1.1.1 is one hop away, but the Arp reply cannot make it back from
10.1.1.1 to 10.1.1.3, so the Tcp SYN eventually is dropped.
This seems like it is a bug of some kind.
>
> I am assuming that you are also testing this with NS-3.3-RC6, because
> I noticed that the default range in this version with Yanswifi is
> around 35-40 meters (found via trial and error), whereas the default
> transmission range in ns-3.2 was around 150-160 meters.
I am testing this with ns-3-dev with the patch for bug451 applied.
>
> Secondly, if the OLSR hello messages are able to get across (lets say
> the two nodes are in fact in communication range), then why aren't the
> data packets able to get through.
>
> What puzzles me is why aren't there any transmissions. If they are not
> received or dropped, that's one thing. But if there are no
> transmission to begin with, that's whole another thing.
The arp requests make it from 10.1.1.3 to 10.1.1.1, even at a distance
of 160 m. The arp replies cannot travel more than 40 m. I will look at
this again tomorrow morning. Drops are being logged to my ascii trace file.
- Tom
This seems to be merely the rate control algorithm doing its work. For
broadcast packets, it uses always the lowest available rate so achieves
the highest range. For non-broadcast packets, it attempts to use a
higher rate so, achieves a lower range. After a while, it should settle
on a lower rate, hence, achieving the required range but this requires
packets to be sent to update the rate control statistics. i.e., the rate
control code takes time to update its tx rate based on the channel
conditions because it can't guess them so...
If you don't like this, you can set the 'constant' rate control
algorithm with a 6mbs rate.
Mathieu
Yes, that's obvious, should have occurred to me. I am used to seeing
the reverse behavior (unicast more robust than broadcast) in
interference-dominated environments.
.
>
> If you don't like this, you can set the 'constant' rate control
> algorithm with a 6mbs rate.
>
Well, I'm wondering whether this is a good default for us to use in the
simulator, since a TCP connection can't even get started. I counted 28
arp replies (retransmissions) and none of them seem to have dropped to
the rate that broadcast is using. Should Arf be this sluggish to
adjust? Should Arf initialize to the lowest rate instead? Or should we
not use Arf as a default?
Tom
Asif,
I think the problem is the 54mbs constant-rate rate control that is
being applied. Applying these wifi changes resolved it (removed the
constant rate rate control, and let the default rate control take over)
- WifiHelper wifi;
+ WifiHelper wifi = WifiHelper::Default ();
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default
();
wifiPhy.SetChannel (wifiChannel.Create ());
wifi.SetMac ("ns3::AdhocWifiMac");
- wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
- "DataMode", StringValue
- ("wifia-54mbs"));
NetDeviceContainer adhocDevices = wifi.Install (wifiPhy,
adhocNodes);
Maybe the issue here (I will look into this and file a bug if needed) is
the behavior of this ConstantRateWifiManager rate control algorithm-- it
seems to only be applied to the broadcast frames perhaps.
Anyway, the above changes make your script work for me now.
Tom
Yes, please contribute scripts that you think would be useful to others.
There is another script that includes more than two adhoc wifi nodes
(examples/mixed-wireless.cc), but I don't think the adhoc portion has
ever been seriously exercised and it may be that everyone is within
range of one another.
Thanks,
Tom