Modbus is a master slave protocol. The master sends formatted instruction messages via Ethernet (via a port). If the message is addressed to the slave, then the slave interprets the message and executes the request (either provides data for a read function or accepts data for a write function).
The Modbus protocol is an open published protocol at modbus.org.
Most people buy the firmware/software for either the slave or the master, as needed, but what you need to write your own Modbus app is in the published protocol.