13.2 Configuration

The previous section talked about error model, in this section we discuss how to use error models in ns over either wired networks or wireless ones.

To use an error model for wired networks, at first it has to be inserted into a SimpleLink object. Because a SimpleLink is a composite object (Chapter 6), an error model can be inserted to many places. Currently we provide the following methods to insert an error module into three different places.

To add an error model over wireless networks, each node can insert a given statistical error model either over outgoing or incoming wireless channels. Precisely, the instanciated error model would be stuck between mac and netif modules depicted in Figure 16.2. For the outgoing link, the error module would be pointed by downtarget_ of the above mac module while for the incoming link it would be linked by uptaget_ pointer of the below netif module. And in each case the target_ of the error module points to either the netif or the mac respectively. The difference of placing over the two different locations is that the outgoing causes all the receivers to receive the packet suffering the same degree of errors since the error is determined before wireless channel module copies the packet. On the other hand, the incoming error module lets each receiver get the packet corrupted with different degree of error since the error is independently computed in each error module.

The insertion into the wireless protocol stack can be done by calling node-config command explained in Section 5.3 with the two options IncomingErrrProc and OutgoingErrProc. We can use these two options at the same time or each one separately. The argument of the two option is the name of the global procedure which creates an error model object, feeds it with necessary initial values appropriate for the new error module, and finally returns the object pointer. The following shows a simple TCL example script to add an error module into the wireless protocol stack.

	$ns node-config -IncomingErrProc UniformErr -OutgoingErrProc UniformErr

	proc UniformErr {} {
		set err [new ErrorModel]
		$err unit packet
		return $err

Tom Henderson 2011-11-05