Крейг Хант - tcp-ip. Сетевое администрирование, 3-издание -...
TRANSCRIPT
TCP/IPNetwork AdministrationThird Edition
Craig Hunt
O'REILLY
TCP/IP
TCP/IP. ,3- . . . . . . , . . .
TCP/IP. , 3- . - . . - : -, 2007. - 816 ., . ISBN-10: 5-93286-056-1 ISBN-13: 978-5-93286-056-4 TCP/IP. - TCP/IP, , . : , , . (RIPv2, OSPF BGP) gated, . , , DNS, Apache, sendmail, Samba, DHCP. . , Apache , Samba Unix/Windows. , gated, pppd, named, dhcpd sendmail. TCP/IP Linux, Solaris, BSD System V. ISBN-10: 5-93286-056-1 ISBN-13:978-5-93286-056-4 ISBN 0 - 5 9 6 - 0 0 2 9 7 - 1 ( ) -, 2004 Authorized translation of the English edition 2002 O'Reilly & Associates Inc. This translation is published and sold by permission of O'Reilly & Associates Inc., the owner of all rights to publish and sell the same. , . , , .
-. 199034, -, 16 , 7, . (812) 324-5353, [email protected]. N 000054 25.12.98. - 005-93, 2; 953000 - . 28.11.2007. 70100' . . 51 . . . 1000 . N 1779 199034, -, 9 , 12.
. .
1. T C P / I P
1118
TCP/IP TCP/IP Internet 2. , IP , 3. DNS
19 24 27 30 30 36 41 42 43 43 45 55 57 64 65 71 72 73 74 75 83 98 100 106
10
13. T C P / I P
495
A . B. g a t e d , C. named, D. dhcpd, E. s e n d m a i l , F. h t t p d . c o n f Solaris G . RFC
495 498 501 504 512 518 534 537 541543 570 619 660 675 748 767 775
TCP/IP. 1992 . , . TCP/IP - , . , . , IP (Internet Protocol, , ), TCP (Transmission Control Protocol, ) UDP (User Datagram Protocol, ), TCP/IP, . TCP/IP . , TCP/IP, , . , , TCP/IP, IP-, , , . 1991 TCP/IP . , . . 2002 , - , . , TCP/IP. TCP/IP. TCP/IP . TCP/IP . , TCP/IP. - , ,
12
TCP/IP. , Unix. TCP/IP Unix, . . , , , . DHCP (Dynamic Host Configuration Protocol, ). , (DNS), BIND 8 , , BIND 9. sendmail (8), , , Solaris Linux. RIPv2 (Routing Information Protocol version 2, 2), OSPF (Open Shortest Path First, ) BGP (Border Gateway Protocol, ). , , - Apache, xinetd, iptables. , . TCP/IP - , . TCP/IP. - , TCP/IP. , TCP/IP, .
Unix-, TCP/IP. 1 , , , , , . . , , Unix-, , , . , , . , Unix. , 1
Unix-. , Windows 98/NT/2000 . NT- Windows NT TCP/IP Network Administration, O'Reilly.
13
. , , . , Unix-. , (. Frisch) Essential System Administration ( ), O'Reilly, Nutshell Handbook).
: , , . TCP/IP. , . . 4 7 , . 8 11 . 12 13 - , : . -, . : 1 TCP/IP TCP/IP, , . 2 . 3 -, , . 4 , , . 5 TCP/IP Unix . 6 , . Ethernet . 7 , , . , , , gated - , .
14
8 DNS , . 9 , DHCP, LPD, POP IMAP, NFS (Network File System), Samba, NIS (Network Information System). 10 sendmail sendmail - , . 11 Apache - Apache. 12 , , . , , . 13 TCP/IP , , - . TCP/IP, . - , TCP/IP. dip, pppd chat. gated, - gated. named, - BIND (Berkeley Internet Name Domain). D dhcpd, - dhcpd (Dynamic Host Configuration Protocol Daemon). E sendmail, , sendmail. F httpd.conf Solaris Apache, 11. G RFC RFC, 13. , , RFC.
Unix Red Hat Linux, Linux, Solaris 8, Sun, Unix System V. , TCP/IP , -
15
- Linux, System V BSD. . , . , . :BIND
BIND 8, Solaris 8. BIND 8 - BIND, Solaris . BIND 8 BIND 9 .sendmail
sendmail 8.11.3 sendmail 8.
:
, , , , .
, , .
, .
%# ,
, . (, filename .) , , shell (%). , (#). , , , .
16
[ ] . , Is [ -1 ] , -1 .
, , , , ( !). , , , : O'Reilly & Associates, Inc. 1005 Gravenstein Highway North Sebastopol, CA 95472 (800) 998-9938 ( ) (707) 829-0515 (/) (707) 829-0104 () O'Reilly -, , . :http://www.oreilly.com/catalog/tcp3
, , :[email protected]
- O'Reilly , , , O'Reilly (O'Reilly Network):http://www.oreilly.com
, , -, http:// www.wrotethebook.com.
, . , , ; . : (John Wack), (Matt Bishop), (Wietse Venema), (Eric Allman), (Jeff Honig),
17
(Scott Brim) (John Dorgan). : , (Bryan Costales), (Cricket Liu), (Paul Albitz), (Ted Lemon), (Elizabeth Zwicky), (Brent Chapman), (Simson Garfinkel), (Jeff Sedayao), (1 Frisch). , . - . . , DNS, , . - (David Collier-Brown), Using Samba, Samba. (Charles Aulds), Apache, Apache. . ! O'Reilly & Associates . (Deb Cameron), , . , , . (Emily Quill) . (Jeff Holcomb) (Jane Ellin) . (Leanne Soylemez). (Tom Dinse) . (Edie Freedman), (Melanie Wang). (Neil Walls) Microsoft Word Frameinaker. , (Chris Reilley) (Robert Romano), (Jessamyn Read). , - , , . . , .
1 TCP/IP
TCP/IP TCP/IP Internet
, Unix - , , , - . , . . - - . . , . , , , . , - , . , , . , , , ( ), , . , . TCP/IP .
TCP/IP
19
TCP/IP . : (TCP, Transmission Control Protocol) Internet (IP, Internet Protocol). TCP/IP - , . - Internet (IPS, Internet Protocol Suite) - . TCP/IP Unix. TCP/IP , . TCP/IP Unix. TCP/IP . TCP/IP Unix. .
TCP/IP 1969 (Advanced Research Projects Agency, ARPA) . , ARPAnet, , , . ARPAnet. , . 1975 ARPAnet , (Defense Communications Agency, DCA).1 ARPAnet : TCP/IP . TCP/IP (Military Standards, MIL STD) 1983 , . , DARPA2 , (Bolt, Beranek, Newman; BBN), TCP/IP Berkeley (BSD) Unix. Unix TCP/IP.1
2
DCA (Defense Information Systems Agency, DISA). 80- ARPA, , : Defense Advanced Research Projects Agency (DARPA). , - .
20
1. TCP/IP
Internet , TCP/IP. 1983 ARPAnet MILNET, (Defense Data Network, DDN), ARPAnet, . Internet : MILNET ARPAnet. 1985 (National Science Foundation, NSF) NSFNet, Internet. NSFNet NSF. ARPAnet , (56 /). NSFNet Internet, NSF , , Internet. NSF , . 1987 NSF , , , . 1990 ARPAnet , 1995 NSFNet Internet. , . ( ) . - , . , , . (Internet Service Providers, ISPs) . , (Network Access Points, NAPs). . , , . , , , . 1983 , , . : TCP/IP. , internet. - , IP. internet - , . internet ( i) - , . Internet ( I) - , ARPAnet IP.
TCP/IP
21
(internet Internet) , TCP/IP. TCP/IP , TCP/IP. TCP/IP , . , . , TCP/IP . TCP/IP, -, (intranets). TCP/IP .
TCP/IP TCP/IP , , . ( ), , , : , . TCP/IP , . , TCP/IP. TCP/IP Ethernet, DSL, , , .
, TCP/IP , . , .
- . , . , , : , -
22
1. TCP/IP
. , , , . . . - , . TCP/IP , . TCP/IP , , . , . TCP/IP . (Internet Engineering Task Force, IETF). RFC (Request for Comments, ). 1 , , . RFC . RFC: (standards, STD), (best current practices, ), (for your information, FYI). RFC, , STD STD- RFC-. - . RFC , : (Proposed Standard)
, -, . , , , , . (Draft Standard)
, , . - , .1
, ? RFC 2026, The Internet Standards Process ( ).
TCP/IP
23
, . (Internet Standard)
, -. . (Technical
Specification, TS) . (Applicability Statement, AS) , . : (Required )
, TCP/IP. , . (Recommended)
, TCP/IP. . (Elective)
. . ( ) RFC, . , , . , , . RFC, , : (Experimental)
RFC . (Historic )
RFC , . (Informational)
RFC , , . RFC FYI (For Your Information, ). FYI, RFC, FYI. -
24
1. TCP/IP
TCP/IP . FYI RFC 2026 . FYI . 1 RFC, , (Best Current Practices, ). . , IETF; - RFC 2026. ( RFC 1918, Address Allocation for Private Internets, -
-). . RFC. , , , . , , . , RFC , . ( RFC, STD.) , . RFC , .
, . . - ( ) . , . , . , (International Standards Organization, ISO). (Open Systems Interconnect (OSI) Reference Model). , -
, 1
FYI RFC 1150, FYI on FYI: An Introduction to the FYI Notes ( FYI).
25
- , , OSI. OSI , . OSI , , . . 1.1, . , , , .
. 1.1. OSI
; . , , , . , , . . - ; , -
26
!. TCP/IP
. . , . , : . , . . , , , , . -. , ; . . , . OSI TCP/IP . TCP/IP OSI : (Application Layer)
, . TCP/IP , . , , , . (Presentation Layer)
, . OSI . TCP/IP, TCP/IP, XDR MIME. (Session Layer)
, TCP/IP. OSI () . TCP/IP , ; (socket, ) .
TCP/IP ( Transport Layer)
27
TCP/IP . OSI . TCP/IP (Transmission Control Protocol, TCP). TCP/IP - (User Datagram Protocol, U D P ) ,
. (Network Layer)
. TCP/IP Internet (IP), , . (Data Link Layer)
. TCP/IP, , . RFC, , IP . (Physical Layer)
, , , , . RS232C V.35, , IEEE 802.3. TCP/IP , . OSI TCP/IP, , TCP/IP. , TCP/IP, .
TCP/IP TCP/IP , TCP/IP . TCP/IP . , . 1.2, (, -, ) DOD Protocol Model DDN Internet. TCP/IP.
28
1. TCP/IP
.
1.2.
TCP/IP
OSI, - . TCP/IP , . , . (header), . , , . (. 1.3).
.
1.3.
TCP/IP
29
. . , , . . , , , . . . 1.4 , TCP/IP . TCP TCP (segment), UDP - (packet). Internet , (datagrams). , TCP/IP, . (packet) (frame, ). . 1.4 , , . (stream), U D P - (message). -
, .
.
1.4.
1. TCP/IP
TCP/IP. . IP-. , ( , . .), , , . TCP/IP OSI (, ). . TCP/IP , (IP, TCP, UDP ) . . TCP/IP- . - . IP- , . IP- , . TCP/IP . IP , , . RFC: RFC 826, Address Resolution Protocol (ARP, ); IP- Ethernet. Networks ( IP- Ethernet); , IP- Ethernet. Unix . , , , , , . R F C 8 9 4 , A Standard for the Transmission of IP Datagrams over Ethernet
Internet Internet. - Internet (IP).
Internet
31
IP 4 (IPv4), RFC 791. IP. IP 5 - (Stream Transport, ST), . IPv6 . IPv6 - IP, . IPv6 , IPv6 IPv4 . IPv6 IP . , IPv6. 1 IPv4. IPv4 , . Internet - TCP/IP. , TCP/IP. Internet . TCP/IP IP .
Internet Internet (IP) - . : , - , , IP. -, IP . , ( , ) . , , , , . , . Internet , . , IP . Internet , . ,
32
1. TCP/IP
IP - . IP , , . TCP/IP. TCP/IP ARPAnet, . - , , . , . , . . , Internet, . IP- . 1.5. 32- , (header). , . ( ) Internet HeaderLength ( I H L , Internet). -
.
. 1.5. IP
Internet . - 32 IP, . ( IP- 2.) , . (gateway) -
Internet
33
. . , , . IP . Internet Internet , IP-. TCP/IP - . , , . ( ), . , , , , . 1, IP- . . 1.6 . ( ) , ( .) Internet, . , . , 1 1, G1 G2. 1 G1, -
. 1.6. , , , . , , TCP/IP .400, , IP- .
34
1. TCP/IP
. 1.7. ,
. G1 G2 . G2, , 1, . 1 , G1. , , . 1 G2, . . 1.7. , , , . 1 G1, 1 Ethernet-. G1 .25 G2, 1. , 1. . , , , . , .
Internet
35
MTU (maximum transmission unit, ), . MTU , . . , . , , , , . Ethernet .25, ; IP Ethernet , .25. - , . , . , , - , . (More Fragments), IP , . , , IP . , . . IP. 2. , IP . , , , , IP- IP: . TCP/IP Internet.
ICMP, Internet IP (Internet Control Message Protocol, I C M P ) , R F C 7 9 2 .
Internet . ICMP , TCP/IP: (Flow control)
, - ICMP- -
36
1. TCP/IP
(Source Quench Message) . .
, , , Destination Unreachable . , . , . ( 2.)
ICMP- (Redirect Message), , , , , . , - . . 1.7. .25 G1, G2, - G1 G2 . , Token Ring, G1 G2. , G2 Token Ring.
ICMP- (Echo Message), Internet . , -. Echo Message ping.
Internet -, . TCP(Transmission
UDP (User Datagram Protocol). TCP . UDP - , . Internet. , .
Control
Protocol)
UDP, (User Datagram Protocol, UDP) ,
37
IP. . UDP - . , , , . UDP . UDP 16- . UDP . 1.8.
. 1.8. UDP
UDP ? . , , . UDP . UDP , -. . , . , , , . .
TCP, TCP, . TCP - , , . -
. TCP (Positive Acknowledgment with Retransmission, PAR). ,
38
1. TCP/IP
PAR, , - , . TCP (. 1.9). , . , . . - TCP , .
. 1.9. TCP
TCP . . () (). TCP . TCP ; . . 1.10. , (Synchronize sequence numbers, SYN). , , . ( .) (Acknowledgment, ) (SYN). , , . , , , .
39
.
1.10.
TCP- , TCP- . , . , FIN (No more data from sender, ), . . TCP , . , TCP . T C P - .
TCP , ; . , . , SYN- . SYN-
ber, ISN), . ISN . , ISN, ISN+1. . , 1 ( ISN = 0), 4000 , 4001, 4001. (Acknowledgment Segment, ) : .
(Initial Sequence Num-
40
1. TCP/IP
, . - , . . , . , 1 2 , 2001. , , . 6000 , 6000. , , . , . , . . 1.11 TCP . 2000 , - 2001. , 6000 , 6000. 1000 4001. 2001 , , . , , . 2001. . , TCP IP . , , 1 6 - , .
.
1.11. TCP
41
. - .
TCP/IP , , . . , . :Telnet
(Network Terminal Protocol) .FTP
(File Transfer Protocol) .SMTP
(Simple Mail Transfer Protocol) .HTTP
(Hypertext Transfer Protocol) - . HTTP, FTP, SMTP Telnet - TCP/IP. , . TCP/IP:Domain Name System (DNS, )
, IP- , . DNS .Open Shortest Path First (OSPF, )
TCP/IP. OSPF . .Network File System (NFS, )
.
42
1. TCP/IP
, Telnet FTP, . , OSPF, . TCP/IP. , !
TCP/IP, , . TCP/IP : , , Internet . . IP- .
, IP
,
2
TCP/IP , TCP/IP . , IP, . , , . , TCP/IP , .
, , - . TCP/IP :
IP, , .
.
44
2.
. - , - , . . . . , , . Ethernet . , , . 2.1.
. 2.1.
. , , , rodent ( ) crab (, ). Ethernet- , , . - , IP-.
IP
45
IP IP - 32- , , TCP/IP. IP , . 1 , 8 32- , 0 255 ( ). IP- . , . IP , . -, crab (. . 2.1), , . . , rodent crab 172.16.12.1, - 10.104.0.19. . , (unicast) . . (multicast) , 224.0.0.9. . 2 (broadcast) , 172.16.255.255. . - , . . 0 255 . IP, , .3 172.16 172.16.255.255. 172.16. IP, , . , 10.0.0.0 10, 172.16.0.0- 172.16. . , 223, . 1
2
3
, . . . . , . 5 , .
46
2.
: 0.0.0.0 back). , IP. , , . , . , Internet . Internet . , ( ). - 32- , . , 127.0.0.0 (loop-
IP , IP-. , , , , , , . . : , , , . , 172.22.12.4 255.255.255.0, 24 8 , 24 , 8 - . , 4 172.22.12. , . 172.31.26.32 255.255.255.224 172.31.26.32/27. /_, _ - . , 172.31.26.32 . , , IP, -. , . , 192.168.16.0/20, 192.168.32.0/24. , , ( ) (32). , 20 12 .
IP
47
12-. 24 8- . , 12-, 4096 192.168.16.0 192.168.31.255, , 8-, 256 192.168.32.0 192.168.32.255. . 192.168.16.0/20 192.168.32.0/24 . , . , .
IP . , , , . , . , , . . . , , . , , . , , . IP- , , . - , . IP-. : , . , . - .
48
2.
, , - . 192.168.32.0/24. 255.255.255.0, 256 . , , 10 6 . , . 256 , . 192.168.32.0/24 16 , 255.255.255.240, 192.168.32.0/28. , . , - - . , 16 , 14 , . . 2.1 , 192.168.32.0/24. 2.1.
( ).
IP
49
, ( ). RFC , , . R F C 1 8 1 2 , Requirements for IP Version 4 Routers ( -
IP 4), , . , RFC. . , , , . . R F C 1 8 7 8 , Variable Length Subnet Table For IPv4 ( -
IPv4). RFC 1878 32 . , . 10.104.0.19 10.104.0.19/8 , 8 , , , 24 . , . , , .
IP , . - , . IP , , . , , , , . : IP- , 8 ( 8), . 8 , 24 .
1 0, - 16 ( 16), . 16 , 16 - . 1 1 0 , - 24 ( 24), . 24 , 8 .
50
2.
1 1 1 0 , . D, . . , (, ), , . , 32 ( 32).
IP , 8- , 32- . , , , 8. - . : 128, 8 ; , - ;
128 191, 16 ; , - ; 192 223, 24 ; , - ; 224 239, . ; , 32 ; 239, . .
2.2 . - 10.104.0.19. 0; , 8 , 24 . , 128, 104.0.19 10. , . - 172.16.12.1. 1 , , 16 16 . : 128 191, 12.1 172.16. , - . , 192.168.16.1 1, 1 0, , 24 , 8 . 192 223, 1 192.168.16; , . 8, 16 24 - 1 , 2 3 .
IP
51
. 2.2. IP
IP- , 32 . . Internet . , , . IP , .
CIDR TCP/IP IP-, , . IP- . TCP/IP - TCP/IP , . , Unix . 32- , ,
52
2.
, , . , . , , , , . . - . , : , . , . - . , . , , , . . . . , . . , , 195.4.12.0 195.4.13.0 , . . , . , , . , , . , . , . , , . , 195.4.12.0 195.4.13.0 -
IP
53
. , , , : 194.0.0.0 195.255.255.255. , , . , . 195.4.12.0 195.4.13.0 , . , . (Classless Inter-Domain Routing, CIDR 1 ). CIDR -
. , , . , , . . , CIDR , , . CIDR . , . TCP/IP IP. IETF - - IP, IPv6.
IPv6IPv6 - IP, . . IPv6 - 128 , . , . IPv6: , 1
.
54
2.
IPv6, . , IPv4, , IPv6. : CIDR , . (NAT, Network Address Translation) . , . , , . , DHCP.
IPsec IPv4 , IPv6. , , IPv4, , . IPv6 , . IPv6 , IPv4. , IP . . - , . IPv6 , , IPv4. , , , , . IPv6. , IPv6 , - . . -
55
, . IPv6 - . IPv6 , , , . 1 16- IPv4. , - . IPv6. TCP/IP (IPv4), CIDR , . , , 32- IP- IPv4.
. , . , ARPAnet. ARPAnet , . (core), - (core gateways).
, , . - {Gateway to Gateway Protocol, CGP). . . : . , . , . . , . TCP/IP (autonomous system, AS) . - , 1
Solaris Linux IPv6, .
56
2.
. , , . , . - . (Exterior Gateway Protocol, E G P ) .
, . (Border Gateway Protocol, BGP).
, . . , , , . . 2.3 . . , . , - . : - , , - ? NSFNET
.
2.3.
57
, ,
tabase, PRDB). NSFNET . , NSF, (NAPs, Network Access Points), , (Routing Arbiter, RA). R A D B (Routing Arbiter Database),
(policy routing da-
. PRDB. RA , . RADB (Internet Routing Registry, IRR). -
, , . . IP- Reseaux IP Europeens (RIPE) Network Control Center (NCC). . , RIPE-181. . , , . , . , , , , . , , , . - , , , , . , , Internet .
, - , . : - , .
58
2.
- , . IP- . ( ).
, Internet . Linux-. Linux- route - . 1 - IP , . Red Hat:
Linux route -n , :Destination
, IP- .Gateway
, .Genmask
, IP Destination.Flags
. Linux : 2 U , . ( ).1 2
Solaris 8 Solaris . R, , , I ! Linux. Unix.netstat.
59
G , . . . G , . R , , , , , reinstate. D , ICMP (ICMP Redirect Message). ICMP Redirect, , , . D. , - , mod.
, ARP. , . : (Forwarding Information Base, FIB), , , , . , , . , . . , . . Solaris , ; , 172.16.255.255 172.16.0.0 Solaris, 172.16.0.0/16, . I , (loopback) , . . L ! , , , . Linux . -
60
2.
. Linux , .Metric
. , . , .Ref
. Linux-.Use
, IP.If
1 , . . - , IP- , . , . , , , , . Destination , IP . Genmask , IP , , , . , . , 172.16.50.183 , 255.55.255.0 172.16.50.0. , Gateway IP , . Gateway IP- , . Gateway (0.0.0.0, route -) (*, route -), , . ,1
- , IP . 6.
61
, , . Ethernet (ethO) (lo). , , . (Ref, Use, Flags Metric) . . Ref, , Linux, . Linux Use, IP - , . Use . Flags , : U , - - , Gateway G. Metric (Routing Information Protocol, RIP). : - , , , . IP (), . , , . Linux route -:
- . , . , , . Linux, route . -
62
2.
route Solaris . Solaris netstat -nr. - , - - . 1
. , , . , . , Solaris (127.0.0.1), (127.0.0.0). , ifconfig. . - , default . , , , . . , . , 192.168.16.0. , , IP 172.16.12.1. , , , . , 172.16.12, . , , - , . , , .1
Linux . Solaris 8 , .
63
. 2.4 IP , , . , 172.16.0.0 255.255.255.0. - (172.16.12.2), - (172.16.1.2), , 172.16.1.0. , , 172.16.1.0, 172.16.12.3. - . . 172.16.12.3 172.16.1.5. . 2.4, , , , . , 172.16.12.2 172.16.12.3 172.16.12.1, , 172.16.1.2 172.16.12.0, . . , (hop) . 1 , . , , , . -. IP . , , , .
.1
2.4.
7, , OSPF BGP, . .
64
2.
IP , . , TCP/IP, IP-. , , . IP . IP Ethernet.
tocol, ARP), RFC 826.
(Address Resolution Pro-
ARP IP- Ethernet. . ARP IP, . , Ethernet , . ARP Ethernet-. IP, Ethernet. , , , Ethernet- , . ARP. ARP. ARP, -. , . , rodent ARP- crab :
- :
, crab, , rodent, Ethernet- Ethernet- 00:50:ba:3f: 2:5. (rodent) , crab. (crab
,
65
224.0.0.0) , crab. S (static) Flags. 224.0.0.0 . (mapping) . Ethernet . crab , . , ARP- IP crab Ethernet- 00:00:c0:dd:d4:da. , ARP- crab. Ethernet- , . ARP-, , ARP. , 24seven clock, . , 24seven ARP , IP- clock Ethernet- 24seven. 24seven, ARP- IP- clock, Ethernet-. , clock, 24seven. 24seven clock . ARP , . ARP , ARP. , ARP . 13.
, , , . TCP/IP . - Internet. . , , : . IP , . (well-known services).
66
2.
(, FTP Telnet), . IANA (Internet Assigned Numbers Authority). http://www.iana.org. Unix- .
. IP, . Unix- /etc/protocols. , . : , . . #. /etc/protocols :
,
67
/etc/protocols Solaris 8. . Protocol Numbers - IANA, . , . , ; , , IPv6. , IPv6 - , - . ? , IP-, IP , . , , IP , . , 6, Internet TCP; 17, IP UDP. TCP UDP - , , , , IP. ICMP, EGP GGP - . , , , TCP/IP.
, IP . , , . ( ) 16- . ( , ) ( , ) TCP UDP. 1024 ( FTP Telnet) IANA. . 1024 4 9 1 5 1 - . IANA , , . 49152 65 535 . . , . , TCP UDP - - -
68
2.
. , . Unix- / etc / services. , , /etc/services. /etc/services Solaris 8:
/etc/protocols. , /. , . /. /etc/protocols /etc/services , . , . , IP . , , , , . . 2.5. , /etc/services . , -
,
69
. 2.5.
), services. Sun RPC, IANA. RPC , . RPC, portmapper. portmapper , RPC. RPC, portmapper, , , . portmapper, 111. portmapper .
R P C ( R e m o t e P r o c e d u r e C a l l , -
- , . , , , , . , , Telnet, 23. , . ,
70
2.
: . , , , 1024. , . telnet 23 , , , telnet ? , - . telnet 23 (telnet). . , , . - , TCP, UDP. , . TCP . 2.6. - , - 3044, 3044 23. - 23 3044. IP- (socket). . . , . - IP . - - - , , TCP.
. 2.6.
71
. , 172.16.12.2 Telnet 192.168.16.2. 172.16.12.2 . 3382. telnet , , , 23. 172.16.12.2.3382 (IP- 172.16.12.2 3382). - 192.168.16.2.23 ( 192.168.16.2, 23). , . , - , . , , . ; .
, - . TCP/IP . , . , , . IP . , . , , . . TCP/IP , , . IP- ( ), . , IP-, (Address Resolution Protocol, ARP). ARP IP Ethernet . TCP/IP . , , .
3
DNS
. , . , , . , , : IP- , , TCP/IP , , ,
TCP/IP PC- . Unix- , . TCP/IP . , . , , . . .
73
, Internet 1 , , : . . . , . . . TCP/IP 32- IP. IP- ( , hostname). , , Internet, . , . . telnet IP- 172.16.12.2, : , , : IP. . , , . . t e l n e t rodent.wrotethebook.com , . rodent.wrotethebook.com , rodent.wrotethebook.com . , . . , .2 , (Domain Name System, DNS). .1
2
RFC 791, Internet Protocol, J o n Postel, ISI, 1981, c. 7.
(Network Information Service, NIS), Sun, . NIS .
74
3.
- , IP- . Unix- /etc/ hosts. /etc/hosts IP, , . # . rodent :
- rodent. IP- 172.16.12.2 rodent.wrotethebook.com () rodent. IP, 172.16.12.2. , , . , . 172.16.12.1. - loghost. loghost - , syslog.conf Solaris. , syslogd, , . , . , Iprhost, mailhost dumphost.
127.0.0.1 localhost. , 127.0.0.0/8 . 127.0.0.1 - , ( localhost). , . , . , : localhost , . DNS, - :
DNS
75
, . , DNS , , . DNS /etc/hosts, , localhost, .
, NIS, NIS. NIS DNS, NIS- , . NIS DNS 9. , , . , , TCP/IP, DNS . : - . DNS NIC (Network Information Center, ) ( NIC). . NIC . , IP-, . , IP-. , . , , - . , , . , , , . - .
DNSDNS : DNS . , , .
76
3.
DNS 100 , NIC 10 . DNS . . . DNS, , () (authoritative server). -
, , . , , , , . , . DNS , , . DNS , . , . /etc/services. UDP- 42 nameserver, ; DNS 53 domain. , . - . DNS, , , .
DNS - , IP. DNS , . , , Unix. DNS , , . Unix , , : - - . . - . -. , ( c c T L D , country co-
de top-level domain). , ccTLD - .uk, - .jp, - .us. .us
DNS
77
( , .wy.us, ). , . - , (, . .), . 1 , ( g T L D s , generic top-level domains).
:
edu
gov
mil
net
, int
org
, , aero
biz
coop
museum
1
. , .
78 pro
3.
, info
,
, . (com, edu, gov, mil, net, int org) . (aero, biz,coop, museum, pro, info name) 2 0 0 0 -
. gTLD .com. , .com. , .com, . . 3.1 , . . . . - , . 1 , , , .
. 3.1.
1
. 3.1 : nih gov wrotethebook .
DNS
79
ICANN (Internet Corporation for Assigned Names and Numbers), IP-, -. ( .) , ICANN, . , , . ( 4.) , - - . . - , ( ) . , . , wrotethebook . , . , . , wrotethebook.com, . . . , (events.wrotethebook.com), , (articles.wrotethebook.com), . . . , . , (. 3.1). wrotethebook.com, . events articles, wrotethebook.com. DNS, NS (name server). , . DNS 8. . NS- . 3.2. linuxuser.articles.wrotethebook.com IP. wrotethe-
80
3.
. 3.2. DNS-
book.com, ( a.root-servers.net) . NS-, crab.wrotethebook.com wrotethebook.com. crab, linuxmag.articles.wrotethebook.com, articles.wrotethebook.com. linuxmag.articles.wrotethebook.com , , IP. - ( ) NS-. linuxuser.articles. wrotethebook.com, . , wrotethebook.com, crab, . 3.2 , . - , . - . . , , . .
. ( ) ( 1
) . 1 , , , ..
DNS
81
, ( F Q D N , fully qualified domain name)
. roaeit.wrotethebook.com - (FQDN) rodent, wrotethebook . . - , Unix . DNS . , wrotethebook.com, wrotethebook.com . crab.wrotethebook.com crab; DNS , wrotethebook.com.
, . , linuxuser.articles , , , articles. crab, , wrotethebook.com, crab.wrotethebook.com. 8, DNS , Unix-. - , . , . IP- .
BIND, named DNS Unix BIND. DNS (resolvers) . ( DNS) - , ; . - , ; . , . ( ), , . , . BIND , . , Berkeley Internet Name Domain (BIND). -
82
3.
, DNS-. DNS- . Unix- . BIND named ( -). . : (Master) ( (primary) ) -
, . , , . (authoritative), . . (Slave )
( ) -
. ; . , . . (Caching-only)
. , , . . . (non-authoritative), , . - DNS , , . DNS . DNS . , . . /etc/hosts ; DNS . , .
83
(NIS) (Network Information Service, NIS1) - , Sun Microsystems. . NIS DNS . NIS DNS , . DNS, NIS , , DNS, . NIS . - NIS , DNS, -. NIS Unix , . NIS. NIS , /etc/hosts /etc/networks. , , NIS. NIS . NIS DNS , , , NIS , DNS. DNS NIS . IP. , . - , . 8. - , . - .
, . , , . - - , . TCP/IP , , . SMTP (Simple Ma-'1
NIS - (Yellow Pages, ). , - .
84
3.
it Transfer Protocol, ), P O P (Post Office Protocol, ) , I M A P (Internet Message Access Protocol,
- ), MIME (Multipurpose Internet Mail Extensions, ). TCP/IP, , . , : SMTP, POP, IMAP MIME. SMTP, TCP/IP.
(SMTP)SMTP - TCP/IP- . . SMTP (Transmission Control Protocol, TCP) R F C 8 2 1 , A Simple Mail Transfer Protocol. -
25. 1 . 3.1 SMTP, . 3.1. SMTP Hello From Recipient Data Reset Verify Expand Help Quit HELO EHLO SMTP- SMTP
MAIL FROM: RCPT TO > DATA RSET VRFY EXPN HELP [] QUIT
SMTP - , . telnet 25 , SMTP. SMTP- , 1
TCP/IP , .
85
. Daniel rodent.wrotethebook.com Tyler crab.wrotethebook.com.
. . , . -. - . From . DATA , (.). QUIT. , . RFC 821 (SEND, SOML, SAML, TURN), SMTP. . HELP, VRFY EXPN , SMTP. SMTP .
86
3.
HELP , . HELP RSET RSET. , - ! VRFY EXPN , , , . EXPN admin, . VRFY , . VRFY , mac , . VRFY , jane - /etc/aliases. - jane, . , . SMTP . SMTP . , UUCP X. 400, , - . , . , . 3.3 . UUCP , SMTP . 1 SMTP , . , . , , . , . , 1
. , UUCP .
87
. 3.3.
. . , , . DNS . , - , . , TCP/IP , (Post Office Protocol, POP).
(POP) : 2 . 2, RFC 937, 109, , RFC 1725, 110. . POP , . 2 , . POP- . /; SMTP, (110) -
88
3.
. :
USER , PASS - , . ( , .) STAT , . 459 . RETR 1 . DELE 1 . . QUIT. ! . 3.2 . 3.2.
89
(RETR) (DELE) , . , . , , . - . , . , , , . , , IMAP.
- (IMAP)- (Internet Message Access Protocol, IMAP) POP. , POP, , , , . IMAP , . , IMAP TCP. IMAP - TCP 143.1 POP, IMAP / . IMAP , POP, IMAP 1
/etc/services IMAP: 143 220. 220 IMAP 3, 143 - IMAP 4 IMAP 2.
90
3.
. IMAP . IMAP, RFC2 0 6 0 , Internet Message Access Protocol - Version 4revl, . 3 . 3 . 3.3. IMAP4 CAPABILITY NOOP LOGOUT LOGIN SELECT EXAMINE CREATE DELETE RENAME SUBSCRIBE UNSUBSCRIBE LIST LSUB STATUS APPEND CHECK CLOSE EXPUNGE SEARCH FETCH STORE COPY UID , , , , , ,
AUTHENTICATE
91
IMAP . , , . IMAP telnet .
telnet; IMAP. IMAP - LOGIN; /etc/ passwd . , 0001. , , . . . IMAP . SELECT , . inbox. IMAP . ,
92
3.
, . , (Seen), (Unseen), (Deleted) . . FETCH . , . . , , Deleted STORE. DELETE , . Delete. Delete , EXPUNGE CLOSE, . LOGOUT. , IMAP POP , . , . . IMAP. , IMAP, , imapd. , ; , , telnet. LOGOUT, .
(MIME) , , - MIME (Multipurpose Internet Mail Extensions).1
, MIME TCP/IP, . MIME , , . SMTP TCP, . , SMTP, RFC 822, Standard for the Format of ARPA Internet Text Messages
( ARPA Internet). RFC 822 , , , SMTP. , 1
MIME Web HTTP.
93
. MIME RFC 822 , : . , RFC 821 RFC 822, 7- ASCII-. , ASCII, , . . RFC 822 , .
MIME , , , . R F C 1 5 2 1 Multipurpose Internet Mail Extensions Part One: Format of Internet Message Bodies ,
. Content-Type ContentTransfer-Encoding.
, Content-Type , . Subtype . RFC. MIME, , . 1 RFC :text
. RFC 1521 plain richtext. , 30 , enriched, xml html. application
. , RFC 1521, - octet-stream, 8- . - PostScript. , 200 . . , , application- msword.image
. RFC 1521 : jpeg gif. , 20 , , tiff, cgm g3fax.1
- ftp://ftp.isi.edu/in-notes/iana/assignments/ media-types.
94 video
3.
. mpeg, . , quicktime. audio
. - basic, PCM (pulse code modulation, - ). 20 audio-, MP4A-LATM.multipart
, . multipart . RFC 1521 . , mixed, , . : alternative, ; parallel, , ; digest, , message. , , , (voice-message) .message
, . RFC 1521 . , rfc822, , RFC 822. partial External-body , partial MIME-. External-body , MIME- , . , news http, HTTP-, MIME. Content-Transfer-Encoding . SMTP- 7- ASCII- 1000 . , MIME, , 7- ASCII-, . RFC 1521 . , . , RFC. :7bit
ASCII. ASCII- .
8bit
95
. . , SMTP-, 1000 .binary
. . , 1000 . binary 8bit , ; 8- . MIME .quoted-printable
. , ASCII-. ASCII , 127 33 , . . , ASCII- , , =0. , - , =3D, . quoted-printable.base64
. . (8- ) 6- , . 6- ASCII , . se64 - 76 . . 3.4 --4.
. 3.4. base64
96 x-token
3.
. . -. , . , . RFC . MIME RFC. MIME , SMTP. , SMTP - RFC 1869, SMTP Service Extensions. RFC 1869 SMTP; , , RFC. RFC 1869 , SMTP . (EHLO) . , , , , . , , , . SMTP, EHLO, ESMTP (Extended SMTP). MIME ESMTP. . 3.4. EHLO, , - RFC, - . - . SMTP. 3.4. SMTP
STARTTLS RFC
97
2487 Transport Layer Security 2554
AUTH
, , EHLO. Solaris 8, sendmail 8.9.3:
EHLO . , EXPN HELP, SMTP, ( . 3.1). 8BITMIME, SIZE, DSN ETRN - ESMTP, . 3.4. - VERB, ONEX XUSR. sendmail 8. RFC. VERB sendmail . ONEX . XUSR - -U sendmail. 1 , RFC ESMTP. . , Solaris 2.5.1 EHLO 1
sendmail .
98
3.
(EXPN, SIZE HELP). , , , sendmail. 1 EHLO - SMTP. ESMTP MIME - , , ASCII-. , , . SMTP, POP, IMAP MIME - , . , . , . , , , - . .
. , . , , .
- , ; . . , , , - . , . , . , .1
sendmail 10.
99
TCP/IP. . TCP/IP , :NetBIOS / (NetBIOS/Server Message Block )
NetBIOS IBM. - Microsoft Windows. Unix Windows - Samba, NetBIOS SMB (Server Message Block, ). (Network File System )
NFS Sun Microsystems . NFS , NFS Unix . Unix-, , NFS - Unix- . Windows- , Unix, Samba. 9.
. , , . ? , . . , , . . , . . . Samba Windows. - Unix 1 Ipd. 9.
100
3.
TCP/IP. , , , . .
, TCP/IP, . TCP/IP , . TCP/IP , - . , , . , . , , , . , . TCP/IP . , , , . TCP/IP , : RARP, DHCP. , RARP, .
(RARP) RARP (Reverse Address Resolution Protocol), RFC 903, IP, (Address Resolution Protocol, ARP). RARP IP- , IP-. , . 1 IP-, . RARP , IP- . , Ethernet. , 1
ARP, RARP , , Internet. TCP/IP 1.
101
. , Solaris 8 :
ifconfig . 1 dnetO - Ethernet. Ethernet ether. 0:0:c0:dd:d4:da. RARP IP- /etc/ethers. /etc/ethers , Ethernet . :
RARP-, /etc/ethers IP. DNS . hosts ethers:
, , RARP- Ethernet 0:80:7::8:04, 24seven /etc/ethers. IP- 24seven ARP - IP 172.16.3.4. RARP - , IP. , . , , - (Bootstrap Protocol), , IP, . RFC 951 RFC 1532. RARP: , RARP. - - RARP. 1
ifconfig 6.
102
3.
. . RFC 1048, , RFC 2132. DHCP (Dynamic Host Configuration Protocol). DHCP , .
(DHCP) (Dynamic Host Configuration Protocol, DHCP) RFC 2131 RFC 2132. DHCP . DHCP, DHCP RFC 1534. DHCP - , , , -. DHCP UDP-, (67 68), . DHCP . : , DHCP, , RFC Requirements for Internet Hosts ( ). DHCP TCP/IP. DHCP IP-. DHCP DHCP, . DHCP (options). RFC Requirements for Internet Hosts Options . , . , - - TCP/IP. . TCP/IP , . DHCP , , DHCP. IP. DHCP :
103
, DHCP. , DHCP, , , DHCP. .
, DHCP. . DHCP, .
DHCP , . . DHCP .
DHCP . (lease). , , . , . - DHCP. , , ( ) . - . . , , . . . , , . , . . DNS. DNS - IP. 1--
104
3.
, , . , , DHCP. Dynamic DNS (DDNS), . 1 , , . , . , DHCP . , . DHCP , . DHCP . DHCP, DHCP-. . , . - . - DHCP. , , DHCP, : , DHCP DHCP : , , ? DHCP , . DHCP DHCP ( DHCPDISCOVER), DHCP - . 255.255.255.255. 2 . , .1 2
DDNS 8. , , , - , .
105
DHCP UDP, , RARP, . DHCPOFFER. DHCP . UDP 67 , UDP 68 - . . , - . ( 1.) , / . DHCP , , IP-. DHCPDISCOVER, , IP- , , . DHCP . , UDP 68, , , . , , , . DHCPOFFER . DHCP TCP/IP. 9 DHCP, D DHCP. , DHCPOFFER - . 120 . , . , DHCPDISCOVER DHCPOFFER . , , , . DHCPOFFER, . DHCPOFFER DHCPREQUEST. DHCPREQUEST , . DHCPREQUEST, , , - . , DHCPACK, , DHCPOFFER. DHCP . 3.5.
106
3.
. 3.5. - DHCP
TCP/IP , , . , TCP/IP. , DNS (Domain Name System) NIS (Network Information Service). - , /etc/hosts. , , . NIS, Sun, , . DNS, TCP/IP, . DNS - , . TCP/IP SMTP (Simple Mail Transfer Protocol, ), POP (Post Office Protocol, ), IMAP (Internet Message Access Protocol, - ), MIME (Multipurpose Internet Mail Extensions, ). SMTP / -
107
. , . TCP/IP POP IMAP. SMTP 7- ASCII-. MIME TCP/IP, . NFS (Network File System) - Unix-. , . TCP/IP Unix LPD/LPR. Samba Windows. TCP/IP . . TCP/IP :RARP (Reverse Address Resolution Pro-
tocol) IP. RARP Ethernet- IP-. Ethernet IP /etc/ethers.
.DHCP (Dynamic Host Configuration
Protocol) , , RFC Requirements for Internet Hosts. , DHCP , . , TCP/IP. TCP/IP .
4
:
:
TCP/IP . TCP/IP , . - . TCP/IP . IP-. , : TCP/IP , , . , , .
, IP.
, , .
. , , . ,
109
. TCP/IP . , , , . TCP/IP , . ? , ? ? ? ? , .
, , . . , . TCP/IP, - () , (NAT). , , . . , , . , , TCP/IP ( , - ), , (intranets), .
, . . , . . - . 12 . - . , . (, ) . . -
110
4.
, . -, -, , -. , - . , - . : , , , . , . - . , . . . , , - IP-, , - , .
, : TCP/IP. TCP/IP, , , . 6, IP-, . , . , .
IP TCP/IP IP. , IP- . TCP/IP , IP- . , , RFC 1918, Address Allocation for Private Intranets ( ),
111
, . 1 : 10.0.0.0 ( 10/8) - 24- . 172.16.0.0 172.31.0.0 ( 172.16/12) - 20- . 192.168.0.0 192.168.255.0 ( 192.168/16) - 16- .
RFC 1918 , . : . , . . , . . RFC 1918 , .
RFC 1918 , . - (NAT). NAT , . NAT , , . : IP. . . , IP , . NAT RFC 1918 -. (), , . , RFC 1918, . , , 172.16.0.0 , , . , .
1
112
4.
, RFC 1918, - .1 .
:
NAT . , , .
, . . , IP-, .
, NAT-, . . , , , NAT.
NAT . , , , NAT . , . - , NAT. , . . - - , , , - . , . - . - FTP-. . , NAT - , NAT IP- , - .1
(martian, ) - .
113
- . IP. . - . , , NAT , -, - . , . NAT , , . NAT , . , IP-. , , . , , . , , NAT, , . - . , structure Guide ( ), :
. RFC 2901, Administrative Internet Infra-
, . : , DHCP- -, . - , , . -. , .
, . , , -
114
4.
. , . 8000 , . , , . -
, . - . - , , (NAP, network access point), 2, .
, -. , (Local Internet Registry) , . (Regional Internet Registry). RFC 2901 , . , -. , . , . , , . -. , , . . , . , : , , . , , , . RFC 2050,
Internet Registry IP Allocation Guidelines (
115 IP-
) : . (VLSM, variable-length subnet mask). VLSM ,
. , , . - , . . , , , . , , . - , , . , . , , . , . , , . , : . , . . , , , . , , . - . - . whois, - , . , NIC-handle,
116
4.
whois. NIC-handle - cwh3. NIC . . , , . , - . IP :IANA
- IANA (The Internet Assigned Numbers Authority) .
IANA . :APNIC
APNIC (Asian Pacific Network Information Center) .ARIN
ARIN (American Registry for Internet Numbers) .RIPE
Reseaux IP Europeens .
IANA . , . , . . , , , . , . APNIC . http://www.apnic.net/member/
117
application.html. APNIC, . ARIN . http://www.arin.net/templates/networktemplate.txt. - http:// www.arin.net/templates/isptemplate.txt. [email protected]. RIPE . RIPE RIPE. RIPE . ftp://ftp.ripe.net/ripe/docs/ripe-159.txt. : , , , , , . IP-. , , . IN-ADDR.ARPA IP- in-addr.arpa. . in-addr.arpa 8, - IP , , , . , , in-addr.arpa. , . , , in-addr.arpa. , , . APNIC, ftp://ftp.apnic.net/ apnic/docs/in-addr-request [email protected].
ARIN, http:// www.arin.net/templates/modifytemplate.txt [email protected]. RIPE, RIPE. [email protected].
118
4.
, RIPE. , . RIPE , . RIPE :domain:
. 8, , , in-addr.arpa. 172.16/16 16.172.in-addr.arpa.descr:
. , wrotethebook.com..admin-c:
NIC .tech-c:
NIC .-:
NIC , .nserver:
.nserver:
.nserver:
RIPE ns.ripe.net.changed:
, , .source:
, RIPE, RIPE. , , . , , . .
. 172.16.0.0/16.
119
1-, 2 4- .1 , , . 172. 16.0.0 172.16.255.255 . , , , . :
. , , .
, . - , , . , . , . , , , . . . , DHCP. - . , , , , . , , . , , . FPP , , , . , DHCP , , . 6, 3 9 DHCP.1
.
120
4.
, . , , . , .
, . , 172.16.0.0/16 16 , ARIN , 172.16.0.0 16- 255.255.0.0. 1 . 2 IP . , , . :
. Ethernet 10 - . Ethernet 500 ; - 300 ; 10- Ethernet-, , 2500 .2 , IP- Ethernet. , Ethernet-. , IP- Ethernet.
IP- , , , . . 4.1 (. ) 172.16.1.0 (Token Ring), Ethernet, 172.16.6.0 172.16.12.0.
. , , .1
2
172.16.0.0 , , RFC 1918. Ethernet, . Ethernet , .
121
- . - , TCP/IP. , . , :
, . , . , .
( ) . , .
, , . , . , , .
, , . , , . . . , , . , IP. 2, , , - . ( 1), ( 0). 255.255.255.0. 8 , 256 . , 256 254
122
4.
. . 4.1 . 172.16.1.0 172.16.12.0, , . . : , - DHCP. , . , , , . , (VLSM, variable-length subnet mask). . , 192.168.5.0/24 : 110 , 50 60 . . . 255.255.255.128 126 255.255.255.192 - 62 . VLSM , , , . ( 7.) - TCP/IP. , .
: 2 , . . , , . : , -
. , . , . , .
: ,
123
. . , . ; , . . , - . , . , , . , . . :, TCP/IP
. IP-, TCP/IP. TCP/IP IP-. , .
. .,
: . , - , . .
, . , .
124
4.
. 4.1.
. 4.1 , . (172.16.1.0) . . , , (172.16.1.0) , , 172.16.12.0, . - . - . , . . , (172.16.3.0, 172.16.6.0, 172.16.9.0) , , . , . , , , , . . . , 172.16.3.0 , 172.16.9.0 D, , .
:
125
. , . 4.1, , (Border Gateway Protocol, BGP). , BGP, . BGP ,
ber, ASN).1 BGP . , ASN , ( 64512 65535). , ASN , . , ASN . ASN, , . APNIC. http://ftp.apnic.net/apnic/docs/asn-request [email protected]. ARIN. http:/ /www.arin.net/templates/asntemplate.txt [email protected]. RIPE. ftp://ftp.ripe.net/ripe/docs/ripe-147.txt [email protected]. , . - , , - (multi-homed) . - , . , . ASN . , . ( ASN, , , !)1
(autonomous
system
num-
2.
126
4.
ASN . ASN , . 2 , , , . ASN, . . , (Internet Routing Registry, IRR). RADB (Routing Arbiter Database, RADB), 2, RIPE, ANS, Bell Canada Cable & Wireless. RIPE RIPE. ANS, Bell Canada Cable & Wireless . RADB . RADB (maintainer object). , . $200. AS. , , , Route. http://www.radb.net. (, , ) , , . , .
: , , IP-. (Domain Name System, DNS) , 3. . , , . .
- , . - ,
:
127
, ; , . . , . . . http://www.icann.org http://www.internic.net. . ICANN (Internet Corporation for Assigned Names and Numbers) - , , . ICANN . - ICANN . http://www.internic.net - - , gTLD- , . , , .. InterNIC - , .org, . .net. . 4.2 http://www.internic.net.
.
4.2.
128
4.
. , $50 , . , , , . , , , . . , , . Network Solutions , . .
, . http:// www.internic.net, , . - - . , Network Solutions http://www.internic.net, http://www.netsol.com. . - . , . , , . , Network Solutions, DNS . wrotethebook.com domain, . , , . whois, , . whois, NIC, . NIC - cwh3. , , . , . IP- , . , . . , Network Solutions, .
:
129
, , - , . , , , . . . .
, , . , , - , . ; , , . , . RFC 1178 . : , , , . IP , . , , . . , , : fall, jump, hop, skip, walk, run, stagger, wiggle, stumble, trip, limp, lurch, hobble . . , , , , . , , , . . , , , , , , . () : www, ftp, nfs . . . 8 ( CNAME). , , - . .
130
4.
- , , . , .
- , . 3 , . , .
, . showmount , . 1 , , . , , . , (man) Unix , , , , .
(1, lpd, Samba), , , : IP- , . , PostScript, . . . , , .
1
showmount 9.
131
TCP/IP . . , . , . , . , . , , . , , sendmail. , : (Mail server)
. , POP IMAP, , . (Mail relay)
- , . , , . (Mail gateway )
- , . , , SMTP. SMTP .400 . TCP/IP . I { , , . , , -. , -. - - , . , -
132
4.
, . 24 . TCP/IP : , POP IMAP . . . TCP/IP SMTP. , , SMTP- . MIME . ; , X , Y. IP- . , , .
, , , . , . -, . 3 NIS, NFS . , DHCP. DHCP , TCP/IP. , - IP, , , , , , - DHCP. . DHCP . . NIS NFS , NIS NFS . NIS , . NIS , Unix-. NFS .
133
() DHCP . DHCP , DHCP , . , , Web. . DHCP Unix Windows. , Unix DHCP , NIS NFS, , NFS. Windows DHCP , NetBIOS. TCP/IP . , , .
- TCP/IP. , , . , , : IP, , . , TCP/IP. , DNS, , . , . ( 6). Unix , TCP/IP .
5
Internet Internet
Unix, TCP/IP, IP- . TCP/IP Unix: . TCP/IP Unix. , , , . , , , 3. : . . . TCP/IP Unix.
, Unix, , . TCP/IP, , . . , , , , . -
135
Linux: , . Solaris. Solaris , . Solaris , . Solaris , Sun. Sun , Solaris, , , .
Unix , , . , . , , . Solaris . , Solaris , /etc/system, , . /etc/system. . , , . Solaris pkgadd. :
device - , - . /dev, /kernel/drv. Ethernet , DEC 21140. - dnet.1 /dev/dnet. 1
dnet . Solaris Ethernet, Solaris.
136
5.
/kernel/drv/dnet, , , - /kernel/drv/dnet.conf. dnet , . , /reconfigure. . . /reconfigure . Solaris , . Solaris ifconfig, 6, modlist, , TCP/IP. :# ifconfig dnetO modlist
0 arp
1 ip 2 dnet
, ARP Ethernet, ip TCP/IP, . , /kernel/drv. arp.conf, ip.conf dnet.conf. . Solaris ndd. , , ndd ?. , :# ndd /dev/ ? ? arp_cache_report arp_debug arp_cleanup_interval arp_publish_interval arp_publish_count (read (read (read (read (read (read only) only) and write) and write) and write) and write)
arp :9
, .arp_cache_report
, ARP. . 2.
137
arp_debug
, ARP. 0, . 1 . ARP - , ARP .arp_cleanup_interval
, .arp_publish_interval
, Ethernet.arp_publish_count
, , . Solaris, . - . modlist . ip ndd /dev/ip ?. 60 ! : ip_forwarding. ip_forwarding , ip , , . , . ip_forwarding , . ip_forwarding, , , . , , . , . , , IP :# ndd /dev/ip ip_forwarding 1 # ndd -set /dev/ip ip_forwarding 0 # ndd /dev/ip ip_forwarding
0
warding
ndd ip_for ip. , 1 . ndd -set
138
5.
ip_forwarding . , , . pkgadd, modlist ifconfig, ndd Solaris. , . , Linux. Linux , Solaris, . Linux , . . . , Linux, . , Linux, Ismod. Red Hat:
. (, smc-ultra SMC Ultra Ethernet), , Linux, IS08859 - DOS FAT (vfat). , lsmod, , . Size, . . , . smc-ultra 8390, 8390 - [smc-ultra]. 8390 , , Used by. : vfat fat, a cdrom ide-cd.
139
(autoclean). , , . autoclean - . , insmod. insmod. - . , 509, insmod 509. autoclean. , - insmod: insmod -k 509. insmod , . smc-ultra, 8390. modprobe. . smc-ultra, modprobe smc-ultra.modprobe , dep-
mod. depmod, . depmod - . modprobe . mmod. , : rmmod appletalk appletalk. , , autoclean, . smc-ultra Ethernet. Linux . - , . Ethernet . Ethernet /lib/ modules. Red Hat 7.1 Ethernet /lib/modules/2.4.7-10/kernel/drivers/net, :
140
5.
. , plip.o, Ethernet. , 3COM, SMC, NE2000, Ethernet Express. Linux Ethernet . Ethernet , modprobe, . , , . , . . Ethernet http://www.scyld.com, Linux. , , . /lib/modules. modprobe . , RPM, . Linux . TCP/IP , . Unix.
, , Linux FreeBSD. 1 1
BSD, SunOS 4.1.3, , FreeBSD.
141
. , , TCP/IP. Unix, , , TCP/IP. - , , , , . , , : , , , . , Unix . Unix. , . , , .
Linux Linux . Linux, http://www.kernel.org tar-. /usr/src/linux , , : # cd /usr/src # tar -zxvf linux-2.1.14.tar.gz Linux - , make. make , ( , Makefile), . :make config
- . . ,
142
5.
- , .make menuconfig
rses , . make config, , . make menuconfig , X Windows.make xconfig
X Windows . , , make xconfig . , . make xconfig. Linux /usr/src/linux. , make xconfig:# cd /usr/src/linux # make xconfig
make xconfig
, . 5.1.
.
5.1.
xconfig Linux
30 , . , . , TCP/IP, -
143
Networking options Network device support. . 5 . 2 , Network device support.
,. 5.2. Linux
, . : . , . . , . FDDI driver support. FDDI FDDI, . 5.2 . , , . . Help. Help , . , , , . . 5.2, Ethernet (10 or 100 Mbit) Ethernet (1000 Mbit), -
- Linux -
144
5.
Ethernet. Ethernet, , y,mvin.
Network device support Ethernet , , . , , . Linux TCP/IP, . Networking options (. . 5.1) Network options, 60 Linux . , , IPv4. , IPv4. . :Packet socket
. , tcpdump, . Packet socket Packet socket: mmapped ,
-, , . , , , - .Kernel/User netlink socket
. Routing messages Netlink device emulation. Netlink -
IPv4, ARP .Network packet filtering
IP-, . Network packet filtering Network packet filtering debugging. , , 12 (iptables).TCP/IP networking
TCP/IP, TCP/IP -
145
. TCP/IP networking TCP/IP:IP: multicasting
. 2.IP: advanced router
, . , . , Linux , . 7 gated Unix. , : IP: policy routing , , 7 BGP, 2 PRDB (Policy Routing Database). gated, gated . IP: equal cost multipath . 7 OSPF. IP use TOS value as routing key IP- Type of Service (TOS) . OSPF, RIP 2. gated, . IP: verbose route monitoring , . IP: large routing tables , .IP: kernel level autoconfiguration
. IP: support IP: RAMP support, - RARP. RARP 3.IP: tunneling
IPv4 IP, , . .
146 IP: GRE tunnels over IP
5.
GRE (Generic Routing Encapsulation), IPv4 IPv6 IPv4. IP: broadcast GRE over IP, . GRE Cisco.IP: multicast routing
. , , mrouted. IP: PIM-SM version 1 support PIM-SM.IP: TCP Explicit Congestion Notification support
IP: PIM-SM version 2 support,
(Explicit Congestion Notification, ECN). ECN , . Linux-, . ECN, .IP: TCP syncookie support
SYN- (cookies), SYN flooding ( Denial-Of-Service- SYN-).IP: Net filter Configuration
, Netfilter. 12 Netfilter iptables.QoS and I or fair queueing
, . , . . , make dep; make clean, . , . make bzlmage /usr/src/linux/i386/boot.1 1
Linux , .
147
, , , bzlmage, vmlinuz, . 1 Linux .2 Linux - Solaris: Linux , Solaris . BSD - .
BSD Linux, BSD Unix , make. config ( , Makefile), . FreeBSD /usr/src/sys/i386/conf.3 GENERIC FreeBSD. , TCP/IP. GENERIC, TCP/IP. TCP/IP GENERIC. 11 BSD , Linux: . BSD. , . , BSD . , GENERIC . FILBERT:
, /usr/src/sys/i386/conf , . , . , TCP/IP. , FreeBSD. 4' , , ; , . - . . . , . , . /usr/src/sys / s y s . / u s r / s r c / s y s . . BSD - Jle (Greg Lehey) The Complete FreeBSD, Walnut Creek CDROM.
3
4
148
5.
TCP/IP BSD , TCP/IP, . TCP/IP BSD : options, pseudo-device device. options options . TCP/IP options : BSD-, TCP/IP, options INET. DINET , , , IP, ICMP, TCP, UDP ARP. IP. .
ICMP- . , .
BSD 4.3 FreeBSD, FreeBSD BSD 4.3. , . , . pseudo-device , TCP/IP BSD, - pseudo-device. - , . pseudo-device (.) . , loop.h:
loop 10. 127.0.0.1; , .
149
, TCP/IP FreeBSD:pseudo-device ether # basic Ethernet support
Ethernet. ARP Ethernet ether. , Ethernet, . TCP/IP SLIP .pseudo-device si 2 # Serial Line IP
SLIP (Serial Litie IP). 2 SLIP, . slO s l l .pseudo-device 2 # Point-to-point protocol
Point-to-Point. 2 , . pppl. , .pseudo-device tun 1 # Tunnel driver(user process )
tun - , . - ; tun FreeBSD . 1 , . .pseudo-device bpfilter 4 # Berkeley packet filter
bpfilter , . - , tcpdump (. 13). bpfilter BSD, Ethernet (promiscuous mode).1 , -
, ( ) , . , , . bpfilter , Ethernet . Ethernet .
150
5.
. 4 Ethernet, bpfilter. device device. , TCP/IP, , . device . TCP/IP, Ethernet. device Ethernet, GENERIC:
device, Ethernet FreeBSD, :device edO at isa? port 0x280 net irq 10 iomem 0xd8000 device deO
- ISA PCI. device edO (isa), - (port 0x280), (irq 10) (iomem 0xd8000). ISA-. , device deO -
151
, , PCI. PCI . Ethernet - TCP/IP, FreeBSD. . SLIP :device device device device sioO siol sio2 sio3 at at at at isa? isa? isa? isa? port I0_C0M1 port I0_C0M2 disable port disable port flags 0x10 irq 4 irq 3 I0_C0M3 irq 5 I0_C0M4 irq 9
, sioO sio3, MS-DOS 1 COM4. SLIP . 6 . device . , ? , GENERIC, FreeBSD, . , , - , . , , . dmesg, , . , . options, pseudo-device device TCP/IP. , , . FreeBSD Unix TCP/IP. , , . , , TCP/IP. , TCP/IP. , , .
Unix IP. TCP/IP . Unix?
152
5.
. , , RIP (Routing Information Protocol) (DNS). , , , . , , . . -, , BSD System V. BSD : . , /etc/rc, /etc/reboot /etc/.local , , . BSD Unix , , /etc/reboot /etc/.local.
BSD, rc.local. . , , . BSD BSD SunOS. Linux Solaris System V, . 1 , init, .
System V, , init. , , init /etc/inittab - , init - , . Red Hat Linux. Linux , , ( ) :1
System V (1 Frisch) Essential System Administration ( ), O'Reilly.
153
0 , . 1 . , . S, 1. Solaris S. 2 - , . 3 - , NFS. Solaris. 4 . , 4. 5 X Window. Linux X Window. Linux 3, . Solaris . 5 Solaris . 6 . , , , -. , - . , init . . init inittab. /etc/inittab inittab, (#), . , inittab . inittab ::::
(. , . ; . , . 3, , , 3.
154
5.
. . , Linux inittab, (++); . , . . 5.1 , Red Hat, Mandrake Caldera Linux. 5.1. inittab Linux
Boot Bootwait Ctrlaltdel Initdefault Kbrequest
. ; init . ++, init SIGINT. . , init . (KeyBoardSignal) , , , , , init SIGPWR
Off Once Ondemand Powerfail
Powerokwait , init SIGPWR /etc/powerstatus Powerwait Respawn sysinit wait , init SIGPWR; init boot bootwait , init
- . , init. , . , , . , . , /sbin/shutdown -t3 - now, , Linux ++, - , . inittab -
155
. : . inittab Red Hat Linux :
- inittab, . init / etc / rc.d / rc.sysinit . . . . , rc.sysinit Red Hat: ; ; /; - fsck; . , Red Hat, . , Caldera . , -. , . , i n i t . . , . 13. , . - 3 . wait i n i t , inittab, 3. i n i t /etc/rc.d/rc - 3. , /etc/rc.d/rc, , , -
156
5.
/etc/rcn.d, - . 3, /etc/rc.d/rc3.d. Red Hat , :
rhnsd K16rarpd K20nfs K20rstatd K20rusersd K20rwalld K20rwhod K28amd K34yppasswdd K35dhcpd
K35smb K45arpwatch K45named K50snmpd K50tux K55routed K61ldap K65identd K73ypbind K74nscd
K74ntpd K74ypserv K74ypxfrd K75gated K84bgpd K84ospf6d K84ospfd K84ripd K84ripngd K85zebra
S05kudzu S06reconfig S08ipchains S09isdn SlOnetwork S12syslog S13portmap S14nfslock S17keytable S20random
S25netfs S26apmd S28autofs S40atd S55sshd S56rawdevices S56xinetd S601pd S80sendmail S85gpm
S85httpd S90crond S90xfs S95anacron S991inuxconf S991ocal
, , . - 3. , S, 3. , rc3.d, . , /etc//init.d. , S80sendma.il - init.d/sendmail. rc3.d, init.d, ? . . . . SlOnetwork , S80sendmail. , , . , , init.d - , . init.d:amd anacron apmd arpwatch atd autofs bgpd crond dhcpd
$ Is /etc/rc.d/init.dfunctions gated 9 pro halt httpd identd ipchains iptables isdn
kdcrotate keytable killall kudzu ldap linuxconf lpd named netfs
network nfs nfslock nscd ntpd ospf6d ospfd portmap random
rarpd rawdevices reconfig rhnsd ripd ripngd routed rstatd rusersd
rwalld rwhod sendmail single smb snmpd sshd syslog tux
xfs xinetd ypbind yppasswdd ypserv ypxfrd zebra
157
init.d. Red Hat - .local. BSD, Linux rc.local. : . rc.local, /etc/rc.d. , , . . S99local, rc.local. rc.local , . Solaris System V, , Linux. -, rc.local. , . -, Solaris . , , . , , . , /sbin/rc2 2, /sbin/ - 3. Solaris . Solaris 8 3 . /sbin/ /etc/rc2.d, /etc/rc3.d. /etc/rc2.d S69inet S72inetsvc. , /etc/rc2.d /etc/rc3.d.
, . , , . . , . , . . inetd, .
158
5.
Internet inetd ( --) , /etc/rc2.d/S72inetsvc. inetd , /etc/inetd.conf. , inetd . , inetd.conf. Solaris 8:ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd
inetd.conf, :
, /etc/services. ftp.
, . :stream
, TCP, TCP. 1dgram
(), UDP.raw
IP. .
, /etc/protocols. tcp udp. tcp6 udp6 Solaris , IPv4, IPv6. FTP TCP, tcp6.wait-status
wait nowait. , , , , wait, nowait. wait inetd , . nowait inetd 1
TCP/IP TCP, - AT&T - BSD.
Internet
159
, . nowait , , , .uid
uid - , . , root. . , Solaris 8 finger fs (Sun Font Server) nobody, .
, inetd. Solaris, /usr/ sbin/in.ftpd. . inetd . , . inetd, internal ..
, . argv[0] ( ). . , in. ftpd. , inetd.conf. , . . , . , # ( ) inetd. , inetd , . , . . , . Solaris/ etc/inetd.conf:
160
5.
TCP/IP. , tftp, . TFTP - FTP, . , , inetd.conf. - finger, , . inetd.conf tftp, . -, tftp . ( sed, !) inetd SIGHUP. :
. tftp. , tftp-cep . -s /tftpboot tftp: , , -s. , inetd.conf. , inetd, , inetd.conf.
Internet inetd - xinetd (Extended Internet Daemon). xinetd / e t c / x i n e t d . c o n f , xinetd , inetd.conf inetd. , , xinetd.conf . . . , in-
Internet
161
etd.conf . xinetd.conf protocol. , protocol = tcp. tftp xinetd.conf:
# -. service. ({}) . service, socket_type, protocol, wait, user, server server_args , inetd.conf Solaris. xinetd inetd. , disable = yes, , disable = yes xinetd tftp , disable = yes tftp inetd.conf . tftp, , disable = .
Red
Hat 7 xinetd. /etc/xinetd.conf Red Hat . Red Hat xinetd , xinetd.conf /etc/xinetd.d. /etc/xinetd.d/tftp Red Hat, . . xinetd . - , inetd.conf xinetd.conf. xinetd inetd 12.
162
5.
, , , /etc/inetd.conf /etc/xinetd.conf - TCP/IP Unix. TCP/IP. , Solaris, , (Linux) . , TCP/IP, , . - xinetd inetd. BSD , . Unix System V - . , . System V Solaris, Linux.inetd xinetd . Unix inetd, , Red Hat Linux, xinetd. inetd xinetd . . inetd xinetd 12.
. , , 4.
ifconfig
TCP/IP
6
, . , , . TCP/IP . : TCP/IP, , . TCP/IP , IP- , , . Ethernet-, Ethernet, IP- . ifconfig (interface configure, ), TCP/IP IP-, , . , (Point-to-Point Protocol, -), , TCP/IP .
. , , . :> , , , ifconfig, , .
164
.
ifconfig ifconfig . Unix, ifconfig IP-, . IP-. ifconfig, Ethernet Solaris: # ifconfig dneto 172.16.12.2 netmask 255.255.255.0 broadcast 172.16.12.255 ifconfig ; . , TCP/IP, :
, TCP/IP. Ethernet dnetO.
IP-, . . /etc/hosts . /etc/hosts, ifconfig DNS. IP- 172.16.12.2.netmask-
. , , . - 255.255.255.0, dnetO. 2 4.broadcast-
. , IP-, 1. (172.16.12.255), , , Solaris 8 . . /, . Solaris . ( ) , : # ifconfig dnetO 172.16.12.2/24
ifconfig
165
, . 24 255.255.255.0. - 172.16.12.255. , . , 4. , ifconfig, .
5 , Ethernet Ethernet . , , . dmesg. :$ dmesg | grep ether Oct 1 13:07:23 crab gld: [ID 944156 kern.info] dnetO: DNET 21x4x: type "ether" mac address 00:00:c0:dd:d4:da $ dmesg | grep eth ethO: SMC EtherEZ at 0x240, 00 00 CO 9A 72 CA,assigned IRQ 5 programmed-1/0 mode.
dmesg , Solaris 8 , Ethernet. type "ether' , dnetO - Ethernet. , Ethernet- (00:00:c0:dd:d4:da). dmesg, PC Linux, . Linux Ethernet eth, , . Linux Ethernet- |00:00:0:9:72:), (SMC EtherEZ) . dmesg . . TCP/IP , Internet, . OSI: , . IP , , . . .
166
6.
? netstat ifconfig. , , :
-i netstat , - - . Solaris 8 netstat -in :Name
. ifconfig. (*) , , .Mtu
(Maximum Transmission Unit) (), . MTU , .Net/Dest
Network/Destination (/ ) ( ), . Ethernet . IP- . -, . - , -. 1 - - . ifconfig. .Address
IP- -, .Ipkts
Input Packets ( ) , .Ierrs
Input Errors ( ) , .1
. 2.
ifconfig
167
Opkts O u t p u t Packets ( ) , . Oerrs O u t p u t E r r o r s ( ) , . Collis Collisions (collisions, ) Ethernet, . Ethernet - , Ethernet. . Queue Packets Queued ( ) , . . netstat -in Linux :
- , . , MTU . 1 RX-OK - , RXERR (), RX-DRP () RX-OVR () . - -, TX-ERR, TX-DRP TX-OVR . , Solaris, : Net/Dest Address. , Linux , Solaris. Met , . Fig : R , (running). U , (up). , . L , (loopback).
, , . , . 10 , TCP/IP. 1
, netstat, 13.
168
.
5. ethO - Ethernet, . - , . 10 Solaris, : Solaris, plumb. , . plum