COMMON INTERNET FILE SYSTEM PROXY CS739 PROJECT REPORT ANURAG GUPTA DONGQIAO LI anurag dongqiao cs wisc edu Computer Sciences Department University of Wisconsin Madison Madison 53706 WI May 15 1999 1 Introduction 1 1 Server Message Block SMB Server Message Block SMB is a protocol for sharing files printers serial ports and communications abstractions such as named pipes and mail slots between computers It is a client server request response protocol except for the case when the server sends an asynchronous lock break request to the client if the client requested a lock on a resource Clients can connect to servers using TCP IP NetBEUI or IPX SPX Once they have established a connection clients can then send commands SMBs to the server that allow them to access shares open files read and write files and other file system activities However in the case of SMB these things are done over the network 1 2 Common Internet File System The Common Internet File System CIFS 1 is a file sharing protocol that is the Microsoft version of a distributed system It is intended to provide an open cross platform mechanism for client systems to request services e g file and printer from server systems over a network potentially the Internet It is based on the standard Server Message Block SMB protocol widely in use by personal computers and workstations running a wide variety of operating systems The CIFS protocol supports features like file access file and record locking safe caching readahead and write behind file change notification protocol version negotiation extended attributes distributed replicated virtual volumes server name resolution independence batched requests and Unicode file names CIFS is transport independent It assumes a reliable connection oriented message stream transport and makes no higher level attempts to ensure sequenced delivery of messages between the client and server It also assumes that there exists some mechanism to detect failures of either the client or server and to deliver such an indication to the client or server so they can clean up their state For example CIFS 1 can be run over NETBIOS over TCP or just over TCP If a CIFS server receives a transport establishment request from a client that it is already conversing with it terminates all other transport connections with that client The CIFS protocol supports the following SMB protocols PC NETWORK PROGRAM 1 0 LANMAN 1 0 LM1 2X002 NT LM 0 12 1 3 Samba Samba is a popular implementation of CIFS The Samba software suite 2 is a collection of programs that implement the Server Message Block protocol for UNIX systems It is an open source software suite that provides seamless file and print services to SMB CIFS clients Samba is freely available under the GNU General Public License It is a widely adopted solution to integrate Microsoft IBM style desktop machines or Microsoft etc servers with Unix or VMS etc servers Samba provides the following features SMB server to provide Windows NT and LAN Manager style file and print services to SMB clients such as Windows 95 Warp Server smbfs and others NetBIOS nameserver which among other things gives browsing support Samba can act as the master browser on the LAN ftp like SMB client to access PC resources disks and printers from UNIX Netware and other operating systems 2 a tar extension to the client for backing up PC s limited command line tool that supports some of the NT administrative functionality which can be used on Samba NT workstation and NT server 3 Project Overview 3 1 Objective The objective of the project was to design and implement a Common Internet File System Proxy for multiple CIFS clients and a CIFS server with caching and locking support 3 2 Design Approaches 3 2 1 Event Driven Multi threaded Proxy Model In our proxy implementation there is one thread the dispatcher listening for client requests on a port and one thread the responder listening to responses from the server Each time a new request from a client comes the dispatcher creates a new thread This newly created thread is in charge of servicing the client request If a request of a file is made which is in the proxy cache the proxy starts serving the request If the proxy does not have a cached copy of the file it forwards the request to the server and caches the file as it is being sent by the server In this way we guarantee that no client is waiting while the proxy is servicing requests from other clients making the proxy more scalable Between the proxy and the CIFS server there is only one SMB connection Thus all requests from different clients need to be multiplexed by the proxy to the same proxy server connection and all responses from the server intended for different clients must be de multiplexed at the proxy We achieved this by using the Multiplex Id mid field in the common SMB message header Each time an Open request from a client comes the dispatcher maps the clientfd mid pair into a new proxy mid which is 3 unique among all clients connected to the proxy and the proxy saves this mapping in an in memory mapping table The dispatcher also sets the mid field in the SMB message header and all subsequent SMB messages to this proxy mid before it forwards the message to the server When a SMB message comes in from the server the responder looks up the client socket descriptor and client mid in its mapping table using the proxy mid from the message header De multiplexing is achieved when the responder resets the mid field to client mid and it then forwards the message to the corresponding client This way the client sees the same mid as it had sent Our proxy is an Application Level Proxy which means all the clients are proxy aware and the proxy server knows the address of the CIFS server The client proxy server setup is shown Figure 1 Client Proxy Server Client Multiplexing Client Disk CIFS Clients CIFS Proxy Figure 1 The Big Picture 4 CIFS Server 3 2 2 Caching Proxy caching has been proven to be an effective method for reducing network traffic and improving the response time for clients for requests to the server 3 By caching common client requests for files on the proxy a big saving can be achieved in network traffic and the response time to the client improves significantly as the resource is brought closer to the client In our implementation we took advantage of a disk cache on the proxy while using the Clock algorithm for cache replacement Cache coherence is maintained by using the last write stamp sent
View Full Document
Unlocking...