infinite timer for Hello & TLU time interval #233
-
Hello TA, thank you for providing newly made PA#4 which is different from before semeters's RIPv1. Having fun doing PA, I got several questions about timer implementaton. In instruction, it has to multicast each type's message for each time intervals.
But, when i have to stop to send more messages and end the program? I implemented this multicast by calling addtimer() at the last part of timerCallBack, so it makes infinite timer call and test cannot be ended. Without implementing the Hello&TLU time interval multicast, I got passed all testcases in testpwosf.cpp by mulitcasting every LSU call immediately and no hello multicast more than twice. In this case, can i get full score by just passing all test cases? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use
Yes, you will get full score, but try to solve the infinite test run for your learning. |
Beta Was this translation helpful? Give feedback.
You can use
finalize()
method to cancel timers. However, it would not be your problem.The reason of infinite test is probably routing loop.
A incorrect implementation of the routing protocol will cause packets to keep traveling through router cycles, increasing simulation time exponentially.
To avoid loops, you need to make right decisions about when to forward packets.