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

I finally found the bug!




Hi,

I think I found the reason why DV doesn't work after 32-bit address format
was introduced. In file rtProtoDV.cc, procedure "command", there's an
incomplete work:
		dst.addr_ = atoi(argv[2]);
                dst.port_ = 0;
			   ~~~~
                u_int32_t mtvar = atoi(argv[3]);
                u_int32_t size  = atoi(argv[4]);
		sendpkt(dst, mtvar, size);

here the port number is set to 0, however, the agent reside on the
destination node port 0 is always not the routing agent, therefore, this
update message ends in vain. So to fix this bug, you have to also specify
the port number of the remote route agent, so, this line should be changed
to:
		dst.port_ = atoi(argv[3]);

Correspondingly, in file route-proto.tcl, you have to do the following
modifications:

in the last line of proc "send-to-peer", change:
$self send-update [$peers_($nbr) addr?] $id [array size update]

to:

$self send-update [$peers_($nbr) addr?] [$peers_($nbr) port?] $id [array
size update]


Of course, you have to add procedures for class rtPeer, but those are
trivial.

After these modifications, DV routing works fine.
The most important thing is, since now we are using port number to
differentiate agents, we have to be really careful when sending messages.


regards.

Guo, Liang.