[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Q] Input Queue
Hello, ns users.
I want to implement a input queue.
but, ns only buit output queue.
generally, ns consist of following object..
entry_ => classifier => queue_ => link_ => .....
| |
+--------node-----------+
I modified this structure.
entry_ => input_queue_ => classifier => queue_ => link_
| |
+--------------- node ----------------+
But, ns does not work correctly. I modified <ns-node.tcl> file.
Anyone points out my faults.
Below is my work.
-------------------------------------------------------------------
Node instproc mk-default-classifier {} {
$self instvar address_ classifier_ id_ input_queue_ delay_link_
set classifier_ [new Classifier/Addr]
# set up classifer as a router (default value 8 bit of addr and 8 bit
port)
$classifier_ set mask_ [AddrParams set NodeMask_(1)]
$classifier_ set shift_ [AddrParams set NodeShift_(1)]
set address_ $id_
# 1999.09.09 hokunchung inserted -----------------------------------
# insert input Queue
set input_queue_ [new Queue/DropTail]
# internal delay link
set delay_link_ [new DelayLink]
$delay_link_ set bandwidth_ 10Mb
$delay_link_ set delay_ 5ms
$input_queue_ target $delay_link_
$delay_link_ target $classifier_
# --------------------------------------------------------------
}
Node instproc entry {} {
if [info exists router_supp_] {
return $router_supp_
}
if ![info exist ns_] {
set ns_ [Simulator instance]
}
if [$ns_ multicast?] {
$self instvar switch_
return $switch_
}
$self instvar classifier_ input_queue_
# 1999.09.09 hokunchung modified -------------------------------------
return $input_queue_
#return $classifier_
}