SNA SDLC Communication Steps

1.	OVERVIEW



2.	SNA FRAME SUMMARY



3.	NORMAL START-UP SEQUENCE OF EVENTS



4.	NORMAL START-UP EXAMPLE



5.	ADDRESSING

6.	RECORDS & BLOCKING



7.	ERROR DETECTION AND RE-TRANSMISSION



8.	STRING BIT BREAKDOWNS

A.	ACTPU

B.	ACTLU

C.	INITSELF/BIND

D.	BEGIN DESTINATION

E.	PACING

F.	SENSE CODE

9.	PROTOCOL DIAGNOSIS

A.	SEGMENTING

B.	CHAINING

C.	PACING

D.	BRACKETING

E.	CHANGE DIRECTION

10.	SNA CHARACTER SET TRANSLATIONS

A. SET HORIZONTAL FORMAT

B. COMPRESSION

C. TRANSPARENCY





1.	OVERVIEW

This document covers the SNA/SDLC communication steps from the Remote protocol
converter to/from the host. This will help you understand the data seen with a
line monitor or the TRON utility. This is intended as a guide to what is normal,
so that you can analyze a trace with a problem.

2.	SNA FRAME SUMMARY

SNA is a bit oriented protocol, meaning that each bit has different meaning,
depending on where it is in a bit stream and what preceded it in the bit stream.
ALL frames start with a 7E (start flag), followed by the secondary address which
is the Physical Unit or station address, and then a control byte. The meaning of
what follows is dependent on the control byte. The frames end with a two byte
Frame Check Sequence (FCS), and another 7E end flag.

a.	Note that the protocol converter TRON mode does not show the start flag or
the secondary address, the FCS (Frame Check Sequence), or the end flag.



SDLC FRAME

| SDLC link header	| SNA layer * | link trailer|
| 
start station	ctrl	PIU	FCS	end

flag	addr	byte	0 to 512 bytes flag

7E xx	xx	|	xx	7E

/	|	|	\
/	|	|
This byte |	|	\

is always |	Only present on	Frame check sequence

the same |	Info frames. to check for errors.

to and from /	\

the host. /	\

/	Contains THs, RHs, FMHs and RUs.
/
This byte can be non-sequenced, (256 or 512 max)

(which means the sequence number field will not be incremented)

and there won't be Nr's and Ns's (PIU will contain 6 records for 512 byte buffer
(6 + 3 + ( 6 x 83 ))

or it can be supervisory. (PIU can contain 2 records for 256 byte buffer (6 + 3
+ 2 + 80 + 3 + 80 + 1)

which includes:	See Section 4 ERROR DETECTION AND

RR ready to receive	RE-TRANSMISSION for more info on

RNR not ready to receive	the Control byte.

REJ re-transmit (although

this is not used with 3770)

contains Nr's but not Ns's

or it can be an Information

frame which is always

sequenced. Contains Nr's

and Ns's.

The SNA layer is completely separate from the SDLC layer. SDLC carries SNA
information, but SNA is not necessarily only carried over SDLC. SDLC is at the
Transport Layer where it could be replaced with channels and networks.




3.	NORMAL START-UP SEQUENCE OF EVENTS

The communication begins with the host (IBM 3705, 3725, 3745). Notice that
depending on how the line was generated at the host, the sequence could be
different. For example, the host can activate several LUs at one time, or
separately, but each LU sequence will be in order. The general sequence is:

Host sends set normal response mode command (SNRM). Remote responds (NSA or UA).
Host activates the PU (ACTPU). Remote responds. Then each LU generated will
start up in this order:

Host activates logical unit (ACTLU). Remote responds. Remote initializes after
all LUs as specifies in the setup are activated (INIT SELF includes logon
parameters). Host checks the logon parameters, LOGMODE ENTRY first, then APPLID,
and finally the LOGON DATA FIELD, then binds (BIND) if the parameters are
correct. Remote responds. When all LUs are ACTIVE and BOUND, the converter
outputs the AUTO LOGON COMPLETE. Host sends start data traffic (SDT) string
Remote responds. To start a job flow:

Remote or host send a begin destination request that reserves a logical unit for
a certain device.

The receiver sends a begin destination response. The receiver sends a pacing
response when it is ready for data. The sender sends data (up to the MAXOUT
number of blocks) on that logical unit, with each block containing information
as to whether it is the first,

middle, last, or whole chain and the first, or whole bracket.

The receiver sends a pacing response when it is ready for more data. The sender
sends more data (up to the MAXOUT number of blocks) on that logical unit, with
each block containing information as to whether it is the

first, middle, last, or whole chain and the middle, or last bracket.

The receiver sends a pacing response when it is ready for more data. The sender
sends the last of the data (up to the MAXOUT number of blocks) on that logical
unit, with each block containing information as to whether it is the first,
middle, last, or whole chain and the last bracket. After the last in the bracket
has been transmitted, and the receiver has sent a pacing response, the sender
transmits an END DESTINATION request.

The receiver sends an END DESTINATION response and puts an EOF on the job to the
output device.


4.	NORMAL START-UP EXAMPLE



control byte

/
/
HOST BF This is an XID request (only used on dial-up lines).

Remote	BF 02 00 01 30 0E 32 XID request response. In the case the

dialup XID block was 013 and the XID number was 00E32.

HOST 93	SNRM Set Normal Response Mode.

Remote	73	NSA	Acknowledge Non-sequenced command

HOST	11	RR	Ready to Receive

Remote 11	RR	" "

Repeating polls

TH	RH FMH

HOST	00 | 2D 00 00 00 15 68 | 6B 80 00 | 11 01 05 00 00 00 00 0A

^

This is an ACTPU string, (activate physical unit). A breakdown of this string is
included in item 4. {Series II displays "PU ACTIVE"} This string should only
occur once. Notice the TH's SNF (Sequence Number Field) started at 15 68.

HOST	11	RR	Ready to Receive

Remote 31	RR	" "

Repeating polls

TH	RH	FMH

Remote 20 | 2D 00 00 00 15 68 | EB 80 00 | 11 01 01 40 40 40 40 40 40 40 40

^

This is the response to the host ACTPU. Notice the TH's SNF (Sequence Number
Field) also happened to start at 15 68.

Remote	31	RR

TH	RH	FMH

HOST 22 | 2D 00 01 00 15 6A | 6B 80 00 | 0D 01 01

^ ^^^^	^

TH	RH	FMH

HOST	24 | 2D 00 02 00 15 6A | 6B 80 00 | 0D 01 01

^	^^^^	^

