[ns] Passing arguments when creating a TCPAgent in .tcl file

2009-01-09 Thread pankaj chand


 There is an instproc init {} procedure each for Agent and for Agent/TCPAgent.
I could not find the instproc init {} procedure of Agent/TCP/Reno or any of the 
other TCP Agents.
 
Why?
 
Is it because they inherit in a virtual way from class TCPAgent?, and so the 
instproc init {} procedure of the class TCPAgent is called only once for each 
of them.
 
Then how do we differentiate between the creation of the different TCPAgents 
from only one instproc init {} procedure of class TCPAgent.
 
My main objective is to pass arguments to the new Agent/TCP/Reno command which 
will pass the arguments to its respective init procedure (which I cannot find) 
and then the arguments will be passed to its static class constructor in the 
tcp-reno.cc file so i can choose whether or not to pass an argument to the 
constructor of the actual class RenoTcpAgent.
 
The main idea is to add one more constructor to class RenoTcpAgent and then to 
be able to choose which constructor to call when creating the object from the 
tcl script like set tcpreno [new Agent/TCP/Reno].
So i thought i would do it by passing an argument like set tcpreno [new 
Agent/TCP/Reno arg1].
 
Any help, advice or suggestions for the above problem, or achieving a solution 
of some kind will be appreciated.
 
Many thanks in advance.
 
Pankaj
_
See all the ways you can stay connected to friends and family
http://www.microsoft.com/windows/windowslive/default.aspx


Re: [ns] how to remove ns-2.33 finally from my system

2008-10-12 Thread pankaj chand


To the best of my knowledge
 
Delete the ns-allinone-2.33 folder.
Delete all the lines which have the ns-allinone-2.33  string in the 
.bash_profile file.
 
there should remain atleast one line with PATH=$PATH:$Home blah blah
 
you did not specify if it was a ns-allinone or a custom installation of ns-2.33.
pankaj
_
Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only 
on Live.com 
http://www.live.com/?scope=videoform=MICOAL


Re: [ns] errors when type make

2008-10-12 Thread pankaj chand


You can try doing MAKE with a fresh installation of ns2.33 on a different user 
on your linux.if it doesn't work, then your compiler or your lib.so files might 
have a problem, or ns2.33 might not be compatible with your linux, or you will 
need to install some patches.If you made some changes in the c++ code, 
especially to the packet.h or packet.cc files then it might help if you 
provided the changes to us. And then it would be a simple case of c++ code 
debugging.
pankaj
_
Want to explore the world? Visit MSN Travel for the best deals.
http://in.msn.com/coxandkings


[ns] How to get a Tcl handle to a dynamically created c++ object

2008-10-12 Thread pankaj chand


In my Tcl file, How do I get a handle to an object which is getting implicitly 
(dynamically) created.
 
I want to access some of the binded c++ variables of the object in my Tcl file.
 
For example, the MySnoop.tcl file in ns-2.33/tcl/ex/snoop
 
It specifies the creation of an LL/LLSnoop object which is an object of class 
LLSnoop.
 
Now LLSnoop object dynamicaly (on-the-fly) creates Snoop object of class Snoop.
It creates it dynamically by calling a Tcl procedure get-snoop which creates a 
Snoop object, and then it typecasts it to a pointer Snoop *snoop.
 
I want to get a TCL handle to this Snoop object which is dynamically created so 
as to track some of its variables on a time basis.
 
Please Refer to files ns-2.33/tcp/snoop.h and ns-2.33/tcp/snoop.cc
 
I already know how to get handle to the LLSnoop object, but thats because it is 
explicitly specified in the Tcl file.
 
I was thinking,
Is there a way to specify the Tcl handle or bind the Snoop 
object at the time of creation (but it is not created in the Constructor).
 
Please Help
thanks in advance
 
pankaj
_
Searching for the best deals on travel? Visit MSN Travel.
http://in.msn.com/coxandkings


[ns] Binding Static Variables is not working- please help

2008-10-12 Thread pankaj chand


I tried Binding a Static Variable, based on how it is described in the 
ns-documentation section 3.5.1, but it is not working.
The simulator is not recognizing the Classname that I am giving.
Here is what I tried
 
I added the static variable in snoop.h in the class Snoop declaration in 
snoop.h
 
static int bufsize_;
 
I defined it in the snoop.cc file
 
int Snoop::bufsize_;
 
I did this
 
class SnoopBufferClass : public TclClass {
protected:
SnoopBufferClass(const char* classname, int bufsize);
TclObject* create(int argc, const char*const* argv);
/* These two implements OTcl class access methods */
virtual void bind();
virtual int method(int argc, const char*const* argv);
};
 
void SnoopBufferClass::bind()
{
/* Call to base class bind() must precede add_method() */
TclClass::bind();
add_method(bufsize);
}
 
