MGSL_DLPARAMS Structure


This structure specifies the functional characteristics of a link instance. This structure is used with the MgslDlGetParams and MgslDlSetParams API functions.

typedef struct _MGSL_DLPARAMS
{
    ULONG Link;             /* link instance identifier */
    ULONG Flags;            /* bitmask of link layer flags */

    UCHAR LocalAddr[16];    /* local address */
    ULONG LocalAddrLength;

    UCHAR RemoteAddr[16];   /* remote address */
    ULONG RemoteAddrLength;

    UCHAR BcastAddr[16];    /* all stations command address */
    ULONG BcastAddrLength;

    ULONG TransmitWindow;   /* maximum outstanding I-frames */
    ULONG RetryLimit;       /* maximum number of retransmissions */
    ULONG MaxInfoField;     /* max info field size in bytes */

    ULONG ResponseTimer;    /* response timeout (milliseconds)*/
    ULONG IdleTimer;        /* idle timeout (milliseconds) */

    ULONG Reserved1;        /* must be zero */
    ULONG Reserved2;        /* must be zero */

} MGSL_DLPARAMS, *PMGSL_DLPARAMS;

Link

This member is set to the link instance identifier by the application before passing the structure to MgslDlGetParams or MgslDlSetParams.

Flags

This member contains flags that specify functional characteristics of the link. Some flags enable the use of optional frames types. A received frame of a disabled type is considered invalid, resulting in appropriate recovery action. A primary or combined station reestablishes the link. A secondary station sends a FRMR and waits for link reestablishment.

DLFLAG_ACCEPT
Accept incoming operational mode setting command. If not set, reject the command with the appropriate link procedures (such as sending a DM response).
DLFLAG_ALL_ADDRESS
A received frame with an address field that does not match the user specified local, remote, or broadcast addresses is treated as a broadcast address match. This option is not appropriate for multidrop connections or point to point connections that must ignore frames with unmatched address fields. Use this option for point to point connections where multiple broadcast addresses are used. Do not confuse this option with the DLFLAG_DEFAULT option, which behaves differently.
DLFLAG_BCN
Enable use of BCN (beacon) frame. Loop mode only.
DLFLAG_CGFR
Enable use of CGFR (configure) frame. Loop mode only.
DLFLAG_DEFAULT
Received frames with unrecognized addresses are processed by the first link with this flag set. The received frame is indicated in a DLINDICATION_RAWDATA primitive.
DLFLAG_DEFAULT_COMMAND
Received frames with unrecognized addresses are processed by all links with this flag set. The frame is treated as a command. This flag should not be used with multidrop applications or point to point connections that must ignore frames with unrecognized addresses. This flag should not be used with the DLFLAG_DEFAULT_RESPONSE flag.
DLFLAG_DEFAULT_RESPONSE
Received frames with unrecognized addresses are processed by all links with this flag set. The frame is treated as a response. This flag should not be used with multidrop applications or point to point connections that must ignore frames with unrecognized addresses. This flag should not be used with the DLFLAG_DEFAULT_COMMAND flag.
DLFLAG_DUPLEX
Allow simultaneous transmission of data from both stations. NRM only, ignored in ABM.
DLFLAG_ENABLE
Enable processing of received frames.
DLFLAG_INLINE_ADDRESS
Prepend the associated received HDLC address to the information field passed to the application from the API in all primitives that return an information field. This allows the application alter processing of data based on the associated HDLC address. The Flags field of the primitive will also have this flag set.
DLFLAG_MULTI_SREJ
Enable multi-selective reject handling. This option allows sending and receiving SREJ frames that request retransmission of multiple frames. Ignored if DLFLAG_SREJ not set.
DLFLAG_POLL
The link instance operates as a polling link, sending broadcast unnumbered poll (UP) commands after each idle timeout. This is useful for loop mode and multi-drop applications. A polling link generally does not perform any other function. Separate link instances without this flag set are used to carry data.
DLFLAG_PRIMARY
Defines station role in NRM. If set, the station role is primary, otherwise it is secondary. Ignored for ABM.
DLFLAG_RD
Enable use of RD (request disconnect) frames. A secondary station sends an RD response to request the primary send a disconnect mode setting command.
DLFLAG_REJ
Enable use of REJ (reject) frames to request retransmission of lost frames. If not set, lost frames are resent using checkpoint detection which is less efficient.
DLFLAG_RSET
Enable use of the RSET (reset) command in ABM. Ignored in NRM. When set, RSET is used in place of FRMR for clearing an invalid N(R) condition.
DLFLAG_SABM
Enable ABM modulus 8 operation.
DLFLAG_SABME
Enable ABM modulus 128 operation.
DLFLAG_SIM
Enable the SIM command and RIM response.
DLFLAG_SNRM
Enable NRM modulus 8 operation.
DLFLAG_SNRME
Enable NRM modulus 128 operation.
DLFLAG_SREJ
Enable SREJ (selective reject) option. This option allows sending and receiving SREJ frames to request retransmission of individual frames. This can be more efficient than requiring retransmission of a range of frames using the REJ option.
DFLAG_TEST
Enable the test command. The test command causes the addressed station to respond with a test response. The response may contain an application specific information field.
DLFLAG_UP
Enable use of unnumbered poll command.
DLFLAG_XID
Enable use of the XID command and response for exchanging identification.

