Monday 21 August 2017

ONE simulator 


The main intention of this article is to give an introduction to the ONE (Opportunistic Network Environment) simulator to the beginners in Windows platforms. Since the ONE provides very less documentation I hope this article may be useful to the beginners who aim to do their research work in Delay Tolerant Networks. 

To start with download the ONE simulator from the link given below. It is better to download one.1.4.1 or above.
  http://www.netlab.tkk.fi/tutkimus/dtn/theone 
Don’t forget to subscribe to the mailman link in the ONE page. Once you are subscribed you can clear any of your doubts with one of the best research community in DTN. 

Here are the steps below to make yourself familiar with ONE.


Setting Java Path Variable
After downloading you get a folder like one_1.4.1. Copy it to any directory in your system. Now, don’t expect to find a .exe because that is not how it starts. 

The pre-requisite for running ONE is to have a jdk in your system. And for one_1.4.1 it is better to use jdk_1.7.0 or above. After downloading and installing jdk set the java path in Environment variables. If you are not familiar with setting the Java path, the steps are given below:

 Go to My Computer. Right Click on Properties. There you can find the Advanced System Settings ->Environment Variables -> System Variable->Path->Edit->C:\Program Files\Java\jdk1.7.0\bin  
 

 

 


 Don’t forget to separate the paths with a semicolon as shown in the figure.  


Compiling and running ONE 
After setting the Java path now we can compile the ONE. Since ONE is written completely in Java it is necessary to compile all the programs before running the simulator.  


When you got to the downloaded ONE folder you can see a list of folders each containing java files. In the ONE folder along with other folders you will see some .txt files also which are settings files. We’ll come to this later.

 

To compile the ONE simulator, now you have two ways.
1.      Double click on compile.bat OR
2.      Go to command prompt, give the path to the directory where you have saved ONE and type compile.bat and enter.
I suggest you to go with the second method because later when you start developing your own programs in ONE this will give errors on the prompt if you have any.
So once the compile.bat runs all the java files in the ONE get compiled. Before compiling you will only see .java files. Now you will get to see .class files also.

 

To run the ONE simulator also you have two ways.
1.      You can choose the GUI mode OR
2.      You can choose the batch mode.
Batch mode is recommended, but being a beginner it is better to go with GUI because it gives a feeling of what the simulation is.
I’ll explain the GUI first and then the batch mode.
To run the GUI double click on one.bat in your ONE folder or type one.bat in command prompt and enter. This will open up the GUI. Always remember this GUI is a running java code. So where is this code? You can find it in one_1.4.1\core\DTNSim.java. If you are a beginner don’t try to study the code at first. Try to learn more about running the ONE simulator. 

  

There will be a pause/play button on the top left side of GUI. Once you enter this the simulation starts.
On the top left corner you can see the Simulation clock. This is the clock of the simulator. By default it will run for 43200s. But in real it doesn’t take this much time, it is the time that the simulator is simulating according to it’s program.
You can also reduce the magnification by changing values in the field right to that magnification glass you see on top of the GUI.
Let’s have a closer look into the GUI. On the right side we have a section called nodes. You may see a lot of button below it like p0, p1 etc. These are the nodes that are running in the simulation. When you click each button it shows the location of that node on the map.
The map that the ONE simulator uses by default is the Helsinki city map. When you start developing your own programs you can change the maps also. That will be discussed in another article.
In the Event log section of the GUI the connections created, the messages transmitted etc can be seen.
These are some basics on the ONE GUI.
·         To run ONE in the batch mode. Type the following command in the command prompt.
one.bat –b 1

 

The real format of running in batch mode is:
one.bat –b <no:of times to run> <settings file path>
Let us understand what this means:
-b: this indicates that the simulation is to be run in the batch mode.
<no:of times to run>: this is always an integer and tells how many times this simulation is to be run. In our example we have given it as 1 because we need to run it only 1 time. There may be some cases where you may want to run your program for n number of times each with a different random seed. However as a beginner we will keep this value to 1.
<settings file path>: This give the path to the settings file that the simulator is running. By default the ONE uses the default_settings.txt as the settings file. You can see this in the one folder. If you need your own settings file, you can have that also. Give path to that file in this place of the command.