int SnoopBufferClass::method(int ac, const char*const* av)
{
Tcl tcl = Tcl::instance();
/* Notice this argument translation; we can then handle them as if in 
TclObject::command() */
int argc = ac - 2;
const char*const* argv = av + 2;
if (argc == 2) {
if (strcmp(argv[1], bufsize) == 0) {
tcl.resultf(%d, Snoop::bufsize_);
return (TCL_OK);
}
} else if (argc == 3) {
if (strcmp(argv[1], bufsize) == 0) {
Snoop::bufsize_ = atoi(argv[2]);
return (TCL_OK);
}
}
return TclClass::method(ac, av);
}
 
After this, I tried to use the following OTcl command to access and change 
values of Snoop::bufsize__:
 
SnoopBuffer bufsize 120
set i [SnoopBuffer bufsize]
set i [SnoopBuffer set bufsize]
 
RESULT: invalid command SnoopBuffer
 
After this, I tried to use the following OTcl command to access and change 
values of Snoop::bufsize__:
 
SnoopBufferClass bufsize 120
set i [SnoopBufferClass bufsize]
set i [SnoopBufferClass set bufsize]
 
RESULT: invalid command SnoopBufferClass
 
I even tried to add a constructor in snoop.cc
 
SnoopBufferClass::SnoopBufferClass(const char* classname, int 
bufsize):TclClass(SnoopBuffer), bufsize_(0)
{
 return 0;
}
 
 
Still same reply
 
Please Help me out with this
 
If you have a working example of binding a static variable please refer it to 
me.
(Except the offset variable in PacketHeader, I cannot understand what is going 
on over there)
The main goal is to get the interpreter to recognise the classname I am 
creating.
 
Any help or suggestions you can give me will be appreciated.
 
thanks in advance
 
pankaj
_
Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only 
on Live.com 
http://www.live.com/?scope=videoform=MICOAL


[ns] using raw2xg and raw2xg_sctp to parse sent tcp and sctp pkts from trace files

2007-04-20 Thread pankaj chand

hi im having problems plotting the sent pkts in xgraph due to problems in 
using raw2xg with trace files.


does anyone know which option in raw2xg is used to plot sent tcp pkts, or 
sent thruput.

-a is for acks
-v is for events
-d is for drops
but which option is for the sent pkts.

also, what is option -n for. i thought -n option would pasrse the packets, 
but its not working all the time, and what is the significance in the value 
passed with option -n. like -n 0, or -n 1 etc.


thanks in advance
pankaj

_
Tried the new MSN Messenger? It’s cool! Download now. 
http://messenger.msn.com/Download/Default.aspx?mkt=en-in




[ns] differentiating between duplicate pkts in trace file

2007-04-01 Thread pankaj chand


hi
i am duplicating tcp pkts using

Packet *pkt = p-copy();

and sending the duplicate along another link.

as both tcp pkts are identical in every way, how do i differentiate between 
them in the trace file.
or is there any way i can change a variable in the duplicate pkt which will 
be visible in the trace file, i.e. which can be used to differentiate it in 
the trace file.


thanks in advance
pankaj

_
The idiot box is no longer passé; it's making news and how! 
http://content.msn.co.in/Entertainment/TV/Default.aspx




[ns] need a tcl script for replicator for tcp packets

2007-03-26 Thread pankaj chand

hi
can anyone please send me a sample Tcl script which makes use of the 
Multicasting or Replicator to replicate TCP packets and send to all 
neighboring nodes. or tell me where to find such a script.

im particularly interested in replicating the packets and sending it to all 
neighboring nodes.

thanking you in advance
pankaj chand

_
Sign in and get updated on all the action from Formula One 
http://content.msn.co.in/Sports/FormulaOne/Default



[ns] ns and nam is getting confused

2007-03-25 Thread pankaj chand

hi
with the current protocol i am implementing, i am duplicating each tcp 
packet at an intermediary node in c++ using

Packet *pkt = p-copy();

and sending the duplicate packet along another link to another node.
however, the ns and the nam simulation is getting confused as to which 
packet is which, as the packets are identical in every way including the tcp 
sequence no. (except their c++ handles i.e. p and pkt). when i try to 
monitor the pkts in nam, the nam gets confused as to which pkt is the actual 
tcp pkt and only tracks the latter pkt that i put the monitor option on.

i ve introduced a new field in the class Packet to keep track of which 
packet is which. i initialize this field in the Packet constructor with 0, 
and increment or set it in the classifiers. however, this field is 
automatically getting initialized again and again to 0 in an irregular way. 
this can only happen in the constructor.

i have concluded that there is only one way that this can happen. when the 
packet is going from  one node to the other, or from a particular layer to 
the next, the original packet object is not being recieved by the target, 
but the packet is being copied into a new Packet object without taking into 
consideration the new field i have put in, and then this new packet is 
recieved by the target.
(i dont know exactly where this is happening).

the old original packet object is either freed or represents one of the many 
infamous memory leaks.

have i concluded right. if so or if not, please tell me how i can rectify 
the situation, so that the new field which i have added to the class Packet 
is not initialized more than once.

