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;
This member is set to the link instance identifier by the application before passing the structure to MgslDlGetParams or MgslDlSetParams.
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.
|
Accept incoming operational mode setting command. If not set, reject the command with the appropriate link procedures (such as sending a DM response). |
|
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. |
|
Enable use of BCN (beacon) frame. Loop mode only. |
|
Enable use of CGFR (configure) frame. Loop mode only. |
|
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. |
|
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. |
|
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. |
|
Allow simultaneous transmission of data from both stations. NRM only, ignored in ABM. |
|
Enable processing of received frames. |
|
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. |
|
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. |
|
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. |
|
Defines station role in NRM. If set, the station role is primary, otherwise it is secondary. Ignored for ABM. |
|
Enable use of RD (request disconnect) frames. A secondary station sends an RD response to request the primary send a disconnect mode setting command. |
|
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. |
|
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. |
|
Enable ABM modulus 8 operation. |
|
Enable ABM modulus 128 operation. |
|
Enable the SIM command and RIM response. |
|
Enable NRM modulus 8 operation. |
|
Enable NRM modulus 128 operation. |
|
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. |
|
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. |
|
Enable use of unnumbered poll command. |
|
Enable use of the XID command and response for exchanging identification. |
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 |
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.
The number of times data or a command can be retransmitted before reporting an error.
The maximum number of bytes allowed in the information field of any frame
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.
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 |