In the batch mode you will not be able to see the node’s location etc.
 
 Report Generation

Now after the ONE finishes the simulation where are the reports generated? Open the reports folder and the MessageStatsReport can be seen. In this report it is possible to see the delivery probability, average latency, overhead ratio etc for the current simulation. 


Settings
Let’s see more about the settings file. As an example we’ll take the default_settings.txt file.

#
# Default settings for the simulation
#
## Scenario settings
Scenario.name = default_scenario
Scenario.simulateConnections = true
Scenario.updateInterval = 0.1
# 43200s == 12h
Scenario.endTime = 43200
 
  The # in the file indicates comments.
·         Scenario.name: The value set for this is the name we give for current simulation. For each simulation this value should be changed, otherwise the reports generated for each simulation will be replaced with the new contents. So if you want separate report files for each simulation change names here.
·         Scenario.simulateConnection: this should be set to true for simulations. In some cases we may use external traces (like those downloaded from CRAWDAD); in such cases the value is set to false.
·         Scenario.updateInterval: This defines the interval in which the update() function in the MessageRouter.java file has to be called. As default it is set to 0.1s.
·         Scenario.endTime: The time for which the scenario is to be simulated. You can keep it to any number of seconds. By default it is kept to 43200s which is 12hrs.

## Interface-specific settings:
# type : which interface class the interface belongs to
# For different types, the sub-parameters are interface-specific
# For SimpleBroadcastInterface, the parameters are:
# transmitSpeed : transmit speed of the interface (bytes per second)
# transmitRange : range of the interface (meters)
# "Bluetooth" interface for all nodes
btInterface.type = SimpleBroadcastInterface
# Transmit speed of 2 Mbps = 250kBps
btInterface.transmitSpeed = 250k
btInterface.transmitRange = 10
# High speed, long range, interface for group 4
highspeedInterface.type = SimpleBroadcastInterface
highspeedInterface.transmitSpeed = 10M
highspeedInterface.transmitRange = 1000
 
We can set interfaces as we like. The set of interfaces supported by ONE are given in interfaces folder.
·         Type: For a scenario we can give specific names to the interfaces we want. For example I want a Bluetooth type interface and a high speed interface. For distinguishing between the two I name the first as btInterface and the other highspeedInterface. The ONE should now understand the difference between two. We keep the type of both interfaces as SimpleBroadcastInterface and vary the parameters for each interface.
For example: we know Bluetooth won’t have a high transmission range and speed and so we keep their values low:

o    btInterface.transmitSpeed = 250k
o   btInterface.transmitRange = 10
      Also we need a high speed and long range interface and so it’s values we keep different.
o   highspeedInterface.transmitSpeed = 10M
o   highspeedInterface.transmitRange = 1000
Note that transmitSpeed and transmitRange are parameters for SimpleBroadcastInterface. For other interfaces there maybe other parameters.
 Thus with the same type of interfaces we can create as many different interfaces with different features.
Scenario.nrofHostGroups: We can define any number of node groups. In the default file they have used 6 node groups. If you need no specific group, keep this value as 1. 
For each group we can have specific settings. These are given in the table above.
# Common settings for all groups

Group.movementModel = ShortestPathMapBasedMovement

Group.router = EpidemicRouter

Group.bufferSize = 5M
Group.waitTime = 0, 120

# All nodes have the bluetooth interface
Group.nrofInterfaces = 1
Group.interface1 = btInterface
Group.speed = 0.5, 1.5
Group.msgTtl = 300
Group.nrofHosts = 40

You may wish to keep some settings common for all groups. That can be specified as above.
  • movementModel: In the above example all groups use ShortestPathMapBasedMovement as the movement model. The movement models that ONE supports can be found in the movements folder. If some group wants to use another movement model simple do:
