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

Re: [ns] introduce error for LAN




>X-Authentication-Warning: mash.CS.Berkeley.EDU: majrdomo set sender to 
[email protected] using -f
>Date: Wed, 14 Jun 2000 12:21:04 -0700 (PDT)
>From: Yan Yu <[email protected]>
>To: ns-users <[email protected]>
>Subject: [ns] introduce error for LAN
>MIME-Version: 1.0
>
>Hello, all,
>   My Q is how to add error model to a LAN, 
>
>when I use make-lan to create a Lan made of several nodes..
>how to add loss into the LAN?? when I do something like 
>"set loss_module [new ErrorModel/Expo $rate $unit]
>$ns lossmodel $loss_module $src $dst" as suggested in ns Doc, I got the
>error: 
>-----------------
>invalid command name ""
>    while executing
>"$link errormodule $lossobj"
>    (procedure "_o4" line 11)
>    (Simulator lossmodel line 11)
>    invoked from within
>"$ns lossmodel $loss_module $src $dst"
>----------------------
>
>I tracked down the ns-lib.tcl code, found out that $link is null since the
>nodes are making a LAN, not simplx or duplex link, therefore there is not
>link between the nodes in the LAN. That is the problem.
> 
>in tcl/ex/snoop/snoop.tcl, it uses LAN, it sets error model for each
>direction between pairs of the nodes, it has something like:
>
>                set e1 [new ErrorModel/Expo $rate $unit]
>                set e2 [new ErrorModel/Expo $rate $unit]
>		
>		add-error $lan $src $dst $e1
>                add-error $lan $dst $src $e2
>
>in "add-error" function, they add filter to introduce error:
>
>proc add-error {lan src dst errmodel} {
>        $lan instvar lanIface_
>
>        set nif $lanIface_([$dst id])
>        set filter [new Filter/Field]
>        $nif add-receive-filter $filter
>        $filter filter-target $errmodel
>        $errmodel target [$filter target]
>        $filter set offset_ [PktHdr_offset PacketHeader/Mac macSA_]
>        $filter set match_ [$src node-addr] # will not work with hier. routing
>}
>
>My Question is:
>DOes it have to be so complex to introduce an error to LAN?

Yes. LANs in NS are broadcast networks. Please read the manual to see how LANs 
are defined. Please note that the mac classifier stuff is obsolete.
>
>btw, I did not see any filter related documentation, I am wodnering is
>Fileter an obsolete interface, not recommendated to use any more?

I don't think so. Filters are relatively easy to use. See filter.h, .cc.

>
>THANKS in advance!
>yan

Tarik