Skip to main content


Showing posts from November, 2009

Installing ns-3.37 and ns-3.35 in Ubuntu | Ubuntu 22.04 | NS3

Multiple Versions of ns3 in Ubuntu 22.04 In this post, we are going to install two versions of ns3 namely ns-3.35 and ns-3.37  My OS is : Ubuntu 22.04 LTS (Long Term Support) ns-3.35 uses waf and (./waf --run scratch/first)  ns-3.37 uses cmake  (./ns3 run scratch/ So we will install both the packages  Go through the video for complete instructions To start with  $ sudo apt update  $ sudo apt install build-essential autoconf automake libxmu-dev g++ python3 python3-dev pkg-config sqlite3 cmake python3-setuptools git qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3 libsqlite3-dev  libxml2 libxml2-dev libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-pip libxml2 libxml2-dev libboost-all-dev  I have downloaded both the versions of ns3 fr

xgraph utility in Network Simulator 2

Xgraph is an X-Windows application that includes: interactive plotting and graphing animation and deritives portability and bug fixes So to plot the characteristics of NS2 parameters like throughput, end to end delay, packets information, etc can be plotted using xgraph The successful installation of NS2 will install xgraph also along with it. To run xgraph from a shell prompt: # xgraph filename.xg inside TCL scripts, xgraph can be written like this exec xgraph filename.xg -geometry 500x500 if there are more xgraph files then, exec xgraph filename1.xg -geometry 500x500 & exec xgraph filename2.xg -geometry 500x500 & The ambersand is mandatory to popup all the graph windows, if & (ambersand) is not there, then only the last xgraph window will be popped up. Sample xgraph file and its contents /*** The xgraph file shows the information about the overhead with size of the network,  Overhead is compared with four routing protocols like AODV, DSR, DSDV and NEAODV (my own algorit

Simple Examples in Javascript

document.write is a simple function used to display the content to the browser and it also embeds HTML tags inside it and renders as HTML tags. <html> <script type=text/javascript> document.write("Hello How are you"); document.write("<h1> This is header 1 </h1>"); document.write("<p> This is a new paragraph </p>"); </script> </html>

Installing NS2 under Ubuntu 9.10

Download NS2 from the following Website, I tried version ns-allinone-2.34.tar.gz . Put the file under /home/pradeep/ (my user login is pradeep, you may try with your username) go the folder in the shell prompt by issuing the following command cd /home/pradeep/ Since installation of NS2 simulator needs some autoconfigurationfiles which will need to be installed. To download those packages, justexecute the following commands $ sudo apt-get install build-essentialautoconf automake libxmu-dev it will take some time to download and install. Now execute the following steps so that NS2 will be installed $ tarzxvf ns-allinone-2.34.tar.gz $ cd ns-allinone-2.34 $ ./install You may get an error like libotcl.o error, to correct that execute, sudo apt-get install g++-4.3 , once done, open the file otcl-1.13/, in line number 7 change  CC= @CC@ to CC= gcc-4.3, then again goto step 6 After the above steps, NS2 will give the path information which needs to be set in the PATH varia

Validating a Textbox

<html> <head> <script type="text/javascript"> document.write("Validating a Text Box<BR>"); function validate_required(field,alerttxt) { with (field)   {   if (value==null || value=="")     {     alert(alerttxt);     return false;     }   else     {     return true;     }  }} function validate_form(thisform) { with (thisform)   {   if (validate_required(email,"Email must be filled out!")==false)   {   email.focus();   return false;}   } } </script> </head> <body> <form action="submit.htm" onsubmit="return validate_form(this)" method="post"> Email: <input type="text" name="email" size="30"> <input type="submit" value="Submit"> </form> </body> </html>

Detect Browser and its Parameters

<html> <body> <script type="text/javascript"> document.write("<p>Browser: "); document.write(navigator.appName + "</p>"); document.write("<p>Browserversion: "); document.write(navigator.appVersion + "</p>"); document.write("<p>Code: "); document.write(navigator.appCodeName + "</p>"); document.write("<p>Platform: "); document.write(navigator.platform + "</p>"); document.write("<p>Cookies enabled: "); document.write(navigator.cookieEnabled + "</p>"); document.write("<p>Browser's user agent header: "); document.write(navigator.userAgent + "</p>"); </script> </body> </html>

Browser Detect in Java Script

<html> <head> <script type="text/javascript"> function detectBrowser() { var browser=navigator.appName; var b_version=navigator.appVersion; var version=parseFloat(b_version); if ((browser=="Netscape"||browser=="Microsoft Internet Explorer")   && (version>=4))   {   alert("You are having a Recent Browser!");   } else   {   alert("It's time to upgrade your browser!");   } } </script> </head> <body onload="detectBrowser()"> </body> </html>

Alert, Confirm and Prompt in Javascript

  <html> <script type=text/javascript> function alertFn() { alert("Welcome to my Website"); } function confirmFn() { confirm("Please Select yes or no"); } function promptFn() { prompt("Enter your Name", "Pradeepkumar"); } </script> <body onload="alertFn()"> <input type=button Value="Click" onclick="confirmFn()"> <input type=button value="Click Me" onclick="promptFn()"> </body> </html>