Re: Non-MII card link detection



On Tue, 2005-02-08 at 12:59 +0200, Paul Ionescu wrote:
>
> On Sun, 06 Feb 2005 14:07:20 +0200, Paul Ionescu wrote:
> > 
> > Every X seconds we send a special frame on the wire, the destination
> > address is our own MAC address of that interface, which means that we
> > are the end destination of that packet. The ether-type can be 0x9000
> > which is
> >  registered for loopback packets.
> > If the link is up, we should receive this packet because it has our own
> > mac address as destination, which will be reflected in rx_packets
> > counter. Now, if we miss Y packet in a row, we could assume the link is
> > off.
>
> I actually did some further test, and so far I like what I found.
> I used only ready available tools (like ping) because I did not have time
> to do some real programs.
> [...]
> I did "ping -b 10.1.1.255" 
> [...]
> Comments ?

Using "ping -b" itself would be bad, very bad on large networks.  Just
imagine the effect of a broadcast ping on a network of several hundred
or several thousand hosts (large corporate, government, or educational
networks or cable modem networks).  Sending out a specially crafted
ethernet packet with our own ethernet address as the destination would
probably be fine, assuming the kernel would actually send it out the
wire and wouldn't short circuit the transmission.

In fact, looking at a dump of my network it looks like I have a Cisco
system out there doing a similar thing:

        Frame 292 (60 bytes on wire, 60 bytes captured)
            Arrival Time: Feb  8, 2005 08:04:01.231936000
            Time delta from previous packet: 10.002011000 seconds
            Time since reference or first frame: 30.366391000 seconds
            Frame Number: 292
            Packet Length: 60 bytes
            Capture Length: 60 bytes
        Ethernet II, Src: 00:0c:30:58:89:89, Dst: 00:0c:30:58:89:89
            Destination: 00:0c:30:58:89:89 (Cisco_58:89:89)
            Source: 00:0c:30:58:89:89 (Cisco_58:89:89)
            Type: Loopback (0x9000)
        Configuration Test Protocol (loopback)
            skipCount: 0
            Function: Reply (1)
            Receipt number: 0
        Data (40 bytes)
        
        0000  00 0c 30 58 89 89 00 0c 30 58 89 89 90 00 00 00   ..0X....0X......
        0010  01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
        0020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
        0030  00 00 00 00 00 00 00 00 00 00 00 00               ............
        
Jeff


Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]