[ns] Creating a new sendpkt routine
Fri, 16 Feb 2001 10:40:24 +0900
Since I am not very familiar with the LS module, I don't know up to what
extend is this of any help, but
I have also implemented agents that do not depend on Otcl "connect" to
work, so I might be able to help you with that.
If you read "connect" (ns-lib.tcl) the main thing it does is
$src set dst_addr_ [$dst set agent_addr_]
$src set dst_port_ [$dst set agent_port_]
Now dst_addr_ and dst_port_ are binded with the C++ variable dst_ used
by the two references daddr() and dport().
So if you have the address and the port of the agent you want to send a
packet to, lets say at agAddr and agPrt ( I assume you know how to get
these, right?) what you do is :
Packet* pkt= allocpkt();
and your brand new packet has destination address and destination port
the address and port of the agent you are sending it to.
I dont know if this helped, or if it is what you wanted to do, but my
impression is that there is no reason to mess directly with the
By the way it is easy to find out what wrong with your error. Make your
agent dump the dst_ values ( addr and port) somewhwere before sending
the packet and check it against the classifier mask to see what you get.
if it is something other than 0,1,2 you haven't overwwritten the dst_
Andreas Alexelis, Lab.1 ACR,
Advanced Telecommunications Research, Japan