9-1
Basic Knowledge on Socket Commu-
nications
9-1-1
Sockets
A socket is an interface that allows you to directly use TCP or UDP functions from the user program.
On a host computer (e.g., personal computer), sockets are provided in the form of a C language inter-
face library. If you load the library, you can program communications via TCP and UDP in the user
program.
On a UNIX computer, a socket interface is provided in the format of system calls.
With a built-in EtherNet/IP port, you can execute instructions in the user program by using sockets.
Through the communications services with sockets, you can send and receive data to and from re-
mote nodes, i.e., between the host computer and Controllers or between Controllers.
Built-in EtherNet/IP ports support UDP socket service as well as TCP socket service.
9-1-2
Port Numbers for Socket Services
Ports 0 to 1023 to be used for TCP/IP are reserved as well-known ports. In addition, ports 1024 to
49151 are reserved as registered ports by the protocols that are used.
Therefore, we recommend that you use port numbers 49152 to 65535 for applications other than the
protocols that are registered with the socket service.
You cannot specify port number 0 for the built-in EtherNet/IP port.
Also, make sure that the following ports, which are used by the built-in EtherNet/IP port, are not used
for other purposes.
Application UDP TCP
FTP server ---
20, 21
*1
DNS 53 ---
BOOTP client 68 ---
HTTP server --- 80
NTP client
123
*1
---
SNMP Agent
161
*1
---
SNMP trap
162
*1
---
FINS/UDP 9600 ---
FINS/TCP ---
9600
*1
Used by system 2222, 2223, and 2224 9610
CIP messages 44818 44818
TCP/UDP message service
*2
64000
*1
64000
*1
*1. These are the default port numbers. You can change the port numbers in the settings.
*2. This can only be used on the NX102 CPU Unit.
9 Socket Service
9-2
NJ/NX-series CPU Unit Built-in EtherNet/IP Port User’s Manual (W506)