[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions on ns emulation. (fwd)



Hello, 

I got some problems while I am running ns emulation for UDP. I will
describe it below:

I have a very simple C program called talk, which basically just sends udp
packets to certain host + port number, and receives udp packets sent to
itself.

Also, I wrote a little tcl script, which uses Network/IP/UDP network
object and tap agent. There are two nodes--node 1 attaches
to tap agent 1, node 2 attaches to tap agent 2. Both tap agents 1 and 2
are "network"ed to udp network objects, say udp1 and udp2. There is also a
simplex link from tap agent1 to tap agent 2. 

udp1 was bound on local port, and udp2 was connected to the remote host +
port number.  Therefore,  when tap agent 1 receives a udp packet coming
from the real world, talk for example, it will pass the packet  to tap
agent 2. Then, tap agent2 will send it back to talk.

It works well with my first packet: when I run the tcl script and talk,
talk sends what I typed to ns and gets the packet back, which contains
what I have typed exactly. 

But, I can not send packets any more. It seems to me that the tap agent or
the udp network object stops working...:(

Could someone please give me some suggestions on how to solve the problem?
I can send you my tcl script if needed. 


Plus, I got 2 problems while reading the nse code:
1. Since we use the real time scheduler in our simulation, the simulation
is supposed to stop at the stop time specified. Can I schedule a finish
function for the script (to close the network, etc) at the stop time?

2. Where is the "dispatch" function in tap/agent being invoked? The
scheduler, I guess...

Thanks a lot for your time and help,

regards,
-chen