[Ns-developers] [ns][MIP]Handover ARP problem
Michal Lewandowski
tk_michal at wp.pl
Sun Aug 21 07:31:36 PDT 2005
Hi all,
Im doing some experiments with Mobile IP and I think I found a serious problem.
Im using standard tcl file and I see that the time of handover is much to long.
After investigations I found out that handover ends when packet message is called.
I thing this is an ARP packet. When I set traffic to the Mobile Node I managed to solve this problem by calling arprequest() function by Foreign Agent every time MN tries to register.
The problem is when traffic is up, I mean when MN is a source. I tried calling arprequest() in several combinations, but with no positive results.
Does anybody know what is going on with this simulator (Im using ns2-28). Why this problem occurs at all? And how to solve it? I think everyone working with Mobile IP is in the same situation. Or maybe this ARP problem is well known, maybe updating ARP table after registration request is not in the standard, it is not a part of basic SUNs MIP model?
Thanks for help,
Michal
PS. Below there is ll:recv() function with my modifications.
/*
This shall be added in arp.cc
MobileNode*
ARPTable::get_node_michu()
{
return node_;
}
*/
void LL::recv(Packet* p, Handler* /*h*/)
{
hdr_cmn *ch = HDR_CMN(p);
hdr_arp *ah = HDR_ARP(p);
hdr_mip *miph = hdr_mip::access(p);
hdr_ip *ip_h = hdr_ip::access(p);
//char *mh = (char*) HDR_MAC(p);
//struct hdr_sr *hsr = HDR_SR(p);
/*
* Sanity Check
*/
assert(initialized());
//if(p->incoming) {
//p->incoming = 0;
//}
// XXXXX NOTE: use of incoming flag has been depracated; In order to track direction of pkt flow, direction_ in hdr_cmn is used instead. see packet.h for details.
// If direction = UP, then pass it up the stack
// Otherwise, set direction to DOWN and pass it down the stack
if(ch->direction() == hdr_cmn::UP) {
//if(mac_->hdr_type(mh) == ETHERTYPE_ARP)
if(ch->ptype_ == PT_ARP){
if(ah->arp_spa == 4194305) // I mean Mobile Node's IP here. Not very elegant way to do it
{
if(licznik < 10)
{
nsaddr_t src_arp = arptable_->get_node_michu()->address(); // this host's IP addr
nsaddr_t dst_arp = miph->ha_; //Home Address of Mobile Node
arptable_->arprequest(src_arp, dst_arp, this);
licznik++;
//printf(" src_arp %d\n", src_arp);
//printf(" dst_arp %d\n", dst_arp);
//printf("arprequest %d\n", licznik);
}
}
if(ah->arp_spa == 4194304) // I mean Mobile Node's IP here. Not very elegant way to do it
{
if(licznik2 < 10)
{
nsaddr_t src_arp = arptable_->get_node_michu()->address(); // this host's IP addr
nsaddr_t dst_arp = miph->ha_; //Home Address of Mobile Node
arptable_->arprequest(src_arp, dst_arp, this);
licznik2++;
//printf(" src_arp %d\n", src_arp);
//printf(" dst_arp %d\n", dst_arp);
//printf("arprequest %d\n", licznik);
}
}
if(ah->arp_spa == 8388608) // I mean Mobile Node's IP here. Not very elegant way to do it
{
if(licznik3 < 10)
{
nsaddr_t src_arp = arptable_->get_node_michu()->address(); // this host's IP addr
nsaddr_t dst_arp = miph->ha_; //Home Address of Mobile Node
arptable_->arprequest(src_arp, dst_arp, this);
licznik3++;
//printf(" src_arp %d\n", src_arp);
//printf(" dst_arp %d\n", dst_arp);
//printf("arprequest %d\n", licznik);
}
}
arptable_->arpinput(p, this);
//printf("arpinput %d\n", licznik);
}
else
{
if((miph->type_ == MIPT_REG_REQUEST) || (miph->type_ == MIPT_REG_REPLY) || (miph->type_ == MIPT_SOL)) //in FA
{
nsaddr_t src = arptable_->get_node_michu()->address(); // this host's IP addr
nsaddr_t dst = miph->ha_; //Home Address of Mobile Node
arptable_->arprequest(src, dst, this);
//uptarget_ ? sendUp(p) : drop(p);
//printf(" src %d\n", src);
//printf(" dst %d\n", dst);
//printf("uptarget_ MIPT_REG_REQUEST\n");
}
uptarget_ ? sendUp(p) : drop(p);
//printf("uptarget_\n");
}
return;
}
if((miph->type_) == MIPT_REG_REQUEST)
{
//double local_time = Scheduler::instance().clock();
//printf(" local_time MIPT_REG_REQUEST %.9f\n", local_time);
// printf("MIPT_REG_REQUEST %d \n", arptable_->get_node_michu()->address());
nsaddr_t src_down = 4194305; //arptable_->get_node_michu()->address(); // this host's IP addr
nsaddr_t dst_down = miph->coa_; //miph->coa_;
arptable_->arprequest(src_down, dst_down, this);
}
else if((miph->type_) == MIPT_ADS)
{
//double local_time = Scheduler::instance().clock();
//printf(" local_time MIPT_REG_REQUEST %.9f\n", local_time);
nsaddr_t src_down = 4194305; //arptable_->get_node_michu()->address(); // this host's IP addr
nsaddr_t dst_down = miph->coa_;
arptable_->arprequest(src_down, dst_down, this);
}
/*
nsaddr_t src_down = 4194305;
nsaddr_t dst_down = 8388608;
arptable_->arprequest(src_down, dst_down, this);
nsaddr_t src_down = 8388608;
nsaddr_t dst_down = 4194305;
arptable_->arprequest(src_down, dst_down, this);
nsaddr_t src_down = 8388608;
nsaddr_t dst_down = 4194304;
arptable_->arprequest(src_down, dst_down, this);
*/
double local_time = Scheduler::instance().clock();
if(local_time < 13)
{
printf(" time %.9f node %d packet %s\n", local_time, arptable_->get_node_michu()->address(), packet_info.name(ch->ptype()));
}
ch->direction() = hdr_cmn::DOWN;
sendDown(p);
}
----------------------------------------------------
26 sierpnia w Stoczni Gdańskiej koncert J.M.Jarre'a - "To będzie mój
najlepszy koncert - koncert wolności" - zapowiedział artysta.
http://klik.wp.pl/?adr=www.muzyka.wp.pl%2Fjarre&sid=468
More information about the Ns-developers
mailing list