Ethernet Phy loopback RRS feed

  • Question

  • Hi All,

    I have a windows 10/intel i7 based products. 

    There are 3 ethernet ports in the system based on intel I210 ethernet controller. 

    The I210 supports the following types of internal loopback in the LAN interface: • MAC Loopback (Point 1) • PHY Loopback (Point 2) • SerDes, SGMII or 1000BASE-KX Loopback (Point 3) • External PHY Loopback (Point 4).

    I wanted to make custom built in test in application space which will do the available hardware loopback. So my question is whether is there any Windows API available to do the same or is there any option to modify the windows driver and do the same?. 

    I am newbie in Windows driver and any help is appreciated

    Abhilash V R

    Tuesday, November 19, 2019 11:18 AM


  • In general, you'd need some driver to request loopback, via OID_GEN_CURRENT_PACKET_FILTER with the NDIS_PACKET_TYPE_ALL_LOCAL flag.  This will loopback in software, unless the NIC driver explicitly supports hardware loopback (many drivers do not).

    I believe that some older versions of wireshark will set the NDIS_PACKET_TYPE_ALL_LOCAL flag.  But I'm not aware of a built-in driver that sets this flag.

    Even if you do find a way to set the flag... the next problem, I assume, will be how to get those loopback packets.  They won't be delivered to a socket (even a raw socket).  So at some point, you'll need to make a protocol driver to get the packets and do something with them.

    You can use the `ndisprot` sample driver to get started with protocol drivers, but do note that it was designed to be easy to understand, and not designed for performance, so it won't scale up to very many packets per second.

    Monday, December 2, 2019 11:06 PM