How would I detect in code whether a computer's Ethernet port is Auto-MDIX, and therefore can use a regular Ethernet cable (-not crossover) to connect to another computer?
I've looked in NetworkInterface
's properties and searched for this, but I might be using the wrong search terms.
Both .net and UWP welcome.
PCs can certainly implement Auto-MDIX and many do. Note that all 1000Base-T (GigE) ports have a built-in equivalent to Auto-MDIX (transmit/receive negotiation per pair) and will work.
A hub or switch that does not have an Auto-MDIX feature needs to have one port, which will not crossover or cross the line. However, a gigabit Ethernet typically has 2 Auto-MDIX ports connected together. Auto-MDIX uses automatic line sensing in the ports called auto sensing.
MDI is part of the media attachment unit that provides the physical and electrical connection to the cabling medium when linking two endpoint devices. MDIX is a version of MDI that enables connection between like devices. MDI ports connect to MDIX ports via straight-through twisted-pair cabling.
Automatic medium-dependent interface crossover (Auto-MDIX) is a feature that allows the switch interface to detect the required cable connection type (straight-through or crossover) and automatically configure the connection appropriately.
As for MDI-to-MDI or MDIX-to-MDIX connections, crossover twisted pair cables are deployed. In some cases, network hubs or switches are built with an MDI port (often switchable) in order to connect to other hubs or switches without a crossover Ethernet cable.
MDIX (Medium Dependent Interface Crossover) is an 8P8C port connection often found on a computer, router, hub, or network switch. Since MDIX is the crossover version of the MDI port, the pins 1 & 2 (transmitting) on an MDI device go to pins 1 & 2 (receiving) on an MDIX device via a straight through cable.
Auto-MDI/MDIX feature allows a switch port to automatically detect what type of port is connected on other end (MDI port or MDIX port) and swap the transmission and receive pins. Thus, the transmission pins on one side may connect with the receive pins on other side. You may use either straight-through crimped twisted pair cables ...
In general, end stations like PCs or workstations use an MDI interface, whereas hubs and network switches use MDIX interfaces. On other network devices like routers, multiple MDIX ports and a single MDI port often co-exist.
The Windows NDIS drivers are ignorant about layer 1 details such as full or half duplex and MDI/MDI-X status. Some drivers obviously expand on that so that a custom tool can display these details, but these extensions are proprietary and there's no standard way to access the information - if at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With