Skip to main content

4. Connection Negotiation

The following example shows a TN3270-capable server and a TN3270 client establishing a connection: The TCP/IP port used to connect with is 23 (Telnet). At any place before and during the TN3270 connection negotiation process, other telnet commands and data may be transferred and will be interpreted under the existing telnet state. Some existing TN3270 servers start a client connection using an NVT telnet dialog to establish parameters needed to complete the TN3270 connection to the desired host. The order of negotiating terminal type, EOR and BINARY is not significant, this example shows a typical TN3270 connection.

      Server:  IAC DO TERMINAL-TYPE
Client: IAC WILL TERMINAL-TYPE
Server: IAC SB TERMINAL-TYPE SEND IAC SE
Client: IAC SB TERMINAL-TYPE IS <terminal type>IAC SE
  where `<terminal type>` is a string consisting of terminal model,
type and support of enhanced attribute bytes; an example is IBM-
3278-2. The acceptable values are listed in RFC 1340, Assigned
Numbers [5]. Other values are in use that do not exist in [5].
The -2 following 3278 designates the alternate screen size. 3270
terminals have the ability to switch between the standard (24x80)
screen size and an alternate screen size. Model -2 is 24x80 which
is the same as the standard size. Model -3 is 32x80, model -4 is
43x80 and model -5 is 27x132.
Appending the two character string "-E" to the end of the terminal
type signifies that the terminal is capable of handling 3270
extended data stream. This is interpreted to mean that the
terminal is able to handle structured fields, which are described
below. Some telnet server implementations also interpret this to
mean that the terminal is capable of handling extended attributes
(highlighting, field validation, character set, outlining, etc.)
[6].
The 3279 series of terminals is capable of extended attributes
while the 3278 series is not.
      Server:  IAC DO EOR IAC WILL EOR
Client: IAC WILL EOR IAC DO EOR
Server: IAC DO BINARY IAC WILL BINARY
Client: IAC WILL BINARY IAC DO BINARY
Server: <3270 data stream> IAC EOR
Client: <3270 data stream> IAC EOR
. .
. .

To terminate the connection the socket is closed by one of the session partners. Typically, when the user logs off of the host, the telnet server closes the connection. If the telnet server wishes to go back to NVT mode, it may issue the following telnet options:

       Server:  IAC WONT BINARY
Client: IAC DONT BINARY
       or
       Server:  IAC WONT EOR
Client: IAC DONT EOR

Either one of the above two cases causes the connection to not satisfy the requirements for a valid TN3270 session. The telnet client would then process data from the server as though it were NVT ASCII data. The following examples show how a TN3270 client handles the 3270- REGIME, SUPPRESS-GO-AHEAD, ECHO and TM options.

4.1. 3270 Regime Option​

Very few servers support the 3270 Regime Telnet Option. If the client does not support this option and responds negatively as shown in the following example, the server will proceed on to the more typical example shown above.

      Server:  IAC DO 3270-REGIME
Client: IAC WONT 3270-REGIME
Normal negotiation:
Server: IAC DO TERMINAL-TYPE
... (see above)

4.2. Suppress Go Ahead Option​

The Suppress Go Ahead option [8] is requested by some servers. The Suppress Go Ahead option RFC lists the default as being go aheads are transmitted to signal the receiver to begin transmitting. Since TN3270 negotiates binary and end-of-record and is a block mode protocol, the telnet go ahead character is not sent. Most servers do not negotiate this option even though they do not use the telnet go ahead character.

      Server:  IAC DO SUPPRESS-GO-AHEAD
Client: IAC WILL SUPPESS-GO-AHEAD

4.3. Echo Option​

The Echo option [9] is negotiated by those servers that make use of the telnet NVT mode to allow the user to enter information prior to negotiating the options necessary for TN3270. This information includes but is not limited to user identification, password and destination 3270 host. Some servers accept the default for this option which is for the client to not do a local echo of characters the user enters at the keyboard. This allows the server to decide if it should echo characters back to the client (or not in the case of password). Echoing characters back to the client causes slow response time since every character is typically echoed individually. Because of this, some servers negotiate for the client to do it's own local echoing (except for passwords). The following example illustrates this case.

      Server:  IAC DO ECHO
Client: IAC WILL ECHO
(Client does local display of all characters)
Server: IAC WONT ECHO
Client: IAC DONT ECHO
(Client enters password - not locally displayed or remotely
echoed)
Server: IAC DO ECHO
Client: IAC WILL ECHO
(Client resumes local display of all characters)

4.4. Timing Mark Option​

The Timing Mark option [10] is used by some servers to test for the continued presence of a TN3270 client. The following example will assure the server the client is still alive.

      Server:  IAC DO TIMING-MARK
Client: IAC WONT TIMING-MARK