Introduction to Operating Systems: Unit IV(b): File System

File Sharing

File System - Introduction to Operating Systems

Multiprogramming and multitasking operating system support the multiple user. These users perform various operations on the files. Files are shared between numbers of users.

File Sharing

• Multiprogramming and multitasking operating system support the multiple user. These users perform various operations on the files. Files are shared between numbers of users. File protection, naming and sharing is issue for file sharing.

• Directory structure may be allows files to be shared by users. Sharing must be done through a protection scheme.

• In single user system, operating system maintains attributes for all files and directory. According to the attributes, operating system allows to operate the files for users. But on the multi-user system, more attributes are needed. An attributes like owner, group and other user are required. These are the access permission for files and directory.

• Access permissions are of three types : Read, Write, and execute.

1. An "r" indicates read permissions for a file or directory.

2. A "w" indicates write permissions.

3. An "x" indicates execution permissions if it is a file and search permissions if it is a directory.

4. Owner is the file owner who created a file. Owner having all rights (read, write and execute).

5. The groups of other user have some limited access permission. Mostly read Juda yer and execute permission.

6. Last categories of user have only executed permission.

• Example In UNIX operating system, file owner can perform all operation on a file. Group member can execute one subset of those operations and other than the group user can execute another subset of operations.

• When a user requests an operation on a file, the user ID can be compared with the owner attribute to determine if the requesting user is the owner of the file. Likewise, the group IDs can be compared.

Remote file systems

• Computer network is used to support remote file system. User can access remote file system. File Transfer Protocol (FTP) and Secure Shell protocol (SSH). Other supporting protocol like distributed file system and world wide web is also used for remote file system.

• SSH is a protocol for secure remote access to a machine over untrusted networks. 

• A client-server model has three components:

1. Service: A service is a software entity that runs on one or more machines. It provides an abstraction of a set of well-defined operations in response to applications' requests.

2. Server: A server is an instance of a particular service running on a single machine.

3. Client: A client is a software entity that exploits services provided by servers.

• Client application program running on the local machine requests a service from another application program, server running on the remote machine. Commonly server provides service to any client, not a particular client.

• Generally, a client application program that requests a service should run only when it is needed. A server program providing service should run all the time, as it does not know when its services will be needed.

• Client-server model allows clients to mount remote file systems from servers. The server is connected with multiple clients and it serve to all clients. Client and user-on-client identification is insecure or complicated.

A client opens the communication channel using IP address of the remote host and the port address of the specific server program running on the host i.e. active open. Request-response may be repeated several times, the process is finite. The client closes the communication channel with an active close.

• A server program opens its door for incoming requests from clients but never initiates a service unless explicitly requested i.e. passive open. A server program is infinite and runs unless a problem occurs.

• Two or more clients can run at the same time on a machine is called concurrency in client. One client must start, run and terminate before another client may start. It is called iterative.

• Network File System (NFS) is standard for UNIX client-server file sharing protocol and Common Internet File System (CIFS) is standard Windows operating system protocol. The NFS client maintains a cache of file and directory attributes. The default settings will not ensure that files created or modified on one system will be visible on another system within a minute of file creation or modification. Network file system is common distributed file sharing system.

• File data modifications might not be visible on any NFS client system other than the one where the modifications are being made until an NFS commit is executed. Most NFS clients will issue a commit as part of closing a file. If multiple systems are reading files that might be modified, file system locking should be used.

• NFS communication protocols lets processes running in different environments share a file system. NFS implements a file system model that is almost identical to a UNIX system.

• Distributed Information Systems such as LDAP, DNS, NIS, and Active Directory implement unified access to information needed for remote computing. It is also known as distributed naming services.

• A name in a distributed system is a string of bits or characters used to refer to an entity. To resolve names a naming system is needed. Names are used to share resources, uniquely identify entities and refer to locations.

• The naming and locating facilities jointly form a naming system that provides the users with an abstraction of an object that hides the details of how and where an object is actually located in the network.

It provides a further level of abstraction when dealing with object replicas. Email and FTP is used for sending information to remote users. But these two protocols will not support true file sharing. Domain Name System (DNS) is used to map the host name to network address translation for the internet. DNS replace the Email and FTP. The DNS is a hierarchical distributed naming system.

• On windows operating system, user name and password is used to create login on the server. Using this authentication method, server will allow and deny access to a requested file system. CIFS is used in conjunction with login name and password.

• Industry is moving towards the new technology. So new protocol called 18. Lightweight Directory Access Protocol (LDAP) is used for secure distributed naming service. LDAP allows user to search for an individual without knowing where they are located.

• An LDAP directory can be distributed among many servers. Each server can have a replicated version of the total directory that is synchronized periodically. An LDAP server is called a Directory System Agent.

• An LDAP server that receives a request from a user takes responsibility for the request, passing it to other DSAS as necessary, but ensuring a single coordinated response for the user.

Failure modes

Reasons for local file system failures:

1. Media fails where file system is stored

2. Corruption of directory structure

3. Power cable and hard disk cable failure

4. Disk controller failure

5. Host adapter failure.

• Apart from these reasons, there are many other reasons for remote file systems. Bandwidth and communication also cause the delay.

Consistency semantics

• Consistency semantics is related with file sharing on the network. When does the changes of the original file is reflected to other users. If there is difference in the oats content of the file, then it creates the problem.

• It deals with the consistency between the views of shared files on a networked system. When one user changes the file, when do other users see the changes of the content?

• Define when modifications of the file data made by a user are observable by other users

1. Unix semantics

2. Session Semantics

3. Immutable shared-files semantics

4. Transaction-like semantics

• Difference operating systems consistency semantics is discussed here :

1. UNIX semantics

• Unix file system (UFS) implements:

a. Writes to an open file visible immediately to other users of the same open file.

b. Sharing file pointer to allow multiple users to read and write concurrently

 • In UNIX semantics, a file is coupled with a single physical image that is associated as special resource. If there is conflict for single then it causes delays in user processes.

 • Centralized system uses UNIX semantics. This is common for single processor systems, but difficult to achieve for distributed file systems.

2. Session semantics

Andrew File System (AFS) implemented complex remote file sharing semantics.

1. Writes to a file by a user is not visible to other users.

2. Once the file is closed, the changes are visible only to new sessions.

• In this semantics, a file can be associated with multiple views. Almost no constraints are imposed on scheduling accesses. No user is delayed in reading or writing their personal copy of the file.

• AFS file systems may be accessible by systems around the world. Access control is maintained through complicated access control lists, which may grant access to the entire world or to specifically named users accessing the files from specifically named remote environments.

• Questions arise about how to handle reads/writes by multiple processes. The file-level transfer model should be used.

3. Immutable-shared-files semantics

• Under this system, when a file is declared as shared by its creator, it becomes immutable and the name cannot be re-used for any other resource. Hence it becomes read-only and shared access is simple.

• Once a file is declared as shared by its creator, it cannot be modified.

• An immutable file has two key properties. Its name may not be reused and its contents may not be altered.


University Question

1. With neat sketch explain about the file sharing.

Introduction to Operating Systems: Unit IV(b): File System : Tag: : File System - Introduction to Operating Systems - File Sharing