Московский Государственный Институт Электроники и Математики
Лабораторная работа №1
по дисциплине «Сети ЭВМ и средства телекоммуникации»
Утилиты TCP/IP
Выполнил: Алексашенков Д.В.
Группа С-65
Москва 2008
Цель работы: практически освоить работу с утилитами TCP/IP, необходимыми в следующих работах.
Задания на лабораторную работу
-
Изучите методические указания к лабораторной работе.
-
Выполните упражнения.
-
Оформите отчет по лабораторной работе, описав выполнение упражнений и дав краткие ответы на контрольные вопросы.
Упражнение 1.
Выведите на экран справочную информацию по утилитам ipconfig, ping, tracert, hostname. Для этого в командной строке введите имя утилиты без параметров или с /?. Изучите ключи, используемые при запуске утилит.
C:\Documents and Settings\lol>ipconfig /?
USAGE:
ipconfig [/? | /all | /renew [adapter] | /release [adapter] |
/flushdns | /displaydns | /registerdns |
/showclassid adapter |
/setclassid adapter [classid] ]
where
adapter Connection name
(wildcard characters * and ? allowed, see examples)
Options:
/? Display this help message
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.
The default is to display only the IP address, subnet mask and
default gateway for each adapter bound to TCP/IP.
For Release and Renew, if no adapter name is specified, then the IP address
leases for all adapters bound to TCP/IP will be released or renewed.
For Setclassid, if no ClassId is specified, then the ClassId is removed.
Examples:
> ipconfig ... Show information.
> ipconfig /all ... Show detailed information
> ipconfig /renew ... renew all adapters
> ipconfig /renew EL* ... renew any connection that has its
name starting with EL
> ipconfig /release *Con* ... release all matching connections,
eg. "Local Area Connection 1" or
"Local Area Connection 2"
C:\Documents and Settings\lol>ping /?
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] target_name
Options:
-t Ping the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don't Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.
C:\Documents and Settings\lol>tracert /?
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.
D:\Documents and Settings\lol>hostname /?
sethostname: Use the Network Control Panel Applet to set hostname.
hostname -s is not supported.
Упражнение 2. Получение имени хоста
Выведите на экран имя локального хоста с помощью команды hostname.
C:\Documents and Settings\lol>hostname
rofl
Упражнение3. Изучение утилиты ipconfig
Проверьте конфигурацию TCP/IP с помощью утилиты ipconfig. Заполните таблицу:
-
Имя хоста
|
rofl
|
IP-адрес
|
10.48.17.18
|
Маска подсети
|
255.255.255.0
|
Основной шлюз
|
10.48.16.1
|
Используется ли DHCP (адрес DHCP-сервера)
|
No
|
Описание адаптера
|
Realtek RTL8168/8111 PCI-E Gigabit Ethernet NIC
|
Физический адрес сетевого адаптера
|
00-1A-4D-99-7E-31
|
Адрес DNS-сервера
|
10.151.10.10
|
Упражнение 4. Тестирование связи с помощью утилиты ping -
Проверьте правильность установки и конфигурирования TCP/IP на локальном компьютере.
C:\Documents and Settings\lol>ping localhost
Pinging rofl [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
-
Проверьте, правильно ли добавлен в сеть локальный компьютер и не дублируется ли IP-адрес.
C:\Documents and Settings\lol>ping 10.48.17.18
Pinging 192.168.1.2 with 32 bytes of data:
Reply from 10.48.17.18: bytes=32 time<1ms TTL=128
Reply from 10.48.17.18: bytes=32 time<1ms TTL=128
Reply from 10.48.17.18: bytes=32 time<1ms TTL=128
Reply from 10.48.17.18: bytes=32 time<1ms TTL=128
Ping statistics for 10.48.17.18:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
-
Проверьте функционирование шлюза по умолчанию, послав 5 эхо-пакетов длиной 64 байта.
C:\Documents and Settings\lol>ping 10.48.16.1 -l 64 -n 5
Pinging 10.48.16.1 with 64 bytes of data:
Reply from 10.48.16.1: bytes=64 time=4ms TTL=255
Reply from 10.48.16.1: bytes=64 time=1ms TTL=255
Reply from 10.48.16.1: bytes=64 time=1ms TTL=255
Reply from 10.48.16.1: bytes=64 time=1ms TTL=255
Reply from 10.48.16.1: bytes=64 time=1ms TTL=255
Ping statistics for 10.48.16.1:
Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 4ms, Average = 1ms
-
Проверьте возможность установления соединения с удаленным хостом.
C:\Documents and Settings\lol>ping auditory.ru
Pinging auditory.ru [80.250.162.181] with 32 bytes of data:
Reply from 80.250.162.181: bytes=32 time=2ms TTL=57
Reply from 80.250.162.181: bytes=32 time=2ms TTL=57
Reply from 80.250.162.181: bytes=32 time=2ms TTL=57
Reply from 80.250.162.181: bytes=32 time=2ms TTL=57
Ping statistics for 80.250.162.181:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 2ms, Average = 2ms
-
С помощью команды ping проверьте перечисленные ниже адреса и для каждого из них отметьте время отклика. Попробуйте увеличить время отклика. Определите IP-адреса узлов.
-
ya.ru – 1 ms
-
google.com – 139 ms
-
yahoo.kr – 218 ms
C:\Documents and Settings\lol>ping ya.ru
Pinging ya.ru [213.180.204.8] with 32 bytes of data:
Reply from 213.180.204.8: bytes=32 time=1ms TTL=60
Reply from 213.180.204.8: bytes=32 time=1ms TTL=60
Reply from 213.180.204.8: bytes=32 time=1ms TTL=60
Reply from 213.180.204.8: bytes=32 time=1ms TTL=60
Ping statistics for 213.180.204.8:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms
C:\Documents and Settings\lol>ping google.com
Pinging google.com [64.233.187.99] with 32 bytes of data:
Reply from 64.233.187.99: bytes=32 time=140ms TTL=241
Reply from 64.233.187.99: bytes=32 time=139ms TTL=241
Reply from 64.233.187.99: bytes=32 time=139ms TTL=241
Reply from 64.233.187.99: bytes=32 time=139ms TTL=241
Ping statistics for 64.233.187.99:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 139ms, Maximum = 140ms, Average = 139ms
C:\Documents and Settings\lol>ping yahoo.kr
Pinging yahoo.kr [66.94.234.13] with 32 bytes of data:
Request timed out.
Reply from 66.94.234.13: bytes=32 time=218ms TTL=48
Request timed out.
Request timed out.
Ping statistics for 66.94.234.13:
Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),
Approximate round trip times in milli-seconds:
Minimum = 218ms, Maximum = 218ms, Average = 218ms
Упражнение 5. Определение пути IP-пакета
С помощью команды tracert проверьте для перечисленных ниже адресов, через какие промежуточные узлы идет сигнал. Отметьте их:
C:\Documents and Settings\lol>tracert yandex.ru
Tracing route to yandex.ru [213.180.204.11]
over a maximum of 30 hops:
1 1 ms <1 ms <1 ms 10.48.16.1
2 <1 ms <1 ms <1 ms 87.249.21.4
3 1 ms 2 ms 3 ms 87.249.21.1
4 1 ms <1 ms <1 ms butlerova7-rt1.tel.ru [87.249.12.73]
5 1 ms 1 ms 1 ms ix2-m9.yandex.net [193.232.244.93]
6 3 ms 1 ms 1 ms eliano-vlan119.yandex.net [87.250.233.59]
7 3 ms 2 ms 2 ms hummer-vlan2.yandex.net [87.250.228.136]
8 2 ms 2 ms 2 ms yandex.ru [213.180.204.11]
Trace complete.
C:\Documents and Settings\lol>tracert mozilla.com
Tracing route to mozilla.com [63.245.209.10]
over a maximum of 30 hops:
1 1 ms <1 ms <1 ms 10.48.16.1
2 <1 ms <1 ms <1 ms 87.249.21.4
3 1 ms 1 ms 1 ms 87.249.21.1
4 1 ms 1 ms <1 ms butlerova7-rt1.tel.ru [87.249.12.73]
5 1 ms 1 ms 1 ms kaluga-car1-ge0-1-103.rt-comm.ru [213.59.3.177]
6 60 ms 67 ms 60 ms lnd-bgw2-ge1-0-3-0.rt-comm.ru [217.106.6.166]
7 59 ms 70 ms 71 ms linx.ge1-0.cr01.lhr01.mzima.net [195.66.225.15]
8 137 ms 142 ms 143 ms eos1-0.cr01.lga02.mzima.net [216.193.255.45]
9 137 ms 138 ms 143 ms xe1-0.cr01.lga01.mzima.net [216.193.255.213]
10 165 ms 161 ms 162 ms eos3-2.cr01.ord01.mzima.net [216.193.255.54]
11 * * 217 ms eos1-22.cr02.sjc02.mzima.net [216.193.255.154]
12 205 ms 211 ms 205 ms ge1-mozilla.cust.sjc02.mzima.net [72.37.156.166]
13 205 ms 207 ms 212 ms v9.core2.sj.mozilla.com [63.245.208.58]
14 205 ms 210 ms 213 ms moz.com01.nslb.sj.mozilla.com [63.245.209.10]
Trace complete.
Упражнение 6: Просмотр ARP-кэша
С помощью утилиты arp просмотрите ARP-таблицу локального компьютера.
C:\Documents and Settings\lol>arp -a
Interface: 10.48.17.18 --- 0x2
Internet Address Physical Address Type
10.48.16.1 00-0f-3d-e3-11-0a dynamic
Упражнение 7. Получение информации о текущих сетевых соединениях и протоколах стека TCP/IP.
С помощью утилиты netstat выведите перечень сетевых соединений и статистическую информацию для протоколов UDP, TCP, ICMP, IP.
C:\Documents and Settings\lol>netstat -a
Active Connections
Proto Local Address Foreign Address State
TCP rofl:epmap rofl:0 LISTENING
TCP rofl:microsoft-ds rofl:0 LISTENING
TCP rofl:803 rofl:0 LISTENING
TCP rofl:pptp rofl:0 LISTENING
TCP rofl:1709 10.50.0.7:pptp ESTABLISHED
TCP rofl:1456 localhost:1457 ESTABLISHED
TCP rofl:1457 localhost:1456 ESTABLISHED
TCP rofl:1458 localhost:1459 ESTABLISHED
TCP rofl:1459 localhost:1458 ESTABLISHED
TCP rofl:1715 irc.gamepad.ca:6667 ESTABLISHED
UDP rofl:microsoft-ds *:*
UDP rofl:isakmp *:*
UDP rofl:1025 *:*
UDP rofl:1063 *:*
UDP rofl:1178 *:*
UDP rofl:1179 *:*
UDP rofl:1180 *:*
UDP rofl:1181 *:*
UDP rofl:1182 *:*
UDP rofl:1183 *:*
UDP rofl:4500 *:*
UDP rofl:ntp *:*
UDP rofl:1900 *:*
UDP rofl:ntp *:*
UDP rofl:1900 *:*
UDP rofl:ntp *:*
UDP rofl:1900 *:*
C:\Documents and Settings\lol>netstat -s
IPv4 Statistics
Packets Received = 394377
Received Header Errors = 13
Received Address Errors = 1314
Datagrams Forwarded = 0
Unknown Protocols Received = 0
Received Packets Discarded = 16
Received Packets Delivered = 394348
Output Requests = 206650
Routing Discards = 0
Discarded Output Packets = 0
Output Packet No Route = 0
Reassembly Required = 0
Reassembly Successful = 0
Reassembly Failures = 0
Datagrams Successfully Fragmented = 0
Datagrams Failing Fragmentation = 0
Fragments Created = 0
ICMPv4 Statistics
Received Sent
Messages 435 395
Errors 0 0
Destination Unreachable 134 6
Time Exceeded 228 0
Parameter Problems 0 0
Source Quenches 0 0
Redirects 0 0
Echos 12 377
Echo Replies 61 12
Timestamps 0 0
Timestamp Replies 0 0
Address Masks 0 0
Address Mask Replies 0 0
TCP Statistics for IPv4
Active Opens = 627
Passive Opens = 35
Failed Connection Attempts = 44
Reset Connections = 26
Current Connections = 6
Segments Received = 314370
Segments Sent = 172187
Segments Retransmitted = 99
UDP Statistics for IPv4
Datagrams Received = 67275
No Ports = 22330
Receive Errors = 2841
Datagrams Sent = 339401>1>1>1>1>1>1>1>1>1>1>1>1>1ms>1ms>1ms>1ms>1ms>1ms>1ms>1ms> |