[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Collision using Mac-802_3 and retransmission



Hi,

While working with LAN on ns I have noticed that there is no
retransmission after collision. I made some change to the code because I
found that ETHER_ADDR(mh->mh_da) in mac-802_3.cc is always 0. The
following change is made to Mac802_3::discard(Packet *p,const char*):

        // Added by PAUL
        char* mha = (char*)p->access(hdr_mac::offset_);
        int dst = this->hdr_dst(mha);
        if (dst == index_)
          {
            //if (drop_ !=0) printf("do recv(p)");
          drop(p);
          }
        else      
          Packet::free(p);
          
        // End Added by PAUL


          //Commented by PAUL
          /*    
                hdr_mac802_3* mh = (hdr_mac802_3*)p->access(off_mac_);
                if((u_int32_t)ETHER_ADDR(mh->mh_da) ==
(u_int32_t)index_)
                drop(p);
                else
                Packet::free(p);
          */
          //End Commented by PAUL

Is this right??

Now drop(p) is called when it is necessary but in the drop(p) drop_ is
also 0. 
        1- How to change drop_ with the ns script using drop-target?
        2- Anyway drop doesn't retransmit. How to retransmit? and what
drop stands for?
        3- Can I forget about drop and redirect the packet whith a
backoff and how?

Thanks.