CAC 2017-12-06

decoding 3270 protocol

null/Projects/Hercules/Linux
sudo /usr/local/bin/hercules -f hercules.cnf

sudo tcpdump -i lo --immediate-mode -n -X -w 3270_capture.dat port 3270

x3270 localhost:3270

tcpdump -r 3270_capture.dat -X 

reading from file 3270_capture.dat, link-type EN10MB (Ethernet)
09:12:07.850670 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [S], seq 192677870, win 43690, options [mss 65495,sackOK,TS val 1944371156 ecr 0,nop,wscale 7], length 0
    0x0000:  4500 003c 6870 4000 4006 d449 7f00 0001  E..<hp@.@..I....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 07ee 0000 0000  .........|......
    0x0020:  a002 aaaa fe30 0000 0204 ffd7 0402 080a  .....0..........
    0x0030:  73e4 bfd4 0000 0000 0103 0307            s...........
09:12:07.850699 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [S.], seq 1264373757, ack 192677871, win 43690, options [mss 65495,sackOK,TS val 1944371156 ecr 1944371156,nop,wscale 7], length 0
    0x0000:  4500 003c 0000 4000 4006 3cba 7f00 0001  E..<..@.@.<.....
    0x0010:  7f00 0001 0cc6 edb8 4b5c cffd 0b7c 07ef  ........K\...|..
    0x0020:  a012 aaaa fe30 0000 0204 ffd7 0402 080a  .....0..........
    0x0030:  73e4 bfd4 73e4 bfd4 0103 0307            s...s.......
