tcp/ip详解(26)

来源:互联网 发布:linux 查看有几个用户 编辑:程序博客网 时间:2024/06/05 11:10
Rlogin默认端口号是513。
Rlogin的客户进程和服务器进程使用一个TCP连接。当普通的TCP连接建立完毕之后,客户进程和服务进程之间将发生下面所述的动作。
1. 客户进程给服务器进程发送4个字符串:(a)一个字节的0;(b)用户登录进客户进程主机的登录名,以一个字节的0结束;(c)登录服务器进程端主机的登录名,以一个字节的0结束;(d)用户终端类型名,紧跟一个正斜杠"/",然后是终端速率,以一个字节的0结束。
2. 服务器进程返回一个字节的0。
3. 服务器进程可以选择是否要求用户输入口令。
4. 服务器进程通常要给客户进程发送请求,询问终端的窗口大小。


Initially, the client begins operations in "cooked"(as opposed to "raw") mode. In this mode, the START and STOP(usually ASCII DC1, DC3) characters are intercepted and interpreted by the client to start and stop output from the remote server to the local terminal, whereas all other characters are transmitted to the remote host as they are received.


In "raw" mode, the START and STOP characters are not processed locally, but are sent as any other character to the remote server. The server thus determines the semantics of the START and STOP characters when in "raw" mode; they may be used for flow control or have quite different meanings independent of their ordinary usage on the client.


服务器给客户端发送的命令:
0x02 清仓输出
0x10 客户停止执行流量控制
0x20 客户继续进行流量控制处理
0x80 将当前窗口大小发送给服务器,并在今后当窗口大小变化时通知服务器


The remote server indicates to the client that it can accept window size change information by requesting a window size message just after connection establishment and user identification exchange. The client should reply to this request with the current window size.
FF FF s s rr cc xp yp




NVT是虚拟设备,连接的双方,都必须把它们的物理终端和NVT进行相互转换。同时,不管服务器进程的终端是什么类型,操作系统必须能够把NVT格式转换为终端所能够支持的格式。


NVT ASCII
行结束符以两个字符CR(回车)和紧接着的LF(换行)这样的序列表示。以\r\n来表示。单独的一个CR也是以两个字符序列来表示,它们是CR和紧接着的NULL,以\r\0表示。


Telnet通信的两个方向都采用带内信令方式。字节0xff(十进制的255)叫做IAC(Interpret as command)。该字节后面的一个字节才是命令。


0 0