The network traffic is captured into the /tmp/ethereal.cap file concurrently with the operation. Note that only traffic between rome and zeus is captured:rome% ls -la /net/zeus/export total 5 dr-xr-xr-x 3 root root 3 Jul 31 22:51 . dr-xr-xr-x 2 root root 2 Jul 31 22:40 .. drwxr-xr-x 3 root other 512 Jul 28 16:48 eng dr-xr-xr-x 1 root root 1 Jul 31 22:51 home rome% ls /net/zeus/export/home /net/zeus/export/home: Permission denied
The explanation given in the snoop section describing each packet applies to the tethereal capture file as well. The main difference is that listing the XID next to the operation type is less intuitive than expanding the arguments to the call as performed by snoop. We suspect this will be addressed in the future. You can see that the reason for failure is not obvious by just looking at this output format. Fortunately, tethereal has extensive filtering capabilities and we can request all mount operations that failed. Using the mount.status filter, we determine that packet 23 returned a failure. We can then print the protocol tree for packet 23 alone and verify that indeed it failed with ERR_ACCESS:rome# tethereal -w /tmp/ethereal.cap host rome and host zeus 46 ^C rome# tethereal -r /tmp/ethereal.cap 1 0.000000 rome -> zeus PORTMAP V2 GETPORT Call XID 0x398fd3ea 2 0.003138 zeus -> rome PORTMAP V2 GETPORT Reply XID 0x398fd3ea 3 0.003328 rome -> zeus NFS V3 NULL Call XID 0x398fd3eb 4 0.004613 zeus -> rome NFS V3 NULL Reply XID 0x398fd3eb 5 0.005823 rome -> zeus PORTMAP V2 GETPORT Call XID 0x398fca35 6 0.008871 zeus -> rome PORTMAP V2 GETPORT Reply XID 0x398fca35 7 0.009823 rome -> zeus TCP 49699 > 33168 [SYN] Seq=1251769928 Ack=0 Win=24820 Len=0 8 0.011067 zeus -> rome TCP 33168 > 49699 [SYN, ACK] Seq=3939269366 Ack=1251769929 Win=24820 Len=0 9 0.011100 rome -> zeus TCP 49699 > 33168 [ACK] Seq=1251769929 Ack=3939269367 Win=24820 Len=0 10 0.011339 rome -> zeus MOUNT V1 EXPORT Call XID 0x398f20d9 11 0.012102 zeus -> rome TCP 33168 > 49699 [ACK] Seq=3939269367 Ack=1251769973 Win=24776 Len=0 12 0.018302 zeus -> rome MOUNT V1 EXPORT Reply XID 0x398f20d9 13 0.018332 rome -> zeus TCP 49699 > 33168 [ACK] Seq=1251769973 Ack=3939269463 Win=24820 Len=0 14 0.018588 rome -> zeus TCP 49699 > 33168 [FIN, ACK] Seq=1251769973 Ack=3939269463 Win=24820 Len=0 15 0.019245 zeus -> rome TCP 33168 > 49699 [ACK] Seq=3939269463 Ack=1251769974 Win=24820 Len=0 16 0.020104 zeus -> rome TCP 33168 > 49699 [FIN, ACK] Seq=3939269463 Ack=1251769974 Win=24820 Len=0 17 0.020143 rome -> zeus TCP 49699 > 33168 [ACK] Seq=1251769974 Ack=3939269464 Win=24820 Len=0 18 0.020661 rome -> zeus PORTMAP V2 GETPORT Call XID 0x398f0440 19 0.024550 zeus -> rome PORTMAP V2 GETPORT Reply XID 0x398f0440 20 0.024731 rome -> zeus MOUNT V3 NULL Call XID 0x398f0441 21 0.026323 zeus -> rome MOUNT V3 NULL Reply XID 0x398f0441 22 0.026881 rome -> zeus MOUNT V3 MNT Call XID 0x398f0442 23 0.179757 zeus -> rome MOUNT V3 MNT Reply XID 0x398f0442
For simplicity, only the RPC and Mount portions of the packet are shown. The RPC header decodes the transaction ID, message type indicating this to be a reply, program, and version number as well as the procedure invoked. The credential verifier is also decoded indicating that the server used no verifier in its reply (since the call did not specify it to begin with). A nice feature of snoop, that tethereal does not yet have, is the ability to indicate the frame for which this is a reply. As expected, the status field of the mount service reply reports an error. Packet 12 contains the results of the export information request:rome# tethereal -r /tmp/ethereal.cap -R "mount.status != 0" 23 0.179757 zeus -> rome MOUNT V3 MNT Reply XID 0x398f0442 rome# tethereal -r /tmp/ethereal.cap -V -R "frame.number == 23" ... Remote Procedure Call XID: 0x398f0442 (965674050) Message Type: Reply (1) Program: MOUNT (100005) Program Version: 3 Procedure: MNT (1) Reply State: accepted (0) Verifier Flavor: AUTH_NULL (0) Length: 0 Accept State: RPC executed successfully (0) Mount Service Program Version: 3 Procedure: MNT (1) Status: ERR_ACCESS (13)
The Data field of the Mount packet shows a hex dump of the export list. The interpreted text value is in the far right column. We can see how the export list is encoded into the packet as a set of exported directories , each followed by the list of hosts (or group of hosts) that they give access to.rome# tethereal -r /tmp/ethereal.cap -V -R "frame.number == 12" ... Remote Procedure Call Last Fragment: Yes Fragment Length: 92 XID: 0x398f20d9 (965681369) Message Type: Reply (1) Program: MOUNT (100005) Program Version: 1 Procedure: EXPORT (5) Reply State: accepted (0) Verifier Flavor: AUTH_NULL (0) Length: 0 Accept State: RPC executed successfully (0) Mount Service Program Version: 1 Procedure: EXPORT (5) Data (68 bytes) 0 0000 0001 0000 000b 2f65 7870 6f72 742f ......../export/ 10 656e 6700 0000 0000 0000 0001 0000 000c eng............. 20 2f65 7870 6f72 742f 686f 6d65 0000 0001 /export/home.... 30 0000 0006 7665 726f 6e61 0000 0000 0000 ....verona...... 40 0000 0000 ....
# tethereal -R "nfs and ip.addr == rome"
# tethereal -R "nfs.status != 0"
# tethereal -R "rpc"
# tethereal -R "rpc.xid == 0x398f0441"
# tethereal -R "tcp.port == 111 or udp.port == 111"
Use rpc.program == 100021 to capture NLM traffic. Useful for tracking lock manager-related traffic. The following example displays all NFS Version 3 Network Lock Manager traffic between hosts zeus and rome. Note that NLM v4 is used for NFS Version 3:# tethereal -R "rpc.program == 100005 and ip.addr == zeus \ and ip.addr == rome"
# tethereal -R "rpc.program == 100021 and rpc.programversion == 4 \ and ip.addr == rome and ip.addr == zeus"
The NFSWATCH log shows the distribution of NFS READ, NFS WRITE, NFS MOUNT, NIS, and RPC AUTHORIZATION packets among others. The NFS counters section indicates the total number NFS operations per filesystem exported (one in this case) during the interval. The operation distribution denoted by (0/0/5/0/12/0/154/0/335/2/0/0/0/0/3/1/0/0) indicates that the majority of the operations occurred in the middle of the interval. The packet counters and nfs procs indicate that there were close to twice as many writes as reads. The low lookup count leads us to believe that most writes occurred to the same file.# NFSwatch log file # Packets from: all hosts # Packets to: zeus # # begin # Date: Tue Aug 1 16:31:22 2000 Cycle Time: 5 Elapsed Time: # # total packets network to host dropped # Interval Packets: 2371 2371 0 Total Packets: 2371 2371 0 # # packet counters int pct total # ND Read: 0 0% 0 ND Write: 0 0% 0 NFS Read: 166 7% 166 NFS Write: 346 15% 346 NFS Mount: 0 0% 0 YP/NIS/NIS+: 0 0% 0 RPC Authorization: 0 0% 0 Other RPC Packets: 1844 78% 1844 TCP Packets: 2 0% 2 UDP Packets: 2358 99% 2358 ICMP Packets: 1 0% 1 Routing Control: 2 0% 2 Address Resolution: 10 0% 10 Reverse Addr Resol: 0 0% 0 Ethernet/FDDI Bdcst: 13 1% 13 Other Packets: 0 0% 0 # # nfs counters int pct total # /export/home: 512 100% 512 (0/0/5/0/12/0/154/0/ 335/2/0/0/0/0/3/1/0/0) # # file counters int pct total # # # nfs procs # Procedure int pct total completed ave.resp var.resp max.resp CREATE 2 0% 2 GETATTR 0 0% 0 GETROOT 0 0% 0 LINK 0 0% 0 LOOKUP 12 2% 12 MKDIR 3 1% 3 NULLPROC 0 0% 0 READ 154 30% 154 READDIR 0 0% 0 READLINK 0 0% 0 REMOVE 0 0% 0 RENAME 0 0% 0 RMDIR 1 0% 1 SETATTR 5 1% 5 STATFS 0 0% 0 SYMLINK 0 0% 0 WCACHE 0 0% 0 WRITE 335 65% 335
[34]According to Leendert's web page, the tool has not been updated in recent years, although he still plans to get to it at some point.
14.3. snoop | 14.5. Version 2 and Version 3 differences |
Copyright © 2002 O'Reilly & Associates. All rights reserved.