Bugzilla – Bug 800
Erroneous packet sender while using aloha or cw mac in uan module
Last modified: 2010-07-16 00:13:11 UTC
Overview: Retrieving the sender address of a packet while using UanMacAloha or UanMacCw will results in the receiver address Steps to Reproduce: Set up two uan nodes with either UanMacAloha or UanMacCw. Set a receive callback to the netdevice of the receiving node. From a node send a packet to the other. In the receiving node try to print out the Address of the sender: ReceivePacketCallback (Ptr<NetDevice> dev, Ptr<const Packet> pkt, uint16_t mode, const Address &sender){ NS_LOG_DEBUG("Receiving packet from " << sender); } or if you are using sockets (like PacketSocket) ReceivePacketCallback (Ptr<Socket> socket) { Ptr<Packet> packet; Address from; while (packet = socket->RecvFrom(from)) { PacketSocketAddress address = PacketSocketAddress::ConvertFrom(from); NS_LOG_DEBUG ("Received packet from: " << address.GetPhysicalAddress()); } } Actual Results: The address of the sender retrieved is the address of the receiver Expected Results: The address of the sender retrieved should be the address of the sender Build Date & Platform: Build 2010-01-30 on Ubuntu 9.10 kernel 2.6.31-17-generic Solving: In uan-mac-aloha.cc:121 change m_forUpCb (pkt, header.GetDest ()); with the following: m_forUpCb (pkt, header.GetSrc ()); In uan-mac-cw.cc:3125 change m_forwardUpCb (packet, m_address); with the following: m_forwardUpCb (packet, header.GetSrc()); I've also attached a corrected version of the two files
Created attachment 742 [details] fixed uan-mac-aloha.cc
Created attachment 743 [details] fixed uan-mac-cw.cc
Leonard remarks that this was fixed along the way.