[ns] installation problem???????????????????

2008-04-06 Thread mohamed saad


salam alikom

i already set environment but i want to sure that was set correctly i guess 
that i set it wrong how i sure that i set it correctly

gazak allah khairn

   
-
You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.


Re: [ns] How to implement flooding for wired nodes (IP_BROADCAST usage)?

2008-04-06 Thread feel2chat

there is an example script: /ns-allinone-2.32/ns-2.32/tcl/ex/flooding.tcl

On Sun, Apr 6, 2008 at 12:00 AM, srupesh [EMAIL PROTECTED] wrote:


  Hi,

  I am a beginner  for ns2. I want to test flooding in wired nodes. I
  went through the posts related to it but couldn't find the solution.
   There is a link related to this issue but there is no solution---

  http://mailman.isi.edu/pipermail/ns-users/2006-January/053762.html

  is it possible to invoke user defined recv() method implicitly after calling
  Connector::send()??

  anybody please give the information for this problem??

  I am posting both C++ code and tcl code here..

  I defined a new packet header here..

  #ifndef BCAST_PKT_H_
  #define BCAST_PKT_H_

  #include packet.h
  #include config.h

  #define HDR_BCAST_PKT(p) hdr_bcast_pkt::access(p)
  struct hdr_bcast_pkt {

  nsaddr_t   pkt_src_; // Node which originated this packet
  u_int16_t pkt_len_;  // Packet length (in bytes)
  u_int8_t   pkt_seq_num_; // Packet sequence number

  inline nsaddr_t   pkt_src() { return pkt_src_; }
  inline u_int16_t pkt_len()  { return pkt_len_; }
  inline u_int8_t   pkt_seq_num() { return pkt_seq_num_; }

  static int offset_;
  inline static int offset() { return offset_; }
  inline static hdr_bcast_pkt* access(const Packet* p) {
  return (hdr_bcast_pkt*)p-access(offset_);
  }

   };



  #endif /*BCAST_PKT_H_*/

  implementation of IP_BROADCAST

  int hdr_bcast_pkt::offset_ ;
  class MyAgent : public Agent{
  public :
 MyAgent();
  protected :
 int command(int argc,const char*const* argv);
  private:
 //int  my_var1;
 //double   my_var2;
 nsaddr_t   ra_addr_;
 void my_func(void);
 void my_bcast(Packet *p);
 void recv(Packet* pkt, Handler*);
  };
  static class bcastHeaderClass : public PacketHeaderClass {
  public:
 bcastHeaderClass() : PacketHeaderClass(PacketHeader/bcast,
sizeof(hdr_bcast_pkt)) {
 bind_offset(hdr_bcast_pkt::offset_);
 }
  } class_bcast_hdr;

  static class MyAgentClass : public TclClass {
  public :
 MyAgentClass() : TclClass(Agent/MyAgentOtcl) {}
 TclObject* create(int argc,const char*const* argv) {
 return (new MyAgent());  
 //(nsaddr_t)Address::instance().str2addr(argv[4])
 }
  } class_my_agent;

  MyAgent::MyAgent() : Agent(PT_bcast) {  //nsaddr_t id
 //bind(my_var1_otcl,my_var1);
 //bind(my_var2_otcl,my_var2);
 //ra_addr_ = id;

  }

  int MyAgent::command(int argc,const char*const* argv) {

 if(argc == 2) {
 if(strcmp(argv[1],callmyfunc) == 0) {
 my_func();
 return (TCL_OK);

 }
 if(strcmp(argv[1],sendpkt) == 0) {
 Packet* newpkt = allocpkt();
 //some packet configuration
 my_bcast(newpkt);
 //recv(newpkt,0);
 return (TCL_OK);
 }
 }

 return (Agent::command(argc,argv));
  }

  void MyAgent::my_func(void) {
 Tcl tcl = Tcl::instance();
 tcl.eval(puts \Message from my_func\);
 //tcl.evalf(puts \ my_var1= %d\,my_var1);
 //tcl.evalf(puts \ my_var2 = %f\,my_var2);

  }



  void MyAgent::my_bcast(Packet *p)
  {
  hdr_cmn* hdrcmn = HDR_CMN(p);
  hdr_ip* iphdr = HDR_IP(p);
  hdr_bcast_pkt* ph  = HDR_BCAST_PKT(p);

  //ph -pkt_src_ = ra_addr_;
  ph -pkt_len_ = 64;
  // set all the necessary things for the common header
  hdrcmn -size_= IP_HDR_LEN + ph-pkt_len();
  hdrcmn -ptype_   = PT_bcast;
  hdrcmn-next_hop_ = IP_BROADCAST;
  hdrcmn-prev_hop_ = this-addr();
  hdrcmn-direction() = hdr_cmn::DOWN;
  hdrcmn -size_= IP_HDR_LEN + ph-pkt_len();
  hdrcmn -ptype_   = PT_bcast;
  // setting the ip header
  iphdr-saddr() = this-addr();
  iphdr-sport() = 254; // 1-254
  iphdr-daddr() = IP_BROADCAST;
  iphdr-dport() = 254; // 1-254
  iphdr-ttl() = 32;
  //Scheduler::instance().schedule(target_, p, 0.0);
  send(p,0);
  Tcl tcl = Tcl::instance();
  tcl.eval(puts \Message from my_bcast()\);
  }


  void MyAgent::recv(Packet* pkt, Handler*)
  {
 Tcl tcl = Tcl::instance();
 tcl.eval(puts \1Message from recv()\);
  hdr_cmn* hdrcmn = HDR_CMN(pkt); //Access the common header for the received
  packet:
  hdr_ip* hdrip = HDR_IP(pkt); // Access the IP header for the received
  packet:
  cout  node   this-addr()  received from node  
  hdrcmn-prev_hop_;

 tcl.eval(puts \2Message from recv()\);
  }


  Front end Tcl code  :

  set ns [new Simulator]

  set n0 [$ns node]
  set n1 [$ns node]
  $ns duplex-link $n0 $n1 1Mb 10ms 

