[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Q: understanding classifiers
Urs Thuermann <[email protected]> writes:
> Trying to understand node, classifiers and link I looked at the object
> structure after setting up the following topologie:
>
> set ns [new Simulator]
> set n0 [$ns node]
> set n1 [$ns node]
> $ns duplex-link $n0 $n1 10Mb 10ms DropTail
> set udp [new Agent/UDP]
> set null [new Agent/Null]
> $ns attach-agent $n0 $udp
> $ns attach-agent $n1 $null
> $ns connect $udp $null
>
> The addresses of $udp and $null are what I expected:
>
> % $udp set addr_
> 0
> % $null set addr_
> 256
>
> I thought the classifier at node $n0 should have an entry in its
> slots_ array pointing to the link from $n0 to $n1 but
>
>
>
> % set c0 [$n0 set classifier_]
> _o12
> % $c0 dump
> classifier _o12
> 0 offset
> 8 shift
> 127 mask
> 1 slots
> slot 0: _o29
This is 'Node instvar classifier_'
> % _o29 dump
> classifier _o29
> 0 offset
> 0 shift
> 255 mask
> 1 slots
> slot 0: _o27
> % puts $udp
> _o27
And this is 'Node instvar dmux_' - port demuxer.
>
> but surprinsingly the classifier at $n0 only has an entry pointing to
> another classifier _o29 which in turn only has one slot pointing back
> to $udp.
>
> The classifier $c0 has shift_ == 8 and mask_ == 127, i.e. when sending
> a packet to
>
> % $udp set dst_
> 256
>
> which is the correct address of $null, the classifier $c0 calculates
> slot number (256 >> 8) & 127 which results in 1. However, $c0 has no
> entry in slot_[1]. In the C++ code there is a default_target_ in
> class Classifier. Is this used here? Can its value be accessed from
> Tcl somehow without changing the ns source?
Default routes will be computed and installed in the classifier when
the simulator is run (see Simulator instproc run).
>
>
> urs