Hi everyone...

I am programming RIP2 router for a college project (no way!!!)

We dont have to programm the routing protocol, we let the kernel to route packets, but... we must keep the kernel's table updated, exchanging route tables with other RIP2 routers...

I have some doubts....

1. does RIP2 (not in rip1 compatible mode) accept host addresses in it s routes table?... or it just keep network addresses?

2. RIP2 protocol says that each route has a timer running, and when any route's timer goes out it starts a new timer (garbage collector's) so, when this other timers runs off, the route is deleted from the table..... As my case... if kernel routes packages, how could i know which decision did the kernel take? so, i can find that route's timer and restart it....

What i thought was to catch the incoming trafic, check the IPv4's packets and get the destination requested... then find the route who matches this destination address and then restart its timer, the rest of the routing method is done by the kernel...
It sounds cool, but.... I can have something like this:

in the routes table:

destination mask gateway
192.168.3.0 24 192.168.3.1
192.168.3.0 28 192.168.3.1

as you can read, it has two similar routes, but they differ in the mask... if i get a destination address request "192.168.3.2" from the IPv4's packet i catched, i dont know its mask (IPv4 header doesn't have it) so, i must search for a matching route for that destination address at the kernel's table... and restart its timer...

In this case, which route should I restart?, both? if i must retart both timers... of course one of them was not the right route the kernel chose for that destination, so i'll update both's timers and one of them should't be updated... so if that route had to be deleted and i restarted its timer, it won't.... is that a problem to be saved from dead when it must not be saved?