Group<ID>.movementModel = <The class name of the movement model>
  • router: The routing protocol that all group of nodes use is set as Epidemic routing protocol. The routing protocols already implemented in ONE can be seen in routing folder.
  • bufferSize: The default buffer size for all the nodes is kept as 5M in this example.
  • waitTime: This is the minimum and maximum wait times (seconds) after reaching destination. In our example min is 0s and max is 120s for all groups.
  • nrofInterfaces : The number of interfaces used by groups. In the example all groups use only 1 interface.
  • interface<ID>: the interface ID used. If we want Bluetooth features that we defined first, then Group.interface1 = btInterface.
What if some group uses two interfaces then the two can be specified by:
Group.interface2 = highspeedInterface.
  • speed: this defines the max and min speed in which the nodes must move. In the example it is given as 0.5-1.5m/s. All the values in this field should be in m/s. (0.5-1.5m/s is generally taken as speed for pedestrians)
  • msgTtl: The TTL value of messages for the group. This should be specified in minutes.
  • nrofHosts: This field specifies the number of nodes in each group. It is kept 40 in this example.

# group1 (pedestrians) specific settings

Group1.groupID = p


# group2 specific settings

Group2.groupID = c

# cars can drive only on roads

Group2.okMaps = 1

# 10-50 km/h

Group2.speed = 2.7, 13.9


# another group of pedestrians

Group3.groupID = w


# The Tram groups

Group4.groupID = t

Group4.bufferSize = 50M

Group4.movementModel = MapRouteMovement

Group4.routeFile = data/tram3.wkt

Group4.routeType = 1

Group4.waitTime = 10, 30

Group4.speed = 7, 10

Group4.nrofHosts = 2

Group4.nrofInterfaces = 2

Group4.interface1 = btInterface

Group4.interface2 = highspeedInterface


Group5.groupID = t

Group5.bufferSize = 50M

Group5.movementModel = MapRouteMovement

Group5.routeFile = data/tram4.wkt

Group5.routeType = 2

Group5.waitTime = 10, 30

Group5.speed = 7, 10

Group5.nrofHosts = 2


Group6.groupID = t

Group6.bufferSize = 50M

Group6.movementModel = MapRouteMovement

Group6.routeFile = data/tram10.wkt

Group6.routeType = 2

Group6.waitTime = 10, 30

Group6.speed = 7, 10

Group6.nrofHosts = 2


In this section, each group is defined and group specific settings are kept.
  • Group1.groupID: We can specify an id for each group. In the example for first group it is p. That is why in GUI mode you were able to see p0,p1 etc. Like this we can define an ID for each group.
The first group in the example doesn’t use any specific settings and use the settings that we kept for the whole group.
  • Group2: Group2 has defined a parameter called okMaps. There are many routes that the nodes can follow. The Group 1 did not specify any value means the nodes in that group can follow all the routes in the map. Such type of nodes can be kept as pedestrians as pedestrians tend to take all routes. The group2 uses only route 1 which is roads. To understand the indexes for each route, it is given in default_settings.txt file.

MapBasedMovement.mapFile1 = data/roads.wkt
MapBasedMovement.mapFile2 = data/main_roads.wkt
MapBasedMovement.mapFile3 = data/pedestrian_paths.wkt

MapBasedMovement.mapFile4 = data/shops.wkt
  • Group 2 also wants another value for speed and defines this as Group2.speed = 2.7,3.9
  • Group4, 5 and 6: They use different values for movement models, routes, buffer, number of nodes etc.
## Message creation parameters

# How many event generators

Events.nrof = 1

# Class of the first event generator

Events1.class = MessageEventGenerator

# (following settings are specific for the MessageEventGenerator class)

# Creation interval in seconds (one new message every 25 to 35 seconds)

Events1.interval = 25,35

# Message sizes (500kB - 1MB)

Events1.size = 500k,1M

# range of message source/destination addresses

Events1.hosts = 0,125

# Message ID prefix

Events1.prefix = M

