IP networking for automation engineers

IPv4 addresses, subnet masks and CIDR, gateways, private ranges, VLANs and the TCP/UDP ports of industrial protocols — what you need when commissioning PLCs, HMIs and SCADA.

Address and mask

An IPv4 address is 32 bits, written as four bytes: 192.168.10.25. The subnet mask tells which part is the network: with 255.255.255.0 (= /24, 24 network bits) all addresses 192.168.10.x are in the same subnet.

ResultHow it is computedExample for 192.168.10.25/24
Network addressIP AND mask192.168.10.0
Broadcastnetwork OR NOT mask192.168.10.255
Usable hosts2^(32−prefix) − 2254 (.1 … .254)

Two devices talk directly only if they are in the same subnet; otherwise they need a default gateway (router). A PLC configured 192.168.0.10/24 cannot reach 192.168.1.20/24 without a router, even on the same switch. Calculate with the IPv4 subnet calculator.

Private ranges (RFC 1918)

10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — not routed on the Internet, used in plants. Avoid overlapping ranges between machines that will later be connected to the same plant network; agree an addressing plan early.

Practical rules

  • One subnet per machine or line, with the PLC on a fixed address; document it on the cabinet.
  • Do not leave devices on DHCP if a controller expects a fixed address.
  • Duplicate IP addresses cause intermittent faults — check with the engineering tool's "accessible devices" or a network scan only where allowed.
  • VLANs separate traffic on shared switches (e.g. control, video, office).
  • Real-time Ethernet protocols (PROFINET RT, EtherCAT) use their own EtherTypes and do not route through IP routers.

Ports of industrial protocols (IANA)

ProtocolPort
Modbus TCPTCP 502 (secure: 802)
ISO-TSAP (used by Siemens S7 communication)TCP 102
EtherNet/IP explicit / I/OTCP/UDP 44818 / UDP 2222
OPC UA binaryTCP 4840 (over TLS: 4843)
PROFINET RT unicast / multicast / context manager34962 / 34963 / 34964
IEC 60870-5-104TCP 2404
DNP3TCP/UDP 20000
BACnet/IPUDP 47808
HART-IP5094
MQTT / MQTT over TLSTCP 1883 / 8883
SNMP / trapsUDP 161 / 162

Firewalls between cells must open exactly the ports in use — and nothing else.

Loading the map…

Sources

  1. RFC 4632 — Classless Inter-domain Routing (CIDR) — IETF
  2. RFC 1918 — Address Allocation for Private Internets — IETF
  3. IANA Service Name and Transport Protocol Port Number Registry — IANA
  4. PROFINET System Description, System Manual 03/2012 — Siemens AG

Updated 2026-10-02