Академический Документы
Профессиональный Документы
Культура Документы
National Instruments software packages and embedded hardware targets take advantage of network communication for
application deployment, remote control of applications or instruments, transferring data, accessing and hosting web servers and
services, and more. When using National Instruments network-enabled products with hardware or software firewalls, information
about individual network port access may be needed to permit communication. This tutorial briefly explains the networking settings
associated with performing common tasks using NI products, including the default TCP/UDP ports used and how to reconfigure
these ports (if possible).
Table of Contents
1.
2.
3.
4.
On modern computer systems, network communication including web page traffic, file transfers, emails, and more can be logically
divided into different layers; this is known as the OSI Model. One layer, known as the network layer, is responsible for successfully
routing network traffic, and providing error detection and diagnostic capability. The main network layer protocol used for both local
network and Internet communication is known as Internet Protocol (IP). Another layer, known as the transport layer, is responsible
for providing end-to-end communication services for applications. Two of the most common transport layer protocols are
Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).
In order for a piece of network traffic to reach an application on a remote system, it must contain two key pieces of information: an
address for the computer(s) that should receive the traffic (this is referred to as an IP address when using the IP protocol), and a
destination port number for the application on the remote system(s) that should process the data. The IP address of the computer
transmitting the data or request is also sent along with a source port number used by the originating application. In practice, each
transport layer protocol (e.g. TCP, UDP) allows for up to 65,535 ports that applications can use.
If an application on a given computer is accepting data, or "listening" on a given port, then the potential exists for that application
to receive network data and do something based on that data. In this way, network traffic can affect the operation of a system up
to the extent that an application allows. To reduce the effect that network traffic can have on a computer's operation, both
networking equipment and individual computers may employ filters called firewalls that use a set of rules to allow or block certain
unwanted network traffic (based on IP addresses, ports, or applications that are attempting to send the traffic).
Hardware Firewalls
Hardware firewalls are commonly built into networking equipment (such as routers), and examine each piece of network traffic
(known as packets) as they are received and then re-transmitted. The header of each packet contains information about the
destination IP address, transport layer protocol used, remote port number, and more. Hardware firewalls can filter packets based
on this information and a set of user-defined rules, resulting in certain network packets being allowed and others being dropped
without re-transmission.
Although each individual hardware firewall may be configured differently (or have different default settings), many personal
network routers are set up by default to allow all outgoing traffic and disable all incoming traffic between a local and external
network. All traffic within the local network itself is typically allowed by default, and incoming traffic based on a recent outgoing
request is also typically allowed.
Software Firewalls
In addition to the presence of hardware firewalls on network, individual computers may also run firewall software packages to filter
network communications and protect against the unwanted influence of remote machines. While software firewalls have a similar
objective as hardware firewalls, they use different methods to do this filtering.
To filter packets based on header information (IP address, transport layer protocol, port, etc), software firewalls commonly employ
an intermediate network driver that can accept or reject traffic based on rules before passing it to an application (in the case of
incoming packets) or for outbound transmission. To filter network traffic based on the individual running application, or process,
that is attempting to send or receive data, software firewalls can also intercept software calls between applications and underlying
transport layer protocol drivers. Using this method, for example, certain applications could be denied the opportunity to listen for
data on a specific port, while others could be granted this permission.
Although each software firewall package may be configured differently (or have different default settings), many personal firewall
software packages are set up by default to allow all outgoing port traffic and disable all incoming port traffic. However, these
packages typically also enable incoming port traffic that is expected based on a previous outgoing request. As mentioned
previously, firewall software may also prompt the user to allow or restrict port access for individual applications.
1/6
www.ni.com
A wide variety of National Instruments products take advantage of network communication to provide different types of
functionality -- from identifying networked hardware targets to providing access to web services created in LabVIEW. Given the
fact that the majority of corporate and personal networks feature a combination of hardware and software firewalls, it is often
necessary to change firewall settings to allow the network traffic needed for a given National Instruments product to function
properly.
The remainder of this document outlines the transport layer protocols and ports that different National Instruments products and
features use, as well as where you can change these ports (if this is possible). Please see the documentation for your hardware or
software firewall for instructions on how to change firewall settings in order to allow the desired traffic. If you are working on a large
network in which you do not have access to change hardware or software firewall settings, please contact your network
administrator and reference this document.
Remember that in most situations it is only necessary to configure your hardware or software firewalls to enable
incoming connections to server ports (for servers running on your local PCs or embedded hardware targets). When
using software firewalls, you may also be prompted to allow individual applications to send or receive data.
Hardware Identification (Measurement & Automation Explorer)
Description of Functionality: NI Measurement & Automation Explorer (MAX) sends broadcast network traffic to poll for all locally
available National Instruments network-enabled devices (such as LabVIEW Real-Time targets).
Server Ports: UDP port 44525
Are the Ports Configurable?: No
Web Servers and Remote Control
www.ni.com
Location of Port Settings: You can change the VI Server port on a development computer by navigating to the Tools >> Options
>> VI Server menu. To change the VI Server port on an embedded hardware target (e.g. CompactRIO), right click on the target in
the LabVIEW Project and select Properties >> VI Server.
Remote Instrument Control with VISA Server
Description of Functionality: In addition to communicating with instruments connected to a local machine through the NI-VISA
API, it is possible to remotely control instruments that are physically connected to another machine -- using the VISA Server.
Server Ports: TCP port 3537 (default)
Are the Ports Configurable?: Yes
Location of Port Settings: To view and change port settings for the VISA server on a PC, open NI Measurement & Automation
Explorer (MAX) software and navigate to Tools >> NI-VISA >> VISA Options >> VISA Server.
FPGA Compile Farms
Description of Functionality: You can send a LabVIEW FPGA compile job to a single remote computer for compilation, or use a
remote bank of computers for site-wide compilation (each compile still utilizes only one computer). Remote compilation on one
machine can be accomplished by installing LabVIEW FPGA Compile Worker software on that machine, and LabVIEW FPGA
Compile Server software on either the local or remote machine. Site-wide remote compilation systems can be built using a bank of
computers with LabVIEW FPGA Compile Worker software installed, and a server computer with the LabVIEW FPGA Compile
Server and LabVIEW FPGA Compile Farm Toolkit installed.
Server Ports: TCP port 3580 (same as Web Monitoring and Configuration server)
Are the Ports Configurable?: No
Legacy: G Web Server
Description of Functionality: The G Web Server is part of the LabVIEW Internet Toolkit, and can be used to provide remote
machines with access to CGI applications written in LabVIEW.
Server Ports: TCP port 80 (default)
Are the Ports Configurable?: Yes
Location of Port Settings: You can configure the G Web Server using the LabVIEW menu located at Tools >> Internet >> G Web
Server Configuration.
File, Email, Web Page, and Data Communication
www.ni.com
Location of Port Settings: You can use the HTTP Client VIs in LabVIEW to connect to remote Web servers -- not implement the
Web server itself. Port 80 is commonly used by Web servers, but you can use the HTTP Client VIs to connect to servers on
non-standard ports by using a URL with format (http://HOSTNAME:PORT). In most cases, no firewall adjustments should be
needed to connect to a remote HTTP server.
Shared Variables and Network Streams
Description of Functionality: Both Network Shared Variables (available in LabVIEW, LabWindows/CVI, and Measurement
Studio) and Network Streams (available in LabVIEW 2010 and higher) can be used to transmit variable data between machines
on a network. In practice, Network Shared Variables are optimized for polling variable values from one or more remote systems,
while Network Streams are optimized for sending a complete stream of data in a lossless manner between one system and
another. Because Network Shared Variables and Network Streams both make use of an underlying protocol called Logos, they
both use the same network ports.
Server Ports: UDP port 2343 (default), UDP ports 6000-6010 (default), TCP ports 59110 and above (one port for each application
running on the server)
Are the Ports Configurable?: Yes
Location of Port Settings: For Network Shared Variables or Network Streams that are hosted on a Windows PC, you can create
a LogosXT.ini file to specify a different range of TCP ports to use (the UDP ports used are fixed). Follow this link to read about the
location and contents of the LogosXT.ini file: Changing the Default Ports for TCP-Based NI-PSP (Windows). In addition, you can
configure these ports for Network Shared Variables and Network Streams hosted on LabVIEW Real-Time targets by editing the
ni-rt.ini file located in the root FTP directory of the controller. The parameters of interest are the LogosXT_PortBase and
LogosXT_NumPortsToCheck entries in the file.
DataSocket (DSTP)
Description of Functionality: NI DataSocket VIs can be used to communicate with other applications, files, FTP servers, and
Web servers. The specific ports used will depend on the type of server that you are connecting to. In addition, DataSocket VIs can
connect to DataSocket servers that use the DataSocket Transfer Protocol (DSTP).
Server Ports Used: TCP port 3015 (for DSTP)
Are the Ports Configurable?: No. You can start the DataSocket server by navigating to Start >> All Programs >> National
Instruments >> Datasocket >> DataSocket Server.
Direct TCP and UDP Communication
Description of Functionality: Using the UDP and TCP VIs in LabVIEW, you can directly send and receive UDP and TCP
communication to and from other machines on a network.
Protocol and Ports Used: Defined by application code or server
Is the Port Configurable?: Yes
Location of Port Settings: The TCP and UDP VIs enable listening on your port of choice, or sending data to another machine on
a port number that you specify.
Time Synchronization (NTP, SNTP)
Description of Functionality: Certain NI embedded hardware targets have a built-in ability to set their system time based on a
network time server (typically a Simple Network Time Protocol, or SNTP server). On other hardware targets, example code is
available for programmatically retrieving a time via NTP or SNTP and setting the system time based on that value.
Server Ports: TCP port 123 (default)
Is the Port Configurable?: Yes (defined by server)
Location of Port Settings: Note that code running on NI hardware targets is typically used to connect to a network time server -not implement the time server itself. Therefore, the network port used will depend on the server that you are connecting to. For
CompactRIO targets, you can use the instructions in this reference to configure the server and port to connect to: Configuring
CompactRIO Real-Time Controllers to Synchronize to SNTP Servers. If you are using code on another target to connect to a
network time server, you can set the server and port to connect to using that code. In most cases, no firewall adjustments should
be needed to connect to a remote NTP or SNTP server.
Device-Specific Port Information
www.ni.com
Description of Functionality: Using NI GPIB-ENET devices, you can control communication with GPIB instruments remotely via
Ethernet.
Server Ports: TCP ports 5000, 5003, 5005, 5010, and 5015
Are the Ports Configurable?: No
3. Summary Table (Network Ports and Settings)
Product or Feature
Server Ports
(default)
UDP 44525
NA
TCP 8080
LabVIEW VI Server
TCP 3363
NI VISA Server
TCP 3537
TCP 3580
NA
TCP 80
TCP 25
TCP 80
Network Streams
Same as above
Same as above
DataSocket (DSTP)
TCP 3015
NA
NA
Defined by application
TCP 123
www.ni.com
NI ENET-232, NI ENET-485
TCP 5225
NA
NA
4. Additional Assistance
If you are experiencing issues with firewalls and NI products, visit ni.com/support and call or e-mail an Applications Engineer for
assistance. You can also ask about any products not mentioned in this tutorial, and request that they be added for future
reference.
6/6
www.ni.com