[ns] ns-2.29 installation problem: trace.c compilation error

2008-04-06 Thread Salih ML

Has any one encountered the following error while installing 2.29. I
 tried installing the 2.29.1  2.29.2 but still got the same error:

 g++ -c -Wall  -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR
 -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H
 -DHAVE_LIBOTCL1_11 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H
 -DHAVE_LIBTCL8_4 -DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION
 -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE
 -Drng_test -I. -I/home/ns/ns-allinone-2.29.2/tclcl-1.17
 -I/home/ns/ns-allinone-2.29.2/otcl-1.11
 -I/home/ns/ns-allinone-2.29.2/include
 -I/home/ns/ns-allinone-2.29.2/include -I/usr/include/pcap -I./tcp
 -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac
 -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast
 -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr
 -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs
 -I./diffserv -I./satellite -I./wpan -o trace/trace.o trace/trace.cc
 ./sctp/sctp.h:705: error: extra qualification 'SctpAgent::' on member
 'DumpSendBuffer'
 make: *** [trace/trace.o] Error 1
 Ns make failed!

I checked the FAQ or ns-problems page but couldn't find the answer there.

I am trying to compile the code on a Ubuntu machine:
Linux x 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 GNU/Linux

Thanks,

salih



[ns] Finding set of nodes transmitting at a particular instance of time

2008-04-06 Thread Sanket Joshi

Hi,

I would like to find all nodes that are transmitting a packet at a
particular instant. Is it possible to obtain all the packet objects at a
particular instant of time in ns-2. If yes, then the information whether a
particular node is transmitting a packet is present in the packet header.
Thus, I can find the transmitting nodes.

Thanks,
Sanket