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

[ns] about the use of "adde-route"



Dear all,

I tried to use "Node add-route <dst> <target>" to change the route during simulation, but failed. The situation is as follows:

Topology:
    #                                n4
    #                              /     \
    #                             /       \
    #             n0-------n1----n2--------n3
Traffic: 
    FTP(/TCP) from n0 to n3
Routing: 
    Static, but I want to change the route to n0---n1---n4---n2---n3 at some time.
Scripts:
    set l14 [$ns link $n1 $n4]
    $ns at 1 "$n1 add-route $n3 [$l14 head]"

Problems:
    1. By checking the trace file, I found that after the "add-route" wass executed, the ACK from n3 arriving at n1 would go to n4, and it kept being transmitted between n1 and n4 to and fro until it was dropped when time out.

    2. I wondered if I should use RtModule/Manual, and I added the script "Node enable-module Manual". But then I was stuck with the following error message:
            ns: _o15 add-route _o25 _o98: syntax error in expression "_o25 << 0"
                while executing
            "expr $dst_address << [AddrParams NodeShift 1"
                (procedure "_o18" line 7)
                (RtModule/Manual add-route line 7)
The RtModule/Manual instproc add-route is like this:
            RtModule/Manual instproc add-route {dst_address target} {
                if {$dst_address == default} { 
                        .......
                } else {
                    set encoded_dst_address [expr $dst_address << [AddrParams NodeShift 1]]
                        ......
                }
            }

    3. An additional problem about RtModule/Manual: the comment in the codes says that "Manual Routing Nodes: like normal nodes, but with a hash classifier". I think it means:
            RtModule/Manual instproc register {node} {
                        ......
                set classifier_ [new Classifier/Hash/Dest 2]
            }
But the RtModule/Base has the same thing:
            RtModule/Base instproc register {node} {
                        ......
                set classifier_ [new Classifier/Hash/Dest 32]
            }
So what exactly differentiates Manual from others?

Thanks for your patience of reading so far! :) Any comment or suggestion will be appreciated!

Best regards,
Jerry