home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / protocol / tcpip / 5145 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  3.1 KB

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