Messages can be generated or can be loaded from an external text file. For beginners we’ll discuss about messages being generated. In some cases we can use different events for message generation. Here only 1 event is used and so we keep Events.nrof =1.
The class of event is MessageEventGenerator, other classes can be seen in input folder in ONE.
The interval in which messages are to be generated has to be defined. It is by default kept as 25-35s.
Events1.interval = 25,35
The message size is to be defined: Events1.size = 500k,1M
Now, the source/destination addresses that are valid to where the messages go is to be defined: Events1.hosts = 0,125
In this example we have a total of 126 nodes (40(p group)+(40 c group) +(40 w group)+ (6 from three t groups)), so we keep the values as 0,125. If we were having 50 nodes then it will 0,49 and so on.

In some cases some routing protocols have their own specific settings. For example:
SprayAndWaitRouter.nrofCopies = 6
# Reports - all report names have to be valid report classes
# how many reports to load
Report.nrofReports = 1
# length of the warm up period (simulated seconds)
Report.warmup = 0

# default directory of reports (can be overridden per Report with output setting)
Report.reportDir = reports/
# Report classes to load

Report.report1 = MessageStatsReport

We can specify the number of reports we want for each simulation. The reports available in ONE are given in the report folder. The MessageStatsReport.java can be seen in this folder. This report contains the delivery rate, average latency etc.
What if we need two reports, say MessageDeliveryReport. Then the settings has to be defined as below:
Report.nrofReports = 2
Report.report1 = MessageStatsReport
Report.report2 = MessageDeliveryReport

We have seen that in batch mode we can run the simulation for any number of times. We can change the settings for each parameter for each run by using a semicolon in the default_settings.txt. For example:
Scenario.name = [simulation1;simulation2;simulation3]
Group.router = [EpidemicRouter;ProphetRouter;SprayAndWaitRouter]

After we change the two parameters like this and then run from cmd: one.bat –b 3

ONE will run for three times and for each time it will take different values separated using semicolon.

Thus we will get three reports in the reports folder:
simulation1_MessageStatsReport.txt (Ran with Epidemic routing)
simulation2_MessageStatsReport.txt (Ran with Prophet routing)
simulation3_MessageStatsReport.txt (Ran with Spray and Wait routing)

How to use a separate settings file?

In some cases we may wish to use a separate settings file. We can create another file and give the path of the file in the command prompt. The ONE uses all the values used in this file. Those values missing in this file will be taken from the default_settings.txt file.

Let us create a file called test.txt. This file uses only one group of nodes.
Scenario.name = test

Scenario.nrofHostGroups = 1
Group.nrofHosts = 100
Events1.hosts = 0,99
Now we run the ONE as below:
One.bat –b 1 test.txt
The parameters that are not defined in the test.txt will be taken from the default_settings.txt.

Wednesday 28 June 2017

Monday 24 April 2017

V Model



The V - model is a model where execution of processes happens in a sequential manner in V-shape. It is also known as Verification and Validation model.
V - Model is an extension of the waterfall model and is based on association of a testing phase for each corresponding development stage.
 So there are Verification phases on one side of the .V. and Validation phases on the other side. Coding phase joins the two sides of the V-Model.

Verification Phases

Following are the Verification phases in V-Model:
·    Requirement Analysis: This phase involves detailed communication with the customer to understand his expectations and exact requirement. This is a very important activity and need to be managed well, as most of the customers are not sure about what exactly they need. The acceptance test design planning is done at this stage as business requirements can be used as an input for acceptance testing.
·        System Design:  System design would comprise of understanding and detailing the complete hardware and communication setup for the product under development. System test plan is developed based on the system design. Doing this at an earlier stage leaves more time for actual test execution later.
·        Architectural Design: Architectural specifications are understood and designed in this phase. Usually more than one technical approach is proposed and based on the technical and financial feasibility the final decision is taken. System design is broken down further into modules taking up different functionality. This is also referred to as High Level Design (HLD).
·    Module Design: It is important that the design is compatible with the other modules in the system architecture and the other external systems. Unit tests are an essential part of any development process and helps eliminate the maximum faults and errors at a very early stage. Unit tests can be designed at this stage based on the internal module designs.

Coding Phases

The actual coding of the system modules designed in the design phase is taken up in the Coding phase. The best suitable programming language is decided based on the system and architectural requirements. The coding is performed based on the coding guidelines and standards. The code goes through numerous code reviews and is optimized for best performance before the final build is checked into the repository.

