Tuesday, March 23, 2021

Accessing Ethereum/Web Server from Guest OS running under Virtual Machine to any Computer in LAN

The objective of this post is to explain how to access the web server running under Guest OS in Virtual Machine (VM) software from Host OS and any other computer connected in a Local Area Network (LAN). I am explaining it for Ethereum blockchain software installed in VM box. However, the same procedure may be applicable for accessing web server or other services.

VM software is used to achieve virtualization and for running multiple Guest operating systems without disturbing the Host operating system. To achieve this, the  processor (CPU) attached to the computer should have the feature of Virtualization. Once the VM software has been installed on a Host OS, the VM software creates a virtual IP address to function networking related activities. As usual, an IP address can be statically set or dynamically (DHCP) obtained for every computer. To this end, a computer system running VM software contains two IP addresses such as 1) Virtual IP created by VM software, and 2) Actual IP address of the system. The following figure shows the block diagram of LAN in which a computer with VM software connected. 




Now we will see how to access a web server launched in Guest OS on VM software from another computer in the LAN.

Step 1: Obtain the IP address of the computer. It is found that the IP address of the system as 172.16.26.1


Step 2: Obtain the IP address of the HOST OS running in VM software. It was found that the IP address of the Host OS as 10.0.2.15




Wednesday, August 17, 2016

Configuring and working with NetTopo Simulator in Eclipse Kepler



Prerequisites:

The system should have either Java 6.0 or higher (i.e., both the JDK and JRE need to be installed), and the JAVA_HOME path should be set in the System variables.  

Configuration Procedure

Step 1:  Download and extract the Eclipse Kepler for JAVA by clicking here.
Step 2: Download Java3D and install in the Java installation directory by clicking here
Step 3:  Extract the Eclipse to C: Drive and run the Eclipse IDE.
Step 4:  Create CVS Project
               4.1 File -> New -> Project -> Project from CVS





               4.2  Set Host -> nettopo.cvs.sourceforge.net
                             Repository Path -> /cvsroot/nettopo/
                             User -> anonymous 
                             Password -> No password required (empty)
                             Connection type -> pserver
                             Port -> Use default port

                             click Next

              

                            
                   4.3  Project name -> NetTopo

 Step 5: Setting up Ant build and run
               
               5.1  In Window menu, select Preferences -> Ant -> Runtime


                   5.2  Select Ant Home Entries and Click on Add External Jar Files
                    
                   select

                  C:\Program Files\Java\jdk1.6.0\lib\tools.jar
                  C:\Program Files\Java\Java3D\1.5.2\lib\ext\j3dutils.jar
                  C:\Program Files\Java\Java3D\1.5.2\lib\ext\j3dcore.jar
                  C:\Program Files\Java\Java3D\1.5.2\lib\ext\vecmath.jar

                 and save the Entries.

Building and Running the NetTopo Project

Step 6:  In Run menu select Run Configurations 
               Project: NetTopo
               Main class: org.deri.nettopo.app.NetTopoApp



Step 7: In (X) argument tab enter the following under VM arguments

                -Djava.library.path=bin


Step 8: In the Package Explorer select NetTopo project and right click
              Run As -> Java Application -> NetTopo Application
            


                   

Friday, April 22, 2016

Jaypee Institute of Information Technology (JIIT), Noida, PhD Thesis LaTex Template

This post consists of the Ph.D Thesis template of Jaypee Institute of Information Technology, Noida, India. The details of the files and folders are as follows
This template is created using LyX platform.
It consists of three main folders namely
1.       front_matter: It consists of the files related to the contents that are placed before the chapters.
They are
cover_page.lyx – Cover page of the thesis
dedication.lyx – Dedication page of the thesis
acknowledgements.lyx – Acknowledgements page of the thesis
declaration by student.lyx – Scholar declaration
supervisor certificate.lyx – Supervisor certificate
abstract.lyx – Abstract of the thesis

2.       main_matter: It consists of chapters of the thesis. Separate folder is created for each chapter. Each chapter folder consists of Image folder in which figures of that chapters are stored.

3.       end_matter: It consists of the files related to the contents that are placed after chapters.
They are
annexure.lyx – annexure or appendix of the thesis
references.lyx – Bibliography of the thesis – references are placed in bibtex format in the references.bib file. It follows IEEE referencing format.
publications.lyx – list of publications out of the thesis
biography.lyx – Authors biography
end_page.lyx - Copyright information of the thesis

