![NFS 对话期间出现奇怪的传输层端口号](https://linux22.com/image/1469377/NFS%20%E5%AF%B9%E8%AF%9D%E6%9C%9F%E9%97%B4%E5%87%BA%E7%8E%B0%E5%A5%87%E6%80%AA%E7%9A%84%E4%BC%A0%E8%BE%93%E5%B1%82%E7%AB%AF%E5%8F%A3%E5%8F%B7.png)
我使用 autofs 来挂载 nfs 共享,autofses 部分运行良好,我可以访问叶文件夹,但是当我尝试访问该文件夹时,会发生以下数据包交换,并且我的 shell 堆栈会丢失
[gm-web01]/net/arkive03/mnt/mfs> cd mfsbackup -bash: cd: mfsbackup: 没有此文件或目录大约一分钟后出现消息。看看最后两行,端口号怎么会高于正常的传输层范围?
[arkive03]~> tcpdump -i em1 -nn 主机 10.24.20.163 tcpdump:抑制详细输出,使用 -v 或 -vv 进行完整协议解码 监听 em1,链路类型 EN10MB(以太网),捕获大小 65535 字节 11:33:48.598351 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [S],序列 2431214407,win 29200,选项 [mss 1460,sackOK,TS val 77231839 ecr 0,nop,wscale 7],长度 0 11:33:48.598381 IP 10.44.20.137.111 > 10.24.20.163.55219:标志 [S.],seq 1732090298,ack 2431214408,win 28960,选项 [mss 1460,sackOK,TS val 2997710933 ecr 77231839,nop,wscale 7],长度 0 11:33:48.602006 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [.],ack 1,win 229,选项 [nop,nop,TS val 77231840 ecr 2997710933],长度 0 11:33:48.602043 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [P.],seq 1:45,ack 1,win 229,选项 [nop,nop,TS val 77231840 ecr 2997710933],长度 44 11:33:48.602054 IP 10.44.20.137.111 > 10.24.20.163.55219:标志 [.],ack 45,win 227,选项 [nop,nop,TS val 2997710934 ecr 77231840],长度 0 11:33:48.602288 IP 10.44.20.137.111 > 10.24.20.163.55219:标志 [P.],seq 1:29,ack 45,win 227,选项 [nop,nop,TS val 2997710934 ecr 77231840],长度 28 11:33:48.605756 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [.],ack 29,win 229,选项 [nop,nop,TS val 77231841 ecr 2997710934],长度 0 11:33:48.605826 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [P.],seq 45:105,ack 29,win 229,选项 [nop,nop,TS val 77231841 ecr 2997710934],长度 60 11:33:48.606038 IP 10.44.20.137.111 > 10.24.20.163.55219:标志 [P.],seq 29:61,ack 105,win 227,选项 [nop,nop,TS val 2997710935 ecr 77231841],长度 32 11:33:48.609504 IP 10.24.20.163.46403 > 10.44.20.137.2049:标志 [S],序列 1293458899,win 29200,选项 [mss 1460,sackOK,TS val 77231842 ecr 0,nop,wscale 7],长度 0 11:33:48.609534 IP 10.44.20.137.2049 > 10.24.20.163.46403:标志 [S.],seq 2805863182,ack 1293458900,win 28960,选项 [mss 1460,sackOK,TS val 2997710935 ecr 77231842,nop,wscale 7],长度 0 11:33:48.612993 IP 10.24.20.163.46403 > 10.44.20.137.2049:标志 [.],ack 1,win 229,选项 [nop,nop,TS val 77231842 ecr 2997710935],长度 0 11:33:48.613030 IP 10.24.20.163.46403 > 10.44.20.137.2049:标志 [P.],seq 1:45,ack 1,win 229,选项 [nop,nop,TS val 77231842 ecr 2997710935],长度 44:NFS 请求 xid 916703790 null 11:33:48.613042 IP 10.44.20.137.2049 > 10.24.20.163.46403:标志 [.],ack 45,win 227,选项 [nop,nop,TS val 2997710936 ecr 77231842],长度 0 11:33:48.613149 IP 10.44.20.137.2049 > 10.24.20.163.46403:标志 [P.],seq 1:29,ack 45,win 227,选项 [nop,nop,TS val 2997710936 ecr 77231842],长度 28:NFS 回复 xid 916703790 回复 ok 24 null 11:33:48.616331 IP 10.24.20.163.46403 > 10.44.20.137.2049:标志[.],ack 29,win 229,选项[nop,nop,TS val 77231843 ecr 2997710936],长度0 11:33:48.616402 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [P.],seq 105:149,ack 61,win 229,选项 [nop,nop,TS val 77231843 ecr 2997710935],长度 44 11:33:48.616600 IP 10.44.20.137.111 > 10.24.20.163.55219:标志 [P.],seq 61:89,ack 149,win 227,选项 [nop,nop,TS val 2997710937 ecr 77231843],长度 28 11:33:48.620262 IP 10.24.20.163.55219 > 10.44.20.137.111: 标志 [P.], seq 149:209, ack 89, win 229, 选项 [nop,nop,TS val 77231844 ecr 2997710937], 长度 60 11:33:48.620457 IP 10.44.20.137.111 > 10.24.20.163.55219:标志 [P.],seq 89:121,ack 209,win 227,选项 [nop,nop,TS val 2997710938 ecr 77231844],长度 32 11:33:48.624021 IP 10.24.20.163.46403 > 10.44.20.137.2049:标志 [P.],seq 45:89,ack 29,win 229,选项 [nop,nop,TS val 77231845 ecr 2997710936],长度 44:NFS 请求 xid 1081853030 null 11:33:48.624103 IP 10.44.20.137.2049 > 10.24.20.163.46403:标志 [P.],seq 29:57,ack 89,win 227,选项 [nop,nop,TS val 2997710939 ecr 77231845],长度 28:NFS 回复 xid 1081853030 回复 ok 24 null 11:33:48.627318 IP 10.24.20.163.53809 > 10.44.20.137.111: UDP,长度 40 11:33:48.627507 IP 10.44.20.137.111 > 10.24.20.163.53809: UDP,长度 24 11:33:48.627617 IP 10.24.20.163.46403 > 10.44.20.137.2049:标志 [F.],seq 89,ack 57,win 229,选项 [nop,nop,TS val 77231846 ecr 2997710939],长度 0 11:33:48.627687 IP 10.44.20.137.2049 > 10.24.20.163.46403:标志 [F.],seq 57,ack 90,win 227,选项 [nop,nop,TS val 2997710940 ecr 77231846],长度 0 11:33:48.627706 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [F.],seq 209,ack 121,win 229,选项 [nop,nop,TS val 77231846 ecr 2997710938],长度 0 11:33:48.627798 IP 10.44.20.137.111 > 10.24.20.163.55219:标志 [F.],seq 121,ack 210,win 227,选项 [nop,nop,TS val 2997710940 ecr 77231846],长度 0 11:33:48.629818 IP 10.24.20.163.53809 > 10.44.20.137.111: UDP,长度 56 11:33:48.630039 IP 10.44.20.137.111 > 10.24.20.163.53809: UDP,长度 28 11:33:48.631031 IP 10.24.20.163.46403 > 10.44.20.137.2049:标志 [.],ack 58,win 229,选项 [nop,nop,TS val 77231847 ecr 2997710940],长度 0 11:33:48.631111 IP 10.24.20.163.55219 > 10.44.20.137.111:标志 [.],ack 122,win 229,选项 [nop,nop,TS val 77231847 ecr 2997710940],长度 0 11:33:48.632826 IP 10.24.20.163.2073489439 > 10.44.20.137.2049:40 空 11:33:48.632921 IP 10.44.20.137.2049 > 10.24.20.163.2073489439:回复 ok 24 null 11:33:48.635617 IP 10.24.20.163.53809 > 10.44.20.137.111: UDP,长度 40 11:33:48.635807 IP 10.44.20.137.111 > 10.24.20.163.53809: UDP,长度 24 11:33:48.638213 IP 10.24.20.163.53809 > 10.44.20.137.111: UDP,长度 56 11:33:48.638404 IP 10.44.20.137.111 > 10.24.20.163.53809: UDP,长度 28 11:33:48.641185 IP 10.24.20.163.**217782617** > 10.44.20.137.2049:40 空 11:33:48.641280 IP 10.44.20.137.2049 > 10.24.20.163.**217782617**:回复 ok 24 null
答案1
据我所知,这不是 TCP 也不是 UDP 端口号;它是 RPC 事务 ID。(参见print-nfs.c:nfsreply_print
tcpdump 源。)
tcpdump 有时倾向于使用非常简洁的输出;请考虑使用-v
或 tshark。