淮海工学院计算机工程学院
实验报告书
课程名: 计算机网络A
题 目: 实验2
班 级:
学 号:
姓 名:
一.实验目的与要求
1、掌握常用的网络命令,了解网络的运行状态;
2、对网络进行简单的测试、分析和诊断。
二.实验内容或题目
1、网络层常用命令:ping,ipconfig,arp,route,tracert
2、统计命令:netstat
三、实验步骤与结果
C:\Documents and Settings\Administrator>ping www.hhit.edu.cn
Pinging www.hhit.edu.cn [218.92.9.156] with 32 bytes of data:
Reply from 218.92.9.156: bytes=32 time<1ms TTL=63
Reply from 218.92.9.156: bytes=32 time<1ms TTL=63
Reply from 218.92.9.156: bytes=32 time<1ms TTL=63
Reply from 218.92.9.156: bytes=32 time<1ms TTL=63
Ping statistics for 218.92.9.156:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Documents and Settings\Administrator>ping www.baidu.cn
Pinging www.a.shifen.com [220.181.112.143] with 32 bytes of data:
Reply from 220.181.112.143: bytes=32 time=33ms TTL=52
Reply from 220.181.112.143: bytes=32 time=32ms TTL=52
Reply from 220.181.112.143: bytes=32 time=32ms TTL=52
Reply from 220.181.112.143: bytes=32 time=33ms TTL=52
Ping statistics for 220.181.112.143:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 32ms, Maximum = 33ms, Average = 32ms
C:\Documents and Settings\Administrator>ipconfig/all
Windows IP Configuration
Host Name . . . . . . . . . . . . : 94
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter VMware Network Adapter VMnet8:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet8
Physical Address. . . . . . . . . : 00-50-56-C0-00-08
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.180.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.119.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8139/810x Family Fast Eth
ernet NIC
Physical Address. . . . . . . . . : 00-15-58-C2-1E-A9
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 219.219.94.20
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 219.219.94.1
DNS Servers . . . . . . . . . . . : 221.6.4.66
210.28.39.88
C:\Documents and Settings\Administrator>arp -a
Interface: 219.219.94.20 --- 0x4
Internet Address Physical Address Type
219.219.94.1 5c-dd-70-3c-0d-00 dynamic
C:\Documents and Settings\Administrator>route
Manipulates network routing tables.
ROUTE [-f] [-p] [command [destination]
[MASK netmask] [gateway] [METRIC metric] [IF interface]
-f Clears the routing tables of all gateway entries. If this is
used in conjunction with one of the commands, the tables are
cleared prior to running the command.
-p When used with the ADD command, makes a route persistent across
boots of the system. By default, routes are not preserved
when the system is restarted. Ignored for all other commands,
which always affect the appropriate persistent routes. This
option is not supported in Windows 95.
command One of these:
PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
CHANGE Modifies an existing route
destination Specifies the host.
MASK Specifies that the next parameter is the 'netmask' value.
netmask Specifies a subnet mask value for this route entry.
If not specified, it defaults to 255.255.255.255.
gateway Specifies gateway.
interface the interface number for the specified route.
METRIC specifies the metric, ie. cost for the destination.
All symbolic names used for destination are looked up in the network database
file NETWORKS. The symbolic names for gateway are looked up in the host name
database file HOSTS.
If the command is PRINT or DELETE. Destination or gateway can be a wildcard,
(wildcard is specified as a star '*'), or the gateway argument may be omitted.
If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The '*' matches any string,
and '?' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes:
Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
The route addition failed: The specified mask parameter is invalid.
(Destination & Mask) != Destination.
Examples:
> route PRINT
> route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
destination^ ^mask ^gateway metric^ ^
Interface^
If IF is not given, it tries to find the best interface for a given
gateway.
> route PRINT
> route PRINT 157* .... Only prints those matching 157*
> route CHANGE 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2
CHANGE is used to modify gateway and/or metric only.
> route PRINT
> route DELETE 157.0.0.0
> route PRINT
C:\Documents and Settings\Administrator>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 50 56 c0 00 08 ...... VMware Virtual Ethernet Adapter for VMnet8
0x3 ...00 50 56 c0 00 01 ...... VMware Virtual Ethernet Adapter for VMnet1
0x4 ...00 15 58 c2 1e a9 ...... Realtek RTL8139 Family PCI Fast Ethernet NIC -
数据包计划程序微型端口
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 219.219.94.1 219.219.94.20 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.119.0 255.255.255.0 192.168.119.1 192.168.119.1 20
192.168.119.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.119.255 255.255.255.255 192.168.119.1 192.168.119.1 20
192.168.180.0 255.255.255.0 192.168.180.1 192.168.180.1 20
192.168.180.1 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.180.255 255.255.255.255 192.168.180.1 192.168.180.1 20
219.219.94.0 255.255.255.0 219.219.94.20 219.219.94.20 20
219.219.94.20 255.255.255.255 127.0.0.1 127.0.0.1 20
219.219.94.255 255.255.255.255 219.219.94.20 219.219.94.20 20
224.0.0.0 240.0.0.0 192.168.119.1 192.168.119.1 20
224.0.0.0 240.0.0.0 192.168.180.1 192.168.180.1 20
224.0.0.0 240.0.0.0 219.219.94.20 219.219.94.20 20
255.255.255.255 255.255.255.255 192.168.119.1 192.168.119.1 1
255.255.255.255 255.255.255.255 192.168.180.1 192.168.180.1 1
255.255.255.255 255.255.255.255 219.219.94.20 219.219.94.20 1
Default Gateway: 219.219.94.1
===========================================================================
Persistent Routes:
None
C:\Documents and Settings\Administrator>tracert www.baidu.com
Tracing route to www.a.shifen.com [220.181.112.143]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms 219.219.94.1
2 <1 ms <1 ms <1 ms bogon [10.10.10.1]
3 * * * Request timed out.
4 * * * Request timed out.
5
C:\Documents and Settings\Administrator>netstat
Active Connections
Proto Local Address Foreign Address State
TCP 94:1304 210.28.39.251:http CLOSE_WAIT
TCP 94:1305 210.28.39.251:http CLOSE_WAIT
TCP 94:1306 210.28.39.251:http CLOSE_WAIT
TCP 94:1307 210.28.39.251:http CLOSE_WAIT
TCP 94:1309 63.151.120.106.static.bjtelecom.net:http CLOSE_
WAIT
TCP 94:1310 114.80.179.226:http CLOSE_WAIT
TCP 94:1311 61.151.120.106.static.bjtelecom.net:http CLOSE_
WAIT
TCP 94:1312 220.181.124.110:http CLOSE_WAIT
TCP 94:1313 63.151.120.106.static.bjtelecom.net:http CLOSE_
WAIT
TCP 94:1316 114.80.179.226:http CLOSE_WAIT
C:\Documents and Settings\Administrator>
四、结果分析与心得
本次试验主要进行的工作是输入一些常用命令对网络进行测试,通过这次的实验,我学到了很多以前不知道的命令,也发现了自己对于网络知识是有多么的缺乏,作为一名网络班的学生,我要做的还有很多很多,我要更加的努力,这次试验学到的东西只是一个开始,希望以后我能有更大的进步。
五、思考题
1、用ping、tracert命令测试网络站点的连通性和路由时,有时可指定机器的域名,有时可指定机器的IP地址,域名和IP地址之间是什么样的关系?彼此间可以相互转换吗?
答:域名与IP地址间可以是一对一关系,也可以是多对一关系。即一个IP地址同
时可对应多个域名,而一个域名同时只能对应一个IP地址。域名与IP地址间可以通过域名系统即DNS进行查询转换。
2、第一次使用arp命令时,看到主机中只有少量的解析记录,当主机被其他主机ping,或主机ping过其他主机后,再次运行arp命令,可发现增加了多条解析记录,为什么?
答:因为本地高速缓存的这个ARP表是本地网络流通的基础,而且这个缓存是动态
的。当主机接收到其他机的应答后,就会对本地的ARP缓存进行更新,将应答中的IP和MAC地址存储在ARP缓存中,所以再次运行arp命令,可发现增加了多条解析记录。