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

Re: LAN simulation with ns



Cristiano,

Please post your future questions to ns-users list.

Cristiano Santoni <[email protected]> writes:

> I have some problems in modeling LANs with ns; can you please help me?
> 
> 1. Is it possible to see collisions and retransmissions    in NAM or
> in any trace file?

I've never done that and I suppose it's not there.  It shouldn't be
too difficult to add - probably you'll just have to set a drop target
for the mac layer.  You'll need to study mac c++ code for that.

> 3. What is the meaning of the tcl object "LanNode"         and how is
> to be used?

LanNode is a "virtual" node.  Its primary purpose is to make LANs work
with ns routing.  Ns topology is stored in link_() array indexed by
source and destination.  To represent connectivity of a LAN you can
either set a mesh of links or create another virtual node.  Example:

         1     3
     ----+--+--+----
            2

To fit this three node lan into link_() : 

a) mesh of links to show that any node can send packets to any other node:  
	set link_(1:2) ...
	set link_(2:3) ...
	set link_(3:1) ...
	set link_(2:1) ...
	set link_(3:2) ...
	set link_(1:3) ...
b) "virtual node": 4
	set link_(1:4) ...
	set link_(2:4) ...
	set link_(3:4) ...
	set link_(4:1) ...
	set link_(4:2) ...
	set link_(4:3) ...

note, that b scales better than a for larger number of nodes.

Aside from that, LanNode is a container for all shared lan objects,
including LanRouter.

> 2. What is the meaning of the tcl object "LanRouter"       and how is
> to be used? (I read nsDoc but I didn't       understant it well)

In the example above, suppose that there is another node - 5 - which
is not on the lan, but connected by a point to point link to 1.
Suppose 2 wants to send a packet to 5.  It knows that the next hop is
node 4 - virtual node.  It sends it to 4 thereby handing it off to the
link layer.  LL is supposed to set a mac dest address for the packet,
so it needs to know who the next hop is (which lan node) but all it
can see it the packet dest. address.  Since LL by itself doesn't have
any connectivity info, it goes off and asks lan-router for the next
hop, then sets the Mac dest address and gives packet to the mac layer.

> 4. How can I simulate a bridge/switch?

You could change the LanRouter so that it will send all local for this
lan packets directly, and all remote packets to one particular node
which will act as a bridge...  something like that.


  -Yuri

> 
> Thanks in advance,
> Cristiano
> _________________________________________________________
> DO YOU YAHOO!?
> Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it