Check the ip header's tll and make sure that it is greater than 1. For example: iphdr->ttl() = 10; I am not sure about the value it must take, but it mustnt be 1.
adoul_2009 wrote: > > > > > > > Hi dears ns-users, > > I'm writing an agent that broadcast a packet to All the neighbor > nodes in the MANET network. I have search for a long time > in the Internet to do it with ns2.33 but I fail. In fact, the problem is > that only neighbors in the range of one hop from the sender node > can receive the packet !! I have used many Ad hoc routing protocols (even > OLSR !! ) but the problem remains the same. The solution > proposed for the broadcast problem by Jeff Bolen didn't resolve the > problem. ( Please follow this link for more details : > http://www.isi.edu/nsnam/archive/ns-users/webarch/2000/msg02832.html). In > his proposition Jeff says that we should make > a duplicate the packet and send a copy with the original packet up but I > didn't know how to do it and in which layer !! :( ... I absolutely agree > with Sanjay Raghani in its post ( Please follow this link for more details > : http://www.mail-archive.com/[email protected]/msg02771.html ) > when he says that the solution of Jeff is not the correct one for many > reasons but till now I don't have any idea how to proceed to solve my > problem :( > Really I'm very confused !! > > My C++ function which I use to broadcast the packet is below : > > void DistacAgent::broadcast_packet( ) > { > > Packet *p = allocpkt(); > if(p==NULL){ > abort(); > } > > hdr_cmn *ch = HDR_CMN(p); > hdr_ip *ih = HDR_IP(p); > > //filling the Common header > ch->ptype() = PT_DISTAC; // My agent packet type !! > ch->size() = IP_HDR_LEN + sizeof(hdr_distac); > ch->iface() = -2; > ch->error() = 0; > ch->addr_type() = NS_AF_NONE; > ch->prev_hop_ = Agent::addr(); > ch->next_hop() = IP_BROADCAST; > ch->direction() = hdr_cmn::DOWN ; > > //filling the IP header > ih->saddr() = Agent::addr(); > ih->daddr() = IP_BROADCAST; > > ih->sport() = DISTAC_PORT; > ih->dport() = DISTAC_PORT; > > ih->ttl_ = 32; > > // and finally sending the packet by putting it on the scheduler > Scheduler::instance().schedule(target_, p, 0); > > } > > Please if you can help or have any idea about this topic, don't hesitate > to write to me and many thanks in advance. > > Regards !! /Adel. > > Windows Live: Keep your friends up to date with what you do online. > > Windows Live: Friends get your Flickr, Yelp, and Digg updates when they > e-mail you. > _________________________________________________________________ > Windows Live: Make it easier for your friends to see what you’re up to on > Facebook. > http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009 > -- View this message in context: http://old.nabble.com/Multihop-Broadcasting-in-MANET-with-ns2-tp25938572p31154537.html Sent from the ns-users mailing list archive at Nabble.com.
