Programming RIP2 with kernel routes table

This is a discussion on Programming RIP2 with kernel routes table within the Linux Programming forums, part of the Platform Specific Boards category; Hi everyone... I am programming RIP2 router for a college project (no way!!!) We dont have to programm the routing ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,750
    Didn't we just do this?

    Ah, yes
    programming RIP2

    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 06:06 PM
  2. programming RIP2
    By jpablo in forum Networking/Device Communication
    Replies: 5
    Last Post: 05-08-2006, 04:30 AM
  3. progarm doesnt compile
    By kashifk in forum Linux Programming
    Replies: 2
    Last Post: 10-25-2003, 06:54 PM
  4. extra word printing
    By kashifk in forum C++ Programming
    Replies: 2
    Last Post: 10-25-2003, 05:03 PM
  5. inputting words from a file
    By kashifk in forum C++ Programming
    Replies: 5
    Last Post: 10-24-2003, 08:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21