Trail: Sockets Direct Protocol
Lesson: Understanding the Sockets Direct Protocol
Creating an SDP Configuration File
Home Page > Sockets Direct Protocol > Understanding the Sockets Direct Protocol
Creating an SDP Configuration File
An SDP configuration file is a text file and you decide where on the file system it will live. Every line in the configuration file is either a comment or a rule. A comment is indicated by the hash character (#) at the beginning of the line — everything following the hash character will be ignored.

There are two types of rules:

A rule has the form:

("bind"|"connect")1*LWSP-char(hostname|ipaddress)["/"prefix])1*LWSP-char("*"|port)["-"("*"|port)]

Decoding the notation: 1*LWSP-char means that any number of linear whitespace characters (tabs or spaces) can separate the tokens. The square brackets indicate optional text. The notation (xxx | yyy) indicates that the token will include either xxx or yyy, but not both. Quoted characters indicates literal text.

The first keyword indicates whether it is a bind or a connect rule. The next token specifies either a host name or a literal IP address. When you specify a literal IP address, you can also specify a prefix, which indicates an address range. The third and final token is a port number or a range of port numbers.

The notation will become more clear in this sample configuration file:

# Use SDP when binding to 192.168.1.1
bind 192.168.1.1 *

# Use SDP when connecting to all application services on 192.168.1.*
connect 192.168.1.0/24     1024-*

# Use SDP when connecting to the http server or MySQL database on hpccluster
connect hpccluster.foo.com   80
connect hpccluster.foo.com   3306

The first rule in the sample file specifies that SDP is used for any port (*) on the local IP address "192.168.1.1". You would add a bind rule for each local address assigned to an InfiniBand adaptor. (An InfiniBand adaptor is the equivalent of a Network Interface Card (NIC) for InfiniBand.) If you had several IB adaptors, you would use a bind rule for each of the addresses assigned to those adaptors.

The second rule in the sample file specifies that whenever connecting to 192.168.1.* and the target port is 1024 or greater, SDP is used. The prefix on the IP address "/24" indicates that the first 24 bits of the 32-bit IP address should match the specified address. Each portion of the IP address uses 8 bits, so 24 bits indicates that the IP address should match "192.168.1" and the final byte can be any value. The "-*" notation on the port token specifies "and above." A range of ports, such as 1024-2056, would also be valid and would include the end points of the specified range.

The final rules in the sample file specify a host name (hpccluster), first with the port assigned to an http server (80) and then with the port assigned to a MySQL database (3306). Unlike a literal IP address, a host name may translate into multiple addresses. When you specify a host name, it matches all addresses that the host name is registered to in the name service.

Previous page: Overview
Next page: Enabling the SDP Protocol