Mailing List Archive

Rip problems/questions about normal behaviour
Hello,

I have some questions about the normal wanted ripd (ripv2) behaviour.
(running quagga cvs of 16-03-2004, on a linux 2.6.3)

1) Recently i had a problem with ripd on a ppp0 interface, the error was
"RIP: Can't setsockopt IP_MULTICAST_IF to fd 9", (
http://bugzilla.quagga.net/show_bug.cgi?id=83 with a proposed patch ),
the problem seems to be that ripd used the peer ip adress instead of its
own adress on the link to enable the multicast (i wonder why that 'if'
statement was written at all).
But this leads me to another problem: When the 'buggy' ripd wants to
send a rip announce on the ppp0 link it sends it on eth0 instead (yes,
the ppp0 route is sent on eth0, and it's not the eth0 route for eth0)!
which is really unwanted. (especially if eth0 is in passive).

Do you think this needs to be fixed too? even if the first MULTICAST
problem is already fixed? something like checking that the iface is
ready before sending data on it? or maybe checking the return value of
the setsockopt option (actually it has no return value!)?


2) let's say we do this:
router rip
network eth0
passive-interface eth0

when i tcpdump eth0, i see that ripd sends one (and only one) router
request, should this be allowed? Does cisco rip do this too?

3) it seems rip has problems with distance, or i haven't understood the
correct way to use them. This problem is explained more in detail on
http://bugzilla.quagga.net/show_bug.cgi?id=81 but since i don't know
the cisco behaviour, i can't tell, only suppose this is wrong.
in summary:
doing a
router rip
distance 121 10.0.5.1/24

A) doesn't brink the administrative distance directly to 121 of the
link, until ripd is restarted.
B) if another link shows up for a route where 10.0.5.1/24 interface has
been chosen for (before, because of some "failure conditions"), the
[121/2] link doesn't get updated by a [120/2] link. I suppose this
ain't normal.



Please, can you confirm to me that ripd is indeed doing it wrong? =)
Also, I don't know if i'll be able to fix point 3, i'm still lost in the
source code

--
Jean-Yves Simon <lethalwp@tiscali.be>
Re: Rip problems/questions about normal behaviour [ In reply to ]
> From: Jean-Yves Simon <lethalwp@tiscali.be>
> Subject: [quagga-dev 975] Rip problems/questions about normal behaviour
> Hello,
>
> I have some questions about the normal wanted ripd (ripv2) behaviour.
> (running quagga cvs of 16-03-2004, on a linux 2.6.3)
>
> 1) Recently i had a problem with ripd on a ppp0 interface, the error was
> "RIP: Can't setsockopt IP_MULTICAST_IF to fd 9", (
> http://bugzilla.quagga.net/show_bug.cgi?id=83 with a proposed patch ),
> the problem seems to be that ripd used the peer ip adress instead of its
> own adress on the link to enable the multicast (i wonder why that 'if'
> statement was written at all).

Hi,

Point-to-point interfaces, being unnumbered, are usually identified in
the kernel by the dstaddr. Having said that, there appears to be a
lot of confusion around this point. As a colleague pointed out:

James.d.carlson@sun.com writes:
> Not looking at the destination address is a bug. See also this:
>
> http://lists.freebsd.org/pipermail/freebsd-bugs/2003-May/000673.html
> http://mail-index.netbsd.org/netbsd-bugs/1999/04/02/0001.html
> http://www.geocrawler.com/archives/3/145/1995/12/0/606471/

I'm not sure what the linux behavior is, but perhaps the other
problem that you report, namely,

> But this leads me to another problem: When the 'buggy' ripd wants to
> send a rip announce on the ppp0 link it sends it on eth0 instead (yes,
> the ppp0 route is sent on eth0, and it's not the eth0 route for eth0)!
> which is really unwanted. (especially if eth0 is in passive).

is related to the first. Are you sure the mcast membership is being
done on the ppp interface? Did you check with 'netstat -gn' (or
it's linux equivalent for reporting mcast membership)?

--Sowmini
Re: Rip problems/questions about normal behaviour [ In reply to ]
On Wed, 2004-03-17 at 16:31, sowmini.varadhan@sun.com wrote:

> > 1) Recently i had a problem with ripd on a ppp0 interface, the error was
> > "RIP: Can't setsockopt IP_MULTICAST_IF to fd 9", (
> > http://bugzilla.quagga.net/show_bug.cgi?id=83 with a proposed patch ),
> > the problem seems to be that ripd used the peer ip adress instead of its
> > own adress on the link to enable the multicast (i wonder why that 'if'
> > statement was written at all).
> Point-to-point interfaces, being unnumbered, are usually identified in
> the kernel by the dstaddr. Having said that, there appears to be a
> lot of confusion around this point. As a colleague pointed out:

> James.d.carlson@sun.com writes:
> > Not looking at the destination address is a bug. See also this:
> >
> > http://lists.freebsd.org/pipermail/freebsd-bugs/2003-May/000673.html
> > http://mail-index.netbsd.org/netbsd-bugs/1999/04/02/0001.html
> > http://www.geocrawler.com/archives/3/145/1995/12/0/606471/
>
> I'm not sure what the linux behavior is, but perhaps the other
> problem that you report, namely,

Infos about pc 1:
]# ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.0.5.2 P-t-P:10.0.5.1 Mask:255.255.255.255
...

]# netstat -gn
IPv6/IPv4 Group Memberships
Interface RefCnt Group
--------------- ------ ---------------------
lo 1 224.0.0.1
eth0 1 224.0.0.1
ppp0 1 224.0.0.1
dummy0 1 224.0.0.1
lo 1 ff02::1
..

piece of code that opens a socket(), then setsockopts() on the socket to
request a "IP_MULTICAST_IF" with addy 10.0.5.1 and 10.0.5.2 on a linux
2.6 kernel:
$ ./test
ssopt: 10.0.5.2 return: 0
setsockopt: Success
ssopt: 10.0.5.1 return: -1
setsockopt: Cannot assign requested address


on peer: (2.4 kernel)
]$ ifconfig ppp1
ppp1 Link encap:Point-to-Point Protocol
inet addr:10.0.5.1 P-t-P:10.0.5.2 Mask:255.255.255.255
...

