. SLIP -- CSLIP, SLIP, IP IP . PPP, Point-to-Point -- . PPP SLIP, . SLIP, IP , . - 23 - 2.3.6. (TCP) , quark, rlogin erdos quark. , , . , . IP, . Ethernet XFree86 GMU FTP . gateway , , . quark, sophus . IP . . . c , TCP, , IP . TCP , IP, , , . A TCP , . . TCP IP , . . , IP , . rlogin, - (rlogin) erdos, 513 quark, rlogind . TCP . , rlogind - 24 - , . / TCP , , rlogin TCP . 2.3.7. (UDP) , TCP TCP/IP . rlogin, NFS. , UDP, . TCP, UDP , , . , . , TeX NFS , galois, , LaTeX. , . , TCP galois, , . , galois, UDP , . , UDP . NFS. 2.3.8. . () , ( ). , . , , . , , - 25 - , 513 . TCP , . , quark erdos, rlogin 1023, 1022. , 513 quark. , . , . , rlogin, . IETF ( Internet ), RFC . , , . Linux , , , /etc/services. 10.3. , TCP UDP , . TCP 513, , UDP 513. , , rlogin (TCP) rwho (UDP). 2.3.9. (socket) Unix , , , Linux. Unix - Berkeley. - (). (bind(2)) , , , , ( connect(2), listen(2), and accept(2)). - 26 - , TCP/IP (AF INET ), , (AF UNIX ). XNS ( ) , X.25. Linux, -- libc C . , AF INET AF UNIX , Novell , , . 2.4. Linux , Linux . , , . UUCP Linux , tcp/ip- 1992, Ross Biro , Net-1. Ross 1993, Fred van Kempen , . Net-2. , Net-2d, 1992 ( 0.99.10 ), , Alan Cox, Net-2Debugged. , Net-3. . Net-3 Ethernet, SLIP ( ), PLIP ( ). Net-3, Linux TCP/IP , . , Linux. - 27 - PPP ( point-to-point, ), Beta , AX.25 - Alpha . Alan Cox Novell's IPX , Novell - Novell . - samba, NetBIOS , Andrew Tridgell. 2.4.1. , , Fred Net-2e, . , Net-2e Beta . Net-2e - DDI, . DDI . TCP/IP Matthias Urlichs, ISDN Linux FreeBSD. , BSD Linux. , Net-3 . Alan AX.25 , . , "" , . , . , Net-2e Net-2d Net-3, . , ; rlogin telnet . , . , TCP/IP. , - 28 - . 2.4.2. FTP. FTP Net-3 - sunacm.swan.ac.uk, sunsite.unc.edu system/Network/sunacm. Net-2e ftp.aris.com. Matthias Urlichs' bsd ftp.ira.uka.de /pub/system/linux/netbsd. nic.funet.fi /pub/OS/Linux/PEOPLE/Linus; sunsite tsx-11.mit.edu . 2.5. , . , , -- , , , , , . . -- log . . , smail C news, . . . , , , logfile root. root; , root , 15. - 29 - , . , . , email root, , . , postmaster, newsmaster usenet. hostmaster DNS. 2.5.1. -- , , . y , , . . , , ; , . , , . Simon Garfinkel " UNIX " ( . [ GETST ""]) -- . . , , ... COPS , , . , . , , - 30 - . , " ," , . , root , . , , TFTP ( ) , /boot. , TFTP, . , , TFTP /boot? , . 10., tcpd, . -- "" . , , , , . . , . , , , . , . , , . , . -- log , , . , tripwire, - 31 - . Tripwire . . 2.6. Linux TCP/IP , . IP 3 . IP , address resolution, . 4. , Ethernet . , TCP/IP , UUCP. 6. TCP/IP. , hostname resolution . SLIP PPP. 8. SLIP , . 9. PPP pppd. 10. , rlogin, rcp, .., inetd - . NIS, , NFS, . NIS - - 32 - . NFS . 13. Taylor UUCP, UUCP . Usenet . 14. , 15. 16. smail sendmail, , Linux. , smail ( ), sendmail . 17. 18. Usenet C news, Usenet . 19. NNTP daemon, . 20. newsreader. . - 33 - 3. TCP/IP Linux TCP/IP, IP , , - . , , , , . 3.1. , , TCP/IP , . . , , , Ethernet Linux eth0 eth1, SLIP -- sl0, sl1, ... , . . TCP/IP , IP , . ; , , . , ; - , Maximum Transfer Unit, MTU. - 34 - . 3.2. IP K , c IP -- 32- . . , TCP/IP , . , Inetrnet, NIC. , IP 8 , octets. , quark.physics.groucho.edu IP 0x954C0C04, 149.76.12.4. dotted quad notation. , IP , octets, , . NIC , , . , , IP . , . , IP . A 1.0.0.0 127.0.0.0. octet, 24 , 1.6 . B 128.0.0.0 191.255.0.0; octets. 16320 65024 . C 192.0.0.0 223.255.255.0, - 35 - octets. 2 254 . D, E, F 224.0.0.0 254.0.0.0 , - . , 149.76.12.4, quark, 12.4 149.76.0.0 B. , octet . octets 0 255 . -- , 1 broadcast () . . , 149.76.255.255 , 149.76.0.0. , 0.0.0.0 127.0.0.0. default route( ), loopback () . default route IP , . 127.0.0.0 IP . , 127.0.0.1 , loopback, . IP TCP UDP . "" . , . , UUCP IP , INN . Linux, INN loopback. 3.3. Address Resolution( ). - 36 - , IP , Ethernet ? Ethernet , IP . , IP Ethernet. Address Resolution Protocol ( ), ARP. , ARP Ethernet, . , ARP , X. . , . ARP Ethernet IP , Ethernet "broadcast"(), . ARP IP . , , ARP- . Ethernet . Ethernet , Ethernet. Routing(), . . ARP. Ethernet , ARP , , , . , ; , Ethernet , . . - 37 - , IP Ethernet . , , . , , Ethernet ! IP . , Reverse Address Resolution Protocol ( ARP), RARP. BOOTP , . 3.4. IP 3.4.1. IP <> , : , , , ... , , : , , ... : , , , , , . IP . Inetrnet , . , . , , . 3.4.2. IP , . , - 38 - IP . , IP , . (2) , , Ethernets. , IP IP . IP . A, B, C, IP . , , . subnet() , netmask. - 32 , IP . Groucho Marx - . B 149.76.0.0, netmask 255.255.0.0. , GMU , . IP 254 , 149.76.1.0 149.76.254.0. , 149.76.12.0. 149.76.1.0. IP , octet , . 255.255.255.0. 3.4.2 149.76.12.4, quark, - B, . subnetting ( ) -- . ( ). , - 39 - , ( Ethernets), ( ) . , , . 3.4.3. Gateways Subnetting - , . , Ethernet, : , , , . gateways. Gateway -- , . IP , IP . 149.76.4.0 . quark, erdos IP , 149.76.12.4, , gateway (sophus ). Sophus : , . (eth0 fddi0 ). IP ? 149.76.1.0 149.76.4.0? : . , sophus IP 149.76.4.1, , 149.76.1.4. , gateway IP , . ( netmask) , . , - 40 - sophus : ---------------------------------------- +-------+-------------+----------------+ | | | Netmask | +-------+-------------+----------------+ +-------+-------------+----------------+ | Eth0 | 149.76.4.1 | 255.255.255.0 | | fddi0 | 149.76.1.4 | 255.255.255.0 | | Lo | 127.0.0.1 | 255.0.0.0 | +-------+-------------+----------------+ +-------+-------------+----------------+ loopback lo. 3.4.3 Groucho Marx (GMU). , . , . , , , Ethernet IP . , , gateway. 3.4.4. , IP gateway . erdos, quark, , . gateway, sophus, . Sophus , quark , , gateway, . niels (gateway ). sophus gateway. - 41 - IP , gateways. (the default route), . gateway 0.0.0.0.. sophus, : ----------------------------------------- +------------+-------------+------------+ | | Gateway | | +------------+-------------+------------+ +------------+-------------+------------+ | 149.76.1.0 | - | Fddi0 | | 149.76.2.0 | 149.76.1.2 | fddi0 | | 149.76.3.0 | 149.76.1.3 | fddi0 | | 149.76.4.0 | - | Eth0 | | 149.76.5.0 | 149.76.1.5 | fddi0 | |... | ... | ... | | 0.0.0.0 | 149.76.1.2 | fddi0 | +------------+-------------+------------+ +------------+-------------+------------+ , sophus "-" gateway. . , IP, . (. 6.). , ; "" . . ( ), RIP, Routing Information Protocol ( ), BSD - 42 - . EGP ( Gateway ), BGP ( Gateway ); ( RIP) gated ( University of Cornell's). 3.4.5. RIP , "hops"(), gateways , . , RIP . 16 . RIP , , gated . gated . ( loopback ), , . , RIP . , gated . . , , , ,