High Availability and load balancing for incoming OFTP (TCP) connections
When working with communication protocols in high availability environments the architecture should always be catering for all the requirements:
- Business requirements regarding availability by supporting HA setups
- Technical requirements regarding scaling and performance by supporting multiple instances, load balancing
- Supporting the business and technical scenarios e.g. by supporting the communication protocols in use
Many modern protocols are based on a HTTP transport layer which makes it relatively easy to fulfill the above requirements by using well known load balancing components (e.g. SAP Web Dispatcher).
The B2B Add-On OFTP Adapter uses a (standardized) transport layer which is not based on HTTP. This would mean that these load balancing components which are typically already in place cannot be used for incoming OFTP connections. OFTP supports two major network layers:
- ISDN connection (via ISDN Router and connecting to the router via TCP/IP remote CAPI)
All configured instances/server nodes are notified about incoming ISDN connection requests and the faster one wins, answers the ISDN call. This means that resilience (handling the crash of a server node) is automatically handled at least for subsequent ISDN calls while load balancing may not be guaranteed as it is determined by the latency/response time of every server node.
For TCP/IP based OFTP connections a relatively new feature of the SAP Web Dispatcher may be used:
2192839 – Using Web Dispatcher protocol ROUTER for TCP load balancing
Using this you could configure a single SAP Web Dispatcher port for incoming OFTP TCP/IP connection requests e.g. 3305:
icm/server_port_0 = PORT=3305,PROT=ROUTER,PROCTIMEOUT=3600 icm/server_port_1 = PORT=0,PROT=HTTPS wdisp/system_0 = SID=T01, EXTSRV=https://applserv1:3305;https://applserv2:3305;http://applserv3:3305, SRCSRV=*:3305
Import are lines 1 and 3:
In line 1 we define a listening port (3305) on our SAP Web Dispatcher with type ROUTER.
In line 3 we define a system 0 (SID T01) with 3 instances all listening for OFTP TCP/IP connections on port 3305 and all serving connection requests for Web Dispatcher port 3305.
The problem with TCP/IP server sockets is that they are a unique combination of IP + PORT. When defining an OFTP Sender channel it is propogated to all instances and server nodes of that PO system – only one server node on each instance will be able to create and bind an active (listening) server socket as shown in the picture.
Keep in mind: the public hostname/IP address is the SAP Web Dispatchers address in that case. The instances are hidden and their addresses should not be published to the communication partners.
Hi Frederic, just wondering do you have a working example? I've recently tried your suggestion in our WD, i couldn't get it to work with OFTP at all. Any idea?
imported following lines:
icm/server_port_3 = PROT=TCP, PORT=6619, TIMEOUT=60, PROCTIMEOUT=90
icm/server_port_4 = PROT=TCP, PORT=3305, TIMEOUT=60, PROCTIMEOUT=90
and updated following from:
wdisp/system_0 = SID=PIQ, MSHOST=abcd, MSPORT=8102, SRCSRV=*:50000;*:443
wdisp/system_0 = SID=PIQ, MSHOST=abcd, MSPORT=8102, SRCSRV=*:50000;*:443;*:6619;*:3305
Got it working with inbound OFTP.
added the following 2 lines:
icm/server_port_<n> = PROT=TCP, PORT=6619, TIMEOUT=<time_in_second>, PROCTIMEOUT=<time_in_second>
wdisp/system_<n> = SID=<SID>, SRCTCPSRV=*:6619, EXTSRV=tcp://<APP_server_fqdn>:6619
Glad you got it to work. It changed a bit with newer WD versions where the TCP protocol is available.