The full thesis can be seen by running thesis_main.lyx file.
For writing algorithms, Algorithm2e.pdf file is placed for reference.
For reference, you may view JIIT PhD thesis preparation guidelines in jiit_phd_thesis_guidelines.pdf file.


   Click Here to download the JIIT PhD thesis template  (Last updated 06-05-2016)


Sunday, February 21, 2016

Handling Segmentation Fault (Core Dumped) in ns-2

Programming c++ in ns-2 is a nightmare for beginners. It requires systematic planning and programming. Though the programming is systematically planned, even experienced programmers frequently encounter  bugs called "Segmentation fault (Core Dumped)" and Floating point exception (Core Dumped).  Generally, Floating point exception can be dealt with positive value in the denominator of an expression. This post explains how to debug these problem in ns2. The following procedure has been tested with ns-2.35.

Prerequisite: Your system should installed with gdb (GNU debugger).

Step 1: goto ns-allinone-2.35/ns-2.35, and edit the Makefile.in file

replace from
CCOPT    = @V_CCOPT@ 

to

CCOPT    = @V_CCOPT@ -g

Next, replace the following from

DEFINE    = -DTCP_DELAY_BIND_ALL -DNO_TK @V_DEFINE@ @V_DEFINES@ @DEFS@ -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=@CPP_NAMESPACE@ -DUSE_SINGLE_ADDRESS_SPACE -Drng_test

to

DEFINE    = -DTCP_DELAY_BIND_ALL -DNO_TK @V_DEFINE@ @V_DEFINES@ @DEFS@ -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=@CPP_NAMESPACE@ -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DNDEBUG -DDEBUG 

Step 2: Save the file and do the following

$ ./configure

$ make clean

$ make distclean

$ ./configure

$ make

$ sudo make install

Now debugging to your ns-2 is ready. If you have encountered the Segmentation fault bug while running any tcl file, then do the following

Step 3: goto the tcl folder and do the following

$ gdb ns

(gdb) run your_tcl_filename.tcl

TCL file runs with the above command and it stops at bug point showing the statement where the bug has present. 

 
 
 

Tuesday, October 20, 2015

Using AVRORA simulator with TinyOS

AVRORA is a popular AVR Simulation and analysis framework for simulating the programs developed for AVR micro controllers. This tool can be used to simulate the programs written in TinyOS environment with little modifications. This post explains how TinyOS programs can be simulated using AVRORA.

This was tested in UBUNTU 12.04 OS environment.

Save the files downloaded from the following steps to a folder. In my system it is
/home/prv/avrora

Step 1: Download the converter from http://compilers.cs.ucla.edu/avrora/jars/avrora-beta-1.7.091.jar

Step 2: Rename the downloaded file as avrora.jar

Step 3: Download the converter.sh file from https://drive.google.com/file/d/0B8u5Jm1ly3NYNm41UEU0ZjdzYkU/view?usp=sharing

Step 4: Open the bashrc file
            gedit ~./bashrc
            and add the following lines at the end of the file.

alias avrora='java -jar /home/prv/avrora/avrora.jar'
alias convert-avrora='sh /home/prv/avrora/converter.sh'

Step 5: Save the file and close all the consoles opened.

Now, to test the AVRORA setup, run any application programmed in TinyOS.

For example, go to the folder Blinks available in /opt/tinyos-2.1.2/tos/apps.

compile the program

make mica2

it creates a build folder in which you will find micaz2 sub folder. Move to it.
In micaz2 folder there exists a main.exe file. This file is the main file consists of  application and TinyOS environment.

convert it into avrora environment as follows

convert-avrora main.exe blink.od

Now, run the avrora

avrora -seconds=5.0 -platform=mica2 blink.od

This command runs the blink application for one sensor node. To do the same for multiple nodes use the following command

avrora -simulation=sensor-network -seconds=10.0 -nodecount=2 blink.od

The screen shot after running the command

avrora -simulation=sensor-network -seconds=2.0 -nodecount=1 blink.od

is as follows



References

[1] http://compilers.cs.ucla.edu/avrora/
[2] http://mythicalcomputer.blogspot.in