LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Mark_Yedinak

Allow user to select the which NIC to use for network connections when multiple NICs are present

Status: Declined
Moved to CAR database. CAR#50694

LabVIEW will always use the primary NIC if more than one NIC is present. It would be nice if the user could select which NIC to use programmatically and not need to worry about defining routes on the computer.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
11 Comments
AristosQueue (NI)
NI Employee (retired)

What's an NIC in this context?

tst
Knight of NI Knight of NI
Knight of NI

NIC = Network Interface Card. If you have several network adapters active on your computer (e.g. LAN + Wi-Fi or two cards connecting to different networks), you have no direct way of controlling which one LV will use when you try to communicate using networking protocols.

 

There are some workarounds for this (if the IP address on the other side is on the same subnet, I believe the OS always picks the NIC which matches and I think that at least in Windows you can change the priority of the NICs), but there's nothing built into LV.


___________________
Try to take over the world!
silmaril
Member

I assume we are talking about TCP/IP communication?

 

I doubt this is something that can (or should) be solved inside LV.

Finding the correct route to use for a TCP packet is the job of the operation system's TCP stack.

 

SteveChandler
Trusted Enthusiast

But if as Mark says LV always uses the primary NIC then it is not delegating it to the OS. I don't know what "primary" means though. This question has me curious.

=====================
LabVIEW 2012


Mark_Yedinak
Trusted Enthusiast

You can force the choice by defining spefic routes on the computer. This is not always the best solution though. In addition this is a problem when using the FTP primatives. If you have two adapters and connection to a FTP server on the secondary NIC (as defined by the configuration on the computer since the adapters are given an order) based on the route for the IP address the data connection will always attempt to establish the connection on the primary NIC. For instance, if my primary NIC has an address of 10.3.4.x and the secondary NIC has an address of 172.30.1.x and I open a FTP connection to the server at 172.30.1.3 when I try to send a file it LV will try to estblish the data connection on the 10.3.4.x address. The data transfer will not go through but the FTP VIs will not return an error. It would be helpful if we could easily query the configurations of the adapters and choose the adapter to establish the connection on.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
D Robertson
Member

With TCP/IP communication this is true, you cannot select a specific NIC.  However, if you use UDP the UDP Open Function does have an exposed terminal for net address and that is referring to the local net address.  This allows the user to specify a NIC in the case that multiple NICs are available.

Brian_Powell
Active Participant

This sounds more like a bug report than a feature idea.

 

For instance, if my primary NIC has an address of 10.3.4.x and the secondary NIC has an address of 172.30.1.x and I open a FTP connection to the server at 172.30.1.3 when I try to send a file it LV will try to estblish the data connection on the 10.3.4.x address.

 

Assuming the subnet masks and routing table are correct on your PC, this should not happen.  For TCP (upon which the FTP VIs in the Internet Toolkit are built), the operating system makes the routing decision.

 

That's not to say that there isn't some problem with the FTP VIs.  Why look... CAR 50694: "FTP VIs Active mode doesn't work with multiple NICs"  Current status: Deferred.

 

Try turning off the Active input to the Put File VI and see if that helps.

 

Looking at the source code, I'm guessing the problem is this unwired "address" input...

 

FTP Open Data Connection bug.png

Brian_Powell
Active Participant

Upon further review, I think the bug may be in the VI just above the circled one.  It creates a listener without specifying the address (NIC) on which to listen.

G-Money
NI Employee (retired)
Status changed to: Declined
Moved to CAR database. CAR#50694
G-Money
NI Employee (retired)

Mark,

 

I can't comment on any future releases of LabVIEW. As far as the LabVIEW 2012 Beta, I would bet that you see this fixed in that. If you try out the beta, report back if you test this out and confirm that it is fixed.