NFS - Network File System

less than 1 minute read

General idea

  • using RPC(based on UDP)
  • no local disk
  • stateless protocol
  • using file handlers <volume ID, inode #, gen #>

Client & Server

arch

Read a file

read1

read2

read3

Server

  • error handling: write buffer(return success after writing into disk)

if return success when after writing into memory, see the graph below, which is not a correct state

memory disk potential result
A X X
B Y B
C Z Z

if return success when after writing into disk, see the graph below, which is a correct state

memory disk potential result
A X X
B Y B
C Z C

Client side cache

There are two problems:

  • Update Visibility

server doesn’t have the latest version

Solution: flush on file descriptor close

  • Stale Cache

client doesn’t have the latest version

Solution: recheck before using cache