Validation Phases

Following are the Validation phases in V-Model:
·        Unit Testing: Unit tests designed in the module design phase are executed on the code during this validation phase. Unit testing is the testing at code level and helps eliminate bugs at an early stage, though all defects cannot be uncovered by unit testing.
·     Integration Testing: Integration testing is associated with the architectural design phase. Integration tests are performed to test the coexistence and communication of the internal modules within the system.
·        System Testing: System testing is directly associated with the System design phase. System tests check the entire system functionality and the communication of the system under development with external systems. Most of the software and hardware compatibility issues can be uncovered during system test execution.
·   Acceptance Testing: Acceptance testing is associated with the business requirement analysis phase and involves testing the product in user environment. Acceptance tests uncover the compatibility issues with the other systems available in the user environment. It also discovers the non functional issues such as load and performance defects in the actual user environment.

Saturday 25 February 2017

Isy Year Materials

C Programming  2 &3 Marks Questions of UNIT-1

Download 

C Short Answers 

Click to Download

 M-1 II & III Marks Questions of UNIT -1

Download

MM II & III Marks Questions of UNIT -1

Download

 Engineering Chemistry 2nd & 3rd Marks Questions of UNIT -1

Download 

Download 2

Download 3

Engineering physics SAQ (2M,3M)  5 units

Click to Download

Wednesday 22 February 2017

Steps for conducting the experiment


General Instructions


Follow are the steps to be followed in general to perform the experiments in Advanced Network Technologies Virtual Lab.

  1. Read the theory about the experiment
  2. View the simulation provided for a chosen, related problem
  3. Take the self evaluation to judge your understanding (optional, but recommended)
  4. Solve the given list of exercises

Experiment Specific Instructions


In the theory part we have learned how to work with NS2. In this section we now learn how to make your system ready so that you can work with Network Simulator 2.NS2 is a open source software. It can be downloaded from Internet and installed.

Basic Requirements:

  • A computer which is having access to the Internet
  • Minimum 512Mb RAM
  • Operating system: Linux(Ubuntu 10.04)
  • ns-2.34 package
  • gcc-4.4.3
  • make tools

The following instructions for downloading and installing ns2 are for a system with:

  • Operating System: Linux (Ubuntu 10.04)
  • ns2: 2.34
  • gcc: 4.4.3

Some of the known problems that have been faced during installation as well as their solutions have been discussed in one of the sections below.
The steps for installation should ideally be applicable for other version and/or configuration of Linux also. Any other problem that might arise would require further troubleshooting.

Downloading ns-2.34


To download ns2 go to http://www.isi.edu/nsnam/ns/ns-build.html. Here you can download the ns all-in-one package or you can download the packages separately.

Well, lets learn how to download the packages separately.

  1. First go to http://www.isi.edu/nsnam/ns/ns-build.html.
  2. Then download Tcl and Tk from http://www.tcl.tk/software/tcltk/downloadnow84.tml [note: the versions of Tcl and Tk must be same.]
  3. Download OTcl from: http://sourceforge.net/projects/otcl-tclcl/files/OTcl/1.13/
  4. Download Tclcl from : http://sourceforge.net/projects/otcl-tclcl/files/TclCL/1.19/
  5. Download ns-2 from :http://sourceforge.net/projects/nsnam/files/ns-2/2.34/
  6. Download nam from :http://sourceforge.net/projects/nsnam/files/nam-1/1.14/ [note : download only nam-1.14.tar.gz not ns-allinone package.]
  7. Download xgraph from: http://sourceforge.net/projects/nsnam/files/xgraph/xgraph-12.1/

Note: there are some other few things to be downloaded but that depends upon your requirement.For example, if some error occurs for absence of any package,then you need to detect the error and download the required package.

Installation


