the relationship of MAC could be found in ns-mobilenode.tcl. The source code:
........
#
# The following setups up link layer, mac layer, network interface
# and physical layer structures for the mobile node.
#
Node/MobileNode instproc add-interface { channel pmodel lltype mactype \
qtype qlen iftype anttype topo inerrproc outerrproc fecproc} {
$self instvar arptable_ nifs_ netif_ mac_ ifq_ ll_ imep_ inerr_ outerr_ fec_
.......
#
# Link Layer
#
$ll arptable $arptable_
$ll mac $mac
$ll down-target $ifq
if {$imepflag == "ON" } {
$imep recvtarget [$self entry]
$imep sendtarget $ll
$ll up-target $imep
} else {
$ll up-target [$self entry]
}
#
# Interface Queue
#
$ifq target $mac
$ifq set limit_ $qlen
if {$imepflag != ""} {
set drpT [$self mobility-trace Drop "IFQ"]
} else {
set drpT [cmu-trace Drop "IFQ" $self]
}
$ifq drop-target $drpT
if { $namfp != "" } {
$drpT namattach $namfp
}
# Mac Layer
#
$mac netif $netif
$mac up-target $ll
if {$outerr == "" && $fec == ""} {
$mac down-target $netif
} elseif {$outerr != "" && $fec == ""} {
$mac down-target $outerr
$outerr target $netif
} elseif {$outerr == "" && $fec != ""} {
$mac down-target $fec
$fec down-target $netif
} else {
$mac down-target $fec
$fec down-target $outerr
$err target $netif
} |

No comments:
Post a Comment