Dear all,
I was using UM-OLSR (0.88, NS2.29) to simulate the network and trying to do
some operation at the destination. Normally, we add this kind of code in the
recv() method for reception:
*recv() {*
.....
**
* if (ch->direction() == hdr_cmn::UP &&
((u_int32_t)ih->daddr() == IP_BROADCAST || ih->daddr() == ra_addr())) {
//....do sth. ...*
* dmux_->recv(p, 0);
return;
}*
**
*}*
**
But it seems that when the NS2 is trying to receive the packet at the
destination, the recv() method is never called, and the packet is delivered
directly from the MAC layer to AGT layer. And from the trace file I got:
r -t 9.799191277 -Hs 1 -Hd 1 -Ni 1 -Nl MAC -Nw --- --Ii 622 -Iv 29 -Pn cbr
-Pi 0 -Pf 4 -Po 3 //the mac layer of the destination get the packet
r -t 9.799216277 -Hs 1 -Hd 1 -Ni 1 -Nl AGT -Nw --- --Ii 622 -Iv 29 -Pn cbr
-Pi 0 -Pf 4 -Po 3 //and pass it to the AGT layer, without passing the
RTR layer
The situation is the same with DSDV and AODV protocol in NS2.
But in DSR, we have:
r -t 9.801548775 -Hs 1 -Hd 1 -Ni 1 -Nl MAC -Nw --- - -Ii 0 -Iv 30 -Pn cbr
-Pi 0 -Pf 3 -Po 3
r -t 9.801573775 -Hs 1 -Hd 1 -Ni 1 -Nl RTR -Nw --- --Ii 0 -Iv 30 -Pn cbr
-Pi 0 -Pf 3 -Po 3 //here the packet is in RTR layer!!! This is what I
want
r -t 9.801573775 -Hs 1 -Hd 1 -Ni 1 -Nl AGT -Nw --- - -Ii 0 -Iv 30 -Pn cbr
-Pi 0 -Pf 3 -Po 3
I try to analyse the differece in the code between the protocols, but have
no idea about this problem. Is there anyone know about it? It will really
save my ass....
Thank you in advance.
Best regards,
J. Yi