Skip to main content

Posts

FlowMonitor for third.cc file in ns3

Flow monitor in ns3 third.cc  See the video for full instruction and hands on Step 1:  Include the header #include "ns3/flow-monitor.h" #include "ns3/flow-monitor-helper.h" Step 2:  include the follwing above the Simulator::Run() // Flow monitor  Ptr<FlowMonitor> flowMonitor; FlowMonitorHelper flowHelper; flowMonitor = flowHelper.InstallAll(); Include the following line after the Simulator::Run() flowMonitor->SerializeToXmlFile("flowthird.xml", true, true); $] ./waf --run scratch/third thirdflow.xml $] ./waf --run "scratch/third --nCsma=10 --nWifi=10" We have done Step2: compilation Step 3: How to process .xml file in ns3, there is a python file to rpocess the flowmonitor xml files. copy the /home/pradeepkumar/ns-allinone-3.27/ns-3.27/src/flow-monitor/examples/flowmon-parse-results.py Copy the file to ns-3.27/ or to the scratch/ folder. To run this file $] python scratch/flowmon-parse-results.py flowthird.xml $] python scratch/flowmon-pa...

Virtual Sensor implementation in Contiki NG OS

Native Temperature, Humidity and Pressure Sensor in Contiki NG  Implementation of Three sensors namely temperature, humidity and pressure sensor in contiki NG OS. We need four files namely Step 1: Create a Folder called temperature/ in the folder contiki-ng/examples/ and then copy paste the following four files to the above folder. // mytemp.h #ifndef MYTEMP_H #define MYTEMP_H struct Sensor {  char name[15];  float value; }; struct Sensor read_temperature(); struct Sensor read_humidity(); struct Sensor read_pressure(); #endif // mytemp.c #include "mytemp.h" #include <string.h> #include <stdlib.h> float random_value(float min, float max) {  float scale = rand() / (float) RAND_MAX;  return min + scale * (max - min); } struct Sensor read_temperature() {  struct Sensor temp;  strncpy(temp.name, "Temperature", 15);  temp.value = random_value(0, 35);  return temp; } struct Sensor read_humidity() {  struct Sensor humdidty;  str...

Counter Design in Contiki NG Operating System

Counter Design in Contiki NG OS $] make TARGET=native Step 1 - Files needed  myowncounter.h, myowncounter.c and ngcounter.c Makefile. Inside the folder contiki-ng/examples/myowncounter Step 2:  //myowncounter.h #ifndef MYOWNCOUNTER_H #define MYOWNCOUNTER_H int next_round(int temp); #endif Step 3:  //myowncounter.c #include "myowncounter.h" int next_round(int temp) { if(temp>59) temp=1; else  temp++; return temp; } Step 4:  //ngcounter.c #include "contiki.h" #include "sys/etimer.h" #include "mycounter.h" #include <stdio.h> PROCESS(mycounter_process, "My Counter Process"); AUTOSTART_PROCESSES(&mycounter_process); static struct etimer et; static int count=0; PROCESS_THREAD(mycounter_process,ev,data) { PROCESS_BEGIN(); while(1) { etimer_set(&et, CLOCK_SECOND*2); PROCESS_WAIT_EVENT_UNTIL(etimer_Expired(&et)); count=next_round(count); printf("Count Value : %d\n",count); } PROCESS_END(); } Step 5: Mak...

How to make boot entry in CentOS for Windows 10

Whenever you try installing Cent OS, after the installation of CentOS, the windows 10  or windows 8 might have gone missing from the boot table entry. This is due to one of the reasons Since Windows 10 or 8 runs with NTFS filesystem which could not be understandable by Cent OS any other booting issues like UEFI or GPT partition issues. Any how, one can try the first method to get rid of the NTFS filesystem issue. After installing CEntOS, get it in to the Cent OS and open the terminal and give the command one by one $] sudo yum install epel-release or $] sudo yum install epel-release.noarch $] sudo yum install ntfs-3g Depending on the speed of the internet, the above command might take some time to install. $] sudo grub2-mkconfig > /dev/null this command will read the windows 10 or 8 partition. Thats it. Reboot the machine and you can boot in to Windows 10. Here is the image   and final step is here, execute these commands $] sudo grub2-mkconfig ...

Wireshark in User Mode

If you are running Ubuntu or Linux Mint, the wireshark may not list all the interfaces except bluetooth. There is a small workaround for enabling all the interfaces within wireshark To install wireshark $ sudo apt install wireshark Checking for all the interfaces $] ifconfig -a  eth0      Link encap:Ethernet  HWaddr b4:b5:2f:90:41:98             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host ...

Greedy Perimeter Stateless Routing (GPSR) protocol in ns3

GPSR - Greedy Perimeter and Stateless Routing Please watch the following video for Full details. VANETs - Vehicular Adhoc NEtworks. PA GPSR, MM GPSR and GPSR. Under and post graduate - You can use the modules as it is and compare these protcols for VANETs. If you are a PhD scholar, you can modify the protocols and design your own GPSR alternatives. In this video, we will be seeing the installation of GPSR and some source codes. ns-3.27 which i could not succeed, So I prefer going to ns-3.23 we can both multiple version of ns3. I am going to run ns-3.23 for GPSR and other simulations with ns-3.27 and ns-3.29 Welcome to the Installation. If you are installing ns3 for the first time, install the following packages. (You can copy paste) $] sudo apt install build-essential autoconf automake libxmu-dev  python-pygraphviz cvs mercurial bzr git cmake p7zip-full python-matplotlib python-tk python-dev python-kiwi python-gnome2 python-gnome2-dev qt4-dev-tools qt4-qm...

Installing Kali Linux 2019 along with Windows 10

Kali Linux along with Windows 10 Kali Linux 2019. For Detailed Instructions: Please follow the Video Link Step 1: Have a pen drive or USB Drive of minimum 8GB (16GB Pendrive) Format it to FAT32 Partition. Step 2: Check your Disk Drive Properties. MBR or GPT Master Boot Record, GPT- GUID Partition Table. See the following image, It shows the partition style as "Master Boot Record" Master Boot Record Step 3: Download bootable Software (RUFUS). Its a powerful USB bootloader creator software. rufus works only with windows. See the following image for rufus window. Use of DD Mode is preferred instead of ISO Model for Kali Linux (Else you might get an error like CD ROM Detection during installation...). Use dd MODE as given in the following figure Rufus Selection of DD or ISO Method. Step 4: Reboot the system and bring the bootloader. Rebooting now... Step 5 : Press F12 or ESC or F1 as per the Laptop model you have. There will be two options: USB HDD or EFI...