Mehic.info

Category Archives: Networks and telecommunications

Posts related to networks or telecommunications topic.

Socket::SetIpTos in NS-3 ver.3.26

One of the changes between ns-3 ver 3.25 and ver 3.26 is that now it is possible to set TOS value to the address. Yes, you read it right, TOS value to the address. Official Doxygen states following: https://www.nsnam.org/docs/release/3.26/models/html/sockets-api.html The native sockets API for ns-3 provides two public methods (of the Socket base class): void […]

Categories: ns3
Read more

Crypto++ VMAC issue

Well, I tried code available on http://www.cryptopp.com/wiki/VMAC in my NS-3 project on the following way: inputString = base64_encode (inputString); byte* Kkey = key->GetKey(); byte digestBytes[key->GetSize()]; byte digestBytes2[key->GetSize()]; CryptoPP::VMAC vmac; vmac.SetKeyWithIV(Kkey, key->GetSize(), m_iv, CryptoPP::AES::BLOCKSIZE); vmac.CalculateDigest(digestBytes, (byte *) inputString.c_str(), inputString.length()); //VMAC Verification vmac.SetKeyWithIV(Kkey, key->GetSize(), m_iv, CryptoPP::AES::BLOCKSIZE); vmac.CalculateDigest(digestBytes2, (byte *) inputString.c_str(), inputString.length()); std::string outputString = std::string( (char*)digestBytes, sizeof(digestBytes […]

Read more

Installing crypto++ with ns3

Installing crypto++ (libcryptopp) on Ubuntu sudo apt-get install libcrypto++-dev libcrypto++-doc libcrypto++-utils On distributions which use yum (such as Fedora): yum install cryptopp cryptopp-devel More details on: http://stackoverflow.com/questions/19187990/installing-crypto-libcryptopp-on-ubuntu and https://www.cryptopp.com/wiki/Linux Then compile and run some test.cc source file Make testcode.cc which contains following: /* -*- Mode:C++; c-file-style:”gnu”; indent-tabs-mode:nil; -*- */ #include <iostream> int main (int argc, […]

Read more

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