Hi everyone,
I am begginer in ns3 and I have implemented a simple underwater acoustic ;MAC communication scenario in which my nodes are suppose to send and receive packages while they are moving underwater. To do so, I have used the UAN framework but the results were not what I expected.
My first goal is to send packages from one node to another specific node and receive them properly. However, my nodes always broadcast to all neighbours instead to the specific one that I want to. I think this happens because by default, the MAC addresses of all UanNetDevices are set to 255 (Broadcast address) when they are created. I have unsuccessfully tried to set this MAC address to be a different number so I don't know what else I can do.
This is how I have tried to modify the MAC address of each device when they are created:
Ptr<UanNetDevice> dev = CreateObject<UanNetDevice> ();
Ptr<UanMacAloha> mac = CreateObject<UanMacAloha> ();
mac->SetAddress(UanAddress::Allocate());
dev->SetMac(mac);
And this is how I send the a packet to the destination node:
Ptr<Packet> pkt = Create<Packet> (m_packetSize);
dev->Send (pkt, address, 0);
where address is a parameter defined as Address address = dev->GetAddress();
Could anyone please suggest me how can I try to fix this so I can send a packet from one UanNetDevice to another UanNetDevice chosen by its address??
Thanks in advance.
Gabriel