Here we will install the the packages separately

  1. All the files will be zip format.So at first you need to unzip all the files. the command to unzip the files:

  2. tar -xzvf <file_name>

    for e.g if we want to unzip the Tcl package the type: tar -xzvf tcl8.4.19
    To unzip all the files together use the following command:

    for ifile in ` ls *.tar.gz`
    do
    ar -xzvf $ifile
    done

  3. Next, we will install Tcl.The command required is:
  4. cd tcl8.4.19
    ls
    cd unix
    ./configure
    make
    sudo make install

  5. Install Tk:
  6. cd tk8.4.19
    ls
    cd unix
    ./configure
    make
    sudo make install

  7. Install OTcl:
  8. cd otcl-1.13
    /configure --with-tcl=../tcl8.4.19 #note-while configuring we need to specify the path of tcl
    make
    sudo make install

  9. Install Tclcl-1.19:
  10. cd tclcl-1.19
    ./configure --with-tcl=../tcl8.4.19 #note-while configuring we need to specify the path of tcl
    make
    sudo make install

  11. Install ns-2.34:
  12. cd ns-2.34
    /configure --with-tcl=../tcl8.4.19
    make
    sudo make install

  13. Install NAM:
  14. cd nam-1.14
    ./configure --with-tcl=../tcl8.4.19
    make
    sudo make install 

  15. Install xgraph: 
  16. cd xgraph-12.1
    ./configure
    make
    sudo make install

Probable problems that could appear while installing the packages and their solution


1. Tk was installed properly but it failed to run somehow.

How to identify this:

After installing tk8.4.19 try to run the script tk8.4.19/unix/wish from the terminal.A small window will open,close it. If no error messages appears in the terminal then Tk installation is successful and Tk is working properly. This can also be verified after installing nam and then trying to run nam. The error message would be something like:

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

Solution:


If you get error messages then download the patch files tk-8.4.18-tkBind.patch and tk-8.4-lastevent.patch from http://bugs.gentoo.org/show_bug.cgi?id=225999.

then copy those files into Tk directory.Now apply the patches by using the following command:

  1. patch -p1 < tk-8.4.18-tkBind.patch
  2. patch -p1 < tk-8.4-lastevent.patch

If fail to apply the patches then open the patch, check the name of the file to be patched, and make the relevant modifications to that file accordingly.

Note: the contents of the original file are shown with a minus(-) sign at the beginning.The modified contents do begin with a plus(+) sign. The contents of the two patch files are shown below for easy reference:

--- tk8.4.18-orig/generic/tkBind.c 2006-07-21 08:26:54.000000000 +0200
+++ tk8.4.18/generic/tkBind.c 2008-07-05 12:17:10.000000000 +0200
@@ -586,6 +586,9 @@
/* ColormapNotify */                                 COLORMAP,
/* ClientMessage */                                  0,
/* MappingNotify */                                    0,
+#ifdef GenericEvent
+ /* GenericEvent */                                 0,
+#endif
/* VirtualEvent */                                        VIRTUAL,
/* Activate */                                               ACTIVATE,
/* Deactivate */                                          ACTIVATE,

and

--- generic/tk.h.orig                     2008-02-06 16:31:40.000000000 +0100
+++ generic/tk.h                          2008-07-24 08:21:46.000000000 +0200
@@ -635,17 +635,15 @@
*
*---------------------------------------------------------------------------
*/
-#define VirtualEvent                (LASTEvent)
-#define ActivateNotify              (LASTEvent + 1)
-#define DeactivateNotify         (LASTEvent + 2)
-#define MouseWheelEvent    (LASTEvent + 3)
-#define TK_LASTEVENT       (LASTEvent + 4)
+#define VirtualEvent               (MappingNotify + 1)
+#define ActivateNotify             (MappingNotify + 2)
+#define DeactivateNotify       (MappingNotify + 3)
+#define MouseWheelEvent   (MappingNotify + 4)
+#define TK_LASTEVENT       (MappingNotify + 5)

#define MouseWheelMask       (1L << 28)
-
#define ActivateMask                  (1L << 29)
#define VirtualEventMask          (1L << 30)
-#define TK_LASTEVENT        (LASTEvent + 4)