These Sequenced I-frames are ACTLU (Activate Logical Unit) strings for LU 01 &
LU 02. Each LU generated will be activated likewise. Notice the TH's SNF
(Sequence Number Field both started at 15 6A.

HOST	31	RR	Ready to Receive

Remote 71	RR	" "

Repeating polls

TH	RH	FMH

Remote	62 | 2D 00 00 01 15 6A | EB 80 00 | 0D 01 ACTLU (01)

^	^

The response to the host's ACTLU 01.

The next response occurs only if "AUTO LOGON" was selected at the setup, or if
the user manually initiates a logon command, as described in the Batch manual
page 3-4.

TH	RH	FMH

Remote 64 | 2C 00 00 01 00 00 | 0B 80 00 | 01 06 81 | 00 D2 E6 F3 F7

^	^^^^^^^ K W 3 7

F7 F7 40 40 F3 08 D1 C5 D2 F3 40 40 40 40 00 00 05 D9 D4 E3 F6 F9

7 7 J E S 3 R M T 6 9

This Sequenced I-frame is an INITSELF string for LU 01. This contains the data
from the LOGMODE ENTRY, and LOGON DATA FIELD setup parameters. Notice the SNF of
the TH is reset for the first normal flow (as indicated by the EFI bit of the
first byte of the TH) data stream from Remote.

Remote	71	RR

HOST	71	RR

TH	RH	FMH

Remote	66 | 2D 00 00 02 15 69 | EB 80 00 | 0D 01 ACTLU (02)

^	^

Remote	71	RR

TH	RH	FMH

HOST	86 | 2C 00 01 00 00 00 | 8B 80 00 | 01 06 81	INITSELF

^^^^^^^^

Notice the SNF of the TH is reset for the first normal flow (as indicated by the
EFI bit of the first byte of the TH) data stream from the host.

TH	RH	FMH

HOST	88 | 2D 00 01 01 00 00 | 6B 80 00 | 31 01 03 03 A1 A1 70 80 00

^	^

01 85 85 0A 00 01 11 00 00 B1 00 C0 00 00 01 00 00 00 04 D1 E2 C9 D6 00

This is a Bind LU 01 command string from the host.

HOST	91	RR

Remote	B1	RR

Repeating polls

TH	RH	FMH

Remote	A8 | 2D 00 01 01 00 00 | EB 80 00 | 31 BIND

This is the response to the host BIND 01 command.

Remote	B1	RR

HOST	B1	RR

Repeating polls

TH	RH FMH

HOST	AA | 2D 00 01 00 00 | 6B 80 00 | A0

^	^

SDT 01 (Start Data Traffic) is always the first thing after a BIND.

After the SDT the SNF (Sequence Number Field) will reset.

HOST	B1	RR

Remote D1	RR

Repeating polls

TH	RH	FMH

Remote	CA | 2D 00 01 01 00 00 | EB 80 00 | A0

^	^

This is the SDF 01 response.

TH	RH	FMH

Remote CC | 2C 00 00 02 00 00 | 0B 80 00 | 01 06 81 00 D2 E6 F3 F7 F7

^	^^^^^^^^ K W 3 7 7

F7 40 40 F3 08 D1 C5 D2 F3 40 40 40 40 00 00 05 D9 D4 E3 F6 F9

7 J E S 3 R M T 6 9

This Sequenced I-frame is an INITSELF string for LU 02. Notice the SNF of the TH
is reset for the first normal flow (as indicated by the EFI bit of the first
byte of the TH) data stream to LU2 from Remote.

Remote	D1	RR

HOST	F1	RR

Remote	D1	RR

Repeating polls

TH	RH	FMH

HOST	EC | 2C 00 02 00 00 00 | 8B 80 00 | 01 06 81	INITSELF 02

^	^^^^^^^^

Notice the SNF of the TH is reset for the first normal flow (as indicated by the
EFI bit of the first byte of the TH) data stream to LU2 from the host.

TH	RH	FMH

HOST	EE | 2D 00 02 01 00 00 | 6B 80 00 | 31 01 03 03 A1 A1 70 80 00

^	^

01 85 85 0A 00 01 11 00 00 B1 00 C0 00 00 01 00 00 00 04 D1 E2 C9 D6 00

This is a Bind LU 02 command string from the host.

HOST	F1	RR

Remote	11	RR

Repeating polls

TH	RH	FMH

Remote	0E | 2D 00 01 02 00 00 | EB 80 00 | 31

^	^

This is the response to the host BIND 02 command.

Remote	11	RR

HOST	11	RR

Repeating polls

TH	RH	FMH

HOST	00 | 2C 00 01 01 00 01 | 0B 81 80 | 06 01 00 00 44 00

^ ^ ^^^^^^^^^^^^^^^

This is a Begin Destination Request string requesting to send data to the
console. It is done in the Function Management Header type 1. The first 00 is
selecting a medium of console. Notice that the SNF of the TH is incremented by
one.

HOST	11	RR

Remote	31	RR

HOST	11	RR

Repeating polls

TH	RH

Remote	20 | 2C 00 01 01 00 01 | 83 81 00

^

This is a positive response to the begin destination and the pacing indicator is
set allowing more requests to be sent on normal flow.

Remote	31	RR

TH	RH

HOST	22 | 2C 00 01 01 00 02 | 03 81 00 | 08 F1 F5 4B F5 F9 4B F0 F2

1 5 . 5 9 . 0 2

40 5B C8 C1 E2 D7 F2 F0 F0 40 D9 D4 E3 F2 F2 40 E2 E3 C1 D9 E3 C5 C4 40

$ H A S P 2 0 0 R M T 2 2 S T A R T E D

D6 D5 40 D3 C9 D5 C5 F2 F2 0D

O N L I N E 2 2

This is a message sent to the console saying "15.59.02 $HASP200 RMT69 STARTED ON
LINE22". Notice that the SNF of the TH is again incremented by one.

HOST 31	RR

Remote	51 RR

Repeating polls

TH	RH

HOST 24 | 2C 00 02 01 00 01 | 0B 81 80 | 06 01 31 00 44 00

^	^

This is a Begin Destination request for printer two. A breakdown of the FM
header is in section 5, but the 3 of the 31 says the output is a document and
the 1 of 31 says the output is to the second of that device type.

HOST 31	RR

Remote	71 RR

Repeating polls

TH	RH

Remote	62 | 2C 00 02 01 00 01 | 83 81 00

This is a positive response to the begin destination and pacing response.

Remote	71	RR

TH	RH

HOST	46 | 2C 00 02 01 00 02 | 03 81 00 | 08 F1 F5 4B F5 F9 4B F0 F2

1 5 . 5 9 . 0 2

40 5B C8 C1 E2 D7 F2 F0 F0 40 D9 D4 E3 F2 F2 40 E2 E3 C1 D9 E3 C5 C4 40

$ H A S P 2 0 0 R M T 2 2 S T A R T E D

D6 D5 40 D3 C9 D5 C5 F2 F2 0D

O N L I N E 2 2

This is a message sent to the printer saying "15.59.02 $HASP200 RMT69 STARTED

ON LINE22"

HOST 51	RR

Remote	91 RR

Repeating polls

TH	RH	FMH

HOST	48 | 2D 00 03 00 15 69 | 6B 80 00 | 0D 01 01

^ ^	^

This Sequenced I-frames is ACTLU (Activate Logical Unit) strings for LU 03.
{Series II displays "LU ACTIVE - 03"} Each LU generated will be activated
likewise. Notice the TH's SNF (Sequence Number Field both happened to start at
15 69.

HOST	51	RR	Ready to Receive

Remote B1	RR	" "

Repeating polls

TH	RH	FMH

Remote	A4 | 2D 00 00 03 15 6A | EB 80 00 | 0D 01 ACTLU (03)

^	^

The response to the host's ACTLU 03.

The next response occurs only if "AUTO LOGON" was selected at the setup, or if
the user manually initiates a logon command, as described in the Batch manual
page 3-4.

TH	RH	FMH

Remote A6 | 2C 00 00 03 00 00 | 0B 80 00 | 01 06 81 | 00 D2 E6 F3 F7

^	^^^^^^^ K W 3 7

F7 F7 40 40 F3 08 D1 C5 D2 F3 40 40 40 40 00 00 05 D9 D4 E3 F6 F9

7 7 J E S 3 R M T 6 9

This Sequenced I-frame is an INITSELF string for LU 03. This contains the data
from the LOGMODE ENTRY, and LOGON DATA FIELD setup parameters. Notice the SNF of
the TH is reset for the first normal flow (as indicated by the EFI bit of the
first byte of the TH) data stream from Remote).

