Deer Teerawat I already know how to transmit to node. 1.generate new packet 2.fill common header and destination address 3. target->recv(p,h) but my problem is that, I can't find out previous hop's address. My purpose is to send a packet to previous node in IFQ. But when packet received by queue's recv function. I can't find anything about previous hop's address in common header, ip header or mac-802_11 header. I also know that in routing object, it can find out the next hop's information in routing table. But unfortunately in IFQ can't access routing object's functions.
any way, thanks a lot of ur reply. Howard 2008/11/11 Teerawat Issariyakul <[EMAIL PROTECTED]> > > Dear Howard, > > The easiest way to transmit from one NsObject (e.g. Nodes) to another is > through a (C++ and Tcl) Connector object. A connector has two pointers > to NsObjects: target_ and drop_. In the OTcl domain, it uses an OTcl > commands "target" and "drop" (followed by the name of the NsObject) > to specify its "forwarding object" and "dropping object" > > A Connector object recieves a Packet "p" through its funciton > recv(p,h). Upon receiving a packet, the Connector object forwards the > packet "p" to its forwarding object by executing > "target_->recv(p,h)". To drop a packet, the function drop(p) of a > Connector object is invoked. In this case, the packet is forwarded to > the dropping object "*drop_" which is responsible for destroying the > packet. > > To find out more about Connector please refer to chapter 5 in the > following book from Springers: > > If you are a beginning user, you may look at the following book from > Springer. > > T. Issaraiyakul and E. Hossain, "Introduction to Network Simulator > NS2", Springer 2008. > > Here is the link: > http://www.springer.com/engineering/signals/book/978-0-387-71759-3 > > You might also find the following slide useful: > http://www.ece.ubc.ca/~teerawat/NS2.htm< > http://www.ece.ubc.ca/%7Eteerawat/NS2.htm > > On 11/11/2008, "howardgod howardgod" <[EMAIL PROTECTED]> wrote: > > > > >---------- Forwarded message ---------- > >From: howardgod howardgod <[EMAIL PROTECTED]> > >Date: 2008/11/8 > >Subject: How to send a packet to previous node > >To: ns-users@isi.edu > > > > > >I want to send a packet to previous node. And I don't know how to find > >previous node's ID and where to fill the ID. > > > >I found that in common header, there's a prev_hop and next_hop_. But the > >prev_hop_ is NOT the previous node. It's the source. > > > >So I want to fill previous node's ID to common header's next_hop_. > > > >And is there anything else I have to fill? > > > >btw I found a way to do so. Reverse the ip header's src and dst then send > >it. but It still do nothing at all. > > > >HELP ME!! PLZ > > > >thanks a lot. > > > > Howard. > > >