Paper

Saturday, March 27, 2010

Wireless MAC trace format

You could do as following steps:

1. Modify mac-802.11.cc

1.1 Mac802_11::sendCTS(int dst, double rts_duration)
{
Packet *p = Packet::alloc();
hdr_cmn* ch = HDR_CMN(p);
struct cts_frame *cf = (struct cts_frame*)p->access(hdr_mac::offset_);

assert(pktCTRL_ == 0);

ch->uid() = 0;
ch->ptype() = PT_MAC_CTS; ##### modify
ch->size() = ETHER_CTS_LEN;
ch->iface() = -2;
ch->error() = 0;
....
}
1.2 Mac802_11::sendRTS(int dst, double rts_duration)
1.2 Mac802_11::sendACK(int dst, double rts_duration)

Thursday, March 25, 2010

How to measure the queue length in the base station or mobile node?

1. modify queue/priqueue.h
#include "trace.h"
class PriQueue : public DropTail {
public:
PriQueue();
int command(int argc, const char*const* argv);
void recv(Packet *p, Handler *h);
void recvHighPriority(Packet *, Handler *);
// insert packet at front of queue
void filter(PacketFilter filter, void * data);
// apply filter to each packet in queue,
// - if filter returns 0 leave packet in queue
// - if filter returns 1 remove packet from queue
Packet* filter(nsaddr_t id);
void Terminate(void);
//added by smallko
Tcl_Channel tchan_; /* place to write trace records */
TracedInt curq_; /* current qlen seen by arrivals */
void trace(TracedVar*); /* routine to write trace records */
…………………….

Gnuplot2

Trace file + plotting data

Refer to : Udin Harun

Gnuplot1

Plotting data

Url: http://t16web.lanl.gov/Kawano/gnuplot/intro/index-e.html

Install NS2-AllInOne-2.33 on Ubuntu 8.04

This is an example of the NS2-AllInOne-2.33 installation.

Suppose that there is "ns-allinone-2.33.tar.gz" in current directory (e.g. "~/" for me is "/home/alien").
All steps are done in Terminal, so open a terminal in Accessories/Terminal.

ns2 tutorial

Web site yang paling ok utk study tntg ns2..
Beginners must learn from this site..

ns2 learning guide