Remote	B1	RR

HOST	91	RR

TH	RH	FMH

HOST	8A | 2D 00 03 01 00 00 | 6B 80 00 | 31 01 03 03 A1 A1 70 80 00

^	^

01 85 85 0A 00 01 11 00 00 B1 00 C0 00 00 01 00 00 00 04 D1 E2 C9 D6 00

This is a Bind LU 03 command string from the host. {Series II displays the
"SESSION BOUND - 03" message.

HOST	91	RR

Remote	D1	RR

Repeating polls

TH	RH	FMH

Remote	C8 | 2D 00 01 03 00 00 | EB 80 00 | 31

^	^

This is the response to the host BIND 03 command.

Remote	D1	RR

HOST	B1	RR

Repeating polls

TH	RH

Remote CA | 2C 00 01 03 00 01 | 0B 80 80 | 06 01 20 00 40 00

^

This is a Begin Destination string from Remote to ask host if the converter can
send data from RD1.

Remote	D1	RR

HOST	D1	RR

TH	RH

HOST	C6 | 2C 00 03 01 00 01 | 83 80 00

Host sends a response allowing data from RD1. Note that the pacing bit is not
set because the bind has defined no pacing on input.

HOST	D1	RR	Transparency on 80 characters

/
/
TH	RH	______

Remote EC | 2C 00 01 03 00 02 | 02 90 01 | 35 50 61 61 5B C6 C3 E2 F3

/ / $ F C S 3
/ / 
HOST D1 RR (notice the host requests the last block again, by

not incremented the Nr (number ready) block count.

TH	RH

Remote EC | 2C 00 01 03 00 02 | 02 90 01 | 35 50 61 61 5B C6 C3 E2 F3

/ / $ F C S 3
/ / 
The converter re-transmits the last block again because the Nr was not
incremented. And so it goes....





5.	ADDRESSING



SDLC Station Address

The Front End Processor (usually a 3725 or 3705) will always send a station
address in the second byte of the SDLC layer of every data stream to the
converter. This is the first byte after the 7E start flag. The converter will
always send the same station address in the second byte of every data stream to
the FEP. It is also known as the secondary address. It will not change unless
the converter is set for STATION ADDRESS - DYNAMIC and the unit is reset and the
converter is polled from another host. SDLC station address "ff" is a special
case. It is a broadcast address that all controllers answer to. On dial-up
lines, the host polls with "ff" and we respond with the address we are set up
for (01) if we are set for dynamic. NEVER use dynamic mode for multi-drop lines.

PU Address

This is completely separate from the station address in that it comes from SNA's
Path Control layer in the Transmission Header. It is always 00.

LUs (Logical Units):

3770 shares LUs, compared to 3270 that hard-ties LUs to printers, etc. The
application program sees different devices, i.e., PR1, PR2, etc. If they are
both defined the same, a job will go to the one that isn't busy. If they have
different message classes or different forms definitions, the job goes to the
one it matches. If you're running JES, there are console commands to change
message class and forms queue for a given device. The lower nibble of the medium
select byte in the Begin Destination FM Header specifies the device number e.g.
30 is printer 1, 31 is printer 2.

The fact that it is SNA and uses LUs should be completely transparent. LUs are
set up in a pool. When the host wants to send data, it selects an LU that is not
between brackets and tells us what device to send the data to. On one
transmission PR1 might be using LU1, on another it might use LU4. It just
depends on which ones are already busy. If there is only one LU, only one device
can talk at a time, so if one goes down, no one else gets data.

3770 does not normally unbind LUs after each printer session like 3270 does.

With 3770, if a print job is sent to a converter that only has a punch defined,
the host would send a Begin Destination for the printer and the converter would
send a Negative Response 08 25. The data itself should never get sent.



6.	RECORDS & BLOCKING

Blocks of data are tied to a certain LU that is not shared when it is between
brackets. A bracket covers a whole job.

Records or Line separation is handled by control characters such as new-lines
and carriage returns in the jobs itself. In this way block size is not tied to
the record size.

The receiver takes in the blocks, and looks at what is in the PIU from the frame
end character. If a 7E (the SDLC end of frame character) were in the data, it
would require transparency.

The converter sends an EOF character when it receives the END DEST REQUEST.



7.	ERROR DETECTION AND RE-TRANSMISSION

Error detection and re-transmission at the SDLC layer is done by building a two
byte frame check sequence while receiving data and comparing to the one attached
to the end of the data. When an error is detected (by the calculated FCS not
matching the attached FCS) the converter informs the host (or vise-versa) in the
control byte, which is the third byte of every frame.

The way of keeping track and therefore informing the sender of which block(s)
have been received correctly is done by Nr's and Ns's. Nr's (number of block we
are ready for) are in supervisory and information control bytes. The sending
device always inserts an Ns (number of blocks sent) for information frames and
this Ns is in the control byte also.

Control bytes that are even are always information frames. Control bytes that
have 0001, 0101, or 1001 as the least significant nibble are supervisory frames.

The format of the RR (Ready to Receive) supervisory frame control byte is:

Nr P/F RR

xxx x 0001

The format of the information frame control byte is as follows:

Nr P/F Ns I-frame

xxx x xxx 0

P/F stands for poll or final and a 1 says it is the last frame (which tells the
receiving device the line will turnaround and the receiver can now send). If the
P/F bit is 0 there is more to come.

Following is the sequence of control byte stripped out from the above normal
start-up example in section 1 for easy viewing of this sequence.

Nr0 f RR

HOST	11 = 000 1 0001, RR (ready to receive frame 0, turnaround)

Nr0 f RR

Remote 11 = 000 1 0001, RR (ready to receive frame 0, turnaround)



Repeating polls

Nr0 p Ns0 I

HOST	00 = 000 0 000 0, I-frame (ready to receive 0, sending frame 0)

Nr0 f RR

HOST	11 = 000 1 0001, RR (ready to receive frame 0, turnaround)

Nr1 f RR

Remote 31 = 001 1 0001, RR (ready to receive frame 1, turnaround)

Repeating polls

Nr1 p Ns0 I

Remote 20 = 001 0 000 0, I-frame (ready to receive 1, sending frame 0)

Nr1 f RR

Remote	31 = 001 1 0001, RR (ready to receive frame 1, turnaround)

Nr1 p Ns1 I

HOST 22 = 001 0 001 0, I-frame (ready to receive 1, sending frame 1)

Nr1 p Ns2 I

HOST	24 = 001 0 010 0, I-frame (ready to receive 1, sending frame 2)

Nr1 f RR

HOST	31 = 001 1 0001, RR (ready to receive frame 1, turnaround)

Nr3 f RR

Remote 71 = 011 1 0001, RR (ready to receive frame 3, turnaround)



Nr1 f RR

HOST	31 = 001 1 0001, RR (ready to receive frame 1, turnaround)

Repeating polls

Nr3 p Ns1 I

Remote 62 = 011 0 001 0, I-frame (ready to receive 3, sending frame 1)

Nr3 p Ns2 I

Remote 64 = 011 0 010 0, I-frame (ready to receive 3, sending frame 2)

Nr3 f RR

Remote 71 = 011 1 0001, RR (ready to receive frame 3, turnaround)

Nr3 f RR

HOST	71 = 011 1 0001, RR (ready to receive frame 3, turnaround)

Repeating polls

Notice that the receiver increments the Nr for each block it receives from the
sender. The receiver stays one block or increment ahead of the sender. Right
after receiving block 2 & 3, (as shown in the Ns) if every is correct, the
receiver will ask for block 4.

Notice that the p/f (poll/final) bit is only high for the last block the sender
transmits.



8.	STRING BIT BREAKDOWNS



A. ACTPU STRING

This is a breakdown of one string the ACTPU.

Note that one bit of a byte could change the whole meaning of the string.

| TH | RH | FM data	|
| 
HOST	00 | 2D 00 00 00 15 68 | 6B 80 00 | 11 01 05 00 00 00 00 0A |

rr DA OA	^

00 is the control byte which says it is a Sequenced Information Frame. This
means the SNF (Sequence Number Field, which is the last two bytes of the TH)
will be incremented.

The next six bytes in this case are the Transmission Header, breakdown as
follows: 2D 00 00 00 15 68

2D = 0010 1101

bits 7 to 4, 0010 = Format Identification Type 2, (3770 is always FID Type 2)

bits 3 & 2, (11) = This is the MPF or mapping field where you check segmenting.
In this case, this is the whole BIU (Byte Information Unit) vs. first (10),
middle (00) or last (01) segment. Segmenting is where a large PIU is broken up
and sent in smaller portions. If segmenting is used, only the first PIU has an
RH.

bit 1, (0) = primary (the host) to secondary (Remote), and

bit 0, (1) = expedited flow (vs. normal flow) which means the SNF won't be
incremented for this I-frame.

00 is a reserved byte, always 00

00 is the DAF (Destination Address Field) or the Remote LU or PU, when it is 00
it is the PU.

00 is the OAF (Origin Address Field), from the host

followed by 15 68 the SNF (Sequenced Number Field). A separate SNF is maintained
for each PU (or LU) data stream. It increments separately for each PU or LU data
stream for non-expedited messages only as indicated by the EFI bit number 0 of
the first byte of the TH. Expedited Responses match Requests. The IBM host and
Remote converter each maintain separate SNF for each of the LU and PUs, one for
transmitting and one for receiving. If the first byte of the TH is even the SNF
should increment. If the first byte of the TH is odd the SNF should not
increment.



The next three bytes compose the RH (Request/Response Header), breakdown as

follows: 6B 80 00

6B (byte 0) = 0110 1011

Bit 7 = 0 which says it is a (RQ) request header.

Bits 6 & 5 = 11 say the RU Category is SC for Session Control (other choices are
00 for FM Data, 01 for Network Control, and 10 for Data Flow Control).

Bit 4 is reserved (always 0)

Bit 3 = 1, FI (Format Indicator) says FMH (Function Management Header) follows.

Bit 2 = 0, SDI (Sense Data Indicator) says there is no Sense Data included.

Sense data is where failure information is included.

Bit 1 = 1, BCI (Begin Chain Indicator) says it is the first in chain. A chain is
a group of buffers within a bracket. Chaining allows related PIUs to be linked
and sent together as a chain.

Bit 0 = 1, ECI (End Chain Indicator) says it is the last in chain.

80 (byte 1) = 1000 0000

Bit 7 = 1, DR1, (Definite Response) 1 indicator says a definite response 1 is
requested, whether the request is good or bad. A definite response is always
asked for at the end of a chain. Definite responses can be used for flow
control. 3770 also uses pacing for flow control. For 3770 and 3270 SNA, either
DR1 or ERI are used on input data. On output data, either DR1, DR2 or ERI are
used.

Bit 5 = 0, DR2 (Definite response 2) indicator says a definite response 2 is not
requested.

Bit 4 = 0, ERI (Exception Response indicator) used to ask for a response only if
the request is bad. In this case a definite response is requested. This bit is
used in conjunction with Bits 5 & 7.

Bit 1 = 0, QRI (Queued Response indicator) says the response bypasses TC queues.
TC stands for Transmission Control layer, which controls rate of data flow,
sequencing and error recovery between end-users. Remote doesn't support this.

Bit 0 = 0, PI (Pacing Indicator) this bit is set on requests when the host wants
a pacing response. For responses this bit is set when Remote is ready for
additional requests on the normal flow.

00 (byte 2)

Bit 7 = 0, BBI (Begin Bracket indicator) says it is not the begin bracket.
Brackets are on both sides of an entire print job. Brackets may contain multiple
chains. Bracketing allows Remote and the host to communicate without
interruption from a third party. 3770 is bracketing only protocol, meaning
another host application can not send data to the printer or punch on the Remote
until the first application is through with that LU. Bracketing is only used on
requests.

Bit 6 = 0, EBI (End Bracket indicator) says it is not the end bracket.

Bit 5 = 0, CDI (Change Direction indicator) says do not change directions.

When change direction is set it allows the receiver to send requests. Change
direction indicators are used with half-duplex send/receive mode.

Bit 4 = reserved.

Bit 3 = 0, CSI (Code Selection indicator) says use code 0. It is always 0.

Bit 2 = 0, ECI (Enciphered Data Indicator) says the RU (Request/Response unit)
is not enciphered. Remote does not support enciphering.

Bit 1 = 0, PDI (Padded Data Indicator) says the data is not padded.

The next eight bytes (11 01 05 00 00 00 00 0A) are the FMH (Function Management
Header) and the only important byte is the 11 which tells us that this is an
ACTPU. Following the 11, the 01 calls out format 0 and a cold start, byte 2 (05)
calls out the FM and TS profile, bytes 3-8 call out the ID of the SSCP.

After this the FCS and End Flag will be transmitted, but they will not be shown
by TRON and/or some line monitors.



B. ACTLU STRING

TH	RH	FMH

HOST 22 | 2D 00 01 00 15 6A | 6B 80 00 | 0D 01 01

^	^

22 is the control byte. Notice the LSB=0 says it is a Sequenced Information
Frame.

The next six bytes in this case are the Transmission Header, breakdown as
follows: 2D 00 01 15 6A

2D = 0010 1101

0010 = Format Identification Type 2, 3770 is always FID Type 2.

bit 3 & 4 ( the MPF, mapping field) = 11, says this is the whole BIU (Byte
Information Unit), other possibilities are 00 for middle segment, 01 for last
segment, 10 for first segment, but for ACTLU's it will always be 11).

bit 1 = 0, indicates primary to secondary, vs. secondary to primary.

bit 0 (the EFI) = 1, which indicates expedited flow, vs. normal flow. For
expedited flow the SNF (Sequenced Number Field) is not incremented.

00 = 0000 0000, is a reserved byte, always 00.

01 = 0000 0001 is the DAF (Destination Address Field), meaning LU1, which will
be the first device setup starting from P1.

00 = 0000 0000 is the OAF (Origin Address Field),

15 6A the SNF (Sequenced Number Field). Not incremented for this LU session
because it is expedited.

The next three bytes compose the RH (Request/Response Header), breakdown as

follows: 6B 80 00

6B = 0110 1011 (byte 0)

Bit 7 = 0, says it is a (RQ) request header.

Bits 6 & 5 = 11, say the RU Category is SC (Session Control).

Bit 4, always 0.

Bit 3 = 1, FI (Format Indicator) says FMH (Function Management Header) follows.

Bit 2 = 0, SDI (Sense Data Indicator) says there is no Sense Data included.

Bit 1 = 1, BCI (Begin Chain Indicator) says it is the first in chain.

Bit 0 = 1, ECI (End Chain Indicator) says it is the last in chain.

80 = 1000 0000 (byte 1)

Bit 7 = 1, DR1, (Definite Response) 1 indicator says a definite response 1 is
requested. One of DR1, DR2 or ERI will always be turned on.

Bit 6, always 0.

Bit 5 = 0, DR2 (Definite response 2) indicator says a definite response 2 is not
requested.

Bit 4 = 0, ERI (Exception Response indicator) says not an exception response
requested. This bit is used in conjunction with Bits 5 & 7.

Bits 3 & 2, always 0.

Bit 1 = 0, QRI (Queued Response indicator) says the response bypasses TC queues.
TC stands for Transmission Control layer, which controls rate of data flow,
sequencing and error recovery between end-users.

Bit 0 = 0, PI (Pacing Indicator) this bit is set on requests when the host wants
a pacing response. No pacing is requested for an ACTLU.

00 (byte 2)

Bit 7 = 0, BBI (Begin Bracket indicator) says it is not the begin bracket.

Bit 6 = 0, EBI (End Bracket indicator) says it is not the end bracket.

Bit 5 = 0, CDI (Change Direction indicator) says do not change directions.

Bit 3 = 0, CSI (Code Selection indicator) says code selection 0.

Bit 2 = 0, ECI (Enciphered Data Indicator) says the RU (Request/Response unit)
is not enciphered.

Bit 1 = 0, PDI (Padded Data Indicator) says the data is not padded.

The next eight bytes are the FMH (Function Management Header) and the only
important byte is the 0D which tells us that this is an ACTLU.



C.	BIND STRING

This is to bind a session to send data to a certain device. This comes after the
Remote sends an INIT-SELF.

TH	RH	FMH

HOST	88 | 2D 00 01 01 00 00 | 6B 80 00 | 31 01 03 03 A1 A1 70 80 00

^	^

01 85 85 0A 00 01 11 00 00 B1 00 C0 00 00 01 00 00 00 04 D1 E2 C9 D6 00

The TH & RH strings are basically the same as the ACTPU and ACTLU strings except
that the flow is normal (vs. expedited) and the SNF is reset, so we will start
with the FMH.

31 (byte 0) OP code for BIND

01 (byte 1) format type 0, non-negotiable bind.

03 (byte 2) FM profile type 3 which restricts requests to secondary to primary
only (3770 always uses this).

03 (byte 3) TS profile type 3 which says the current operation will abort if a
session failure occurs (3770 always uses this.

A1 (byte 4) FM data usage (PLU) = 1010 0001, where

bit 7 = 1 which allows a multiple elements chain

bit 6 = 0 says immediate response mode (only one definite response can be
outstanding @ a time...that response must be rec'd before the primary
half-session can send another RU)

bits 5 & 4 = 10, specifies that the primary half-session can request only
definite responses. 01 would specify exception response, which we do not
support. 11 specifies either definite or exception.

bits 3 & 2 = 00 reserved

bits 1 = 0, specifies no compressed data.

bit 0 = 1, specifies that the primary half-session can send end-brackets.

A1 (byte 5) FM data usage (SLU) = 1010 0001, where

bit 7 = 1 which allows a multiple elements chain

bit 6 = 0 says immediate response mode (only one definite response can be
outstanding @ a time...that response must be rec'd before the secondary
half-session can send another RU)

bits 5 & 4 = 10, specifies that the secondary half-session can request only
definite responses. 01 would specify exception response, 11 either.

bits 3 & 2 = 00 reserved

bits 1 = 0, specifies no compressed data.

bit 0 = 1, specifies that the secondary half-session can send end-brackets.

70 80 (bytes 6 & 7) FM usage common LU profiles:

70 = 0111 0000, where:

bit 7 = 0 reserved

bit 6 = 1, specifies that the primary half-session and secondary half-session
can exchange FM headers.

bit 5 = 1, specifies that bracket are used and the bracket state manager's reset
state is between brackets (BETB).

bit 4 = 1, specifies bracket termination rule 2: a bracket is terminated
unconditionally when the last request of the chain that has the end bracket in
it's first request is processed, regardless of the form of response requested.

bit 3 = 0, which says that alternate code sets will not be used.

bits 2 - 0 = 000, and are reserved.

80 = 1000 0000, where

bit 7 selects half-duplex flip-flop protocol that uses the CDI (Change Direction
Indicator) bit in the RH (Request Header) when the session is BETB.

bit 6 says that the contention loser is responsible for error-recovery.

(if bits 7 & 6 = 00 full duplex,

01 half duplex contention,

10 half duplex flip flop)

bit 5 says the secondary half-session is the winner of all contentions.

00 (byte 8) pacing SLU to PLU, 0 indicates no pacing is allowed from the
secondary, meaning that the host will not use pacing on input.

01 (byte 9) pacing NCP to SLU 1 indicates pacing is allowed to the secondary,
meaning that the host will use pacing on output to Remote.

85 (byte 10) max RU from SLU (could be 86 if 512 block size)

85 (byte 11) max RU from PLU (could be 86 if 512 block size)

0A (byte 12) pacing PLU send count, how many blocks the host can send me

without a response from the converter

00 (byte 13) pacing PLU receive count, 00 indicates we can send unlimited files

without a response from the host

01	(byte 14) LU type. (Always LU1).

the remaining bytes are 15-25 PS valve characteristics, which is where the host
tells Remote what SCS features are supported, transparency, cryto options,
crypto enciphering mode, and the crypto key.

11 00 00 B1 00 C0 00 00 01 00 00 00 04 D1 E2 C9 D6 00





D.	BEGIN DESTINATION STRING

This is to tell the receiving device which device is intended to send or receive
the data that will follow.

TH	RH	FMH

HOST	00 | 2C 00 01 01 00 01 | 0B 81 80 | 06 01 00 00 44 00

The TH strings are basically the same as the ACTPU, ACTLU and BIND strings, with
the exception that this is normal flow (vs. expedited) and the SNF is
incremented. The SNF increment separately for each LU data stream whenever the
flow (as indicated by the EFI bit number 0 of the first byte of the TH
(Transmission Header starts with 2C). The IBM host and Remote maintain separate
SNF for each of the LU and PUs, one for transmitting and one for receiving.

The three bytes that compose the RH (Request/Response Header), breakdown as
follows:

0B = 0000 1011 (byte 0)

Bit 7 = 0, indicates it is a (RQ) request header.

Bits 6 & 5 = 00, say the RU Category is FM Data (FMD). The FM header is where
the destination information is found.

Bit 4, always 0.

Bit 3 = 1, FI (Format Indicator) says FMH (Function Management Header) follows.

Bit 2 = 0, SDI (Sense Data Indicator) says there is no Sense Data included.

Bit 1 = 1, BCI (Begin Chain Indicator) says it is the first in chain.

Bit 0 = 1, ECI (End Chain Indicator) says it is the last in chain.

81 = 1000 0001 (byte 1)

Bit 7 = 1, DR1 (Definite Response 1) indicator says a definite response 1 is
requested.

Bit 6, always 0.

Bit 5 = 0, DR2 (Definite response 2) indicator says a definite response 2 is not
requested.

Bit 4 = 0, ERI (Exception Response indicator) says not an exception response
requested. This bit is used in conjunction with Bits 5 & 7. Bits 3 & 2, always
0.

Bit 1 = 0, QRI (Queued Response indicator) says the response bypasses TC queues.
TC stands for Transmission Control layer, which controls rate of data flow,
sequencing and error recovery between end-users.

Bit 0 = 1, PI (Pacing Indicator) this bit is set on requests when the host wants
a pacing response. In this case a pacing response is requested before the host
will send Remote data.

80 = 1000 0000 (byte 2)

Bit 7 = 1, BBI (Begin Bracket indicator) says it is the begin bracket, which
means this is the beginning of a group of blocks to form a job. Bit 6 = 0, EBI
(End Bracket indicator) says it is not the end bracket.

Bit 5 = 0, CDI (Change Direction indicator) says do not change directions.

Bit 3 = 0, CSI (Code Selection indicator) says code selection 0. Bit 2 = 0, ECI
(Enciphered Data Indicator) says the RU (Request/Response unit) is not
enciphered. Good thing because Remote does not support enciphered data. Bit 1 =
0, PDI (Padded Data Indicator) says the data is not padded.

FMD (Function Management Data) 06 01 00 00 44 00

/ / / / / /
/ / / / / /
# bytes / / / / /
# 
# FMHs / / / /
# 
device / / /

profile / /

begin/end and comp /

exchange record length

06 (byte 0) tells us there are 6 bytes including itself

01 (byte 1, the concatenation byte)

bit 0 (the MSB) tells us no FMH follows the FMH-1

bit 1-7 = 0000001 tells us this is FMH type 1.

00 (byte 2 bits 0-3 = 0 which is device type console, some others are:

1 exchange

2 card

3 document

bits 4-7 is the logical sub-address and specifies the device number e.g. 30 is
printer 1, 31 is printer 2. 2 is punch card.

00 (byte 3) is the stack reference indicator (SRI), Demand select, and data
stream profile (DSP)

bit 0 is the SRI which says to use the sender's stack bit 1 says the receiver
may direct to alternate medium or sub-address bits 2-3 are reserved bits 4-7 is
the DSP and 0 is the default.

44 (byte 4) FMH-1 properties

0100 0100

bits 0-2 = 010 which tells us this is a begin destination selection, other

choices are: 000 resume, 001 end, 011 begin/end, 100 suspend, 101 end/abort,

110 continue.

bit 3 is the data set transmission which tells us to use the transmission

exchange format.

bit 4 is reserved

bit 5 is the (CMI) compression indicator = 1, compression is turned on.

bit 6 is the compaction indicator = 0, it must be off (we don't support it)

bit 7 is reserved

00 (byte 5)

0-7 ERCL (exchange record length) if medium = exchange medium or card; otherwise
reserved. 00 indicates record length 80 columns, 50 is 80 and 84 is 132.





E.	PACING STRING

We send the pacing response to a Begin Destination Request (or between chains of
data being sent) when we are ready for that device to accept more blocks of data
as set by the pacing in the bind request. Pacing is how the sender is prevented
from sending too many blocks at one time and therefore over-flowing the
receiving device. Data could be sent to other devices while this device is not
ready. When the converter is not ready to receive data to any device it can send
an RNR (Not ready to receive).

lsb is pacing bit

TH	RH /

Remote	82 | 2C 00 01 01 00 01 | 83 81 00

82 is the control byte which says it is a Sequenced Information Frame.

The next six bytes in this case are the Transmission Header, breakdown as
follows:

2C Format Identification Type 2, this is the whole BIU (Byte Information Unit),
primary to secondary, and it is normal flow.

00 is a reserved byte, always 00

01 is the DAF (Destination Address Field),

01 is the OAF (Origin Address Field),

00 01 the SNF (Sequenced Number Field). The SNF increment separately for each LU
data stream whenever the flow (as indicated by the EFI bit number 0 of the first
byte of the TH (Transmission Header starts with 2C). The IBM host and Remote
maintain separate SNF for each of the LU and PUs, one for transmitting and one
for receiving.

The next three bytes compose the RH (Request/Response Header), breakdown as
follows:

83 = 1000 0011 (byte 0)

Bit 7 = 1 which says it is a (RSP) response header.

Bits 6 & 5 = 00 say the RU Category is Function Management Data (FMD). Bit 3, FI
= 0 (Format Indicator) says no FMH (Function Management Header) follows.

Bit 2, SDI = 0 (Sense Data Indicator) says there is no Sense Data included.

Sense data is where failure information is included.

Bit 1, BCI = 1 (Begin Chain Indicator) says it is the first in chain. A chain is
a group of buffers within a bracket.

Bit 0, ECI = 1 (End Chain Indicator) says it is the last in chain.

81 = 1000 0001 (byte 1)

Bit 7 DR1 = 1, (Definite Response) 1 indicator says it is a definite response 1
is requested.

Bit 5, DR2 = 0 (Definite response 2) indicator says it a definite response 2 is
not requested.

Bit 4, RTI = 0 (Response Type Indicator) is positive.

Bit 1, QRI = 0 (Queued Response indicator) says the response bypasses TC queues.
TC stands for Transmission Control layer, which controls rate of data flow,
sequencing and error recovery between end-users. Remote does not support Queued
Responses so this bit should always be 0. Bit 0 = 1, PI (Pacing Indicator) which
indicates this is a pacing response and indicates we are ready to receive data.

00 (byte 2) reserved byte (always 00)



F.	SENSE CODE SRINGS



F.1	OVERVIEW:

This is a method by which the receiving device can tell a sending device what is
wrong with a data stream sent. In this case the SDI (Sense Data Indicator) (bit
2 of byte 0 of the RH) will be high. Sense data will be sent as a response to
something in a data stream just received that that the receiver can does not
understand or support.

When the converter sends an invalid data string to the host and thus receives a
sense code string from the host, it will send a message to the Remote system
console: "NEGATIVE RESPONSE RECEIVED xx yy", where xx yy is the major code and
yy is the modifier. Negative response (a sense code string) received is from the
host, and the message is from the converter point of reference, and the Remote
converter is in error.

When the converter receives an invalid string from the host, it will send a
sense code string to the host and a message to the Remote system console:
"NEGATIVE RESPONSE TRANSMITTED xx yy", where xx yy is the major code and yy is
the modifier.

When the host receives an invalid string from the converter, it will send a
sense code string to the converter and a message to the IBM host system console
like "NS PROCEDURE ERROR 08 01 00 00". NS is for Network Services.

NOTE:

Some of the errors are recoverable (by the IBM system or protocol converter) and
require no immediate action, but might show an area where the software or line
gen could be modified.

F.2	REFERENCES:

SNA'Sessions between Logical Units, GC20-1868-2, page 24

SNA'Format and Protocol Reference Manual: Architecture Logic, SC30-3112.

Questronics SNA Guide



F.3	STRING BREAKDOWN:

SDI bit

/
/
1000 0111

v

TH	/ Sense Data

HOST	EC | 2C 00 02 00 00 00 | 87 90 00 | 10 08 40 04

-------------

/
/
//
//
Sense Bytes 0-1

10 08 (the first two bytes) are the SNA sense code data.

The first byte (10) of the SNA sense code data is major code which tells if it
is a path error, RH usage error, state error, request error, or a request
reject. The next byte is the modifier which tells you more specifically what was
wrong. In this example, the 08 says it is an invalid FM header.

Bytes 2 & 3 contain more detailed user info. (For 3770, this is only if it is a

request error (major code 10) and an invalid FM header (08). In this case, the

40 04 tells us that "compaction is not supported"



F.4	Remote SYSTEM CONSOLE MESSAGE FORMAT:



"NEGATIVE RESPONSE RECEIVED 08 21 01 10 40"

08 indicates a REQUEST REJECT, the 21 indicates Invalid Session Parameters.

The format of the following bytes of information vary depending on the major
code, modifier and operating system. In this case:

01 indicates LU type 1.

10 is a hex value offset pointing to the byte that causes the reject, 16 decimal
bytes in from the second byte of the bind data.

40 is the byte that caused the reject.

In this case the BIND was rejected because the line was set for compaction and
the converter does not support compaction.



F.5	COMMON SENSE CODES:

These are the sense byte failure that occur most commonly during installations
while attempting to logon:

Remote SETUP ERRORS:

NEGATIVE RESPONSE RECEIVED 08 yy	Request reject.

NEGATIVE RESPONSE RECEIVED 08 01 JES not started, too many active LUs prevent
the

or NETWORK SERVICES PROCEDURE ERROR	host from responding to Remote request or
an

(NSPE) 08 01 00 00	INVALID LOGON DATA FIELD.

NEGATIVE RESPONSE RECEIVED 08 05	Session limit exceeded. Application program
busy.

NEGATIVE RESPONSE RECEIVED 08 06	Resource unknown; invalid logon data or host
line

not properly gen'd. INVALID APPLID. Can be invalid LOGON DATA for DOS POWER
systems.

NEGATIVE RESPONSE RECEIVED 08 09	Mode inconsistency. The requested function
can not be performed in the present state of the receiver.

NEGATIVE RESPONSE RECEIVED 08 0B	Bracket Race Error. Host set to 256, Remote
set to 512 or DATMODE is set to FULL DUPLEX, needs to be HALF DUPLEX.

NEGATIVE RESPONSE RECEIVED 08 21 00 00	Invalid session parameters, Usually
invalid LOGMODE ENTRY does not match the DLOGMOD in the PU statement. (sometimes
you can leave the LOGMODE ENTRY blank)

NEGATIVE RESPONSE RECEIVED 08 22 Link procedure failure: equipment or invalid
response to link command. Not a path error, request was delivered to
destination.

NEGATIVE RESPONSE RECEIVED 08 25	Component not available; host accessing
undefined	device, setup for

REQUESTED DEVICE NOT CONFIGURED	DEVICE TYPE does not match host line gen



NEGATIVE RESPONSE RECEIVED 08 57	Request Reject when Remote has more LUs
defined than the IBM host.

NEGATIVE RESPONSE RECEIVED 08 7D 00 01	Request Reject when the APPLID is
wrong.

NEGATIVE RESPONSE RECEIVED 10 01	RU Data Error, typically happens when
sending the	INITSELF and indicates an APPLID, LOGMODE ENTRY, or DATA field is
incorrect. Make sure 0s are 0s, and Os are Os, capital letters and watch those
spaces.

NEGATIVE RESPONSE RECEIVED 10 02	RU Length Error. Host set to 256, Remote set
to 512.

UNDEFINED DAF	Incorrect LU1 address.



UNDEFINED ADDRESS FIELD RECEIVED	Host has more LUs defined than

VERIFY LOGICAL UNIT ADDRESSING	Remote has been setup for.



F.6	HOST ERRORS:

NEGATIVE RESPONSE TRANSMITTED 10 01	RU Data Error. Host set to 512, Remote
set to 256.

NEGATIVE RESPONSE TRANSMITTED 08 13 Bracket Bid Reject - No RTR forthcoming. The
host bid was rejected and ready-to-receive will not be	generated.

NEGATIVE RESPONSE TRANSMITTED 08 1B	Receiver in Transmit Mode. Caused by the
host trying to use an LU the converter has. Non-catastrophic.

NEGATIVE RESPONSE TRANSMITTED 08 21 01 10 40 Invalid Session Parameters. The
host bind was rejected because the BIND is trying to set compaction and it is
not supported.



9.	PROTOCOL DIAGNOSIS

To troubleshoot problems you must look at strings before the string with the
sense data.

A.	SEGMENTING

Segmenting is not used by 3770. Examine the MPF bits 2 & 3, the DAF, and OAF of
the TH. The sequence of the MPF bits for the strings with the same DAF and OAF
must be:

10 or 11 for the first occurrence or 11 if this is the only occurrence,

00 for a string with the same OAF and DAF before and after,

01 for the last occurrence

B.	CHAINING

Chaining is used in 3770. If one RU in a chain can not be processed, the whole
chain should be discarded and the whole chain will be re-transmitted. A chain is
interruptable. Examine the chaining bits which are the LSBs of the first byte of
a request RH. (Response chaining bits are always 11). The sequence of the
chaining bits for the strings with the same DAF and OAF must be:

10 for the first occurrence or 11 if this is the only occurrence,

00 for a string with the same OAF and DAF before and after,

01 for the last occurrence

C.	PACING

The pacing bit is the LSB of the middle byte of the RH. Examine the TRON to see
if data was shipped to a device using the same DAF and OAF when the pacing bit
was low on the response preceding the data. This would be an error, however it
is acceptable to send an FM header to end the transmission, with no more data.

D.	BRACKETING

Bracketing is used on data streams in 3770. The whole data stream to a device
will be un-interruptable if between brackets, meaning that during the bracketed
transaction the LU will not be shared. Brackets may contain multiple chains.

Examine the bracketing bits which are the MSBs of the last byte of a request RH.
(Response chaining bits are always 11). The sequence of the chaining bits for
the strings with the same DAF and OAF must be:

10 for the first occurrence or 11 if the only occurrence, 00 for a string with
the same OAF and DAF before and after, this can also mean no brackets are used.

01 for the last occurrence

E.	CHANGE DIRECTION

The CDI or change direction indicator should be set in the data string before
where the OAF and DAF are reversed.





10.	SNA CHARACTER SET TRANSLATIONS

A.	SET VERTICAL FORMAT DATA.

The SVF's which fall under SCS (SNA Character Set) will be in the middle of the
data stream. Most SCS translations are done by using spaces and line feeds. Set
Vertical Format strings are the only variation from this and Remote supports
SVF's translated to DSL's (down stream loads) for Centronics and Dataproducts
parallel printers only to improve speed.

The application will first send an SVF (down stream load) to load the printer's
forms control buffer (FCB) and which will tell the printer what line to move to
if a certain vertical tab is sent later in the data stream.

a.	Down Stream Load

The DSL supported units will both load the FCB (Forms Control Buffer) and
convert IBM channel selects into printer EVFU channel select commands. SCS (SNA
Character Set) sends a SVF (Set Vertical Format) string which contains the FCB
(Forms Control Buffer) information that we translate to the printer when we get
it. The SVF defines the maximum page length, the top margin (usually 01), the
bottom margin, (usually equal to the maximum page length), and it can define up
to 12 vertical channel stops.

cnt= count (byte count, including itself, starting from itself)

mpl= maximum presentation lines

tm= top margin

bm= bottom margin

ch#= channel #

| Forms Control Buffer info |
| 
SCS Set Vertical Format	2B C2 cnt mpl tm bm ch2 ch3 ... ch9 ch12

SCS Sample string 2B C2 09 42 01 42	03 00 ... 40 42

/ / / /	/ /
/ / / /	/ /
/ / / / / (Skip 12 = 66)
/ / / / / 
(# of bytes) / / / (Skip to channel 9 = line 64)

/ / (Skip to channel 2 = line 3)
/ / 
(Skip to channel 1 = line 1) (42Hex= 66 lines per page)



b.	Channel Selects

This is what we send to a printer with it's FCB (Forms Control Buffer) loaded,
either from the tape control unit or a down-stream-load from the host via the
protocol converter.

IBM 3770 DATAPRODUCTS	CENTRONICS

Skip to Channel 1 04 81	80	1F 01

Skip to Channel 2 04 82 81	1F 02

Skip to Channel 3 04 83 82	1F 03

Skip to Channel 4 04 84 83	1F 04

Skip to Channel 5 04 85	84	1F 05

Skip to Channel 6 04 86	85	1F 06

Skip to Channel 7 04 87 86 1F 07

Skip to Channel 8 04 88 87 1F 08

Skip to Channel 9 04 89	88 1F 09

Skip to Channel 10 04 7A 89	1F 0A

Skip to Channel 11 04 7B 8A	1F 0B

Skip to Channel 12 04 7C 8B	1F 0C





B.	COMPRESSION

If the line is gen'd for compression the CMI bit in the Begin Destination string
will be = 1. If the CMI bit is high the data must have an SCB (String Control
Byte) at the start of the data. The SCB byte's first two bits tell you if there
are repeatable characters, a space, or another character. The SCB will precede
and cover all of the data, by specifying whether it is repeated (compressed),
repeated prime (prime character is normally a space), or a non-duplicate
character string. The SCB format is as follows:

these two bits define no duplicate characters /	(nnnnnn is a hex value from 1
to 63, 0 is invalid)

00 nnnnnn

these two bits define repeated spaces

/ (nnnnnn is a hex value from 3 to 63, 0,1, & 2 are invalid)
/ 
10 nnnnnn

these two bits define repeated next character

/ (nnnnnn is the number of times to repeat the next character)
/ 
11 nnnnnn is a hex value from 3 to 63, 0,1, & 2 are invalid.

Example:

The user wants to send the character * (which is an EBCDIC 5C) 50 times.

in binary = decimal 50.

/
/
11 110010 = 1111 1010 (shuffled for easier viewing)

= F A (in hex)

Host sends FA 5C and the converter will translate to 50 X 2A (2A is an ASCII *)

C.	TRANSPARENCY

Transparency allows you to pass SCS control characters as data. If the line is
gen'd for transparency and the user includes binary data in a given record, the
host will append 35 xx follows by the binary data, where xx is the number of
bytes of binary data. This gets the data through VTAM and helps prevent the
converter from treating the binary data as a SNA Character Set control
characters when using stream mode. When using stream mode in conjunction with
transparency, the converter will do a direct EBCDIC to ASCII translation of the
data. For example: A user wants to send a random sequence of binary character
like 2B C2 09 34 that would normally get looked at as an SCS Set Vertical Format
command but he just wants an ASCII translation of those characters for some
hokie reason like sending to a plotter. The host data will come in this format:

inserted by host (line set for transparency)

/ /
/ /
35 04 2B C2 07 2D

Remote translates to ASCII 00 42 7F 05 (the ASCII equivalents)

NOTE: Remote ALWAYS SEND TRANSPARENT DATA TO THE HOST SO ALL RECORDS START WITH:
35 50 (50 hex = 80 decimal, card reader records are always 80 characters)

NOTE: Transparency does not override compression. In other words, if compression
is turned on a transparent string will be compressed with string control bytes.
The SCB will come first and the transparency will be inside the compression. The
converter has to un-compress the compression, then treat the transparency.