eth0 192.168.12.1/28
PC1
http://opds.sut.ru
S1
R1
PC2
eth1 10.10.0.1/29
H1
S2
PC3
10.10.0.0/29
192.168.12.0/28
PC4
PC5
FTP
DNS
PC6
eth0
Gateway
10.10.12.1
0.0.0.0
127.0.0.1
Genmask
0.0.0.0
255.255.255.240
255.0.0.0
eth2
R1
eth2
Flags
UG
U
UG
R2
MSS
0
0
0
Window
0
0
0
PC1
irtt
0
0
0
Iface
wlan0
wlan0
lo
eth0
S1
eth1
eth1
S2
PC4
collisions 0
PC2
PC3
)))
PC6
PC5
-
. . . . - ( )
()
. .
.
Computer Network Simulator.
,
210700 .
-
20122013.
1.
2.
3.
3.1. . . . . . . . . . . . . . .
3.2. . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3. . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1. help . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.2. mactable . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.3. arp . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.4. ping . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.5. route . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.6. ifconfig . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.7. iwconfig . . . . . .
3.3.8. iwconfig . . . . . . . . . .
4.
4.1. . . . . . . . . . . . . . . . . . . . . . .
4.2. . . . . . . . .
4.3. . .
4.4. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
8
8
9
11
12
12
13
13
14
15
15
16
.
.
.
.
17
17
17
18
19
5.
5.1. 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2. 2. . . . . . . . . . . . . . . . . . . . . .
5.3. 3.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4. 4. . . . . . . . . . . . . . . . . .
5.5. 5.
ARP . . . . .
5.6. 6.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
6.
38
39
21
24
26
29
32
35
4
.
. .
41
PC
PC
))) )))
.
.
. .
1.
, ISO/OSI
.
(GUI).
. (CLI),
(ifconfig, arp, route . .),
GNU/Linux BSD.
, Ethernet. Ethernet 48-
MAC- . IPv4, ICMP . .
ARP.
CNS
, ,
. ,
, , IP-, , ARP, IPv4, ICMP ..
.
,
.
Computer Network Simulator , (MS Windows, GNU/Linux, FreeBSD
. .), Java (JRE).
GNU GPL , .
2.
!
. , .
ftp://ftp.darkstar.su/pub/
CNS, (http://opds.sut.ru).
http://net-simulator.org.
Computer Network Simulator
Java (Java RE). JRE
http://www.oracle.com
http://www.java.com.
.
Computer Network Simulator ,
. Windows run.bat, .
Java (JRE), Computer Network
Simulator ,
.1.
. .
1. Run.sh
3.
3.1.
,
. , , .
. . .
.
. 2.
html. . . , ,
, , . .
. , , , ,
.
. 3.
. . .
(, ) .
.3.
.
, , .
3.2.
. :
. 4.
, 8 Ethernet IPv4 , .
;
10
. .
,
. ,
;
, . Ethernet
. ;
, .
PC, ;
Ethernet.
, , . , 8
Ethernet;
,
OSI. ,
MAC-. 6, 12 24 Ethernet. MAC-
;
. Wifi Ethernet.
;
, , .
.
, ( ), .
() , .
.
.
, , ( . . . ), ( . . . ) ( ).
.
11
. 5.
. 6.
.7. .
.
,
.
3.3.
, . , Up
Down. , help. Ctrl-L .
, ,
-h. , ifconfig -h route -h . .
, .
. ISO/OSI.
(
Ethernet), , . , , , ,
.5, eth0. eth1 . .
12
. .
. 7.
3.3.1. help
help [-h]
.
-h
:
help
3.3.2. mactable
mactable [-h]
MAC- ()
: MAC- .
. .
-h
:
mactable
13
3.3.3. arp
arp [-h] [-r <address> <interface>]
ARP- . CNS MAC- IP-,
. ,
ARP- .
-h
-r <address> <interface>
arp MAC- IP-
:
arp
arp -r 192.168.0.1 eth0
3.3.4. ping
ping [-h] [-i <interval>] [-t <ttl>] <destination>
, TCP/IP.
ICMP.
-h
-i <interval>
-t <ttl>
destination
.
Time to Live (8-
ttl IPv4)
IP-. - ttl 64
IP-
:
ping 10.0.0.1
14
. .
3.3.5. route
route [-h] [-add|-del <target> [-netmask <address>] [-gw <address>] [-metric
<M>] [-dev <If>]]
IP4
( ). ,
.
-h
target
-add
-del
-dev <If>
-gw <address>
-netmask <address>
-metric <M>
.
. 255.255.255.255
,
,
.
, 255.255.255.255
( )
:
route -add 0.0.0.0 -netmask 0.0.0.0 -gw 91.122.0.1
route -add 192.168.11.0 -netmask 255.255.255.240 -gw 89.110.53.35
route -del 192.168.11.0 -netmask 255.255.255.240 -gw 89.110.53.35 -dev eth0
15
3.3.6. ifconfig
ifconfig [-h] [-a] [<interface>] [<address>] [-broadcast <address>] [-netmask
<address>] [-up|-down]
.
, .
-h
-a
interface
address
-broadcast <address>
-netmask <address>
-up
-down
. ,
IP-
.
,
A, B C
.
.
:
ifconfig -a
ifconfig eth0 192.168.1.1 -netmask 255.255.0.0 -up
ifconfig eth0 -down
3.3.7. iwconfig
iwconfig [-h] [-essid <essid>] [-p <password>] [-enable|disable]
. , .
16
. .
-h
-essid <essid>
-p <password>
-enable|disable
(-enable) (-disable)
:
iwconfig -essid hotspot -p verysecret -enable
iwconfig -disable
3.3.8. iwconfig
iwconfig [-h] [<interface>] [-essid <essid>] [-p <password>] [-address <IP>]
[-broadcast <broadcast-IP>] [-netmask <netmask-IP>] [-enable|disable]
wlan0.
c (wlan0), ,
.
-h
interface
-essid <essid>
-p <password>
-address <IP>
-broadcast <broadcast-IP>
-netmask <netmask-IP>
-enable|disable
wlan0
IP- wlan0
:
iwconfig wlan0
iwconfig wlan0 -essid ap1 -p scrt -address 10.0.0.2 -netmask 255.0.0.0 -enable
iwconfig wlan0 -disable
17
4.
, .
, Ethernet IP-.
4.1.
, .8 , , IP- .
R,
(192.168.12.0/28 10.10.0.0/29).
S H.
eth0 192.168.12.1/28
PC1
S1
R1
PC2
eth1 10.10.0.1/29
H1
S2
10.10.0.0/29
PC3
192.168.12.0/28
PC4
PC5
PC6
DNS
FTP
. 8.
.1 2 IP- .
4.2.
, .
,
18
. .
1. IP- 192.168.12.0/28
IP-
192.168.12.0 255.255.255.240
192.168.12.1 255.255.255.240 eth0 R
192.168.12.2 255.255.255.240
1
192.168.12.3 255.255.255.240
2
192.168.12.4 255.255.255.240
3
192.168.12.5 255.255.255.240
4
192.168.12.6 255.255.255.240
5
192.168.12.7 255.255.255.240
6
192.168.12.8 255.255.255.240
.......................................................................
192.168.12.15 255.255.255.240
2. IP- 10.10.0.0/29
IP-
10.10.0.0 255.255.255.248
10.10.0.1 255.255.255.248 eth1 R
10.10.0.2 255.255.255.248
DNS
10.10.0.3 255.255.255.248
FTP
10.10.0.4 255.255.255.248
....................................................................
10.10.0.7 255.255.255.248
. , 3.2 , ; ; ,
(). , .9.
4.3.
R : 192.168.12.0/28 10.10.0.0/29.
eth0 192.168.12.0/28 , , IP- 192.168.12.1 255.255.255.240. eth1
10.10.0.0/29 IP- 10.10.0.1 255.255.255.248. R ,
.
ifconfig, 3.3,
eth0,
-up:
19
. 9.
2. eth0
> ifconfig eth0 192.168.12.1 - netmask 255.255.255.240 - up
eth1:
3. eth1
> ifconfig eth0 10.10.0.1 - netmask 255.255.255.248 - up
.
4.4.
,
IP-. 1.
, , .
1 192.168.12.0/28 , IP , IP- 192.168.12.2. ,
Ethernet (eth0, . 3.2).
ifconfig, eth0:
4. eth0 1
> ifconfig eth0 192.168.12.2 - netmask 255.255.255.240 - up
20
. .
21
5.
5.1. 1.
:
,
.
: , .10,
.
H1
S1
PC1
PC2
PC3
PC4
PC6
PC5
. 10. 1
1) (P C1 P C2 ) (). IP-, 1 (.3, );
2) IP- ( ifconfig). ,
ping ;
3) , Ethernet ()
(P C3 P C4 ). IP, 2 (.3.);
4) , IP- .
ping,
;
22
. .
5) , 8 Ethernet
() (P C5 P C6 ). IP , 192.168.99.0/30;
6) ping, .
: , html. . . (
html), xml- CNS. , .
:
, . .
.
:
1) ISO/OSI : , , ?
2) Ethernet?
3) - -?
4) MTU MRU Ethernet?
5) , ?
6) ,
ISO/OSI?
7) Ethernet-II 802.3 DIX, ?
8) Ethernet-II, - (VLAN ID) ?
9)
? .
10) :
00:00:00:00:00:00;
FF:FF:FF:FF:FF:FF;
01:00:00:00:00:00;
01:00:5e:00:00:00;
C0:F8:DA:A6:2E:2B.
23
24
. .
5.2. 2.
:
.
: , .11, , (
), 8 .
IP- .
H3
H1
H2
PC1
PC4
PC2
PC3
PC5
PC6
. 11. 2
1) . ;
2) 1 .3, IP- (ifconfig);
3) ping,
P C3 ;
4) .
,
;
5)
.
25
:
, . .
.
: , html. . . (
html), xml- CNS. , .
:
1) : , , ?
2) ?
3) ,
?
4)
(MAC)?
5) ? ?
6) ?
7) ,
?
8) , ?
9) Uplink- Ethernet-
Normal/Uplink?
10) MDI/MDI-X Ethernet-?
26
. .
5.3. 3.
:
, .
: , .12, ,
, . ,
, IP- .
PC4
PC1
S1
H1
PC2
PC3
S2
PC5
PC6
. 12. 3
1) , .12, , ;
2) , ;
3) 2 .3, P C1 P C6
IP- ( ifconfig);
4) ping, P C1 , P C4 P C5 .
27
5) .
,
. ;
6) mactable MAC- ;
7) MAC- , (
ifconfig;
8) .
.
.
:
, . .
.
: , html. . . (
html), xml- CNS. , .
:
1) ? , .
2)
(MAC)?
3) ?
4) ?
5) , ?
6) ?
28
. .
7) ? ?
8) ?
9) ,
8 FastEthernet-?
10) , ?
11)
?
12) , ?
13) CSMA/CD CSMA/CA?
, ?
29
5.4. 4.
:
. ,
.
: , .13, .
, .
IP .
eth0
eth2
eth2
R1
R2
PC1
eth0
S1
eth1
eth1
S2
PC4
PC2
PC6
PC3
PC5
. 13. 4
1) .13, :
(2 .), (2 .)
P C1 P C6 . , .
2) P C1 R1 (eth0) IP- 91.122.40.4/30.
3) IP- P C2 P C3 ,
R1 (eth1), 1 .3 ( ifconfig).
30
. .
4) P C4 R2 (eth1)
IP- 91.122.40.8/30.
5) , IP- P C5 P C6 , R2 (eth0),
2 .3.
6) eth2 (R1 ), eth2
(R2 ) IP- 91.122.40.0/30.
7) , route R1 R2 .
8) , route , P C1 P C6 . P C2 P C3
P C5 P C6 . P C1 P C4
9) ping, P C1 , P C2 , P C4 P C5 .
. , .
10)
route .
11) . IP- .
:
, . .
.
: , html. . . (
html), xml- CNS. , .
:
1) ISO/OSI ?
31
2) ,
? , .
3) IP- IPv4 IPv6?
4) :
169.254.0.0/16;
127.0.0.0/8;
255.255.255.255;
224.0.0.0;
240.0.0.0;
5) , IP- ?
6) IPv4? IPv4?
7) : , VLSM, CIDR?
8) IP-:
10.10.12.7 255.255.255.240;
192.168.1.4 255.255.128.1;
172.31.100.15 255.252.0.0;
9)
?
10)
?
11) ,
ISO/OSI?
32
. .
5.5. 5. ARP
:
ISO/OSI () . IPv4 MAC
ARP.
: , .14, ,
. , ,
.
, .
R1
S1
S2
eth0
eth1
PC1
PC6
PC2
PC5
. 14. 5
1) , , P C1 P C4 . ,
.
2) P C1 , P C2 , eth0
IP-, 1 .3.
33
3) P C3 , P C4 , eth1
IP-, 2 .3.
4) ping, P C1 , P C2 P C3 , P C4 .
.
, .
5) mactable MAC- . MAC-
, ( ifconfig.
6) arp P C1 , P C2 , P C3 , P C4
ARP-.
7) P C1 , arp
P C2 , P C3 P C4 .
.
8) .
, . IP- (MAC) P C1 P C4 .
:
, . .
.
: , html. . . (
html), xml- CNS. , .
:
1) ARP ?
2) ?
3) , ARP?
34
. .
4) , Ethernet
(IP- , MAC- , IP- , MAC-
) P C1 P C2 P C1 P C4 ?
5) ARP, RARP, inARP?
6) ARP ?
7) ARP :
A (MAC C0:F8:DA:11:23:43, IP 10.10.0.2) ARP-, (MAC
C0:F8:DA:11:22:58, IP 10.10.0.5);
B ARP- A.
8) ARP, Ethernet-II DIX,
.
35
5.6. 6.
:
WiFi.
.
: , .15, ,
. ( ) ( ),
, , . . Laptop1 Laptop4 P C1
P C4 .
PC4
PC2
PC3
PC1
eth0
eth1
R1
S2
S1
AP1
eth2
))) )))
eth3
))) )))
AP2
Laptop 1
Laptop 4
Laptop 2
Laptop 3
. 15. 6
36
. .
Laptop4 (AP1 AP2 ). P C1 P C4 . ,
.
2) P C1 , P C2 , eth0
IP-, 89.110.0.0/29.
3) P C3 , P C4 , eth1
IP-, 89.110.1.0/29.
4) , AP1 (essid) APspot1
pa33vvord ( iwconfig).
5) eth2 IP- 1 .3.
6) iwconfig, Laptop1
Laptop2 IP- 1 .3, APspot1 pa33vvord
AP1 .
7) AP2 APspot2
3ekret.
8) eth3 IP- 2 .3.
9) Laptop3 Laptop4 2 .3, APspot2,
3ekret AP2 .
10) ping,
Laptop1 , Laptop2 Laptop3 , Laptop4 .
11) ( route),
Laptop1 Laptop4
P C1 P C4 . ping.
:
, . .
.
37
: , html. . . (
html), xml- CNS. , .
:
1) IEEE WiFi?
2) 802.11a, 802.11b, 802.11g
802.11n?
3) :
(WIC), (AP), (WR)?
4) Ad-hoc Hotspot?
5) ?
?
6) ?
7) : SSID, WPA, WEP, WLAN, OFDM, DSSS?
8) ?
9) IP- ?
10) ?
38
. .
6.
[1] ., . http://www.net-simulator.org/ru/index.shtml WWW,
2011.
[2] . ., . . . , , :
. 3- . .: , 2008.
[3] . TCP/IP. , 3- . .: -, 2004.
[4] ., ., . . Linux. . 3- .
.: -, 2006.
39
.
(.). PDF.
(xml, html), CNS
.
PDF- , (zip, tar .).
, , ,
. . ,
NebaevIA_lr8.tar.gz.
reports@darkstar.su. subject , , ..3.
(http://ru.wikipedia.org/
wiki/Netiquette).
40
. .
. .
NN
, :
,
. : .. . . . .
: . . . . ,
,
. : . . . . . . , . . . ,
. . . .
- :
() .
R2
192.168.3.0/27
1
172.17.100.0/24
R1
R3
H8
Hn
H1
R2
H9
S1-S3
H2
H7
H3
H4
H5
H6
Hn
n
192.168.2.0/27
nn
192.168.1.0/30
. 16. . . .
:
. ,
.
:
CNS (xml) (html).
41
.
3:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
1
10.1.0.0/16
172.20.2.0/24
10.3.0.0/24
192.168.4.0/24
172.30.5.0/24
10.6.0.0/16
10.7.0.0/24
172.18.8.0/24
192.168.9.0/24
192.168.10.0/24
172.21.11.0/24
10.12.0.0/16
192.168.13.0/24
172.24.0.0/12
10.15.0.0/24
192.168.16.0/24
172.27.17.0/24
10.18.0.0/16
192.168.19.0/24
192.168.20.0/24
172.21.1.0/24
172.23.22.0/24
192.168.0.0/16
10.24.0.0/16
172.27.0.0/16
192.168.26.0/24
10.27.0.0/24
172.28.0.0/24
10.29.0.0/16
172.29.30.0/24
192.168.31.0/24
172.16.32.0/24
10.0.73.0/24
192.168.2.0/24
10.35.0.0/16
2
192.168.1.0/24
192.168.0.0/16
172.16.0.0/12
10.4.0.0/16
10.0.0.0/8
192.168.0.0/16
172.17.7.0/24
192.168.0.0/16
10.0.0.0/8
10.10.0.0/16
192.168.0.0/16
192.168.0.0/16
10.13.0.0/16
10.14.0.0/16
192.168.0.0/16
10.16.0.0/16
10.0.0.0/24
192.168.0.0/16
10.19.0.0/24
172.20.1.0/24
10.0.0.0/16
10.10.0.0/16
172.23.23.0/24
192.168.24.0/24
10.25.1.0/24
10.26.1.0/24
172.17.110.0/24
192.168.0.0/16
192.168.0.0/16
10.30.0.0/16
10.31.0.0/16
192.168.32.0/24
172.31.33.0/24
172.18.34.0/24
192.168.20.0/24
42
. .
3:
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
1
172.19.34.0/24
10.0.37.0/24
172.21.34.0/24
192.168.39.0/24
172.23.34.0/24
172.17.41.0/24
10.42.42.0/24
172.26.34.0/24
172.22.44.0/24
172.28.34.0/24
10.46.0.0/16
10.10.47.0/24
172.31.34.0/24
10.0.0.0/16
10.50.0.0/24
172.27.34.0/24
10.52.0.0/16
192.168.53.0/24
172.25.0.0/16
192.168.5.0/24
10.56.0.0/16
172.27.57.0/24
172.28.58.0/24
172.30.0.0/24
10.0.1.0/24
10.61.0.0/16
172.30.34.0/24
10.63.0.0/16
192.168.64.0/24
172.29.34.0/24
10.66.66.0/24
172.27.67.0/24
192.168.68.0/24
10.69.0.0/16
172.20.70.0/24
172.22.34.0/24
10.72.0.0/16
2
10.36.36.0/24
192.168.3.0/24
192.168.38.0/24
10.39.0.0/16
10.40.0.0/16
192.168.41.0/24
172.18.0.0/16
10.9.10.0/24
192.168.44.0/24
10.45.1.0/24
192.168.46.0/24
172.24.7.0/24
10.48.0.0/16
172.16.1.0/24
192.168.50.0/24
10.1.51.0/24
192.168.52.0/24
172.25.53.0/24
192.168.0.0/16
172.26.0.0/16
172.26.56.0/24
10.57.0.0/16
10.58.1.0/24
10.59.0.0/16
172.20.60.0/24
172.21.61.0/24
10.62.0.0/16
172.23.63.0/24
172.24.64.0/24
192.168.65.0/24
192.168.66.0/24
192.168.67.0/24
172.30.68.0/24
172.29.96.0/24
10.70.0.0/16
192.168.71.0/24
172.22.72.0/24
43
3:
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
00
1
10.73.0.0/16
192.168.74.0/24
172.25.34.0/24
10.76.0.0/16
10.77.0.0/16
192.168.78.0/24
10.79.1.0/24
10.10.80.0/24
172.24.34.0/24
10.82.0.0/16
192.168.8.0/24
172.24.48.0/24
10.10.85.0/24
192.168.6.0/24
10.78.0.0/16
10.88.1.0/24
192.168.89.0/24
10.90.0.0/16
10.91.1.0/24
192.168.29.0/24
10.93.0.0/16
10.94.0.0/16
192.168.95.0/24
10.96.1.0/24
10.97.0.0/16
192.168.1.0/24
10.99.0.0/16
172.30.0.0/24
2
172.23.73.0/24
172.18.74.0/24
10.75.0.0/24
172.16.76.0/24
192.168.0.0/16
172.18.78.0/24
172.17.19.0/24
192.168.80.0/24
10.81.0.0/16
172.24.82.0/24
172.28.83.0/24
10.10.84.0/24
192.168.85.0/24
172.26.86.0/24
192.168.87.0/24
192.168.9.0/24
172.29.89.0/24
192.168.90.0/24
192.168.0.0/16
172.28.92.0/24
172.23.93.0/24
172.30.94.0/24
10.95.0.0/16
172.19.96.0/24
192.168.11.0/24
172.18.98.0/24
172.17.99.0/24
10.0.10.0/24