Introduction

  • The network file system(NFS) is a client/service application that provides shared file storage for clients across a network.
  • An NFS client grafts a remote file system onto the client’s local file system name space and makes it behave like a local UNIX file system.
  • Multiple clients can mount the same remote file system so that users can share files.

Goals

  • The design of NFS had four major goals.

    • It should work with existing applications, which means NFS ideally should provide the same semantics as a local UNIX file system.
    • It should be easy to retrofit into existing UNIX systems.
    • The client should be implementable in other operating systems

      such as Microsoft’s DOS, so that a user on a personal computer can have access to the files on a n NFS server.
    • It should be efficient enough to be tolerable to users.

NFS Implementation

Three main layers

  • System call layer:Handles calls like open, read and close.
  • Virtual File System Layer
    • Maintains table with one entry (v-node) for each open file.
    • v-nodes indicate if file is local or remote.
      • If remote it has enough info to access them.
      • For local files, FS and i-node are recorded.
  • NFS Service Layer

    • This lowest layer implements the NFS protocol.

NFS Client/Server Structure

  • Client programs have file descriptors, current directory, &c.
  • When client programs make system calls.
    • NFS v-node implementation sends RPC to server.
    • Kernel half of that program waits for reply.
    • So we can have one outstanding RPC per program.
  • Server kernel has NFS threads, waiting for incoming RPCs.
    • NFS thread acts a lot like user program making system call.
    • Find vnode in server corresponding to client’s vnode.
    • Call that vnode’s relevant method.

The NFS File Handle

  • A mounter sends a remote procedure call to the file server host and asks for a file handle.
  • A file handle is a structured name,containing a file system identfier, an inode number, and a generation number-which it uses to locate the file.
  • Why use file handles to name files and directories instead of path names.
    • When program 1 invokes READ, program 1 would read “dir2/f” according to the UNIX specification.
    • Unfortunately, if the NFS client were to use path names, then the READ call would result in a remote procedure for the file “dir1/f”.
    • To avoid this problem, NFS clients name files and directories using file handles.

The NFS remote procedure calls



- The NFS remote procedure calls are designed so that the server can be stateless, that is the server doesn’t need to maintain any other state than the on-disk files.

Consistency

  • Close-to-open consistency

    • If I write() and then close(), then you open() and read(), you see my data, otherwise you may see stale data.
    • When a user program opens a file, the clients check with the server if the client has the most recent version of the file in its cache.
      • If so, the client uses the version in its cache.
      • If not, it removes its version from its cache.
    • The client implements READ by returning the data from the cache, after fetching the block from the server if it is not in the cache.
    • The client implements WRITE by modifying its local cached version, without incurring the overhead of remote procedure calls.
    • When the user program invokes CLOSE on the file, CLOSE will send any modifications to that file to the server and wait until the server acknowledges that the modifications have been received.

文章下载

