TCP IP Illustrated

Nfs sun7aa6 reply ok 96 sun7aa7 bsdinfs 116 lookup

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sun % cat /nfs/bsdi/usr/rstevens/hello.c copy file to terminal file:///D|/Documents%20and%20Settings/bigini/Docu...homenet2run/tcpip/tcp-ip-illustrated/nfs_netw.htm (14 of 23) [12/09/2001 14.47.56] Chapter 29. NFS: Network File System main () { printf ("hello, world\n"); } On the host sun (the NFS client) the filesystem /nfs/bsdi/usr is really the /usr file-system on the host bsdi (the NFS server), as shown in Figure 29.6. The kernel on sun detects this when cat opens the file, and uses NFS to access the file. Figure 29.7 shows the tcpdump output. 1 2 3 4 5 6 7 8 9 10 0.0 0.003587 (0.0036) 0.005390 (0.0018) 0.009570 (0.0042) 0.011413 (0.0018) 0.015512 (0.0041) 0.018843 (0.0033) 0.022377 (0.0035) 0.027621 (0.0052) 0.032170 (0.0045) sun.7aa6 > bsdi. nfs: 104 getattr bsdi.nfs > sun.7aa6: reply ok 96 sun.7aa7 > bsdi.nfs: 116 lookup "rstevens" bsdi.nfs > sun.7aa7: reply ok 128 sun.7aa8 > bsdi.nfs: 116 lookup "hello.c" bsdi.nfs > sun.7aa8: reply ok 128 sun.7aa9 > bsdi.nfs: 104 getattr bsdi.nfs > sun.7aa9: reply ok 96 sun.7aaa > bsdi.nfs: 116 read 1024 bytes @ 0 bsdi.nfs > sun.7aaa: reply ok 140 Figure 29.7 NFS operations to read a file. When tcpdump decodes an NFS request or reply, it prints the XID field for the client, instead of the port number. The XID field in lines 1 and 2 is 0x7aa6. The filename /nfs/bsdi/usr/rstevens/hello.c is processed by the open function in the client kernel one element at a time. When it reaches /nfs/bsdi/usr it detects that this is a mount point to an NFS mounted filesystem. In line 1 the client calls the GETATTR procedure to fetch the attributes of the server's file:///D|/Documents%20and%20Settings/bigini/Docu...homenet2run/tcpip/tcp-ip-illustrated/nfs_netw.htm (15 of 23) [12/09/2001 14.47.56] Chapter 29. NFS: Network File System directory that the client has mounted (/usr). This RPC request contains 104 bytes of data, exclusive of the IP and UDP headers. The reply in line 2 has a return value of OK and contains 96 bytes of data,...
View Full Document

Ask a homework question - tutors are online