Ok,

The reason this wasn't working was because I'd defined the links to and from
$n1 prior to updating $n1's entry point.  Thus, the following code works...

--
# Create nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]

# Create MyAgent
# NOTE: $n1's entry point must be updated before connecting links
set agnt [new Agent/MyAgent]    
$ns attach-agent $n1 $agnt      
$n1 insert-entry [new RtModule] $agnt "target"

# Create links
$ns duplex-link $n0 $n1 5Mb 2ms DropTail
$ns duplex-link $n1 $n2 5Mb 2ms DropTail
--

MyAgent will receive every packet passing $n1.  MyAgent will send via the
original classifier.

Regards,

Tim


daft wrote:
> 
> Hi 
> 
> I'm trying to swap out the default classifier in a node for my own agent.
> The following code inserts my agent into the entry point of the node...
> 
> # Create CSG
> set agt [new Agent/MyAgent]   
> puts "Node entry: [$n1 entry] agt entry: [$agt target]"
> $ns attach-agent $n1 $agt     
> $n1 insert-entry [new RtModule] $agt "target"
> puts "Node entry: [$n1 entry] agt entry: [$agt target]"
> 
> The final puts statement shows that the entry point of $n1 is correctly
> assigned to $agt, and the agents target is set to the original classifier
> (which is the behaviour I'm after).
> 
> However when I send a packet to $n1 the original classifier is invoked
> first, and if I send a packet through $n1 the original classifer is used
> and my agent is never invoked.
> 
> Any ideas what's going wrong/on?
> 
> Thanks
> 
> Tim
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/node-entry--tf3138100.html#a8706560
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to