[ns] regarding static arp in ns
SHARAT GEORGE
sharath at iitb.ac.in
Sun May 23 10:22:04 PDT 2004
hi,
saw this messge post on how to get static arps in wireless nodes..
im quite new to ns and did not quite understand the code snippet... i have
the following queries...
do i have to edit mac/arp.cc to have static arps?
is there any way i can have static arps for variable number of nodes that
i can change in my tcl script?
is there any way that i can increase the size of the arp table to hold
around 100 nodes so that the arp queries will be generated only in initial
simulation time?
whats is "p" in the code that had been posted? in >> hdr_ip *ip=HDR_IP(p)
kindly answer my queries, thanks in advance
regards,
sharath
-----------------------------prev post----------------------
Hi,
to make a static ARP cache you have to insert entries for all possible ip
destination addresses. The ARP entries do not time out.
Here is an example how to insert an entry: mapping of ip->saddr() to
mh->dh_sa
ARPEntry *llinfo;
hdr_ip *ip = HDR_IP(p);
struct hdr_mac802_11 *mh = HDR_MAC802_11(p);
llinfo = new ARPEntry(&arphead_, ip->saddr());
assert(llinfo);
llinfo->macaddr_ = ETHER_ADDR(mh->dh_sa);
llinfo->up_ = 1;
Stefan
More information about the Ns-users
mailing list