Sarajevo, Bosnia and Herzegovina

Category Archives: Networks and telecommunications

Posts related to networks or telecommunications topic.

Clearing Linux disk cache

For experimentation, it’s very convenient to be able to drop the disk cache. For this, we can use the special file /proc/sys/vm/drop_caches. By writing 3 to it, we can clear most of the disk cache: $ free -m total used free shared buffers cached Mem: 1504 1471 33 0 36 801 -/+ buffers/cache: 633 871 […]

Read more

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 […]

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