ARP实验二:不同Telnet客户端的超时处理

2015年11月02日

一、实验目的

了解不同Telnet客户端的超时处理

二、实验环境

表1 ARP实验环境
机器名称 网卡名称 IP地址 (以太网)MAC地址
CentOS V1 eth0 192.168.146.133 00:50:56:37:63:fe
FreeBSD V1 em0 192.168.146.141 00:0c:29:4b:8e:c3
Mac vmnet8 192.168.146.1 00:50:56:c0:00:08

三、实验步骤

  • 在CentOS V1上监听本身的ARP请求
1
2
# 命令
tcpdump -e -i eth0 -vnn src host 192.168.146.133 and arp
  • 在CentOS V1对不存在的主机(192.168.146.137)进行telnet操作
1
2
# 命令
telnet 192.168.146.137
  • CentOS V1上监听到eth0上的网络内容如下
1
2
3
4
5
6
21:51:03.456255 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.133, length 28
21:51:04.459512 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.133, length 28
21:51:05.461454 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.133, length 28
21:51:06.463381 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.133, length 28
21:51:07.465662 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.133, length 28
21:51:08.467993 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.133, length 28
  • 在CentOS V1上监听来自FreeBSD V1的ARP请求
1
2
# 命令
tcpdump -e -i eth0 -vnn src host 192.168.146.141 and arp
  • 在Mac对不存在的主机(192.168.146.137)进行telnet操作
1
2
# 命令
telnet 192.168.146.137
  • CentOS V1上监听到eth0上的网络内容如下
1
2
3
4
5
6
7
8
9
21:52:06.063573 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:52:09.082755 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:52:12.312590 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:52:15.550413 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:52:18.794164 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:52:22.018983 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:52:28.252781 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:52:40.662741 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
21:53:05.282952 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.141, length 46
  • 在CentOS V1上监听来自Mac的ARP请求
1
2
# 命令
tcpdump -e -i eth0 -vnn src host 192.168.146.1 and arp
  • 在Mac对不存在的主机(192.168.146.137)进行telnet操作
1
2
# 命令
telnet 192.168.146.137
  • CentOS V1上监听到eth0上的网络内容如下
1
2
3
4
5
6
7
21:54:23.107847 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.1, length 46
21:54:24.101259 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.1, length 46
21:54:25.094773 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.1, length 46
21:54:26.089341 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.1, length 46
21:54:27.083305 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.1, length 46
21:54:57.995357 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.1, length 46
21:55:29.930853 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.146.137 tell 192.168.146.1, length 46

四、结果分析

  1. CentOS对不存在的主机进行telnet操作,每隔1秒进行一次ARP请求,连续请求6次后放弃;
  2. FreeBSD V1对不存在的主机进行telnet操作,一开始是每隔3秒进行一次ARP请求,连续请求5次后,将ARP请求间隔修改6秒,12秒,24秒,直到TCP超时;
  3. Mac对不存在的主机进行telnet 操作,一开始也是每隔1秒进行一次ARP请求,连续请求5次后,将ARP请求间隔修改为38秒,直到TCP超时;

五、参考内容