Thread: Programming RIP2 with kernel routes table

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    8

    Programming RIP2 with kernel routes table

    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?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Didn't we just do this?

    Ah, yes
    http://cboard.cprogramming.com/showthread.php?t=78359

    Today's lesson is spam.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Writing array, to file
    By zootreeves in forum C Programming
    Replies: 9
    Last Post: 09-08-2007, 05:06 PM
  2. programming RIP2
    By jpablo in forum Networking/Device Communication
    Replies: 5
    Last Post: 05-08-2006, 03:30 AM
  3. progarm doesnt compile
    By kashifk in forum Linux Programming
    Replies: 2
    Last Post: 10-25-2003, 05:54 PM
  4. extra word printing
    By kashifk in forum C++ Programming
    Replies: 2
    Last Post: 10-25-2003, 04:03 PM
  5. inputting words from a file
    By kashifk in forum C++ Programming
    Replies: 5
    Last Post: 10-24-2003, 07:18 AM