Addresses

HDLC frames start with an address field. Command frames use the address of the recipient. Response frames use the sender’s address. Addresses are one byte long with all 256 combinations available, unless the DLPHYSFLAG_EXTENDED_ADDRESS flag is set in the MGSL_DLPHYSPARAMS structure. Extended addresses may be larger than a single byte, and must set the least significant bit of each address byte to 0, except the last byte, which has a 1 in the least significant bit. The API supports address fields from 1 to 16 bytes in length.

The MGSL_DLPARAMS structure contains 3 configurable addresses. Some protocols may require configuring only a subset these addresses. The function of the addresses is described below.

local matches received command, send response
remote send command, matches received response
broadcast matches received command, send all station command

Some commands can optionally be sent with the broadcast command address by specifying DLFLAG_BROADCAST in the Flags member of the associated primitive. DLREQUEST_XID, DLREQUEST_TEST, DLREQUEST_CONFIGURE, DLREQUEST_ESTABLISH, and DLREQUEST_UNITDATA use this flag. Unnumbered poll (UP) commands are always sent with the broadcast command address (loop mode only).

Received frames are processed by every link with a matching address as shown above.

SNA SDLC Example

SNA SDLC uses a single byte address. The primary only sends commands, which use the recipient’s (secondary station) address. The secondary station only sends responses, which use the sender’s (secondary station) address. The example uses a secondary station address of 0xC1.

The primary uses the following configuration:

local 0, length 0 (never sends responses or receives commands)
remote 0xC1, length 1
broadcast 0xFF, length 1

The secondary uses the following configuration:

local 0xC1, length 1
remote 0, length 0 (never sends commands or receives responses)
broadcast 0xFF, length 1

LAPB Example

LAPB (X.25) uses a one byte address. One station is the DTE side of the connection and the other is the DCE side. LAPB uses ABM so both sides are combined stations that can send both commands and responses.

The DTE side uses the following configuration:

local 0x03, length 1
remote 0x01, length 1
broadcast 0xFF, length 1

The DCE side uses the following configuration:

local 0x01, length 1
remote 0x03, length 1
broadcast 0xFF, length 1

LAPD Example

LAPD uses a two byte address with command/response encoded in bit 1 (CR) of the first byte as shown below. One station is the network side of the connection and the other is the user side. LAPD uses ABM so both sides are combined stations that can send both commands and responses. The SAPI and TEI fields are LAPD specific and are not explained here. Both of the fields are set to 0 for this example.

Byte 0: Bit 0: EA = 0, Bit 1: CR (see below),
                       Bits 7..2 : SAPI
Byte 1: Bit 0: EA = 1, Bits 7..1 : TEI

Command, Network to User, CR = 1
Command, User to Network, CR = 0
Response, Network to User, CR = 0
Response, User to Network, CR = 1

For simplicity, this example uses a SAPI of 0 and a TEI of 0. TEI 127 is used as the group (broadcast) address for SAPI 0.

The network side uses the following example configuration:

local 0x00 0x01, length 2
remote 0x02 0x01, length 2
broadcast 0x02 0xFF, length 2

The user side uses the following example configuration:

local 0x02 0x01, length 2
remote 0x00 0x01, length 2
broadcast 0x00 0xFF, length 2

TransmitWindow

The number of I-frames that may be sent without receiving acknowledgement from the peer. This value cannot be larger than the operating mode modulus minus one. For example, modulus 8 operation can have a maximum transmit windows of 7 and modulus 128 operation can have a maximum transmit window of 127.

RetryLimit

The number of times data or a command can be retransmitted before reporting an error.

MaxInfoField

The maximum number of bytes allowed in the information field of any frame

ResponseTimer

The number of milliseconds to wait for a response or acknowledgement before retransmitting a command or data. A value of 0 disables the response timeout (not recommended for most applications). The response timeout should be set to a value high enough to allow a command to travel to the peer, and the response to travel back to the local station. Typical values are 1000 (1 second) to 3000 (3 seconds).

This timer is armed when a station expects a response to a command or acknowledgement of transmitted data. A secondary station (normal response mode) ignores this timeout.

IdleTimer

The maximum number of milliseconds allowed with no exchange of frames while a link is in the established state. A value of 0 disables the timeout.

Primary or Combined Station
When there are no frames to send and no acknowledgements are expected, the idle timer is armed. When the timer expires, the link enters the timer recovery state and sends an enquiry to the peer. When the peer responds, the established state is restored and the idle timer is restarted.

Use this timer in balanced mode to detect a failed peer with a typical value of 30000 (30 seconds). In normal response mode (SDLC), this is used by the primary station as a poll timer with a value of 1000 (1 second) or less.

Secondary Station
The timer is restarted after each received frame while link is established. If the timer expires then a DLINDICATION_RELEASE primitive is generated and the link enters the released state. This allows detection of a failed link when the primary station is unable to send a disconnect command. A typical value is 30000 (30 seconds).


Previous Contents Next