CS 111: Scribe Notes for 12/02/2008

by Sahil Amoli, Max Chang, Sheng Lu, Sharon Tang

NFS protocol


For Example:

*Can be found in Table 4-1, page 4-46*

NFS file handle – unique ID for the file in that NFS server


Important Design Criteria of original NFS


Caching could help performance but at the expense of losing simplicity

Problems with NFS

  1. Locks on files
    • fcntl() advisory locks
      • doesn't work in original NFS v3
      • NFS v4
        • “statefull”
        • locks
  2. Packet loss
    • Client to Server
      • if client issues a packet à times out à RETRY
        • NFS method issues at least one retry
      • Client issues REMOVE à server removes à sends packet back à packet loss
        • Would the retry be appropriate? NO, file already removed
        • Workaround: Item Potency Cache
          • server maintains cache of recent requests allowing a duplicate response to be sent in the case of receiving a duplicate request
          • Not truly stateless

  1. Stale file handle problem
    • Scenario
      1. Client 1 opens “f”
      2. Receives file handle – 963 (usually a much larger number)
      3. Client 2 removes “f”
      4. Client 1 performs read of 963
      5. errno == ESTALE (obtained because server does not know open files of each client)

    • Hack: client kernel, when told to unlink an open file, instead renames it to “.nfs196”
      • Same file handle, although under different name
      • On last close, client kernel unlinks “.nfs196”
      • Issues?
        • Only works if same machine performs operations on the same file (client 1 = client 2)
        • Client crash before final unlink will result in file with cryptic name

    • In Unix
      • No clean up is done until last file descriptor is closed
      • NFS is “stateless” and does not know what is open, so it removes when asked

NFS model



NFS does not have write-to-read consistency


NFS Security

·         Evil client host that lets users become “root”, or any other user

§  You can look at any file you like (Quick hack: “root” = “nobody” over wire)

+ Simple client authentication:

·         based on IP address – ideal for local networks

·         We can also use SSH, IPSec, and hardware assisted security while losing performance

Users in NFS are modeled by UIDs (user ID)

NFS

 If user “Eggert” has two different UIDs on system A and B, the NFS will recognize Eggert-A and Eggert-B as two different users. One way to solve this issue is by using an authentication system, such as Kerberos.

 

Security

·         Real world security - defend against force & fraud attacks

o   Main forms of attacks:

                                                                                - against privacy

                                                                                - against integrity

                                                                                - against service (commonly seen as DoS)

·         General goals:

·         Allow authorized access (a positive goal)

·         Disallow unauthorized access (a negative goal)

o   Harder to test – attackers never file bug reports

 

·         Threat modeling + classification

o   Insiders

o   Social engineering

o   Network attacks:

- virus, drive-by downloads (phishing)

- DoS (Denial of Service)

- Buffer overruns

o   Device attacks:

- USB virus

General mechanisms for any security scheme:

Authentication

Cryptographic building blocks for authentication - hash functions

Symmetric encryption

Bottom Line: encryption and decryption must be hard if we don’t have the required information