09:12:07.850719 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [.], ack 1, win 342, options [nop,nop,TS val 1944371156 ecr 1944371156], length 0
    0x0000:  4500 0034 6871 4000 4006 d450 7f00 0001  E..4hq@.@..P....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 07ef 4b5c cffe  .........|..K\..
    0x0020:  8010 0156 fe28 0000 0101 080a 73e4 bfd4  ...V.(......s...
    0x0030:  73e4 bfd4                                s...
09:12:07.850783 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [P.], seq 1:4, ack 1, win 342, options [nop,nop,TS val 1944371156 ecr 1944371156], length 3
    0x0000:  4500 0037 a060 4000 4006 9c5e 7f00 0001  E..7.`@.@..^....
    0x0010:  7f00 0001 0cc6 edb8 4b5c cffe 0b7c 07ef  ........K\...|..
    0x0020:  8018 0156 fe2b 0000 0101 080a 73e4 bfd4  ...V.+......s...
    0x0030:  73e4 bfd4 fffd 18                        s......

> 1: fffd 18 ...

09:12:07.850797 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [.], ack 4, win 342, options [nop,nop,TS val 1944371156 ecr 1944371156], length 0
    0x0000:  4500 0034 6872 4000 4006 d44f 7f00 0001  E..4hr@.@..O....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 07ef 4b5c d001  .........|..K\..
    0x0020:  8010 0156 fe28 0000 0101 080a 73e4 bfd4  ...V.(......s...
    0x0030:  73e4 bfd4                                s...
09:12:07.891412 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [P.], seq 1:4, ack 4, win 342, options [nop,nop,TS val 1944371197 ecr 1944371156], length 3
    0x0000:  4500 0037 6873 4000 4006 d44b 7f00 0001  E..7hs@.@..K....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 07ef 4b5c d001  .........|..K\..
    0x0020:  8018 0156 fe2b 0000 0101 080a 73e4 bffd  ...V.+......s...
    0x0030:  73e4 bfd4 fffb 18                        s......

< 2: fffb 18 ...

09:12:07.891449 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [.], ack 4, win 342, options [nop,nop,TS val 1944371197 ecr 1944371197], length 0
    0x0000:  4500 0034 a061 4000 4006 9c60 7f00 0001  E..4.a@.@..`....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d001 0b7c 07f2  ........K\...|..
    0x0020:  8010 0156 fe28 0000 0101 080a 73e4 bffd  ...V.(......s...
    0x0030:  73e4 bffd                                s...
09:12:07.891473 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [P.], seq 4:10, ack 4, win 342, options [nop,nop,TS val 1944371197 ecr 1944371197], length 6
    0x0000:  4500 003a a062 4000 4006 9c59 7f00 0001  E..:.b@.@..Y....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d001 0b7c 07f2  ........K\...|..
    0x0020:  8018 0156 fe2e 0000 0101 080a 73e4 bffd  ...V........s...
    0x0030:  73e4 bffd fffa 1801 fff0                 s.........

> 3:  fffa 1801 fff0 

09:12:07.891556 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [P.], seq 4:22, ack 10, win 342, options [nop,nop,TS val 1944371197 ecr 1944371197], length 18
    0x0000:  4500 0046 6875 4000 4006 d43a 7f00 0001  E..Fhu@.@..:....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 07f2 4b5c d007  .........|..K\..
    0x0020:  8018 0156 fe3a 0000 0101 080a 73e4 bffd  ...V.:......s...
    0x0030:  73e4 bffd fffa 1800 4942 4d2d 3332 3739  s.......IBM-3279
    0x0040:  2d34 2d45 fff0                           -4-E..

< 4: fffa 1800 4942 4d2d 3332 3739 2d34 2d45 fff0  ....IBM-3279-4-E..

09:12:07.891600 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [P.], seq 10:13, ack 22, win 342, options [nop,nop,TS val 1944371197 ecr 1944371197], length 3
    0x0000:  4500 0037 a063 4000 4006 9c5b 7f00 0001  E..7.c@.@..[....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d007 0b7c 0804  ........K\...|..
    0x0020:  8018 0156 fe2b 0000 0101 080a 73e4 bffd  ...V.+......s...
    0x0030:  73e4 bffd fffb 00                        s......

> 5: fffb 00 ...

09:12:07.891638 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [P.], seq 13:16, ack 22, win 342, options [nop,nop,TS val 1944371197 ecr 1944371197], length 3
    0x0000:  4500 0037 a064 4000 4006 9c5a 7f00 0001  E..7.d@.@..Z....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d00a 0b7c 0804  ........K\...|..
    0x0020:  8018 0156 fe2b 0000 0101 080a 73e4 bffd  ...V.+......s...
    0x0030:  73e4 bffd fffd 00                        s......

> 6: fffd 00 ...

09:12:07.891644 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [P.], seq 22:25, ack 13, win 342, options [nop,nop,TS val 1944371197 ecr 1944371197], length 3
    0x0000:  4500 0037 6876 4000 4006 d448 7f00 0001  E..7hv@.@..H....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 0804 4b5c d00a  .........|..K\..
    0x0020:  8018 0156 fe2b 0000 0101 080a 73e4 bffd  ...V.+......s...
    0x0030:  73e4 bffd fffd 00                        s......

< 7: fffd 00 ...

09:12:07.891655 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [P.], seq 16:19, ack 22, win 342, options [nop,nop,TS val 1944371197 ecr 1944371197], length 3
    0x0000:  4500 0037 a065 4000 4006 9c59 7f00 0001  E..7.e@.@..Y....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d00d 0b7c 0804  ........K\...|..
    0x0020:  8018 0156 fe2b 0000 0101 080a 73e4 bffd  ...V.+......s...
    0x0030:  73e4 bffd fffb 19                        s......

> 8: fffb 19 ...

09:12:07.892134 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [P.], seq 28:31, ack 1064, win 358, options [nop,nop,TS val 1944371198 ecr 1944371197], length 3
    0x0000:  4500 0037 687a 4000 4006 d444 7f00 0001  E..7hz@.@..D....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 080a 4b5c d425  .........|..K\.%
    0x0020:  8018 0166 fe2b 0000 0101 080a 73e4 bffe  ...f.+......s...
    0x0030:  73e4 bffd fffd 19                        s......

< 9: fffd 19 ...

09:12:07.932949 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [.], ack 31, win 342, options [nop,nop,TS val 1944371198 ecr 1944371198], length 0
    0x0000:  4500 0034 a069 4000 4006 9c58 7f00 0001  E..4.i@.@..X....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d425 0b7c 080d  ........K\.%.|..
    0x0020:  8010 0156 fe28 0000 0101 080a 73e4 bffe  ...V.(......s...
    0x0030:  73e4 bffe                                s...
09:12:07.932982 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [P.], seq 31:34, ack 1064, win 358, options [nop,nop,TS val 1944371238 ecr 1944371198], length 3
    0x0000:  4500 0037 687b 4000 4006 d443 7f00 0001  E..7h{@.@..C....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 080d 4b5c d425  .........|..K\.%
    0x0020:  8018 0166 fe2b 0000 0101 080a 73e4 c026  ...f.+......s..&
    0x0030:  73e4 bffe fffb 19                        s......

10; fffb 19 ..

09:12:07.932994 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [.], ack 34, win 342, options [nop,nop,TS val 1944371238 ecr 1944371238], length 0
    0x0000:  4500 0034 a06a 4000 4006 9c57 7f00 0001  E..4.j@.@..W....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d425 0b7c 0810  ........K\.%.|..
    0x0020:  8010 0156 fe28 0000 0101 080a 73e4 c026  ...V.(......s..&
    0x0030:  73e4 c026                                s..&
09:12:10.934969 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [.], ack 34, win 342, options [nop,nop,TS val 1944371238 ecr 1944371238], length 0
    0x0000:  4500 0034 a06b 4000 4006 9c56 7f00 0001  E..4.k@.@..V....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d424 0b7c 0810  ........K\.$.|..
    0x0020:  8010 0156 fe28 0000 0101 080a 73e4 c026  ...V.(......s..&
    0x0030:  73e4 c026                                s..&
09:12:10.935003 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [.], ack 1064, win 358, options [nop,nop,TS val 1944374240 ecr 1944371238], length 0
    0x0000:  4500 0034 687c 4000 4006 d445 7f00 0001  E..4h|@.@..E....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 0810 4b5c d425  .........|..K\.%
    0x0020:  8010 0166 fe28 0000 0101 080a 73e4 cbe0  ...f.(......s...
    0x0030:  73e4 c026                                s..&
09:12:12.233123 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [F.], seq 34, ack 1064, win 358, options [nop,nop,TS val 1944375538 ecr 1944371238], length 0
    0x0000:  4500 0034 687d 4000 4006 d444 7f00 0001  E..4h}@.@..D....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 0810 4b5c d425  .........|..K\.%
    0x0020:  8011 0166 fe28 0000 0101 080a 73e4 d0f2  ...f.(......s...
    0x0030:  73e4 c026                                s..&
09:12:12.233289 IP localhost.localdomain.verismart > localhost.localdomain.60856: Flags [F.], seq 1064, ack 35, win 342, options [nop,nop,TS val 1944375539 ecr 1944375538], length 0
    0x0000:  4500 0034 a06c 4000 4006 9c55 7f00 0001  E..4.l@.@..U....
    0x0010:  7f00 0001 0cc6 edb8 4b5c d425 0b7c 0811  ........K\.%.|..
    0x0020:  8011 0156 fe28 0000 0101 080a 73e4 d0f3  ...V.(......s...
    0x0030:  73e4 d0f2                                s...
09:12:12.233342 IP localhost.localdomain.60856 > localhost.localdomain.verismart: Flags [.], ack 1065, win 358, options [nop,nop,TS val 1944375539 ecr 1944375539], length 0
    0x0000:  4500 0034 687e 4000 4006 d443 7f00 0001  E..4h~@.@..C....
    0x0010:  7f00 0001 edb8 0cc6 0b7c 0811 4b5c d426  .........|..K\.&
    0x0020:  8010 0166 fe28 0000 0101 080a 73e4 d0f3  ...f.(......s...
    0x0030:  73e4 d0f3                                s...

$ tcpflow -C -D -r 3270_capture.dat
>  0000: fffd 18 ...  DO TELOPT_TTYPE

< 0000: fffb 18 ...   

> 0000: fffa 1801 fff0  ......   SB 18 01 SE   Negotiating for LU

< 0000: fffa 1800 4942 4d2d 3332 3739 2d34 2d45 fff0  ....IBM-3279-4-E..

> 0000: fffb 00 ...  WILL BINARY

> 0000: fffd 00 ...  DO BINARY

0000: fffd 00 ...

0000: fffb 19 ...

0000: fffd 19 ...

0000: fffb 19 ...

http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/3270/GA23-0059-4_3270_Data_Stream_Programmers_Reference_Dec88.pdf

GA27-2749-10 3270 Information Display System Component Description Feb80 (2764)/GA27-2749-10 3270 Information Display Syst
library_dir_dir/system_library_1/source/ibm3270_mpx.pl1

/* DIALUP interrupt - This means that the major channel has dialed up and the multiplexer is now loaded */
INTERRUPT (1):

/* HANGUP interrupt - This means that we have lost the phone and the multiplexer is considered crashed */
INTERRUPT (2):

/* CRASH interrupt - Parent multiplexer has crashed. We must propagate the information */
INTERRUPT (3):

* SEND_OUTPUT interrupt - We are allowed to send more output */
INTERRUPT (4):

/* INPUT_AVAILABLE Interrupt - Not used */
INTERRUPT (5):

/* ACCEPT_INPUT - Real data to processes */
INTERRUPT (6):

/* INPUT REJECTED interrupt - Ignore */
INTERRUPT (7):

/* QUIT interrupt - Ignore */
INTERRUPT (8):

/* DIAL STATUS interrupt - Ignore */
INTERRUPT (10):

/* WRU TIMEOUT interrupt - Ignore */
INTERRUPT (11):

/* SPACE AVAILABLE interrupt - Retry suspended write operation. */
INTERRUPT (12):

                                                            /* various others - ignore */
INTERRUPT (13):  ACKNOWLEDGE_ECHNEGO_INIT
INTERRUPT (14):  ACKNOWLEDGE_ECHNEGO_STOP
INTERRUPT (15):  TIMER
INTERRUPT (16):  USER_INTERRUPT

/* MASKED interrupt - Treat like hangup but use different wakeup message */
INTERRUPT (17):

/* LINE STATUS interrupt - Decode and act upon in */
INTERRUPT (9):
LINE_STAT (1):                                              /* No response to poll */
LINE_STAT (2):                                              /* Badly formated output block */
LINE_STAT (3):                                              /* Rvi - device has status */
LINE_STAT (4):                                              /* Too many naks */
LINE_STAT (5):                                              /* Write status - can't happen */
LINE_STAT (6):                                              /* 3270 write complete */
LINE_STAT (7):                                              /* 3270 wack msg - printer going busy */
LINE_STAT (8):                                              /* Ibm3270 write eot */
LINE_STAT (9):
          md.write_abort = md.write_abort + 1;
LINE_STAT (10):
          md.select_failed = md.select_failed + 1;
LINE_STAT (11):
          md.wack_select = md.wack_select + 1;
LINE_STAT (12):
          md.nak_output = md.nak_output + 1;

GA27 -27 49-10 IBM 3270 Information Display System Component Description

x3270 ids as IBM-3279-4-E (Colot!)

32 stations/controller

Polling: each device is available/ready/busy; and is i/o pending/

Multics starts polling with:

SET_POLLING_ADDR
    data_len 4
    char1 64
    char2 64
    char3 127
    char4 127
START_POLL

64 is x40; fig 6.1 pg 185, note 2:  "I/O character address (" 0x7f) is used as the device address to specify a General Poll operation. "

ibm3270_control_.pl1:

else line_ctl.op = SET_POLLING_ADDR;
                    valchar.data_len = 4;
                    substr (valchar.data, 1, 1), substr (valchar.data, 2, 1) = controller_char;
                    substr (valchar.data, 3, 1), substr (valchar.data, 4, 1) = device_char;

if ^select_sw then controller_char = ad.bit6_char (ad.controller);
                    else controller_char = ad.bit6_char (ad.controller + 32);

    2 controller fixed bin,                                 /* Address of controller, usually 0 */

More from 6-1:

General Poll CU5     C5  7F
Specific Pill Device 4 on CU5  C5 C4
Select Device 4 on Cu5  E5 C4

Interesting; implies more than one controller on the line. I don't see a way for x3270 to specify the controller, so probably not practical...

Poll:

No response, timeout
There is no I/O pending nor pending status; send EOT. For General Poll, the sends EOR after polling all devices.
Reponses:
  Text
   Status
   Test Request

3271,3274,3276: For General Poll, the search for a response starts at some random device address and continues sequentially (as
long as ACKs are received in response to text transmissions) until all devices are given the opportunity to respond.

ibm3270_.pl1

/* Initialize attach data variables */

          ad.first_read_infop = null;
          ad.last_read_infop = null;
          ad.header_buf_len = 16;
          allocate header_buf in (work_area);
          ad.input_buf_len = 4096;
          allocate input_buf in (work_area);
          ad.text_buf_len = 4096;
          allocate text_buf in (work_area);
          ad.output_buf_len = 56*40;                        /* FNPs arbitrary limit */
          allocate output_buf in (work_area);
          ad.header_len, ad.text_len, ad.unscanned_data_len = 0;
          ad.input_state = 1;
          ad.last_device_polled = -2;                       /* Set to invalid number */
          ad.last_device_selected = -2;
          ad.cur_out_reqp = null;                           /* No output */
          ad.first_out_reqp (*) = null;
          ad.last_out_reqp (*) = null;
          ad.min_dev, ad.max_dev = -1;
          ad.pend_interval = 30000000;                      /* 30 seconds */
          ad.pend_time (*) = 0;
          ad.close_in_progress = "0"b;
          ad.output_in_progress = "0"b;
          ad.input_line_status, ad.output_line_status = 0;
          ad.general_poll, ad.polling_in_progress = "0"b;
          ad.device_responded = "0"b;
          ad.first_poll_reqp, ad.last_poll_reqp = null;

          unspec (ad.stx) = "002"b3;
          unspec (ad.etx) = "003"b3;
          unspec (ad.soh) = "001"b3;
          unspec (ad.sf) = "035"b3;
          unspec (ad.sba) = "021"b3;
          unspec (ad.ic) = "023"b3;
          unspec (ad.eua) = "022"b3;
          if ad.ascii then do;
               unspec (ad.etb) = "027"b3;
               unspec (ad.eot) = "004"b3;
               unspec (ad.pt) = "011"b3;
               unspec (ad.ra) = "024"b3;
               unspec (ad.esc) = "033"b3;
          end;
          else do;
               unspec (ad.etb) = "046"b3;
               unspec (ad.eot) = "067"b3;
               unspec (ad.pt) = "005"b3;
               unspec (ad.ra) = "074"b3;
               unspec (ad.esc) = "047"b3;
          end;

          do i = 0 to 63;                                   /* Set up usavble form of address_mapping array */
               unspec (ch) = "0"b || address_mapping (i);
               ad.bit6_char (i) = ch;
          end;

          ad.open_description = rtrim (iox_modes (arg_mode));

priv_ibm3270_mpx.pl1

                    else do;  // EDBDIC
                         unspec (md.nl) = "025"b3;
                         unspec (md.sba) = "021"b3;
                         unspec (md.stx) = "002"b3;
                         unspec (md.esc) = "047"b3;
                         unspec (md.write) = "361"b3;
                         unspec (md.erase_write) = "365"b3;
                         unspec (md.ic) = "023"b3;
                         unspec (md.etx) = "003"b3;
                         unspec (md.soh) = "001"b3;
                         unspec (md.eot) = "067"b3;
                         unspec (md.percent) = "154"b3;
                         unspec (md.slash) = "141"b3;
                         unspec (md.letter_R) = "331"b3;
                         unspec (md.etb) = "046"b3;
                         unspec (md.enter) = "175"b3;
                         unspec (md.clear) = "155"b3;
                         unspec (md.pa1) = "154"b3;
                         unspec (md.pa2) = "156"b3;
                         unspec (md.pa3) = "054"b3;
                         unspec (md.bs) = "026"b3;
                         unspec (md.cr) = "015"b3;
                         unspec (md.em) = "031"b3;
                         unspec (md.copy) = "367"b3;
                    end;
                    if load_info.quit_key = PA1
                    then md.quit_key = md.pa1;
                    else if load_info.quit_key = PA2
                    then md.quit_key = md.pa2;
                    else if load_info.quit_key = PA3
                    then md.quit_key = md.pa3;
                    else md.quit_key = md.pa1;
                    if load_info.formfeed_key = PA1
                    then md.formfeed_key = md.pa1;
                    else if load_info.formfeed_key = PA2
                    then md.formfeed_key = md.pa2;
                    else if load_info.formfeed_key = PA3
                    then md.formfeed_key = md.pa3;
                    else if load_info.formfeed_key = CLEAR
                    then md.formfeed_key = md.clear;
                    else md.formfeed_key = md.clear;

dcl  1 status_msg unal based (textp),                       /* Format of status and test_req */
       2 soh char (1),
       2 percent char (1),                                  /* Should be "%", untranlated */
       2 type char (1),                                     /* "/" for test_req, "R" for status */
       2 stx char (1),
       2 controller_address char (1),
       2 device_address char (1),
       2 status1 char (1),
       2 status2 char (1),
       2 etx char (1);

ibm3270_mpx.pl1:

Run turnkey, capture

> 0000: fffd 00 ... DO BINARY

<  0000: fffd 00 ... WILL BINARY

> 0000: f140 115d 7f1d 6040 404f 40c9 c5c1 f1f0 f1c1 40e2 d7c5 c3c9 c6e8 40e2 e8e2 e3c5  .@.]..`@@O@.......@.......@.....

F1 order f1: write
40 wcc: 40 reset
11 SBA
5d first addr byte
7f  2nd addr 
1d start field
60   attributes
40 _
40 _
4f |
40 _
c9 I
c5 E
c1 A
f1 1
f0 0
f1 1
c1 A
40 _
e2 S
d7 P
c5 E
c3 C
c9 I
c6 F
e8 Y
40
e2 
e8
e2 
e3
c5

0020: d440 d7c1 d9c1 d4c5 e3c5 d9e2 40c6 d6d9 40d9 c5d3 c5c1 e2c5 40f0 f34b f840 4be5  .@..........@...@.......@..K.@K.
0040: e2f2 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  ..@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0060: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0080: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00a0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00c0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00e0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0100: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0120: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0140: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0160: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0180: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
01a0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
01c0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
01e0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0200: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0220: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0240: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0260: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0280: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
02a0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
02c0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
02e0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0300: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0320: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0340: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0360: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0380: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
03a0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
03c0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
03e0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0400: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0420: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0440: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0460: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0480: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
04a0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
04c0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
04e0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0500: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0520: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0540: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0560: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0580: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
05a0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
05c0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
05e0: 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 4040 403c 5ad1 40              @@@@@@@@@@@@@@@@@@@@@@@<Z.@

40 _
40 _
3c DC4  Repeat to address
5a   addr 1
d1   addr 2
40  _

> 0000: ffef  ..   EOR

> 0000: f6 .  Read Modified

> 0000: ffef  .. EOR

< 0000: 6040 40ff ef `@@..

60  AID: No AID generated
40    cursor address
40    cursor address
ffef EOR

> 0000: f1c3 115a d1 ...Z.

F1 order f1: write
C3 wcc: C3   1 1 0 0 0 0 1 1  reset, kb restore, reset modified data tag
11 SBA
5a first addr byte
d1 2nd addr 

> 0000: ffef  .. EOR

> 0000: f2 . Read buffer

> 0000: ffef  .. EOR

< 0000: 6040 4040 404f 40c9 c5c1 f1f0 f1c1 40e2 d7c5 c3c9 c6e8 40e2 e8e2 e3c5 d440 d7c1  `@@@@O@.......@.......@......@..

GA23-0061-2_3274DescriptionProgrammersGuide_Mar85.pdf

The 3274 Control Unit models can operate in local or remote configurations:
    The 3274 A units operate as channel-attached local units using SNA protocols (see Chapter 5).
    The 3274 Band D units operate as channel-attached local units using the host processor channel program (see Chapter 3).
    The 3274 C units operate as remote units using SNA/SDLC or BSC disciplines (see Chapters 4 and 5).

3274 C

4-1:

Text Blocking

The 3274 performs inbound text blocking. Each block of data can contain a
maximum of 256 text characters. Of that total, each block contains the STX and
ETB (or ETX) data-link control characters. Two address bytes (CU poll address
and device address) precede the read heading in the first block only and are
included in the 25 6-character total. The last block of a message is terminated
with ETX, which is also included in the 256-character total. 

Control Mode 

The 3274 enters control mode whenever it transmits or receives a valid BOT
sequence. While in control mode, the unselected 3274 monitors the
communications line for the following:
• A valid selection or poll addressing sequence, by which the 3274 will become
selected for entry into text mode.
• ADLE-STX sequence, placing the 3274 in transparent-monitor mode. 

Text Mode 

Once a 3274 is successfully selected, it enters text mode. In text mode, the 3274
is either a master station or a slave station, as is the TCU. This status depends on
the operation being performed. The station that is transmitting a message is
called the master station; the station that is receiving and acknowledging the
message is called the slave station.

The 3274.becomes the master station (and the TCU the slave station) once it
sends STX to the TCU while executing a Read command or a poll operation. As
the master station, it can (1) transmit text messages and (2) transmit ENQ to
request a reply or retransmission from the TCU. After transmission of the
message is completed, the 3274 returns to control mode.

The 3274 becomes the slave station (and the TCU the master station) when
executing a write-type command. As a slave station, it responds appropriately to
master-station (TCU) transmissions. 

Transparent-Monitor Mode 

Transparent-monitor mode is provided with EBCDIC 3274s only. It permits the
transmission of data in any of the 256 possible EBCDIC bit patterns between the
TCU and another unit on the same communications line with the 3274. This data
may be independent of the selected transmission code (EBCDIC). Examples of
such format-independent data are packed-decimal data, programs (both source
and object), core images, and other binary data. Thus, link control characters
within this data will not inadvertently initiate a 3274 operation.

When an EBCDIC 3274 decodes a OLE STX sequence while in control mode, it
enters transparent-monitor mode. While in this mode, the 3274 disregards all
data configurations that may appear on the communications line except for ( 1) a
transparent text sync sequence (OLE SYN) or (2) a transparent text-terminating
sequence (DLE ITB, DLE ETX, OLE ETB, or OLE ENQ). The 3274 leaves
transparent-monitor mode and returns to control mode ( 1) if a transparent text
sync sequence is not received within any 3-second period or (2) if a transparent
text-terminating sequence is decoded. 

RVI (Reverse Interrupt) 

RVI is a 2-byte character as follows:
• EBCDIC: 107C (hex)
• ASCII: 103C (hex)
RVI is generated by the 3274 in response to an attempted selection (not poll) by
the TCU when the 3274 has a status and sense message to be transmitted.
Whenever the 3274 accepts RVI from the TCU, the 3274 responds with BOT and
resets all pending status and sense information. The 3274 accepts RVI in place of
ACK 0 or ACK 1 and then only when they would have been valid. If RVI is
received at the 3274 in response to RVI, a timeout occurs at the 3274. 

fig 4-1: note 2:

EOT:  There is no I /0 pending nor pending status. For General Poll, the CU sends EOT only after polling all devices. 

note 1: no response: If the tn3270 disconnects, I need to set a bit that makes the general poll return the timeout.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License