home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!wupost!micro-heart-of-gold.mit.edu!eddie.mit.edu!minya!jc
- From: jc@minya.UUCP (John Chambers)
- Newsgroups: comp.protocols.tcp-ip
- Subject: Is telnet protocol documented?
- Keywords: telnet 23
- Message-ID: <1391@minya.UUCP>
- Date: 12 Nov 92 19:13:00 GMT
- Lines: 56
-
- Well, it wasn't as easy as I thought it might be, so I thought I'd ask
- the experts...
-
- Does anyone know (or know of documentation on) how a program might
- talk to telnetd and make a connection?
-
- What the project involves is: I have a chunk of code that was written
- to call out via a serial port, modem, and whatever, to make a link to
- another computer, login, start up a remote daemon, and so on. Sorta
- like your usual uucp or slip daemons, y'know. Someone was asking "How
- hard would it be to make this software talk across TCP?" I opined as
- how it shouldn't be too hard; I'd just find all the code that dealt
- with a serial port, and write some parallel code to do TCP instead.
- Rather than open("/dev/%s",...), I'd have it call gethostbyname("%s"),
- and similar stuff.
-
- It wasn't too hard to do this (maybe a day's work), and it all worked
- fine, except that when the connect() returned success and the program
- wrote something down the line, instead of a "login:" that I get when I
- type "telnet %s", it gets utter garbage. The garbage is quite
- consistent: It consists of the 3 bytes FF FD 18, and then it gets
- nothing else. Eventually the connection goes away, as if telnetd had
- given up in disgust or something.
-
- When I put my own tcpserver on the other end (which just accepts
- connections and echoes back whatever it receives), then my client
- program gets just what I expect. (If I tell the client to send "Hello
- there!\r", tcpserver gets back exactly those bytes, it's log shows
- that it got them and echoed them, and the client reports getting
- them.) This is proof that it is making the connection correctly, and
- is able to exchange messages sanely with whatever is at the other end.
-
- But if it's telnetd at the other end, my client just gets the FF FD
- 18, and the link goes nowhere. It seems obvious that telnetd is doing
- some sort of binary handshake on startup. But I haven't found any
- description of what it might be in TFM, or in the few RFCs that I have
- copies of.
-
- Now I suppose I could just write my own verion of telnetd that does
- things in a way that I understand. But telnetd is already there as
- off-the-shelf (or is it off-the-wall? ;-) software on zillions of
- machines, so why reinvent the wheel, as they say?
-
- Any idea how I might get documentation of telnetd's protocol? Is there
- an RFC on it that someone can email me? Is there some PD code that
- does the protocol? Or is it some proprietary stuff that isn't for the
- likes of me?
-
- [Meanwhile, maybe I'll just barge ahead with making my own daemon, for
- cases where telnetd isn't there or can't be made sane or ... ;-]
-
- --
- All opinions Copyright (c) 1992 by John Chambers. Inquire for licensing at:
- 1-617-647-1813 ...!{bu.edu,harvard.edu,eddie.mit.edu,ruby.ora.com}!minya!jc
- --
- Pensu tutmonde; agu loke.
-