JGroups Protocol TP

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Configuration

bind_addr

Specifies the IP bind address which should be used by this transport. The following special values are also recognized: GLOBAL, SITE_LOCAL, LINK_LOCAL and NON_LOOPBACK.

The actual value to use is maintained by the TP superclass as:

  protected InetAddress bind_addr;

UDP Behavior

The value is applied to both the unicast datagram socket and multicast datagram sockets with setInterface(). If the "bind_addr" attribute it is set in the configuration, the internal bind_addr variable is initialized by by calling:

InetAddress.getByName(bind_addr)

Else, if "bind_addr" attribute is NOT set in the configuration, the internal bind_addr variable is initialized by by calling

InetAddress.getLocalHost()

According to Java documentation, InetAddress.getLocalHost() returns the address of the local host. This is achieved by retrieving the name of the host from the system, then resolving that name into an InetAddress.

TCP Behavior

If "bind_addr" is not set, the server socket is obtained by messaging the TCPConnectionMap's socket_factory to create a server socket for service "jgroups.tcp.srv_sock", on the specified port.

If "bind_addr" is set, the same socket factory is used but this time bind_addr is passed down.

bind_port

The port to which the transport binds. 0 means to bind to any (ephemeral) port.

port_range

The range of valid ports, from bind_port to end_port.

0 only binds to bind_port and fails if taken. Default (hardcoded) is 50.

Recommended to set to 0 explicitly.

bind_interface

The interface (NIC) which should be used by this transport.

external_addr/external_port

Use "external_addr" if you have hosts on different networks, behind firewalls. On each firewall, set up a port forwarding rule (sometimes called "virtual server") to the local IP (e.g. 192.168.1.100) of the host then on each host, set "external_addr" TCP transport parameter to the external (public IP) address of the firewall. "external_port" is used to map the internal port (bind_port) to an external port. Only used if greater than 0.

receive_on_all_interfaces

If true, the transport should use all available interfaces to receive multicast messages.

receive_interfaces

Comma delimited list of interfaces (IP addresses or interface names) to receive multicasts on. The multicast receive socket will listen on all of these interfaces. Example: "192.168.5.1,eth1,127.0.0.1". Duplicates are discarded; we only bind to an interface once. If this property is set, it overrides receive_on_all_interfaces.

logical_addr_cache_max_size

Max number of elements in the logical address cache before eviction starts. Default hardcoded to 500.

logical_addr_cache_expiration

Time (in ms) after which entries in the logical address cache marked as removable are removed. Default hardcoded to 120,000.