[comp.unix.wizards] specifing a port when using telnet

rgoguen@MIKEY.BBN.COM (Robert J Goguen) (06/02/87)

Folks
	I'm sorry if this has been asked before, but ......

I'm running 4.3 bsd and why is it whenever you use a port number in the telnet 
command (I.e telnet <host> <port number>) 
it turns off echoing the characters back at you until you hit the CR? I looked 
at the source and it turns out that when using telnet, anytime you have 3 
arguments it does this. Even if I specify port 23, which is the telnetd port,
it still turns off the echoing.
	Why is this? Is it because the designers figured if the port number was
added, this is not a human running telnet but a program and there's no need to 
echoing things back. 

	I can't find any switch to enable the echoing. Now I could go ahead
and change the telnet program but next version I'm stuck with the same problem.
		Any thoughts or suggestions are welcome.
Bob Goguen

hedrick@topaz.rutgers.edu (Charles Hedrick) (06/02/87)

Telnet is an application protocol defined above TCP.  In addition to
a normal TCP stream, you get other features, such as negotiations
that let you decide whether to be full or half duplex, etc.  These
negotiations are implemented using sequences that start with IAC
(which I believe is 255).  Suppose you decide you want to test your
mail server.  The natural thing to do is
  telnet yourhost 25 25 being the SMTP port.  Now the problem is that
SMTP will not recognize telnet negotiations, since those are peculiar
to the telnet application protocol.  The implementors of telnet
apparently believed that when you specify a port number, you are
probably going to be talking to something other than a telnet server,
and so they should not supply negotiations.  Of course if you specify
the telnet port number explicitly, you get odd results, because your
telnet has its telnet protocol processing disabled.  This is sort of a
bug.  I mean, presumably the program telnet should always implement
the telnet protocol, right?  But I guess it seemed easier to do this
than to write a separate program, presumably to be called not-telnet,
or to provide an option in telnet to make it not telnet.  It does what
you want 99% of the time.

(Actually, the copy of telnet that we have responds to telnet
negotiations even when in not-telnet mode.  It just doesn't initiate
any.)