Nearly every Windows laptop / netbook you can buy now comes with a built in LAN and wireless network interface and some with 3G as standard. Whilst this offers great flexibility, having a laptop with multiple active network interfaces can have some drawbacks which I am going to discuss.
In home / small office it is unlikely that these issues will be applicable. If there are a relatively small number of laptops then typically they will all just use LAN or Wi-Fi and in many cases communication between internal devices doesn’t extend further than the clients having to access a file / e-mail server in a workgroup configuration.
The scenarios below apply more to corporate laptops that are part of an Active Directory domain where access to the corporate network is available via LAN and Wi-Fi.
A switched, full duplex wired network eliminates data collisions and typically provides 100Mbps or 1Gbps throughput where multiple streams of communication can occur simultaneously.
By comparison a Wi-Fi connection using 802.11n technology is only half duplex as it is impossible for a device to send and receive data over the air at the same time. Throughput speeds of up to 150Mbps sound impressive until you consider that only one device can communicate at a time and collisions have to be handled by CSMA/CA. In short the fewer devices on the Wi-Fi network the better it will perform.
Taking the above into account it’s clear to see that in nearly every corporate scenario a wired LAN connection is superior to a corporate Wi-Fi network. And that’s before you even consider other advantages of LAN such as low latency, QOS capability and security. However, Wi-Fi is an invaluable tool and when offered in a corporate environment gives users the flexibility to work from anywhere within or even outside the office.
In an ideal world we would like to have both interfaces enabled and route all traffic over the LAN when available and WAN when disconnected from the wire. This sounds obvious, but as I mentioned before there are some issues with this configuration which I will describe below.
Imagine Fred comes in to the office, docks his laptop and boots it up. The docking station is wired to the network and the laptop’s wireless interface is enabled and configured within Windows 7 to automatically connect to the corporate Wi-Fi network. The result of this is that Fred’s laptop ends up with two IP addresses. As the corporation is using DHCP with active directory integrated DNS the NIC will be allocated an IP address and this will be registered dynamically in DNS. The same will happen for the Wi-Fi adapter. So the result is the laptop ends up with two active network interfaces each with its own IP address. Both interfaces are capable of accessing internal corporate resources and the Internet. Within DNS, two A records will be created for the same hostname – one for each IP address.
Windows will have assigned a metric to each interface and this will determine which interface is used as priority. The metric assigned is based on link speed as follows:
Greater than 200 Mb – Metric = 10
Greater than 80 Mb, and less than or equal to 200 Mb – Metric = 20
Greater than 20 Mb, and less than or equal to 80 Mb – Metric = 25
In the case of Fred’s laptop we can do some quick analysis to see what’s happened.
An IPCONFIG will display the IP address allocated to each adapter. From the results below we can see that the wired interface is 10.243.29.6 and the Wi-Fi interface is 10.67.12.58.
C:\Users\Fred>ipconfig
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix. : domain.com
IPv4 Address. . . . . . . . . . . : 10.67.12.58
Subnet Mask . . . . . . . . . . . : 255.255.252.0
Default Gateway . . . . . . . . . : 10.67.15.254
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix. : domain.com
IPv4 Address. . . . . . . . . . . : 10.243.29.6
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.243.29.254
By running an NSLOOKUP command we can confirm that DNS holds two IP addresses for the hostname ‘laptop’.
C:\Users\Fred>nslookup laptop
Server: DC.domain.com
Address: 172.20.220.26
Name: laptop.domain.com
Addresses: 10.243.29.6
10.67.12.58
By running the ROUTE PRINT command we can confirm the Interface metrics assigned to each adapter. In this case a metric of 25 has been assigned to the wireless adapter (54Mbps) and a metric of 10 has been assigned to the wired adapter (1Gbps).
C:\Users\me>route print
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.67.15.254 10.67.12.58 25
0.0.0.0 0.0.0.0 10.243.29.254 10.243.29.6 10
When more than one network connection is available, Windows uses the one with the lowest metric value so in this case the wired interface should always be used for network traffic initiated from the laptop – so far so good!
However, we do get different behaviour if another computer initiates communication with the laptop. Firstly, it must first resolve the hostname to an IP address. We know DNS has two IP addresses associated with the hostname so how does DNS know which one to use? The answer is that it is not aware of network metrics and is not qualified to evaluate which interface to use. It therefore simply resolves the hostname to one of the two IP addresses based on round-robin.
This presents the first issue with having multiple active network adapters. Say Fred undocks his laptop and walks to a meeting room with no LAN connection. His access to internal resources and the internet continues to work seamlessly as the traffic is now routed over the W-Fi network. Fred then encounters an application issue and calls the IT Helpdesk. A technician attempts to remove onto his machine using a remote control tool but is unable to connect to machine.
The problem is that even though Fred has disconnected from the LAN, the associated DNS record is not deleted automatically. We can prove this by pinging LAPTOP from the IT technician’s machine and confirming the connectivity failure. Clearing the local name resolution cache and then pinging it again as shown below then results in a success (as DNS will then resolve LAPTOP to the other IP based on its round-robin method).
C:\Users\me>ping laptop
Pinging laptop.domain.com [10.243.29.6] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 10.243.29.6:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\Users\me>ipconfig /flushdns
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
C:\Users\me>ping laptop
Pinging laptop.domain.com [10.67.12.58] with 32 bytes of data:
Reply from 10.67.12.58: bytes=32 time=7ms TTL=122
Reply from 10.67.12.58: bytes=32 time=25ms TTL=122
Reply from 10.67.12.58: bytes=32 time=7ms TTL=122
Reply from 10.67.12.58: bytes=32 time=7ms TTL=122
Ping statistics for 10.67.12.58:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 7ms, Maximum = 25ms, Average = 11ms
These connectivity and performance issues typically cause a problem where another machine initiates the communication and has to do a DNS lookup in the first instance.
For most client/server style apps this is not an issue as the client initiates the communication and the server responds to the IP it received the request from.
Even when both connections are active, data transmission that is initiated from a remote machine may not occur over the interface with the lowest metric as the laptop will respond on the interface it received the request on.
In addition, there is another potential issue with having multiple active network adapters. If Fred went to visit a different office and plugged into a 100Mbps wired LAN connection and also connected automatically to the corporate Wi-Fi network at 108Mbps he would get a metric of 20 for both connections. This is not a desirable configuration as the LAN connection will give much better performance for reasons outlined earlier.
In order to overcome this issue on his Windows 7 machine Fred can hardcode a metric value on one or both of the network interfaces as follows:
In Control Panel, open the Network and Sharing Applet
Hit the Change Adapter Settings link
Right-click a network interface, and then click Properties
Click Internet Protocol Version 4 (TCP/IPv4), and then click Properties
On the General tab, click Advanced.
To specify a metric, on the IP Settings tab, click to clear the Automatic metric check box, and then enter the metric that you want in the Interface Metric field.
There are a few steps we can take to alleviate these issues…
HP Laptops have a BIOS setting called ‘LAN switching’. Enabling this setting means that the laptop will automatically disable the wireless interface when a LAN connection is present. Just unplugging the LAN connection re-activates the wireless interface. I strongly recommend turning this setting on unless you have a good reason for having wired and wireless interfaces active at the same time.
A similar setting may be available in the BIOS of other manufacturers’ laptops. In some cases you can achieve similar results by network management utilities provided by the manufacturer (e.g. Lenovo Access Connections). In my opinion this is a chunkier way of doing this and the BIOS method would be my preference if this is available.
Another alternative is to train the end-user community so that they only activate and use Wi-Fi when required.
Finally training IT support staff and other appropriate people on how to run an NSLOOKUP command will allow them to identify the IP address of both adapters and then enable them to connect to the remote machine using the IP address.
Hopefully Microsoft is aware of this issue and will look to implement a solution in future implementations of Windows/DHCP/DNS…