1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
|
Network Working Group G. Clark
Request for Comments: 2217 Cisco Systems, Inc.
Category: Experimental October 1997
Telnet Com Port Control Option
Status of this Memo
This memo defines an Experimental Protocol for the Internet
community. This memo does not specify an Internet standard of any
kind. Discussion and suggestions for improvement are requested.
Distribution of this memo is unlimited.
Introduction
This memo proposes a protocol to allow greater use of modems attached
to a network for outbound dialing purposes.
Table of Contents
1. Negotiation of the Com Port
Control Option Protocol .................. 5
2. Com Port Configuration Commands .................. 6
Version
Baud Rate
Data Bit Size
Parity
Stop Bit size
3. Special Com Port Control Commands ................. 8
XON/XOFF Flow Control
HARDWARE Flow Control
BREAK Signal
DTR Signal
RTS Signal
4. Notification of Com Port and .................. 12
Modem Line Changes
5. Flow Control .................. 13
6. Security Considerations .................. 13
7. Author's Address .................. 14
8. Reference Section .................. 14
Discussion
The Telnet protocol defines an interactive, character-oriented
communications session. It was originally designed to establish a
session between a client and a remote login service running on a host
[5].
Clark Experimental [Page 1]
^L
RFC 2217 Telnet Com Port Control Option October 1997
Many new business functions require a person to connect to remote
services to retrieve or deposit information. By in large, these
remote services are accessed via an async dial up connection. This
new class of functions include:
- dial up connections to the Internet
- connecting to bulletin boards
- connecting to internal and external databases
- sending and receiving faxes.
The general nature of this new class of function requires an
interactive, character-oriented communications session via an async
modem. This is typically known as outbound modem dialing.
To help defer the cost of installing and maintaining additional phone
lines which may be used very little per person, many equipment
manufacturers have added the ability to establish a Telnet session
directly to the outbound ports on many of the most popular access
servers and routers, here after referred to as access servers.
However, the current Telnet protocol definitions are not sufficient
to fully support this new use. There are three new areas of
functionality which need to be added to the Telnet protocol to
successfully support the needs of outbound modem dialing. These are:
- The ability for the client to send com port configuration
information to the access server which is connected to the
outbound modem. This is needed to ensure the data being
transmitted and received by the modem is formatted correctly
at the byte level.
- The ability for the access server to inform the client of any
modem line or signal changes such as RLSD changes (carrier
detect). This information is vital, since many client software
packages use this information to determine if a session with the
remote service has been established. RLSD changes are also
used for signaling in Class I faxing [6].
- The ability to manage flow control between the client and
the access server which does not interfere with the flow
control mechanisms used by the session between the client and
the remote service. Unfortunately RFC 1372 "Telnet Remote
Flow Control Option" [2] can not be used for this purpose
because it relies on sending XON/XOFF style characters which
maybe transmitted or received as a normal course of the
client / remote service session.
Clark Experimental [Page 2]
^L
RFC 2217 Telnet Com Port Control Option October 1997
Though this discussion has focused on outbound modem dialing as the
primary use of this protocol, the protocol can also be used for any
serial device attached to an access server. Such devices could be:
- serial printers
- plotters
- monitoring devices such as pipe line monitors or medical
monitors
- general office equipment such as photo-copiers and cash
registers
Definition of Terms
Access Server - Any network device which accepts Telnet sessions
and passes the data received to a com port, and
passes data received from the com port to the client
via the Telnet session.
Baud Rate - For the purposes of this document, baud rate will
mean the communications of data in bits per second.
Client - Any network device which initiates a Telnet session
to an access server.
Outbound - Transmission of data from the modem attached to the
access server to a remote service.
Inbound - Transmission of data from the remote service to the
modem attached to the access server.
Remove Service - Any service which accepts dial-up connections,
including fax machines.
Clark Experimental [Page 3]
^L
RFC 2217 Telnet Com Port Control Option October 1997
Illustration
=====================
| |
| CLIENT |\
| | \ < ---- Local Area /
===================== \ Enterprise Network
\
\
=============================
| Telnet Interface |
| | |
| | |
| ACCESS SERVER | |
| | |
| | |
| Com Port Interface |
=============================
|
|
==================
| |
| MODEM |
| |
==================
|
Access to Remote Service |
most commonly Public Switched ----->|
Network |
|
|
======================
Could be Internet Service | |
Provider, Bulletin Board | |
or FAX machine | REMOTE SERVICE |
| |
| |
======================
Command Names and Codes:
COM-PORT-OPTION 44
Clark Experimental [Page 4]
^L
RFC 2217 Telnet Com Port Control Option October 1997
Client to Access Server Access Server to Client
SIGNATURE text text
SET-BAUDRATE 1 101
SET-DATASIZE 2 102
SET-PARITY 3 103
SET-STOPSIZE 4 104
SET-CONTROL 5 105
NOTIFY-LINESTATE 6 106
NOTIFY-MODEMSTATE 7 107
FLOWCONTROL-SUSPEND 8 108
FLOWCONTROL-RESUME 9 109
SET-LINESTATE-MASK 10 110
SET-MODEMSTATE-MASK 11 111
PURGE-DATA 12 112
Discussion: As initially proposed, com port configuration
commands are only sent from the client to the access
server. There is no current vision that the access
server would initiate the use of a com port configuration
command, only the notify commands. However, to allow for
access server initiated com port configurations different
command values have been established.
1. Negotiation of the Com Port Control Option Protocol
The negotiation of the com port control option protocol uses the
standard Telnet negotiation protocol mechanism:
IAC WILL COM-PORT-OPTION
The sender of this command is willing to send com port
control option commands.
IAC WONT COM-PORT-OPTION
The sender of this command refuses to send com port
control option commands.
IAC DO COM-PORT-OPTION
The sender of this command is willing to accept com port
control option commands.
IAC DONT COM-PORT-OPTION
The sender of this command refuses to accept com port control
options commands.
Typically a client will use WILL and WONT, while an access server
will use DO and DONT.
Clark Experimental [Page 5]
^L
RFC 2217 Telnet Com Port Control Option October 1997
2. Com Port Configuration Commands
Once DO and WILL have been negotiated, the client may send any of the
following commands. The client can send these commands at any time
and multiple times throughout the Telnet session. Each command
transmitted from the client to the access server must be acknowledged
once the command has been processed by the access server. This
confirmation informs the client of the value set at the access server
after the processing of the command. This acknowledgment is not used
to acknowledge the receipt of the command, which is handled at the
TCP protocol layer. Its purpose is to inform the client of the value
in use, which may be different than the value requested in the
client's command. For example, the client may request a baud rate
higher than the access service can provide. If an acknowledgment is
not received by the client within a reasonable time (such as twice
the delay acknowledgment timer), the client may wish to resend the
command or terminate the session.
Though the commands may be sent from the client to the access server
in any sequence, there are sequences which may result in invalid
configurations for the com port (for example: EVEN parity is only
valid if the data size is set to less than 8 bits). Thus it is
recommended that commands be issued in the following sequence:
1. SET-BAUDRATE
2. SET-DATASIZE
3. SET-PARITY
4. SET-STOPSIZE
IAC SB COM-PORT-OPTION SIGNATURE <text> IAC SE
This command may be sent by either the client or the access
server to exchange signature information. If the command is
sent without <text> it is a request from the sender to receive
the signature text of the receiver. The text may be a
combination of any characters. There is no structure to the
<text> field. It may contain manufacturer information, version
number information, or any other information desired. If an
IAC character appears in the text it must be translated to
IAC-IAC to avoid conflict with the IAC which terminates
the command.
IAC SB COM-PORT-OPTION SET-BAUD <value(4)> IAC SE
This command is sent by the client to the access server to set
the baud rate of the com port. The value is four octets (4 bytes).
The value is represented in network standard format. The value
is the baud rate being requested. A special case is the value 0.
If the value is zero the client is requesting the current baud
rate of the com port on the access server.
Clark Experimental [Page 6]
^L
RFC 2217 Telnet Com Port Control Option October 1997
Discussion: Though baud rates used today form a very sparse space,
and the initial version of the option used an index
based baud rate table, after much discussion with a
number of groups it has been determined that the
actual baud rate should be used. There are two main
reasons. 1) It limits the number of updates to the
option as faster baud rates come into use,
2) It provides the greatest amount of flexibility
in the selection of the baud rates.
IAC SB COM-PORT-OPTION SET-DATASIZE <value> IAC SE
This command is sent by the client to the access server to set
the data bit size. The command can also be sent to query the
current data bit size. The value is one octet (byte). The value
is an index into the following value table:
Value Data Bit Size
0 Request Current Data Bit Size
1 Available for Future Use
2 Available for Future Use
3 Available for Future Use
4 Available for Future Use
5 5
6 6
7 7
8 8
9-127 Available for Future Use
Discussion: There are only eight possible values for the data bit
size, only four have ever been used historically and
only two are commonly used today. The use of the
command-value format is recommended to preserve
consistency with other commands. It also reduces the
number of commands defined in the protocol, and
allows for future expansion.
IAC SB COM-PORT-OPTION SET-PARITY <value> IAC SE
This command is sent by the client to the access server to set
the parity. The command can also be sent to query the current
parity. The value is one octet (byte). The value is an index into
the following value table:
Value Parity [1]
0 Request Current Data Size
1 NONE
2 ODD
3 EVEN
4 MARK
Clark Experimental [Page 7]
^L
RFC 2217 Telnet Com Port Control Option October 1997
5 SPACE
6-127 Available for Future Use
Discussion: There are only five possible values for parity
commonly used today. The use of the command-value
format is recommended to preserve consistency with
other commands.
IAC SB COM-PORT-OPTION SET-STOPSIZE <value> IAC SE
This command is sent by the client to the access server to set
the number of stop bits. The command can also be sent to query
the current stop bit size. The value is one octet (byte). The
value is an index into the following value table:
Value Stop Bit Size
0 Request Current Data Size
1 1
2 2
3 1.5
4-127 Available for Future Use
Discussion: Stop bit 1.5 is supported by most com port hardware
only if data size is set to 5 bits. It is not
commonly used.
3. Special Com Port Control Commands
The client can send this command to the access server at any time
and multiple times throughout the Telnet session. Each command
transmitted from the client to the access server is acknowledged
with a confirmation of the command and the actual value set. The
client should expect a response within a reasonable time (such as
twice the delay acknowledgment timer). The client may wish to
resend any command which is not acknowledged or terminate the
session.
IAC SB COM-PORT-OPTION SET-CONTROL <value> IAC SE
This command is sent by the client to the access server to set
special com port options. The command can also be sent to query
the current option value. The value is one octet (byte). The
value is an index into the following value table:
Value Control Commands
0 Request Com Port Flow Control Setting
(outbound/both)
1 Use No Flow Control (outbound/both)
2 Use XON/XOFF Flow Control (outbound/both)
3 Use HARDWARE Flow Control (outbound/both)
Clark Experimental [Page 8]
^L
RFC 2217 Telnet Com Port Control Option October 1997
4 Request BREAK State
5 Set BREAK State ON
6 Set BREAK State OFF
7 Request DTR Signal State
8 Set DTR Signal State ON
9 Set DTR Signal State OFF
10 Request RTS Signal State
11 Set RTS Signal State ON
12 Set RTS Signal State OFF
13 Request Com Port Flow Control Setting (inbound)
14 Use No Flow Control (inbound)
15 Use XON/XOFF Flow Control (inbound)
16 Use HARDWARE Flow Control (inbound)
17 Use DCD Flow Control (outbound/both)
18 Use DTR Flow Control (inbound)
19 Use DSR Flow Control (outbound/both)
20-127 Available for Future Use
Discussion: Flow control options were divided into inbound and
outbound to take full advantage of existing
programming interfaces and access server
capabilities.
Discussion: The outbound values should set flow control for both
outbound and inbound. If inbound is to be, or can
be, set separately it should be done after the
setting of the outbound value.
Discussion: If the access server is not able to set inbound flow
control differently from the outbound flow control,
it should ignore the inbound flow control commands
and set the flow control option based on the outbound
flow control commands only.
IAC SB COM-PORT-OPTION SET-LINESTATE-MASK <value> IAC SE
This command is sent by the client to the access server to set a
bit mask for the sending of the NOTIFY-LINESTATE option (see
section 4). When the LINESTATE changes on the access server, the
access server will "AND" the new LINESTATE with the LINESTATE-
MASK. If the result is not zero, the access server will send the
result of the "AND" as the value in a NOTIFY-LINESTATE com port
option. If more than one bit satisfies the LINESTATE-MASK, only
one NOTIFY-LINESTATE, with all the satisfying bits, will be sent
to the client. The SET-LINESTATE-MASK may be any combination of
bits as listed below. These are the same bit values used in the
NOTIFY-LINESTATE option. The SET-LINESTATE-MASK values are based
on the most popular UART (com port control chip) in use [1].
Clark Experimental [Page 9]
^L
RFC 2217 Telnet Com Port Control Option October 1997
Bit Position Value Meaning
7 128 Time-out Error
6 64 Transfer Shift Register Empty
5 32 Transfer Holding Register Empty
4 16 Break-detect Error
3 8 Framing Error
2 4 Parity Error
1 2 Overrun Error
0 1 Data Ready
Discussion: The SET-LINESTATE-MASK value of 0 will prevent the
access server from sending NOTIFY-LINESTATE options
to the client.
Discussion: The SET-LINESTATE-MASK value of 255 will allow the
access server to send a NOTIFY-LINESTATE option to
the client each time the LINESTATE changes on the
access server.
Discussion: The initial LINESTATE-MASK at the access server is 0.
Discussion: The client does not have to send a new
SET-LINESTATE-MASK after receiving a NOTIFY-
LINESTATE. The LINESTATE-MASK on the access server
is retained until set by the client or reset at the
start of a new Telnet session.
IAC SB COM-PORT-OPTION SET-MODEMSTATE-MASK <value> IAC SE
This command is sent by the client to the access server to set a
bit mask for the sending of the NOTIFY-MODEMSTATE option (see
section 4). When the MODEMSTATE changes on the access server,
the access server will "AND" the new MODEMSTATE with the
MODEMSTATE-MASK. If the result is not zero, the access server
will send the result of the "AND" as the value in a NOTIFY-
MODEMSTATE com port option. If more than one bit satisfies the
MODEMSTATE-MASK, only one NOTIFY-MODEMSTATE, with all the
satisfying bits, will be sent to the client. The SET-
MODEMSTATE-MASK may be any combination of bits as listed below.
These are the same bit values used in the NOTIFY-MODEMSTATE
option. The SET-MODEMSTATE-MASK values are based on the most
popular UART (com port control chip) in use [1].
Clark Experimental [Page 10]
^L
RFC 2217 Telnet Com Port Control Option October 1997
Bit Position Value Meaning
7 128 Receive Line Signal Detect
(also known as Carrier Detect)
6 64 Ring Indicator
5 32 Data-Set-Ready Signal State
4 16 Clear-To-Send Signal State
3 8 Delta Receive Line Signal Detect
2 4 Trailing-edge Ring Detector
1 2 Delta Data-Set-Ready
0 1 Delta Clear-To-Send
Discussion: The SET-MODEMSTATE-MASK value of 0 will prevent the
access server from sending NOTIFY-MODEMSTATE options
to the client.
Discussion: The SET-MODEMSTATE-MASK value of 255 will allow the
access server to send a NOTIFY-MODEMSTATE option to
the client each time the MODEMSTATE changes on the
access server.
Discussion: The initial MODEMSTATE-MASK at the access server
is 255.
Discussion: The client does not have to send a new
SET-MODEMSTATE-MASK after receiving a NOTIFY-
MODEMSTATE. The MODEMSTATE-MASK on the access server
is retained until set by the client or reset at the
start of a new Telnet session.
IAC SB COM-PORT-OPTION PURGE-DATA <value> IAC SE
This command is sent by the client to the access server to
instruct the access server to immediately clear all data from the
buffer or buffers referenced by the value. The value is one
octet (byte). The value is an index into the following value
table:
Value Purge Data Buffer
0 Available for Future Use
1 Purge access server receive data buffer
2 Purge access server transmit data buffer
3 Purge both the access server receive data
buffer and the access server transmit data
buffer
4-127 Available for Future Use
Clark Experimental [Page 11]
^L
RFC 2217 Telnet Com Port Control Option October 1997
4. Notification of Com port and Modem Line Changes
The access server can send these commands to the client any time
and multiple times throughout the Telnet session. The access
server should send the appropriate command to the client as soon
as the com port or modem line changes occurs. The client does
not issue a response to these commands.
IAC SB COM-PORT-OPTION NOTIFY-LINESTATE <value> IAC SE
The value is one octet (byte). The value is a bit level
composition made up from the value table below. Multiple bit
values may be set in a single transmission. The values are based
on the most popular UART (com port control chip) in use [1].
Bit Position Value Meaning
7 128 Time-out Error
6 64 Transfer Shift Register Empty
5 32 Transfer Holding Register Empty
4 16 Break-detect Error
3 8 Framing Error
2 4 Parity Error
1 2 Overrun Error
0 1 Data Ready
Discussion: The LINESTATE is the line state of the UART on
the access server.
IAC SB COM-PORT-OPTION NOTIFY-MODEMSTATE <value> IAC SE
The value is one octet (byte). The value is a bit level
composition made up from the value table below. Multiple bit
values may be set in a single transmission. The values are based
on the most popular UART (com port control chip) in use [1].
Bit Position Value Meaning
7 128 Receive Line Signal Detect
(also known as Carrier Detect)
6 64 Ring Indicator
5 32 Data-Set-Ready Signal State
4 16 Clear-To-Send Signal State
3 8 Delta Receive Line Signal Detect
2 4 Trailing-edge Ring Detector
1 2 Delta Data-Set-Ready
0 1 Delta Clear-To-Send
Clark Experimental [Page 12]
^L
RFC 2217 Telnet Com Port Control Option October 1997
5. Flow Control
The client and/or access server can send these commands any time and
multiple times throughout the Telnet session.
IAC SB COM-PORT-OPTION FLOWCONTROL-SUSPEND IAC SE
The sender of this command is requesting that the receiver
suspend transmission of both data and commands until the
FLOWCONTROL-RESUME is transmitted by the sender.
IAC SB COM-PORT-OPTION FLOWCONTROL-RESUME IAC SE
The sender of this command is requesting that the receiver resume
transmission of both data and commands.
Discussion: Established Telnet sessions are initially in a
resume state between the client and the access server
and the access server and the client. There is no
need to send the resume command during session
initialization.
Discussion: Multiple concurrent suspend commands may be sent.
Secondary suspend commands can be ignored.
Transmission will resume with the sending of a single
resume command.
Discussion: The flow control option is designed to handle client
to access server flow control for the Telnet session.
This option has been added in deference to RFC 1372:
Telnet Remote Flow Control Option [2]. RFC 1372 uses
a simple character XON/XOFF technology to implement
flow control. This can lead to two problems. First,
the flow control characters may be valid data values.
Second, the flow control characters may be used for
end to end flow control (client application to remote
dial up service).
6. Security Considerations
There are two security issues to discuss; authentication and
resetting resources.
Authentication can follow either the Kerberos authentication protocol
established in RFC 1411 [3] or the SPX authentication protocol
established in RFC 1412 [4].
Once the Telnet session between the client and the access server has
been terminated, the access server should ensure the connection to
the remote service is disconnected and the com port geometry (baud
Clark Experimental [Page 13]
^L
RFC 2217 Telnet Com Port Control Option October 1997
rate, data size, stop bits, parity, and flow control) is reset to a
factory or administrator defined configuration. This ensures the com
port is in a known state and ready to receive the next client
session. This will make operations more predicable and avoid
problems which might occur from starting a new session with random
com port configurations.
7. Author's Address
Glen Clark, Software Architect
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 96134
USA
EMail: glenc@cisco.com
WEB: www.cisco.com
8. Reference Section
[1] Joe Campbell. C Programmer's Guide to Serial Communications,
Second Edition. Indianapolis: SAMS Publishing, 1993. 213-224.
[2] Hedrick, C., and D. Borman, "Telnet Remote Flow Control Option",
RFC 1372, Cray Research, Inc., October 1992.
[3] Borman, D., "Telnet Authentication: Kerberos Version 4",
RFC 1411, Cray Research, Inc., January 1993.
[4] Alagappan, K., "Telnet Authentication: SPX",
RFC 1412, Digital Equipment Corporation, January 1993.
[5] D. E. Comer and David Stevens. Internetworking with TCP/IP,
Volume III. Prentice Hall, 1993.
[6] Andrew Margolis. The FAX Modem Sourcebook. John Wiley & Sons.
1995.
Clark Experimental [Page 14]
^L
|