RFC 2840
TELNET KERMIT OPTION
RFC 2840: TELNET KERMIT OPTION π
Okay bestie, here's the whole vibe check on this one π
- RFC number: 2840
- Network Working Group πΈ
- Authors: J. Altman and F. da Cruz, both from Columbia University π
- Category: Informational (it's just for info, not an Internet standard)
- Date: May 2000
- Obsoletes / Updates: the doc doesn't say it obsoletes or updates anything π
Status of This Memo π
This memo is here to give info to the Internet community π. It doesn't specify an Internet standard of any kind, and anyone can distribute it freely β¨.
Copyright Notice π
Copyright (C) The Internet Society (2000). All Rights Reserved π .
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 π«Ά.
Abstract π¦
So this doc describes an extension to Telnet that lets you negotiate, coordinate, and use the Kermit file transfer and management protocol over a Telnet connection that already exists π₯. Literally Telnet hosting Kermit. Iconic.
Contents π§
1. MOTIVATION . . . . . . . . . . . . . . . . . . . . . . . . 2
2. DEFINITIONS. . . . . . . . . . . . . . . . . . . . . . . . 2
3. COMMANDS AND CODES . . . . . . . . . . . . . . . . . . . . 3
4. COMMAND MEANINGS . . . . . . . . . . . . . . . . . . . . . 3
5. KERMIT PROTOCOL IMPLICATIONS . . . . . . . . . . . . . . . 5
6. EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.1. EXAMPLE 1. . . . . . . . . . . . . . . . . . . . . . . . 6
6.2. EXAMPLE 2. . . . . . . . . . . . . . . . . . . . . . . . 7
6.3. EXAMPLE 3. . . . . . . . . . . . . . . . . . . . . . . . 8
6.4. EXAMPLE 4. . . . . . . . . . . . . . . . . . . . . . . . 9
6.5. EXAMPLE 5. . . . . . . . . . . . . . . . . . . . . . . . 10
7. SECURITY CONSIDERATIONS. . . . . . . . . . . . . . . . . . 11
8. REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . 11
9. AUTHORS' ADDRESSES . . . . . . . . . . . . . . . . . . . . 11
10. FULL COPYRIGHT STATEMENT. . . . . . . . . . . . . . . . . 12
1. MOTIVATION β¨
Okay so the Kermit protocol [KER] does error-corrected file transfer and management over a bunch of connection types, including terminal connections, and it works across all kinds of hardware and software platforms π». It's supported by loads of Telnet clients, and it's also widely available on the Internet hosts you connect to with Telnet π.
Traditionally, a user starts the Kermit protocol connection by hand, or maybe an automated script does it π. It's on the user to start the Kermit server on one end and the Kermit client on the other, or to start a Kermit "send" on one end and a Kermit "receive" on the other. Lowkey a lot of pressure π.
This procedure came from necessity on ordinary direct-dial connections, and it does its job in that setup π . But it causes timing and dexterity problems. It also has no good way for each Kermit program to figure out the "mode" of the other one, or even whether it's there at all. So you can't be sure which operations are legal on the connection at any given moment π.
When Kermit services are on the Internet, though, you can build a strong coupling between the two end applications. You let the Telnet protocol [TEL] be the supervisor for Kermit sessions, so you always get a valid, known relationship π«Ά. The Kermit sessions are basically embedded inside Telnet sessions. Telnet handles starting and stopping them, and it decides which end is the Kermit client and which is the Kermit server. It can even switch that relationship when the user does stuff π₯.
2. DEFINITIONS π
Kermit server A software program that's ready to accept and act on commands in the form of well-defined Kermit packets [KER] π.
Kermit client A software program that gets requests through its user interface from a human (or a script or some other source). It turns them into command packets and sends them to a Kermit server, which kicks off a Kermit protocol transaction, like transferring one or more files π.
Availability of Kermit server For this doc, a Kermit server counts as available if, through the negotiations described here, its Telnet partner knows that it's a Kermit server β¨.
3. COMMANDS AND CODES π
Kermit server support gets negotiated separately in each direction π¦. That means Kermit service can be embedded in the Telnet client, the Telnet server, or both. The proposed Telnet extensions are symmetrical, which is so cute πΈ.
When the connection first opens, Kermit service is unavailable in both directions π.
The availability of Kermit service is negotiated with this Telnet option:
KERMIT 47 (assigned by IANA)
The state of the connection is controlled by these Telnet subnegotiation function codes:
START-SERVER 0
STOP-SERVER 1
REQ-START-SERVER 2
REQ-STOP-SERVER 3
SOP 4
RESP-START-SERVER 8
RESP-STOP-SERVER 9
4. COMMAND MEANINGS π§
The KERMIT OPTION gets negotiated with the standard Telnet mechanisms π :
IAC WILL KERMIT: the sender has a Kermit server built in and is willing to negotiate its use π.IAC WONT KERMIT: the sender doesn't have a Kermit server, or refuses to negotiate its use π ββοΈ.IAC DO KERMIT: the sender asks the receiver to negotiate use of a Kermit server π.IAC DONT KERMIT: the sender refuses to negotiate the use of a Kermit server π.
Once WILL KERMIT is negotiated in a particular direction, subnegotiations are used to indicate or request a change in the state of the connection, or to pass along other info. Subnegotiations may be sent at any time β¨.
IAC SB KERMIT START-SERVER: the WILL side sends this to say the Kermit server is now active, which means client-initiated Kermit packets will be accepted π₯.IAC SB KERMIT STOP-SERVER: the WILL side sends this to say the Kermit server is no longer active, so it isn't ready to accept Kermit packets π.IAC SB KERMIT REQ-START-SERVER: the DO side sends this to ask for the Kermit server to be started. It must be responded to with either RESP-START-SERVER or RESP-STOP-SERVER, depending on whether the request was accepted π«Ά.IAC SB KERMIT REQ-STOP-SERVER: the DO side sends this to ask for the Kermit server to be stopped. It must be responded to with either RESP-START-SERVER or RESP-STOP-SERVER, depending on whether the request was accepted π .IAC SB KERMIT RESP-START-SERVER: the WILL side sends this in response to REQ-START-SERVER or REQ-STOP-SERVER, to say the Kermit server is active after the request was accepted or denied πΈ.IAC SB KERMIT RESP-STOP-SERVER: the WILL side sends this in response to REQ-START-SERVER or REQ-STOP-SERVER, to say the Kermit server is not active after the request was accepted or denied π¦.IAC SB KERMIT SOP <octet>: this is Kermit Start Of Packet. The sender says which octet it'll use to mark the start of the Kermit packets it sends. Each connection partner MUST NOT skip this... wait, correction, the original says it must be sent by each connection partner on the first WILL/DO pair, so each partner must send it then π. It must also be sent whenever the Start of Packet character changes π₯. The values are restricted to ASCII C0 control characters other than Carriage Return and NUL π§. The normal value is 1 (ASCII SOH). The two Kermit partners normally use the same SOP, but they can use different ones if they want π.
Now here's the deal with SOP: it's what lets each Telnet partner recognize incoming Kermit packets afterwards. Data that comes after the SOP gets handled by the Kermit packet analyzer π. All the other Kermit protocol parameters get negotiated automatically inside the Kermit protocol, during the first exchange of Kermit packets [KER] β¨.
START-SERVER and STOP-SERVER commands must be sent by the WILL side whenever the state of the Kermit server changes π. When WILL is successfully negotiated, the WILL side's state is assumed to be STOP-SERVER. If the server is active, the WILL side must send a START-SERVER to show the change in state π¦.
The receiver of a REQ-START-SERVER or REQ-STOP-SERVER doesn't have to agree to change state π. It still must respond with either RESP-START-SERVER or RESP-STOP-SERVER, to show the state of the Kermit server after the request. RESP-xxx-SERVER gets sent instead of xxx-SERVER so the sender of REQ-xxx-SERVER can tell apart the WILL side's spontaneous state change from the response to its own request π₯.
If the Kermit server gets a Kermit packet telling it to stop Kermit service (like a FINISH, REMOTE EXIT, or BYE packet [KER]), it must send IAC SB KERMIT STOP-SERVER if the command is accepted π.
These rules make sure the Telnet client's user interface always knows whether a Kermit server is available, and on which end. So it can only show the user valid choices π . And when one Telnet partner changes state, the other one automatically switches to a complementary, valid state π.
It's possible for a traditional telnet service (port 23) to use this option and also keep supporting the existing remote shell access. But that's not really expected π. This option is mainly meant for dedicated Kermit services, like the Internet Kermit Service (port 1649) [IKS] πΈ.
5. KERMIT PROTOCOL IMPLICATIONS π¦
The Kermit protocol is described elsewhere [KER] π. It's extensible and self-configuring, kind of like Telnet, so any two proper Kermit implementations should interoperate automatically β¨.
In Kermit, just like in Telnet, one particular octet is special. In Telnet it's IAC (decimal 255). In Kermit it's whatever character the IAC SB KERMIT SOP negotiation sets, which is normally SOH (decimal 1, Ctrl-A) π₯. All Kermit packets must begin with the SOP, and they should not contain the SOP character in an unquoted form π«Ά.
Telnet takes priority over Kermit. Whenever an IAC shows up, it's processed as the start of a Telnet command, unless another IAC quotes it π. Telnet commands can contain any characters at all, including the SOP octet, and it's all transparent to the Kermit protocol. In fact, Telnet commands never get seen by the Kermit protocol at all π§.
Kermit protocol must follow the Telnet NVT rules in each direction when Telnet binary mode isn't negotiated for that direction π .
If you want 8-bit transparency, Telnet binary mode can be negotiated when you enter the Kermit protocol, in the right direction. Then the previous mode (NVT or binary) gets restored when you exit the Kermit protocol π. Telnet binary mode can make transfers more efficient, but it isn't required for data transfer, since the Kermit protocol doesn't need a transparent path π.
6.1. EXAMPLE 1 π
okay so the Telnet server has a Kermit server inside it, but the Telnet client has Kermit protocol and doesn't do the Telnet KERMIT Option. bestie, watch how the negotiation goes π
Telnet Server Telnet Client
----------------------------- -----------------------------
<starts negotiations>
WILL KERMIT
DO KERMIT
<responds to negotiations>
DONT KERMIT
WONT KERMIT
after that, no subnegotiations happen at all π so the Kermit client/server relationship is just manual, controlled by whoever is using the Telnet client π§
6.2. EXAMPLE 2 π
this one is giving server-first energy. the Telnet server has a Kermit server and starts it right after the connection is made, while the Telnet client doesn't offer a Kermit server at all π¦
Telnet Server Telnet Client
----------------------------- -----------------------------
<starts negotiations>
WILL KERMIT
DO KERMIT
<responds to negotiations>
DO KERMIT
SB KERMIT SOP <0x01>
WONT KERMIT
SB KERMIT SOP <0x01>
<starts Kermit Server>
SB KERMIT START-SERVER
so at this point the Telnet client knows there's a Kermit server on the other end π«Ά and it can make its command set or menus show only the commands that work when you're a client of a Kermit server. iconic β¨
6.3. EXAMPLE 3 πΈ
ooh this one has main character energy. both the Telnet server and the Telnet client have a Kermit server π the client's Kermit server only runs while its terminal emulator is active and is off otherwise. the Telnet server is mostly for shell access, so it doesn't start a Kermit Server unless somebody asks it to π
Telnet Server Telnet Client
--------------------------- -----------------------------
<starts negotiations>
WILL KERMIT
DO KERMIT
<responds to negotiations>
DO KERMIT
SB KERMIT SOP <0x01>
WILL KERMIT
SB KERMIT SOP <0x01>
<telnet client enters terminal emulator>
SB KERMIT START-SERVER
<client leaves terminal emulator>
SB KERMIT STOP-SERVER
<client requests Kermit service>
SB KERMIT REQ-START-SERVER
<starts Kermit server>
SB KERMIT RESP-START-SERVER
<client sends Kermit FINISH packet>
<stops Kermit server>
SB KERMIT STOP-SERVER
<client returns to terminal emulator>
SB KERMIT START-SERVER
the vibe is basically: the client turns its server on and off as it moves between the terminal and Kermit work, and the server only wakes up when it's asked π
6.4. EXAMPLE 4 π§
this one is a whole mood π both sides have a Kermit server, and the client's Kermit server is active whenever the terminal emulator is active. the Telnet server is used only for Kermit protocol, so it starts a Kermit Server automatically as soon as it accepts the connection.
Telnet Server Telnet Client
--------------------------- -----------------------------
<starts negotiations>
WILL KERMIT
DO KERMIT
<responds to negotiations>
DO KERMIT
SB KERMIT SOP <0x01>
WILL KERMIT
SB KERMIT SOP <0x01>
<client enters terminal emulator>
SB KERMIT START-SERVER
<in response to DO>
SB KERMIT SOP <0x01>
SB KERMIT START-SERVER
<client restricts command set to
Kermit protocol commands>
SB KERMIT STOP-SERVER
<client performs Kermit protocol
operations>
<client want to enter terminal mode>
SB KERMIT REQ-STOP-SERVER
<Kermit Server refuses>
SB KERMIT RESP-START-SERVER
6.5. EXAMPLE 5 π
this is the one that should NEVER happen π some Telnet clients with file transfer features are built to accept incoming connections. in that setup, the Telnet client acts like a pseudo Telnet Server, but it can't give you shell access or do a lot of the other Telnet stuff. now, if both clients support this option AND have a Kermit server that's active during terminal emulation, you can end up in a deadlock if scripting is supported too. why? because Telnet clients that support a script language don't process input while they're waiting for the next command to be issued. yikes π
Telnet Client One Telnet Client Two
--------------------------- -----------------------------
<starts negotiations>
WILL KERMIT
DO KERMIT
<responds to WILL>
DO KERMIT
SB KERMIT SOP <0x01>
<in response to DO>
SB KERMIT SOP <0x01>
SB KERMIT START-SERVER
<responds to DO>
WILL KERMIT
SB KERMIT START-SERVER
<client one restricts command
set to Kermit protocol and
disables Kermit Server>
SB KERMIT STOP-SERVER
<client two restricts command
set to Kermit protocol and
disables Kermit Server>
SB KERMIT STOP-SERVER
so at the end, both clients have narrowed their command set to Kermit Protocol commands π but neither side is actually processing input, so it's still stuck. which is why this rule is non-negotiable:
The following restriction MUST be enforced: A Telnet partner may not restrict the command set if it accepted the incoming connection.
7. SECURITY π₯
okay bestie, this part is serious, so listen up π«Ά anyone implementing this Telnet Option must enforce proper user authentication and file system access restrictions alongside their Kermit file transfer protocol implementation. those issues are outside the scope of this document, so you've gotta handle them yourself π
8. REFERENCES π
here's the reading list, with every citation kept exactly as written π
- [BCP] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [KER] da Cruz, Frank, "Kermit, A File Transfer Protocol", Digital Press/ Butterworth Heinemann, Newton, MA, ISBN 0-932376-88-6 (1987).
- [IKS] da Cruz, F. and J. Altman, "Internet Kermit Service", RFC 2839, May 2000.
- [TEL] Postel, J. and J. Reynolds, "Telnet Protocol Specification", STD 8, RFC 854, May 1983.
- [TEL] Postel, J. and J. Reynolds, "Telnet Option Specification", STD 8, RFC 855, May 1983.
9. AUTHORS' ADDRESSES π¦
the squad behind this one π
Jeffrey E. Altman
EMail:jaltman@columbia.edu
Frank da Cruz
EMail: fdc@columbia.edu
The Kermit Project Columbia University 612 West 115th Street New York NY 10025-7799 USA http://www.columbia.edu/kermit/ http://www.kermit-project.org/
10. Full Copyright Statement β
the legal stuff, but make it cute π the Internet Society holds the copyright for 2000, with all rights reserved. you're free to copy and share this document, and to prepare derivative works that comment on it, explain it, or help people implement it. you can publish and distribute those too, in whole or in part, with no restrictions, as long as the copyright notice and this paragraph stay on every copy. the document itself, though, can't be modified in any way, like removing the copyright notice or the references to the Internet Society or other Internet organizations. the exceptions are for developing Internet standards, where the Internet Standards process copyright procedures have to be followed, or translating it into languages other than English. those permissions are perpetual and won't be revoked by the Internet Society or its successors or assigns π
this document and its information are provided "AS IS", and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE π
Acknowledgement π«Ά
funding for the RFC Editor function is currently provided by the Internet Society β¨
π¦ where this page comes from
- ietf: rfc2840 2000-05
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms