- Home Page of ProjectGuideline.com ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- how to read header information?
Murugesan
Participant
hai
i am final year PG studnet ,doing myproject in WLAN ….. in queued paket, how can i collect or get parameter like TTL(Time To Live),data rate,queue length etc ..or is there any inbuilt function in NS2 ?…such a value i s need for me to create fuzzy scheduler. can you explain me regarding this.
CharlesPandian
Keymaster
Generally, in ns2, this kind of task can not done only with TCL scripts. You have to write the required code at specific areas of existing agents or you have to write your own agent to do the same.
For example, the following code segment is handling ttl.
hdr_ip *iph = HDR_IP(p);
hdr_cmn *ch = HDR_CMN(p);
int src = Address::instance().get_nodeaddr(iph->saddr());
int dst = ch->next_hop();
/*
* Must be a packet I'm originating...
*/
if(src == myaddr_ && ch->num_forwards() == 0) {
/*
* Add the IP Header
*/
ch->size() += IP_HDR_LEN;
iph->ttl_ = IP_DEF_TTL;
}
/*
Learn to write or manipulate agent code in ns2.
[/code]