To be able to connect to a SAP server from the Internet, one uses SAProuter as a proxy between the SAP GUI and the SAP server.
SAProuter is an SAP program that acts as an intermediate station (proxy) in a network connection between SAP Systems, or between SAP Systems and external networks. SAProuter controls the access to your network (application level gateway), and, as such, is a useful enhancement to an existing firewall system (port filter)."
"The use of saprouter means that a client will first connect to saprouter. SAProuter then connects to an additional SAProuter or to a SAP server.
The connection from SAP GUI to SAP router is a connection to port 3299, and SAProuter uses port 32## to connect to the SAPserver for a "normal" connection and port 33## for an RFC (Remote Function Call) connection. In both cases ## is the systemnumber of the SAP server.
Each instance of an SAP System has a gateway. The gateway enables communication between work processes and external programs, as well as communication between work processes from different instances or SAP Systems.