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

error model/losses



Hi,

I've been looking at the script snoop.tcl to see an example of adding
losses to a LAN.   I am really confused why the function add-errors
uses a Filter and commands such as:

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] 
}

Can't we simply do something like this:
$ns lossmodel $errormodel $node0 $node1

Is there something different about inserting link errors on Lans compared
to point-to-point links?

Thanks for any clarification!!

Chris