Design and Implementation of the Sun Network File System的更多相关文章

  1. NFS(Network File System)服务配置和使用

    Sun公司开发NFS (Network File System)之初就是为了在不同linux/Unix系统之间共享文件或者文件夹.可以在本地通过网络挂载远程主机的共享文件,和远程主机交互.NFS共享存 ...

  2. CentOS7.5搭建NFS(Network File System)

    NFS(Network File System)即网络文件系统,是由Sun公司开发的一种通过网络方式共享文件系统的通用共享解决方案.可以将远程Linux系统上的文件共享资源挂载到本地主机(Linux客 ...

  3. NFS - Network File System网络文件系统

    NFS(Network File System/网络文件系统): 设置Linux系统之间的文件共享(Linux与Windows中间文件共享采用SAMBA服务): NFS只是一种文件系统,本身没有传输功 ...

  4. Centos7——NFS(Network File System)服务

    NFS(Network File System)即网络文件系统,允许计算机之间通过网络共享资源:在NFS客户端即可NFS服务端所共享的目录挂载到本地,此时即可像读写本地目录一样读写远程计算机的目录与文 ...

  5. Network File System

    Network File System 2014-12-31 #system 接着上一篇博客Distributed Systems 分布式系统来扯淡,之前的博客一再在写文件系统,这次继续,只不过是分布 ...

  6. 【Azure 存储服务】如何把开启NFS 3.0协议的Azure Blob挂载在Linux VM中呢?(NFS: Network File System 网络文件系统)

    问题描述 如何把开启NFS协议的Azure Blob挂载到Linux虚拟机中呢? [答案]:可以使用 NFS 3.0 协议从基于 Linux 的 Azure 虚拟机 (VM) 或在本地运行的 Linu ...

  7. NFS(Network File System)即网络文件系统 (转)

    第1章 NFS介绍 1.1 NFS服务内容的概述 □ RPC服务知识概念介绍说明,以及RPC服务存在价值(必须理解掌握) □ NFS服务工作原理讲解(必须理解掌握) □ NFS共享文件系统使用原理讲解 ...

  8. nfs 是Network File System 网络文件系统

    NFS的基本原刚是容许不同的客户端及服务通过一组PRC分享相同的文件系统,它是独立于操作系统,容许不同硬件及操作系统的系统共同进行文件的分享.NFS在文件传送过程中依赖于RPC协议.远程过程调用Rem ...

  9. CentOS7 配置NFS(Network File System)及其使用

    1.       服务端配置 1.1.    安装NFS yum -y install nfs* 1.2.    查看是否安装了NFS与RPCBIND rpm -qa | grep nfs rpm - ...

随机推荐

  1. metaWeblog Test

     #include "stdio.h" int main(int argc ,char **argv) { printf("argc = %d \n",arg ...

  2. net.sf.json.JSONException: There is a cycle in the hierarchy!的解决办法

    使用Hibernate manytoone属性关联主表的时候,如果使用JSONArray把pojo对象转换成json对象时,很容易出现循环的异常.解决的办法就是, 在转换json对象时忽略manyto ...

  3. hdu1282回文数猜想

    Problem Description 一个正整数,如果从左向右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数.任取一个正整数,如果不是回文数,将该数与他的倒序数相加,若其 ...

  4. Quick Cocos (2.2.5plus)CoinFlip解析(MenuScene display AdBar二次封装)

    转载自:http://cn.cocos2d-x.org/tutorial/show?id=1621 从Samples中找到CoinFlip文件夹,复制其中的 res 和 script 文件夹覆盖新建工 ...

  5. Eclipse常用快捷键汇总

    经常使用eclipse进行开发,不掌握快捷键步行啊,在此整理了一些快捷键,大家要灵活运用啊... (注:红色标出来的是经常使用到的快捷键,磨刀不误砍柴工啊...) Ctrl+1 快速修复(最经典的快捷 ...

  6. Android如何一进入一个activity就唤醒键盘

    方法总结: 在AndroidManife.xml中对应的的Activity配置中加入以下配置项: android:windowSoftInputMode="stateVisible|adju ...

  7. JS判断是不是手机浏览器浏览网站的网页,并自动跳转

    现在智能手机上网越来越普遍了,为了获得用户体验增加网站流量,你有必要为你的网站增加一个访问端设备的判断功能,若发现是手机用户访问,则直接跳转到手机站,通过百度的APP site,很容易就可实现这功能. ...

  8. EXCEL 2010学习笔记 —— 数据透视表

    今天整理一下EXCEL2010 数据透视表的课程笔记,数据透视表可以对多组数据进行统计和整理,是一种基本的数据可视化工具. 记录6个方面的总结: 1.创建数据透视表 2.更改数据透视表的汇总方式 3. ...

  9. $q -- AngularJS中的服务(理解)

      描述 译者注: 看到了一篇非常好的文章,如果你有兴趣,可以查看: Promises与Javascript异步编程 , 里面对Promises规范和使用情景,好处讲的非常好透彻,个人觉得简单易懂. ...

  10. 学习 opencv---(6)玩转opencv源代码:生成opencv 工程解决方案与opencv 源码编译

    在这篇中,我们探讨如何通过已安装的opencv选择不同的编译器类型,生成高度还原的OpenCV开发时的解决方案工程文件,欣赏OpenCV新版本中总计 六十六多万行的精妙源代码.我们可以对其源代码进行再 ...