FTP有自己的特殊性,在IPVS中进行了特殊的处理。在这一节中把关于FTP的处理择出来,缕清楚。
FTP有两种模式 主动和被动,主动和被动是针对服务器说的,指的是对于数据连接,服务器主动连接到客户端,还是服务器被动接收客户端的连接。
主动模式(active)是 client主动通告服务器它所开启的数据端口,服务器用20端口来连接client的数据端口。client通告服务器端口的消息有一个固定的格式,"PORT xxx,xxx,xxx,xxx,ppp,ppp\n" 这个数据包,
被动模式(passive)是 服务器 告诉客户端它监听的数据端口,客户端主动连接到服务器。"227 Entering Passive Mode (xxx,xxx,xxx,xxx,ppp,ppp)".xxx,xxx,xxx,xxx is the server address, ppp,ppp is the server port number.
先分析主动模式的处理。
To setup ftp with LVS, you schedule only port 21 for forwarding. While the realserver is listening on port 21, it calls the client from port 20 (i.e. it's not listening on port 20) rather than the client calling the realserver (through the director). You do not add entries for port 20 with ipvsadm. Port 20 is handled by persistence for LVS-DR and LVS-Tun. For active ftp with LVS-NAT, you don't need the ipvs ftp helper module (the ftp helper module is only needed for passive ftp, Wensong 17 Sep 2002) (however see ftp helper module.)

本文探讨了IPVS中对FTP特殊处理的细节,通过netstat命令展示了FTP文件传输后的客户端和真实服务器状态。在使用fwmark后,与仅使用persistent的情况在ip_vs_service_get和ip_vs_sched_persist中的实现有所不同,特别是对于FTP数据连接的处理。注释指出,基于fwmark的持久服务在此处处理,而port zero模板则用于另一种情况。fwmark被认为是更优选的方法,但未详细说明原因。

800

被折叠的 条评论
为什么被折叠?



