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

Re: simulation cross traffic





On Tue, 11 Nov 1997, Ken Tang wrote:

>           t1
>            |
>            |
> s1---- s2 ---------s3
>            |
>            |
>           t2
> 
> Hi, I was wondering how I can set up NS so that the packets from
> s1 and t1 goes to the same queue in s2 (s1 is sending packets to s3
> and t1 is sending packets to t2).  I have done some test and it seems
> that the packets going from s1 to s3 and packets going from t1 to t2
> are using different queues when they arrive at s2.  Is there a way to

You are right. Packets from s1 are going to the link(src=s2, dst=s3);
and packets from t1 are going through the link(src=s2, dst=t2).
I'm using ns1.3 and think ns2.0 has the same logic [do not have ns2.0
succ. yet].
One solution to your problem (I did the same way for my w/less research)
would be to create the object called Router or Gateway with single buffer
queue. Add this object to the link class. (this involves additional work
for otcl/tcl scripts - to enable the script syntax to add/attach GW to
the link). Then change link receiving function in such a way that, if the
link has attached router, it will not enqueue the packet but pass it to
the router. Router will get the packet, enqueue it, and then pass it to
the link. Here you have a choice. The link itself can enqueue the packet
or it can forward it right away. This may look a little awkward for ns2.0. 
I know it has MAC layer objects. So you can reuse MAC objects to do the
same thing. I just explained how I did the this in ns1.3

> make
> these packets go to the same queue in s2?  Thanks.
> 
> 
> Ken
>