i will very grateful if anyone can shed some light onto this problem.

thanking you
pankaj chand

_
Get Married in 2007. Join Shaadi.com 
http://www.shaadi.com/ptnr.php?ptnr=mhottag



[ns] implementation (source code) of Tcl_GlobalEval() function

2007-03-07 Thread pankaj chand

hi
can anyone please tell me where i can find the implementation (source code)
of the Tcl_GlobalEval() function, so that i can know which c++ functions it
calls and in which order.

NOTE: the Tcl_GlobalEval() function is executed by the eval() function in
class Tcl.

thanks in advance

email: [EMAIL PROTECTED]

_
Airtel Song Catcher. Get your Hello Tunes instantly 
http://www.airtel.in/songcatcher/SONG_CATCHER.html



[ns] sizes of different types of packets

2007-03-07 Thread pankaj chand

can anyone please tell me where i can find the sizes of different types of 
packets. example tcp, udp, ack, message, rtproto etc.

in particular, when im manually duplicating a 60 byte tcp pkt and forcibly 
sending it to a non recipient node and then dropping it at that node's LL 
(link layer), the non recipient node automatically returns a 40 byte tcp pkt 
with the SAME seqno (sequence no). but it is defintely a different pkt, as 
it is 40 bytes (not the original 60 bytes) and shows up differently when 
tracked in the nam (network animator).

the configuration of the node is a mobile IP base station in heirarchical 
routing with Mac802.11,
Channel/WirelessChannel and Phy/WirelessPhy.

so, my question is, what is this 40 byte pkt. is it nessecarily tcp (which 
is shown when i click on it)
or something else like MESSAGE pkt.

how is this pkt being automatically generated at the node in response to a 
stray or misguided tcp pkt. and why and where (from which layer) is it being 
generated from, so that i can manually suppress it.

if anyone can tell me where i should suppress it at (mac802.11 functions, 
wirelesschannel functions or wirelessphy functions) or how do i found out 
which function or line is generating that pkt to have the same seqno, i will 
be very grateful.

thanks in advance

email: [EMAIL PROTECTED]

_
Catch all the cricketing action right here. Live score, match reports, 
photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx



[ns] debuggin c++ in ns

2007-02-28 Thread pankaj chand

hi can anyone please tell how to debug the c++ source code in ns. after 
adding the -g and several other statements in the makefile.in and install 
file, im able to debug but the debugger cannot find the source code, and 
hence cannot show me the line of code which is raising the error (bug).
i am calling the debugger on the ns binary executable in the 
ns-allinone2.29/bin folder.
how do i make the debugger, GDB or DDD find the source code of the ns 
program so as to find the exact line of code that is generating the bug.

thanks in advance.
pankaj chand
mail address: [EMAIL PROTECTED]

_
Airtel Song Catcher. Get your Hello Tunes instantly 
http://www.airtel.in/songcatcher/SONG_CATCHER.html



[ns] how to capture a tcp packet at the Home Agent in Mobile IP

2007-01-21 Thread pankaj chand

in Mobile IP, when the Home Agent is encapsulating tcp pkts to send to the 
Foreign Agent, im not able to detect or capture these Tcp pkts in the LL 
object of the Home Agent base station by omparing them with PT_TCP, however 
all other types of pkts can be detected. can anyone please tell me how to 
detect the tcp pkts in the LL of the Home Agent Base station during 
Encapsulation of the pkts.
thanks in advance
[EMAIL PROTECTED]
pankaj chand

_
Spice up your IM conversations. New, colorful and animated emoticons. Get 
chatting! http://server1.msn.co.in/SP05/emoticons/



[ns] how to configure nam for correct seqnos

2006-11-26 Thread pankaj chand

in ns2.28,in the nam simulation the seq no of retransmitted tcp pkts is not 
quite right. whether the pkt is an old retransmittted pkt or new pkt, the 
seq no keeps increasing. i would like to configure nam to actually show the 
correct seq nos of retransmitted pkts.
has anyone got an idea of how to do this?
thanks in advance
pankaj

_
Connect with your friends who use Yahoo! Messenger with Voice. Click! 
http://www.msnspecials.in/wlmyahoo/index.asp



[ns] how to send only 2 tcp packets

2006-08-23 Thread pankaj chand

can anyone please tell  me how to send only 2 tcp packets in a simulation. 
these 2 pkts must also be rxmitted if nessecary.
thanks in advance




[ns] how to smiulate mobile ipv6

2006-08-08 Thread pankaj chand

hi can anyone tell me how to simulate mobile ipv6. i want to not use mobile 
ipv4 and instead use mobile ipv6.
thanks
pankaj




[ns] how to perform Mobile IPv6

2006-08-02 Thread pankaj chand

hi can anyone tell me how to perform Mobile IPv6. ill be using a wired cum 
wireless scenario, similar to the Mobile IPv4 example given in ns2.
thanks
pankaj