$ ./test
ssopt: 10.0.5.2 return: -1
setsockopt: Cannot assign requested address
ssopt: 10.0.5.1 return: 0

Couldn't try it on other kernels.



> > But this leads me to another problem: When the 'buggy' ripd wants to
> > send a rip announce on the ppp0 link it sends it on eth0 instead (yes,
> > the ppp0 route is sent on eth0, and it's not the eth0 route for eth0)!
> > which is really unwanted. (especially if eth0 is in passive).
>
> is related to the first. Are you sure the mcast membership is being
> done on the ppp interface? Did you check with 'netstat -gn' (or
> it's linux equivalent for reporting mcast membership)?
>

So the problem is in rip_interface.c at ~line 165, the multicast
returns (with no return value) without having bind() to the correct and
wanted address, and ripd.c line ~1314 happily continues without knowing
it's not sending on the correct interface

Maybe that option should return -1 if failed, 0 if succeeded? that would
be tested to do or cancel the send, or the return should simply be
removed?

--
Jean-Yves Simon <lethalwp@tiscali.be>
Re: Rip problems/questions about normal behaviour [ In reply to ]
> > > But this leads me to another problem: When the 'buggy' ripd wants to
> > > send a rip announce on the ppp0 link it sends it on eth0 instead (yes,
> > > the ppp0 route is sent on eth0, and it's not the eth0 route for eth0)!
> > > which is really unwanted. (especially if eth0 is in passive).

> So the problem is in rip_interface.c at ~line 165, the multicast
> returns (with no return value) without having bind() to the correct and
> wanted address, and ripd.c line ~1314 happily continues without knowing
> it's not sending on the correct interface

>
> Maybe that option should return -1 if failed, 0 if succeeded? that would
> be tested to do or cancel the send, or the return should simply be
> removed?

ah. I see what's happening, then.

rip_interface_multicast_set() should return an int as you suggest, and
the caller should check this before continuing.

I don't think it makes sense to remove the return and continue with the
bind if rip_interface_multicast_set can't live up to its name.

I'm still investigating about the right IP_MULTICAST_IF behavior
for if_pointopoint interfaces that would work across all platforms..
--Sowmini
Re: Rip problems/questions about normal behaviour [ In reply to ]
On Thu, 2004-03-18 at 16:36, sowmini.varadhan@Sun.COM wrote:

> rip_interface_multicast_set() should return an int as you suggest, and
> the caller should check this before continuing.
>
> I don't think it makes sense to remove the return and continue with the
> bind if rip_interface_multicast_set can't live up to its name.
>
> I'm still investigating about the right IP_MULTICAST_IF behavior
> for if_pointopoint interfaces that would work across all platforms..
> --Sowmini
>

http://bugzilla.quagga.net/show_bug.cgi?id=84
http://bugzilla.quagga.net/attachment.cgi?id=29&action=view
proposed patch sent, tried here, works for me.
Just waiting for IP_MULTICAST_IF now :)


--
Jean-Yves Simon <lethalwp@tiscali.be>