diff --git a/examples/mesh.cc b/examples/mesh.cc index 26484e086..f677ec28a 100644 --- a/examples/mesh.cc +++ b/examples/mesh.cc @@ -39,8 +39,8 @@ int main (int argc, char *argv[]) { // Creating square topology with nNodes x nNodes grid: - int xSize = 4; - int ySize = 4; + int xSize =5; + int ySize = 5; double step = 100.0; //Grid with one-hop edge double randomStart = 0.1; //One beacon interval NodeContainer nodes; diff --git a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc index 338a09733..0b58fc8bc 100644 --- a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc +++ b/src/devices/mesh/dot11s/hwmp-mac-plugin.cc @@ -59,7 +59,6 @@ HwmpMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) HwmpTag tag; packet->RemoveHeader(meshHdr); //TODO: address extension - NS_LOG_UNCOND("Received Data frame"); Mac48Address destination; switch (meshHdr.GetAddressExt ()) { @@ -69,7 +68,8 @@ HwmpMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) default: NS_ASSERT(false); }; - tag.SetSeqno (2);//meshHdr.GetMeshSeqno ()); + NS_LOG_UNCOND("Received Data frame to "< packet, WifiMacHeader & header, //TODO: add a mesh header and remove a TAG NS_ASSERT(header.IsData ()); HwmpTag tag; + NS_LOG_UNCOND("sending packet to "<FindFirstMatchingTag(tag)); WifiMeshHeader meshHdr; meshHdr.SetMeshSeqno(tag.GetSeqno()); diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc index 9f58a1382..df443be5c 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -159,7 +159,6 @@ HwmpProtocol::RequestRoute ( MeshL2RoutingProtocol::RouteReplyCallback routeReply ) { - NS_LOG_UNCOND("Packet has come!"); HwmpTag tag; if (sourceIface == GetMeshPoint ()->GetIfIndex()) // packet from level 3 @@ -186,11 +185,19 @@ HwmpProtocol::ForwardUnicast(uint32_t sourceIface, const Mac48Address source, c { NS_ASSERT(destination != Mac48Address::GetBroadcast ()); HwmpRtable::LookupResult result = m_rtable->LookupReactive(destination); + NS_LOG_UNCOND("FORWARD UNICAST"); if(result.retransmitter == Mac48Address::GetBroadcast ()) result = m_rtable->LookupProactive (); if(result.retransmitter != Mac48Address::GetBroadcast ()) { + NS_LOG_UNCOND("Reply now:"); //reply immediately: + packet->RemoveAllTags (); + //Add a proper HWMP-tag: + HwmpTag tag; + tag.SetAddress (result.retransmitter); + //seqno and metric is not used; + packet->AddTag(tag); routeReply (true, packet, source, destination, protocolType, result.ifIndex); return true; } diff --git a/src/devices/mesh/mesh-point-device.cc b/src/devices/mesh/mesh-point-device.cc index 056677c28..f2121ce27 100644 --- a/src/devices/mesh/mesh-point-device.cc +++ b/src/devices/mesh/mesh-point-device.cc @@ -77,6 +77,7 @@ MeshPointDevice::ReceiveFromDevice (Ptr incomingPort, PtrGetUid ()); const Mac48Address src48 = Mac48Address::ConvertFrom (src); const Mac48Address dst48 = Mac48Address::ConvertFrom (dst); + NS_LOG_UNCOND("SRC="< const_packet, Mac48Address hdr.SetAddr4 (from); hdr.SetDsFrom (); hdr.SetDsTo (); - // Address 1 is unknwon here. Routing plugin is responsible to correctly set it. hdr.SetAddr1 (Mac48Address ());