/*
After doing all these stuffs, do install Tk from beginning again and also verify whether 'wish' runs properly(as indicated above).

2. Problem while running 'make' for OTcl

otcl.o: In function `OTclDispatch':
/home/barun/Desktop/ns2/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/barun/Desktop/ns2/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Nonrepresentable section on output
make: *** [libotcl.so] Error 1

Solution:

  1. goto the 'configure' file
  2. In line no. 5516

SHLIB_LD="ld -shared"
change the above to
SHLIB_LD="gcc -shared"
for further information you can gob to http://nsnam.isi.edu/nsnam/index.php/User_Information

3. Problem wile running ' sudo make install' for ns-2.34

ns: error while loading shared libraries: libotcl.so: cannot open shared object file: No such file or directory

Solution:

We need to set the following environment variables, and store them in the ~/.bashrc file.
 1    OTCL_LIB=/your/path/ns-2.34/otcl-1.13
2    NS2_LIB=/your/path/ns-2.34/lib
3    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB
Now open a new terminal, and type ns. This should now work without any error.

4. Problem while running 'make' for nam

rm -f tkcompat.o; gcc -o tkcompat.o -c -Wall -Wno-write-strings -DTCL_TK -DNO_VOID -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCLINT_H -DHAVE_TCL_H -I. -I/home/bibudhendu/Desktop/ns2/tclcl-1.19 -I/home/bibudhendu/Desktop/ns2/otcl-1.13 -I/usr/local/include -I/home/bibudhendu/Desktop/ns2/tcl8.4.19/generic -I/home/bibudhendu/Desktop/ns2/tcl8.4.19/generic tkcompat.c

rm -f tkUnixInit.o; gcc -o tkUnixInit.o -c -Wall -Wno-write-strings -DTCL_TK -DNO_VOID -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCLINT_H -DHAVE_TCL_H -I. -I/home/bibudhendu/Desktop/ns2/tclcl-1.19 -I/home/bibudhendu/Desktop/ns2/otcl-1.13 -I/usr/local/include -I/home/bibudhendu/Desktop/ns2/tcl8.4.19/generic -I/home/bibudhendu/Desktop/ns2/tcl8.4.19/generic tkUnixInit.c

rm -f xwd.o; gcc -o xwd.o -c -Wall -Wno-write-strings -DTCL_TK -DNO_VOID -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCLINT_H -DHAVE_TCL_H -I. -I/home/bibudhendu/Desktop/ns2/tclcl-1.19 -I/home/bibudhendu/Desktop/ns2/otcl-1.13 -I/usr/local/include -I/home/bibudhendu/Desktop/ns2/tcl8.4.19/generic -I/home/bibudhendu/Desktop/ns2/tcl8.4.19/generic xwd.c

xwd.c:87:29: error: X11/Xmu/WinUtil.h: No such file or directory make: *** [xwd.o] Error 1

Solution:
Install the package libxmu-dev. Then run

./configure
make clean
make
sudo make install

5. Problem while running 'make' for xgraph

/usr/include/stdio.h:651: note: expected ‘size_t * __restrict__’ but argument is of type ‘char *’
dialog.c:780: error: too few arguments to function ‘getline’
dialog.c: In function ‘getline’:
dialog.c:899: error: argument ‘lptr’ doesn’t match prototype
/usr/include/stdio.h:651: error: prototype declaration
dialog.c:899: error: number of arguments doesn’t match prototype
/usr/include/stdio.h:651: error: prototype declaration
make: *** [dialog.o] Error 1

Solution:

Download the patch below-

http://archive.ubuntu.com/ubuntu/pool/universe/x/xgraph/xgraph_12.1-12.diff.gz

Note: copy and unzip the above patch file into xgraph-12.1
view source
print?
1 patch < xgraph_12.1-12.diff
After applying the patch if you see in get any problem with the configure.in file like

configure.in:3: version mismatch. This is Automake 1.11,
configure.in:3: but the definition used by this AM_INIT_AUTOMAKE
configure.in:3: comes from Automake 1.11.1. You should recreate
configure.in:3: aclocal.m4 with aclocal and run automake again.

then goto configure.in file and add 'AC_LOCAL' in the first line.