lkml.org 
[lkml]   [2001]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: questions about link-level loopback, PF_PACKET and ETH_P_LOOP
Christopher Friesen wrote:
>
> I'm attempting to write a piece of code that will validate the physical ethernet
> link from a NIC to the nearest router/hub/switch. What I'd like to do is to
> send out an ethernet packet addressed to me, bounce it off the
> hub/switch/router, and then read it back in. This is all at the ethernet layer.
>

No properly configured ethernet hub or router will return you the
same packet you sent. You can get some of this information out of the
drivers though, as their hardware knows the link state, at least the
physical layer.

Check out Becker's mii-diag program. There are some options
in it to dump out all kinds of neat information about the drivers
and link condition.

> The nitty-gritty on this is that I have a machine that has two NICs but only one
> IP address. I want to do some kind of packet loopback at the ethernet layer to
> verify that my NIC transceiver is working properly.

Ping your switch. Or use something like ethernet channel bonding.

If both ports are up, then you should be able to send a pkt
from one NIC with your other NICs MAC in it, and the switch should deliver
that pkt to your other NIC. However, if you don't receive the packet, you
cannot determine which one of your links/NICs is bad without going to
a third party (which I suggest should be your switch itself).

--
Ben Greear <greearb@candelatech.com> <Ben_Greear@excite.com>
President of Candela Technologies Inc http://www.candelatech.com
ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.024 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site