Sebilj, Sarajevo, Bosnia and Herzegovina

Category Archives: Networks and telecommunications

Posts related to networks or telecommunications topic.

Greedy Perimeter Stateless Routing (GPSR) in ns3.25

Please find the updated Greedy Perimeter Stateless Routing protocol (GPSR) code which works in the latest ns3.25 version. Just copy it into your /src folder and execute “./waf configure” and “./waf”. Also, move the examples from /src/gprs/examples to /scratch and test it. It works fine for me in ns3.25 version. Enjoy! — Files to download: […]

Read more

IP ToS fields with UDPSockets – implementation issue

For the purposes of my project, I needed to add TOS tag to UDP packets which are generated by OLSR routing protocol. In olsr-routing-protocol.cc I added ToS Values: // Create a socket to listen only on this interface Ptr socket = Socket::CreateSocket (GetObject (),UdpSocketFactory::GetTypeId ()); socket->SetAllowBroadcast (true); socket->SetIpTos(6); socket->SetIpRecvTos(true); And when I executed the code […]

Read more

Add and read content to Packet payload in NS3

To add content to packet payload you can use following commands: std::ostringstream msg; msg << “Hello World!” << ‘\0’; Ptr<Packet> packet = Create<Packet> ((uint8_t*) msg.str().c_str(), msg.str().length()); To read content from packet payload: uint8_t *buffer = new uint8_t[packet->GetSize ()]; packet->CopyData(buffer, packet->GetSize ()); std::string s = std::string((char*)buffer);

Read more

NS3 – undefined reference to..

I received following bug when I tried to install new module and build NS3 : ./libns3.22-network-debug.so: undefined reference to `ns3::Queue::IsFull() const’ collect2: error: ld returned 1 exit status The problem was that my point-to-point-net-device.cc was calling function return !(m_queue->IsFull ()); which was not implemented in src/networking/utils/queue.cc. The function was declared in queue.h as virtual but […]

Read more