I'm not sure I understand, and perhaps I've not adequately described what I'm trying to do, so I'll try again using a semi-hypothetical scenario: (Please keep in mind I'm new to ns!)
Suppose I've got the following topology: N1 - N2 - N3 And three "different" agents, (A1,A2,A3) which have all been implemented differently in C++. The basic idea is that I want these agents to automatically communicate with each other... In C++ I've written an A1::command() function that will 'send' sends an IP packet to the A2 agent. When the A2 agent receives this packet, it then sends a packet back to A1, which then gets returned to A2 (basically a 3-way handshake). A2 should then automatically send another packet to the A3 agent by creating a packet, and inserting N3's address in the IP header. (I'm assuming all of my agents and nodes know about the topology) In TCL I've done this: ------------------------------------ set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] set a1 [new Agent/A1] set a2 [new Agent/A2] set a3 [new Agent/A3] $ns attach-agent $n1 $a1 $ns attach-agent $n2 $a2 $ns attach-agent $n3 $a3 $ns connect $a1 $a2 #$ns connect $a2 $a3 ;# if I do this, the handshake doesn't work $ns at 0.0 $a1 send ------------------------------------ When I run this, ns gives me this error: --- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) --- _o158: no target for slot 3 _o158 type: Classifier/Port content dump: classifier _o158 0 offset 0 shift 2147483647 mask 1 slots slot 0: _o153 (Agent/A3) ---------- Finished standard no-slot{} default handler ---------- Basically I want A3 to look at any or all packets send to N3. How can I force this? I'm using ns-2.29 on Mac OS X 10.4.7. Thanks in advance! Brad On 7/2/06 6:10 PM, "Mark Shifrin" <[EMAIL PROTECTED]> wrote: > no problem with tcp > you can do attach agent as many time as you want to a single node. > you must first define it as tcp-source. and then to choose the application > which runs over this > tcp, for example i did it with FTP. moreover you can do it for n, within a > loop > > --- Brad Montgomery <[EMAIL PROTECTED]> wrote: > >> >> Hello All, >> >> I'm wondering if it's possible to have a single Agent connected to 2 or more >> other Agents. I have a topology similar to this: >> >> N2 >> | >> N0 -- N1 -- N3 -- N4 >> >> I have an agents A0, A2, A3 connected to N0, N2, N3 respectively, and I >> would like A0 to send a packet to A2, which would then in turn send a packet >> to A3. Is this possible? >> >>> From reading the mailing list archives, it seems like this may not be >> possible, so my second question would be this: >> >> Is it possible to attach an agent to a Node, and force that agent's recv >> function to get executed for every packet that passes through that node? >> For example: Could N2 send a packet to N4, so that A3's recv function >> processes that packet before sending it onward. >> >> Any help is GREATLY appreciated! >> >> Brad >> >> > > > enjoy the life - > Mark > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com