Antipov D. TCP/IP servis dlya IBM PC. 1994 .REPLYADDR dima@elvis.msk.su X-RealName: Dima Antipov .Organization: Elvis+, Ltd. TCP/IP servis dlya IBM PC. (Obzor paketov programm) Antipov D. Versiya 12.3.94. Copyright (c) Elvis+ Co, Ltd. 1994. 103460, Moskva, Zelenograd, Central'nyj prospekt, 11. AO |LVIS+ Tel. (095) 532-8689 Faks (095) 531-2403 Status etogo dokumenta: razresheno svobodnoe rasprostranenie, kopirovanie, reproducirovanie v lyuboj forme bez polucheniya special'nogo razresheniya. Zapreshcheno vnosit' v tekst lyubye izmeneniya. Pri citirovanii ssylka na dokument i firmu obyazatel'na. Poslednyuyu versiyu etogo dokumenta mozhno najti na servere ftp.elvis.msk.su v kataloge /pub/windows/winsock/quick/pc-ip.txt ¡ ftp://ftp.elvis.msk.su/pub/windows/winsock/quick/pc-ip.txt Vashi zamechaniya, dopolneniya, voprosy budut prinyaty s blagodarnost'yu, esli ih napravit' po adresu: dima@elvis.msk.su Copyright. Unix - zaregistrirovannyj tovarnyj znak firmy AT&T. PostScript - zaregistrirovannyj tovarnyj znak firmy Adobe Systems. MS-DOS - zaregistrirovannyj tovarnyj znak firmy Microsoft. MS-Windows - zaregistrirovannyj tovarnyj znak firmy Microsoft. Novell - zaregistrirovannyj tovarnyj znak firmy Novell. PC NFS - zaregistrirovannyj tovarnyj znak firmy Sun Microsystems. PC TCP - zaregistrirovannyj tovarnyj znak firmy FTP Software. Soderzhanie Sistemy na baze TCP-IP Internet Naibolee chasto ispol'zuemye servisnye programmy. gopher Mosaic ili WWW-klient (World Wide Web) WAIS (Wide Area Information Servers) mail (elektronnaya pochta) news (Usenet) IRC (Internet Relay Chat) finger telnet FTP (File Transfer Protocol) archie X-server lpq/lpr/lprm ping Setevye pakety, podderzhivayushchie TCP/IP PCNFS i PCTCP. TCPABI (Copyright (c) P.R.Tattam) WATTCP (Waterloo TCP) Trumpet WINSOCK Setevaya model' TCP/IP. Odnovremennoe ispol'zovanie neskol'kih setevyh paketov. Ustanovka Trumpet Winsock. Prilozheniya WinSock. WS_PING. WSFINGER. WinQVT. WinVn. WS_FTP. WINARCH. NCSA-telnet. EINet winWAIS. NCSA Mosaic. Gde nahodyatsya programmy. Literatura. Sistemy na baze TCP-IP Naibolee shirokoe rasprostranenie v nastoyashchee vremya nashli setevye sistemy postroennye na osnove protokolov semejstva TCP/IP. Pervonachal'no eti sistemy bazirovalis' na mnogopol'zovatel'skih UNIX-mashinah, odnako v poslednee vremya prakticheski ves' setevoj servis stal dostupen i na personal'nyh komp'yuterah, naprimer tipa IBM-PC, prichem kak pod MS-DOS tak i pod MS-Windows. Mnogozadachnyj rezhim raboty v sisteme MS-Windows pozvolyaet pol'zovat'sya neskol'kimi setevymi uslugami odnovremenno.Naprimer, vy mozhete kopirovat' fajly s fajlovogo servera, i odnovremenno, po tomu zhe setevomu kanalu chitat'/otpravlyat' soobshcheniya drugim pol'zovatelyam, proizvodit' poisk v bazah dannyh i t.d. Pri etom vam ne pridetsya tomitsya v bezdejstvii, ozhidaya okonchaniya kakoj-libo operacii. Vy prosto pereklyuchaete svoe vnimanie na chto-nibud' drugoe, naprimer chtenie lichnoj pochty ili novostej. Internet Posle integracii mnogih lokal'nyh setej v Internet, servis, kotoryj mozhno poluchit' na komp'yutere znachitel'no rasshirilsya. |to i informaciya o razlichnyh nauchnyh i issledovatel'skih proektah, ogromnye fajlovye arhivy, kommercheskie bazy dannyh, sredstva obmena informaciej (bol'shej chast'yu v rezhime on-line, t.e. otvet vy poluchite s zaderzhkoj men'she chem neskol'ko sekund). Novym tolchkom k razvitiyu posluzhila kommercializaciya seti. K Internet podklyuchayutsya banki, birzhi, reklamnye i torgovye agentstva promyshlennye firmy i t.d. Po dannym, sobrannym Win Treese (treese@crl.dec.com) i opublikovannyh v Internet GNN, nachinaya s avgusta 1991 bolee chem polovina vseh zaregistrirovannyh setej, podklyuchennyh k Internet - kommercheskie. Za 1993 god chislo obrashchenij k sisteme Gopher vyroslo na 997%, a k Mosaic na 341.634%. V 1993 godu novaya set' podklyuchalas' k Internet v srednem kazhdye 10 minut. V Norvegii na 1000 chelovek naseleniya prihoditsya 5 mashin, podklyuchennyh k Internet, a v SSHA - 4. V iyule 1993 obshchee chislo mashin v Internet bylo primerno 1,776,000. Po elektronnoj pochte cherez Internet dostupno (po ne tochnym dannym) 137 stran. Glavnym sderzhivayushchim faktorom dlya razvitiya setej v nashej strane schitalas' vysokaya stoimost' oborudovaniya. Odnako v poslednee vremya rynok bukval'no zavalen nedorogimi setevymi kontrollerami i modemami. Zamet'te, chto esli vy imeete lokal'nuyu set' vam ne nuzhno dlya kazhdoj mashiny pokupat' otdel'nyj printer i derzhat' na lokal'nom diske kazhdoj mashiny svoyu kopiyu odnih i teh zhe programm i paketov. Vsyu etu nagruzku voz'mut na sebya special'no vydelennye dlya etoj celi setevye ustrojstva. A podklyuchivshis' k Internet vy otkroete novyj mir unikal'nyh vozmozhnostej. Posle pervogo zhe nebol'shogo znakomstva s Internet ya ponyal, chto rabotu v seti i bez nee mozhno sravnit' s rabotoj s komp'yuterom i bez nego. Esli vy imeete tol'ko neskol'ko komp'yuterov, ili dazhe odin, vy vse ravno mozhete podklyuchit'sya k Internet, vospol'zovavshis' naprimer, obychnym telefonnym (modemnym) soedineniem . Konechno, rabotat' cherez modem namnogo medlennee chem cherez setevoj adapter, no eto edinstvennoe otlichie. Prakticheski vse setevye programmy rasschitany na rabotu v tom chisle i na medlennyh liniyah. Naibolee chasto ispol'zuemye servisnye programmy. Nizhe opisany naibolee chasto ispol'zuemye servisnye programmy [1]. gopher Proizvodit informacionnyj servis, delaya dostupnym informaciyu v Internet cherez sistemu ierarhicheskih menyu. Gopher-klient mozhet podklyuchitsya k lyubomu Gopher-serveru Internet i poluchat' informaciyu, dostupnuyu etomu serveru. Krome togo, cherez Gopher mozhno poluchat' razlichnyj setevoj servis: ftp, News, Archie i dr. (ob etih sistemah sm. nizhe). Est' i svoya sistema poiska informacii (Veronica). V ExUSSR est' sleduyushchie servera: amet.net.kiae.su - Relcom Information System rd.relcom.msk.su Relcom Research & Development ftp.pczz.msk.su hq.izhmark.udmurtia.su Mosaic ili WWW-klient (World Wide Web) V osnove takzhe lezhit ierarhicheskaya ideologiya dostupa k informacii. No v otlichii ot gopher imeet gipertekstovuyu obolochku, to est' pozvolyaet srazu zhe otobrazhat' poluchennuyu informaciyu bud' to graficheskie illyustracii, komp'yuternyj fil'm ili muzyka. Krajne prost v ispol'zovanii. Vy prosto nazhimaete knopku myshi v opredelennyh tochkah stranicy i perehodite k novoj stranice, otkuda opyat' mozhno perejti k sleduyushchej i t.d. WAIS (Wide Area Information Servers) Sistema hraneniya i poiska dokumentov v seti Internet. Dlya poiska ne trebuetsya special'nogo yazyka zaprosov. Zaprosy formiruyutsya na obychnom russkom ili anglijskom yazykah. Zaprosom mozhet byt' kak proizvol'nyj nabor klyuchevyh slov, tak i obychnoe predlozhenie tipa: "Rasskazhi mne o ...". Dlya bystroj raboty ispol'zuetsya indeksnyj poisk, est' mehanizm kotoryj pozvolyaet ispol'zovat' rezul'taty predyidushchego poiska dlya sleduyushchih. V nastoyashchee vremya v Internet sushchestvuet bol'shoe kolichestvo baz dannyh dlya WAIS ohvatyvayushchih chrezvychajno shirokij spektr znanij: - biologiya (server "net.bio.net", baza "biology-journal-contents"); - matematika (server "cirm5.univ-mrs.fr", baza "/bases/bibli-cirm/cirm- books.src"); - obrazovanie (server "borg.lib.vt.edu" baza "/LocalLibrary/WAIS/jte/jte"); - lirika (server "cs.uwp.edu" baza "lyrics"); - psihologiya (server "gopher.stolaf.edu" tcp-port 8001 baza "MacPsych"); - algoritmy (server "theory.lcs.mit.edu", baza "/i/wais-index/algorithms- suggest"); - informaciya o servise, dostupnom cherez Internet (server "wais.concert.net" tcp-port 8000 baza "netinfo"); a takzhe sotni drugih baz i serverov. Na mashine elvis.msk.su otkryt dostup k WAIS serveru, soderzhashchemu dokumenty s kommercheskimi ob®yavleniyami i so spiskami fajlov serverov ExUSSR. mail (elektronnaya pochta) Pozvolyaet obmenivat'sya soobshcheniyami s pomoshch'yu komp'yutera. Pohozha na obychnuyu pochtu, no pis'ma nuzhno ne opuskat' v pochtovyj yashchik, a otpravlyat' i prinimat' s pomoshch'yu special'nyh programm, ustanovlennyh na komp'yutere. CHerez Internet vashe pis'mo popadet v lyubuyu tochku zemnogo shara za schitannye minuty.Sushchestvuet vozmozhnost' otpravlyat' i prinimat' pis'ma prakticheski v/iz lyuboj seti mira. Pis'mo predstavlyaet soboj obychnyj tekstovyj fajl s zagolovkom v nachale, kotoryj sostoit iz neskol'kih tekstovyh strok: From: e-mail@adres.otpravitelya Date: data otpravleniya To: e-mail@adresa.poluchatelej Cc: e-mail@adresa.poluchatelej.kopii.pis'ma Subject: Stroka s kratkoj annotaciej pis'ma a takzhe neskol'kih sluzhebnyh polej - marshrut, kotorym shlo pis'mo, razmer, status i t.d. E-mail adres v Internet, v obshchem sluchae, sostoit iz imeni pol'zovatelya i imeni mashiny (naprimer dima@elvis.msk.su). Adres mozhet imet' ne tol'ko chelovek, no i nekotorye demony-programmy (naprimer news, newsserv, mailserv, root, uucp i dr.) Obychno Mail-klient soderzhit v sebe tekstovyj redaktor, dlya podgotovki novyh pisem i chteniya prihodyashchih, podsistemy sortirovki i hraneniya pochty. V Internet ispol'zuetsya neskol'ko protokolov dlya peredachi pochty: SMTP (Simple Mail Transfer Protocol) - otpravlenie soobshchenij; POP2 (Post Office Protocol Version 2) - tol'ko poluchenie soobshchenij; POP3 (Post Office Protocol Version 3) - otpravlenie/poluchenie soobshchenij; IMAP (Interactive Mail Access Protocol) - otpravlenie/poluchenie soobshchenij. V dokumentacii na Mail-programmu ukazyvaetsya, s kakimi protokolami ona rabotaet. V Relkome pochtovye soobshcheniya na russkom yazyke prinyato peredavat' v kodirovke KOI8. Esli vash komp'yuter ispol'zuet druguyu kodirovku, to libo programma na vashej mashine, libo na pochtovom servere dolzhna umet' preobrazovyvat' informaciyu iz odnoj kodirovki v druguyu. V sistemah tipa MS-Windows inogda spasaet vybor sootvetstvuyushchego fonta, no uchtite, chto mogut vozniknut' problemy s vvodom simvolov s klaviatury. news (Usenet) Usenet sejchas - eto tysyachi News-grupp, kazhdaya iz kotoryh soderzhit stat'i s opredelennoj temoj. Stat'ya predstavlyaet soboj obychnoe pis'mo, tol'ko v otlichii ot elektronnoj pochty ee mozhet prochitat' lyuboj, kto podpishetsya na etu gruppu. CHasto Usenet nazyvayut telekonferenciyami ili eho- pochtoj, eho-konferenciyami. Telekonferencii dejstvuyut na osnove ustavov - pravil prinyatyh samimi uchastnikami [6]. Usenet bol'she vsego napominaet periodicheskuyu pechat'. Vy, podpisavshis' na gruppy s interesuyushchej vas temoj, regulyarno poluchaete stat'i samyh razlichnyh avtorov, kotorye, takzhe kak i vy podpisalis' na etu gruppu. No v otlichii ot gazet i zhurnalov, vy mozhete, naprimer, ne soglasitsya s avtorom i poslat' oproverzhenie v tu zhe gruppu, ili naoborot, dobavit' svoyu informaciyu v podtverzhdenie. Odnim slovom, uchastvovat' v diskussii. Odnim iz samyh krupnyh v nashej strane yavlyaetsya blok konferencij ierarhii RELCOM.*. Programmirovanie na razlichnyh platformah, geografiya, literatura, politika, muzyka, vystavki, kursy valyut, voprosy zakonodatel'stva, diskussii o rynke, birzhevaya informaciya - vot daleko ne polnyj perechen' voprosov, dostupnyj podpischikam Relcom. Otdel'no - bol'shoj paket konferencij s kommercheskimi ob®yavleniyami tipa kuplyu/prodam. Qushchestvuet vozmozhnost' otpravlyat' i poluchat' stat'i prakticheski v/iz lyuboj seti mira. Poskol'ku chislo abonentov postoyanno uvelichivaetsya, novye gruppy sozdayutsya nepreryvno. Programmy ispol'zuyut protokol NNTP dlya dostupa k Usenet i obychno vklyuchayut v sebya tekstovyj redaktor, sistemy sortirovki i hraneniya, sredstva dlya otpravki soobshcheniya v gruppu, dayut vozmozhnost' otvetit' avtoru stat'i kak cherez elektronnuyu pochtu, tak i v News-gruppu, vozmozhnost' pereslat' stat'yu komu- nibud' po elektronnoj pochte. IRC (Internet Relay Chat) Ochen' pohozh na News, no dialog vedetsya v real'nom vremeni, kak na selektornom soveshchanii. Mnozhestvo razlichnyh grupp. Est' russkoyazychnye gruppy (naprimer server irc.funet.fi kanal #russian). Dlya sozdaniya novoj gruppy dostatochno prosto prisoedinitsya k nesushchestvuyushchemu kanalu s trebuyushchimsya vam imenem. Esli vybrannaya vami tema diskussii budet interesna drugim pol'zovatelyam Internet, to oni tozhe podklyuchatsya k etomu kanalu i vy smozhete nachat' diskussiyu. Odnovremenno podderzhivaetsya obmen soobshcheniyami mezhdu dvumya pol'zovatelyami. Est' vozmozhnost' peredavat' fajly po IRC-kanalam. finger Pervonachal'no zadumana kak programma, kotoraya vozvrashchaet informaciyu o zaregistrirovannom pol'zovatele ili o pol'zovatelyah, kotorye v dannyj moment nahodyatsya v sisteme na udalennoj (ili lokal'noj) mashine. V kachestve parametra trebuet @. Esli ne ukazano imya mashiny, budet pytat'sya poluchit' informaciyu ot lokal'noj mashiny. Esli imya pol'zovatelya ne ukazano (simvol '@' pered imenem mashiny v etom sluchae obyazatelen, naprimer @elvis.msk.su), budet vydana informaciya o vseh pol'zovatelyah, imeyushchih terminal'nyj seans v dannyj moment vremeni. Inogda ispol'zuetsya takzhe dlya peredachi tekstovyh fajlov (text server) ili dlya polucheniya kakoj libo informacii. Sushchestvuyut mashiny, podklyuchennye k INTERNET, osushchestvlyayushchih podobnyj servis besplatno (naprimer svodka pogody - weather@wisc.edu , novosti Centra Kosmicheskih Issledovanij NASA - nasanews@space.mit.edu). Naprimer - amerikanskij hit-parad: C:\> finger buckmr@rpi.edu [rpi.edu] Login: buckmr Name: Ron Buckmire Directory: /home/58/buckmr Shell: /usr/local/bin/session Project: To create a world free of homophobia, racism and sexism. Plan: *** PROVIDED FOR PERSONAL EDUCATIONAL USE ONLY *** Here is an update on the available charts for the week ending 02/05/94: Copyright Billboard Magazine (1994) To see the latest Billboard chart info try "finger buckmr@rpi.edu" or 'telnet rpi.edu 79' and enter 'buckmr'. ? = previous position unknown - = no previous position ------------------------------------------------------------------------------ U.S. Top Pop Singles: 1. (01) BRYAN ADAMS/ROD STEWART/STING -- All For Love [THIRD week at #1] 2. (02) MARIAH CAREY -- Hero 3. (04) CELINE DION -- The Power Of Love 4. (03) TONI BRAXTON -- Breath Again 5. (1?) ACE OF BASE -- The Sign 6. (07) ACE OF BASE -- All That She Wants 7. (06) MICHAEL BOLTON -- Said I Loved You...But I Lied 8. (05) JANET JACKSON -- Again 9. (08) BRYAN ADAMS -- Please Forgive Me 10. (09) SALT-N-PEPA -- Shoop [...] telnet Ispol'zuet standartnyj protokol Internet dlya polucheniya terminal'nogo dostupa k udalennoj mashine. Posle zapuska etoj programmy vasha mashina budet emulirovat' udalennyj terminal. Sushchestvuet spisok mashin, podklyuchennyh k INTERNET, razreshayushchih ogranichennyj dostup besplatno [2]. Mnogie mashiny pri etom predostavlyayut dostup k svoim bazam dannyh, esli ispol'zovat' special'noe imya pol'zovatelya (naprimer bibliotechnaya sistema universiteta v Stenforde - telnet forsythetn.stanford.edu i imya pol'zovatelya socrates) ili k drugim klientam Internet: Klient! Host !Login ------+--------------------+------ mosaic!sunsite.unc.edu !lynx gopher!info.elvis.msk.su !gopher WAIS !info.elvis.msk.su !swais IRC !info.elvis.msk.su !irc Primer: C:\> telnet info.elvis.msk.su Trying info.elvis.msk.su.... login: irc FTP (File Transfer Protocol) Pozvolyaet pol'zovatelyam odnoj mashiny poluchat' dostup k fajlovoj sisteme i poluchat' (peredavat') fajl s drugoj mashiny (na druguyu mashinu). Na mnogih mashinah INTERNET imeyutsya ogromnye kollekcii (terabajty informacii) arhivov programmnyh sredstv, vsevozmozhnoj dokumentacii, hudozhestvennoj literatury, komp'yuternye fil'my, muzyka i dr. Kak pravilo, etot servis predostavlyaetsya besplatno, pri uslovii, chto v kachestve imeni pol'zovatelya vy zadadite anonymous, a v kachestve parolya svoj e-mail adres. Spisok takih mashin dostupen v Mosaic (http://hoohoo.ncsa.uiuc.edu/ftp- interface.html). Naibolee krupnye FTP-arhivy v ex-USSR: ftp.kiae.su archive.monolit.kiev.ua ftp.stc.simbirsk.su ftp.sovam.com ftp.pczz.msk.su orgland.zgrad.su ftp.elvis.msk.su Informaciya o novyh postupleniyah na eti i drugie servera regulyarno publikuetsya v razlichnyh telekonferenciyah, naprimer, relcom.archives. archie Sistema avtomaticheskogo poiska fajlov v arhivah Internet, dostupnyh po FTP. Sushchestvuet spisok mashiny, podklyuchennyh k INTERNET, osushchestvlyayushchih etot servis besplatno. Poskol'ku baza dannyh nahoditsya na toj mashine, soedinenie s kotoroj vy ustanovili, poisk proizvoditsya s dostatochno vysokoj skorost'yu (obychno eto neskol'ko sekund). X-server |muliruet graficheskij terminal sistemy X-Windows. lpq/lpr/lprm Programmy, osushchestvlyayushchie dostup k setevomu printeru. lpq - oprashivaet sostoyanie printera i ocheredi k nemu; lpr - stavit zadanie v ochered'. lprm - udalyaet zadanie iz ocheredi. ping Testiruet IP-soedinenie, ispol'zuetsya dlya otladki. V kachestve parametra obychno ukazyvaetsya imya ili IP-adres mashiny (host) vozmozhnost' ustanovleniya IP-soedineniya s kotoroj proveryaetsya. V otvet ping-klient soobshchaet dostupna ili net mashina i vremya, cherez kotoroe ot nee poluchen otvet. Naprimer: C:\> ping elvis.msk.su elvis.msk.su is alive (mashina dostupna) C:\> ping elvis.msk.su no answer from elvis.msk.su (mashina nedostupna) C:\> ping bad-host ping: unknown host bad-host (neizvestnoe imya) Setevye pakety, podderzhivayushchie TCP/IP PCNFS i PCTCP. Naibolee izvestnymi paketami, podderzhivayushchie TCP/IP servis na PC pod MSDOS yavlyayutsya PCNFS (Copyrigt (c) Sun Microsystems) i PCTCP (Copyrigt (c) FTP Software). |to naibolee polnye setevye pakety, nezamenimye pri rabote v lokal'nyh setyah. Krome obychnogo FTP soderzhat sredstva, pozvolyayushchie montirovat' fajlovuyu sistemu drugih mashin (v tom chisle i s drugoj operacionnoj sistemoj) i rabotat' s nej kak s sobstvennym diskom. Poslednie versii etih paketov soderzhat winsock.dll podderzhivayushchuyu "Microsoft Windows Sockets" specifikaciyu [7], chto pozvolyaet ispol'zovat' setevye programmy pod MS-Windows. PCNFS i PCTCP strogo kommercheskie pakety i priobresti ih mozhno tol'ko u oficial'nyh dillerov firm. Biblioteki i ih specifikacii dlya programmirovaniya v etih sistemah postavlyayutsya otdel'no za dopolnitel'nuyu platu. TCPABI (Copyright (c) P.R.Tattam) Avtorom bol'shinstva programm etogo paketa, yadra TCP/IP (drajver TCPDRV.EXE) i specifikacii yavlyaetsya P.R.Tattam (peter@psychnet.psychol.utas.edu.au). Status - shareware. V paket vhodyat sleduyushchie programmy: archie2.exe Archie-klient finger2.exe Finger-klient ftp2.exe ftp-klient hopchk2.exe hop check-klient (trassirovka marshruta IP-paketa) ichat2.exe internet chat-klient ustanavlivaet soedinenie tochka-tochka mezhdu dvumya pol'zovatelyami, ispol'zuya TCP port 2048 (eto ne IRC-klient) ping2.exe ping-klient status.exe vyvodit status tcp na ekran tel2.exe telnet-klient whois2.exe whois-klient (ispol'zuet server nic.ddn.mil) A takzhe: newsabi.exe news-klient ircabi.exe IRC-klient Esli vy zahotite napisat' sobstvennye programmy dlya etogo paketa vy mozhete vospol'zovat'sya specifikaciej (fajl tcp201.specification) ili svyazat'sya po elektronnoj pochte s P.R.Tattam (e-mail adres: peter@psychnet.psychol.utas.edu.au) WATTCP (Waterloo TCP) |tot paket interesen tem, chto programmy obrashchayutsya k paketnomu drajveru napryamuyu, ne trebuya zagruzki dopolnitel'nyh rezidentnyh drajverov, zanimayushchih i bez togo nebol'shoe prostranstvo pamyati pod DOS. V paket vhodyat ping-, datime-, lpq-, lpr-, finger- i drugie klienty (vmeste s (ishodnymi tekstami). A takzhe: irc101.zip IRC-klient pcpine_p.zip IMAP-klient (|lektronnaya pochta) telnetd.zip telnet-demon! Pozvolit vojti cherez telnet na vashu PC c drugoj mashiny seti. Esli vy hotite poluchit' knigu "rukovodstvo programmista po WATTCP" kotoraya vklyuchaet ishodnye teksty mnogih programm, poshlite $50 po adresu: Erick Engelke 1010-130 Lincoln Rd. Waterloo, Ontario N2J-4N3 (e-mail adres: Erick@development.watstar.uwaterloo.ca) Trumpet WINSOCK Copyright (c) 1993,1994 by Peter R. Tattam (peter@psychnet.psychol.utas.edu.au). Status - shareware. Zapreshchena prodazha etogo produkta bez razresheniya avtora. Vy mozhete svobodno pol'zovat'sya etoj programmoj 30 dnej i, po istechenii etogo sroka, dolzhny zaregistrirovat' svoyu kopiyu v firme Trumpet Software International. Registracionnaya plata US$20. Poryadok registracii opisan v fajle install.txt. |to dinamcheskaya biblioteka dlya MS-Windows - winsock.dll, podderzhivayushchaya "Microsoft Windows Sockets" specifikaciyu [7]. Rabotaet cherez paketnyj drajver, ves' servis transportnogo urovnya TCP/IP osushchestvlyaet sama, ne ispol'zuya drugih (krome paketnogo) drajverov pod DOS'om. Zagruzhaetsya avtomaticheski, posle vyzova setevyh programm, vygruzhaetsya cherez neskol'ko sekund posle zaversheniya poslednej ispol'zuyushchej ee programmy. Soderzhit v sebe vstroennyj SLIP, chto pozvolyaet ispol'zovat' ee na modemnyh soedineniyah bez vsyakih DOS'ovskih drajverov voobshche. Sushchestvuet bol'shoe kolichestvo shareware i freeware programm razlichnyh avtorov pod MS-Windows opirayushchihsya na Winsock. Programmirovanie v etoj sisteme pochti takoe zhe kak v UNIX BSD. Sohranilis' dazhe sinopsisy mnogih funkcij, chto oblegchaet perenos setevyh programm iz UNIX [7]. Setevaya model' TCP/IP. Vy mozhete propustit' etot razdel, tak kak hotya v nem i privedeny mnogie terminy i ponyatiya, kotorye mogut vstretit'sya pri rabote s setyami, odnako obychno ne trebuyushchiesya bol'shinstvu pol'zovatelej. Kak pravilo, setevye programmy rabotayut po principu klient-server. To est', kogda pol'zovatel' zapuskaet programmu, zaprashivayushchuyu kakoj-libo setevoj servis (takuyu programmu nazyvayut klientom), to eta programma soedinyaetsya po seti s drugoj programmoj (nazyvaemoj demonom) zapushchennoj na drugoj mashine v seti. Mashina, predostavlyayushchaya setevoj servis nazyvaetsya serverom. Mashina podklyuchennaya k seti nazyvaetsya hostom (host). Lyuboj host (dazhe PC) mozhet byt' serverom, esli na nem zapushcheny sootvetstvuyushchie programmy, predostavlyayushchie setevoj servis, ili esli eti programmy budut zapushchenny avtomaticheski, neposredstvenno srazu posle pervogo zhe obrashcheniya za servisom. Host, na kotorom rabotaet pol'zovatel' nazyvaetsya lokal'nym (local host). Vse hosty imeyut Internet-adres, sostoyashchij iz chetyreh chisel, razdelennyh tochkami (naprimer 192.153.171.60) i sostavnoe imya v domennoj forme (naprimer elvis.msk.su). Odin host mozhet imet' neskol'ko imen i adresov. Ran'she, sootvetstvie mezhdu adresom i imenem opredelyalos' iz special'nogo tekstovogo fajla - hosts. No so vremenem, kogda kolichestvo mashin v Internet stalo takim, chto fajl stal zanimat' neskol'ko megabajt, i k tomu-zhe, ego trebovalos' korrektirovat' nepreryvno, byl izobreten special'nyj mehanizm zaprosov, pozvolyayushchij poluchat' etu informaciyu iz seti - DNS (Domain Name System) i ARP (Address Resolution Protocol). Pri peredache informacii po seti komp'yuter vypolnyaet nad nej neskol'ko etapov obrabotki, nazyvaemyh urovnyami: +-------------------------------+ |Uroven' programmy pol'zovatelya | +-------------------------------+ | +-----------------+ | Uroven' TCP/UDP | +-----------------+ | +------------+ | Uroven' IP | +------------+ | +------------------+ |Fizicheskij uroven'| +------------------+ Teoreticheski, zaprosy kazhdogo urovnya obrabatyvayutsya otdel'noj programmoj, no na praktike takie programmy chasto ob®edinyayut. Preobrazovanie informacii na kazhdom urovne osushchestvlyaetsya v sootvetstvii so standartom, kotoryj nazyvayut protokolom etogo urovnya. Kogda kakoj-libo pol'zovatel'skoj programme trebuetsya peredat' informaciyu po seti, ona ne pytaetsya otpravlyat' ee napryamuyu, cherez fizicheskoe soedinenie, a otdaet na bolee nizkij uroven', TCP ili UDP. Protokol TCP (Transmission Control Protocol - protokol upravleniya peredachej) garantiruet dostavku poluchennoj informacii. Razbivaet postupivshuyu informaciyu, na bloki dannyh (pakety), vychislyaya optimal'nyj razmer paketa. Trebuet ustanovleniya soedineniya do nachala peredachi informacii, to est', snachala proveryaetsya vozmozhnost' peredachi dannyh s odnoj storony, i nalichie poluchatelya informacii s drugoj. Protokol UDP (User Datagram Protocol - protokol pol'zovatel'skih datagramm) v otlichie ot TCP ne garantiruet nadezhnuyu dostavku, no i ne trebuet ustanovleniya soedineniya. Protokoly TCP i UDP nahodyatsya na odnom urovne i yavlyayutsya al'ternativoj drug drugu. Programma verhnego urovnya associiruet obrabatyvaemyj eyu setevoj servis s nomerom porta TCP ili UDP. Nomer porta - eto atribut TCP/UDP paketa po kotoromu ustanavlivaetsya ego sootvetstvie opredelennomu servisu. Tekstovyj fajl services, nahodyashchijsya na kazhdoj mashine seti, obespechivaet odnoznachnuyu interpretaciyu sootvetstviya servisa i nomera porta. TCP i UDP pakety postupayut na sleduyushchij uroven' - IP, kotoryj obespechivaet ih marshrutizaciyu. I tol'ko posle urovnya IP, pakety postupayut na fizicheskij uroven' - setevoj adapter ili modem. Na priemnoj storone pakety "raspakovyvayutsya" v obratnom poryadke. Odnovremennoe ispol'zovanie neskol'kih setevyh paketov. Podavlyayushchee bol'shinstvo setevyh programm obrashchaetsya ne neposredstvenno k setevoj plate (setevomu adapteru) a cherez special'nyj paketnyj drajver: Programma pol'zovatelya | Paketnyj drajver | MSDOS | Setevaya plata On osushchestvlyaet interfejs mezhdu razlichnymi vidami setevyh adapterov i standartnymi setevymi programmami i postavlyaetsya vmeste s adapterom. Interfejs k paketnomu drajveru so storony programm verhnego urovnya strogo standartizovan, chto pozvolyaet "otvyazat'" eti programmy ot ispol'zuemoj apparatury. Pri lyubom fizicheskom soedinenii programmy verhnego urovnya budut obrashchat'sya tol'ko k paketnomu drajveru. Vmesto setevoj platy mozhno ispol'zovat' modem (nul'-modem) i togda zagruzhayut SLIP-drajver vmesto paketnogo. Dlya PCNFS, PCTCP, TCPABI trebuetsya zagruzit' vdobavok drajver, osushchestvlyayushchij TCP/IP podderzhku: Programma pol'zovatelya | Drajver podderzhki TCP/IP | Paketnyj drajver | MSDOS | Setevaya plata Preimushchestvo etogo metoda sostoit v tom, chto vo-pervyh, yadro otlazhivaetsya nezavisimo ot samih programm, a vo-vtoryh, ekonomitsya razmer samih programm, znachitel'naya chast' ob®ema kotoryh perenositsya v drajver. Nedostatok - postoyannoe nalichie rezidentnogo drajvera, kotoryj zanimaet primerno 100K operativnoj pamyati, dazhe v tot moment, kogda mashina ne otrabatyvaet setevyh zaprosov. Kak byt', esli trebuetsya ispol'zovat' neskol'ko setevyh paketov odnovremenno? Dlya etogo ispol'zuyut PKTMUX () - paketnyj mul'tipleksor, kotoryj porozhdaet do vos'mi virtual'nyh paketnyh drajverov. Naprimer, vy hotite montirovat' setevye diski s pomoshch'yu NFS i odnovremenno chitat' News'a programmoj newsabi iz paketa TCPABI. Predpolozhim, chto vasha setevaya plata rabotaet s paketnym drajverom NE2000. V takom sluchae v autoexec.bat posle stroki, zagruzhayushchej paketnyj drajver nuzhno dobavit' stroku PKTMUX i dve stroki PKTDRV: . . . Rem Zagruzka paketnogo drajvera NE2000 0x60 2 0x300 Rem Sozdanie 2-h virtual'nyh paketnyh drajverov PKTMUX PKTDRV PKTDRV Rem Zagruzka NFS NET START . . . C:\> newsabi Shematichno eto mozhno predstavit' sleduyushchim obrazom: PC NFS NEWSABI | | PKTDRV PKTDRV \ | \ / \ / \ / \ / | PKTMUX | Paketnyj drajver | MSDOS | Setevaya plata V dokumentacii po PKTMUX est' primery po ego ispol'zovaniyu dlya PCTCP, PCNFS, NOVEL i drugimi paketami. Naibolee interesno rabotat' s setevymi programmami v mnogozadachnom rezhime. Na PC takoj rezhim raboty predostavlyaet sistema MS-Windows. Vy mozhete, naprimer odnovremenno zapustit' FTP-sessiyu (prichem ne odnu) i eto ne zablokiruet nadolgo displej. Odnovremenno mozhno rabotat' s lyuboj drugoj programmoj. Odnako, esli paketnyj drajver zagruzhen do starta WINDOWS on mozhet okazat'sya nedostupnym dlya zadachi, zapushchennoj posle starta WINDOWS, chto vyzovet zavisanie sistemy. Poetomu primenyayut drajver WINPKT, kotoryj razreshaet etu konfliktnuyu situaciyu. Naprimer: . . . NE2000 0x60 2 0x300 WINPKT 0x60 . . . win T.e.: NCSA telnet / news / mail / FTP | sessiya DOS | Windows 3.1 | WinPKT | Paketnyj drajver | MSDOS Vy mozhete ispol'zovat' PKTMUX/PKTDRV esli trebuetsya zagruzit' neskol'ko programm rabotayushchih s paketnym drajverom. FTP NCSA telnet | | PKTDRV PKTDRV | | sessiya DOS sessiya DOS +-----------+-----------------+ | Windows 3.1 | PKTMUX | Paketnyj drajver | MSDOS | Setevaya plata Bolee luchshij put' - ispol'zovat' WINSOCK. |to dinamicheskaya biblioteka, kotoraya osushchestvlyaet TCP/IP servis pod Windows i sama mul'tipleksiruet setevye dannye (pakety) mezhdu Windows-programmami (no uchtite, chto dlya DOS- programm ona ne dostupna): FTP PC Eudora WinVn FTPD | | | | +-------+---+----+-------+ | WINSOCK.DLL | Windows 3.1 | WinPKT | Paketnyj drajver | MSDOS V AUTOEXEC.BAT dolzhno byt': . . . NE2000 0x60 2 0x300 WINPKT 0x60 . . . win A esli vy ispol'zuete modemnoe soedinenie, to dlya raboty s Trumpet Winsock ne trebuetsya zagruzhat' nikakie drajvery. Trumpet Winsock soderzhit vnutri sebya podderzhku SLIP-protokola. YA uspeshno ispol'zoval sleduyushchuyu konfiguraciyu: FTP WinQVT WinVn FTPD | | | | +-------+---+--+-----+ | | WATTCP TELNETD | / | PKTDRV | / WINSOCK.DLL sessiya DOS \ / Windows 3.1 / | PC NFS / | | PKTDRV | PKTDRV | | | +---------+--------+ | PKTMUX | Paketnyj drajver | DOS Ustanovka Trumpet Winsock. Copyright (c) 1993,1994 by Peter R. Tattam (peter@psychnet.psychol.utas.edu.au). 1.a. Esli vy sobiraetes' ispol'zovat' Winsock na SLPIP-protokole (t.e. cherez modem) pp 1,2,3 mozhno propustit'. 1.b. Dlya raboty s setevym adapterom: Perepisat' WINPKT.COM. V AUTOEXEC.BAT posle paketnogo drajvera dobavit' stroku "winpkt": ne2000 0x60 2 0x300 winpkt 0x60 VNIMANIE! WINPKT dolzhen byt' (Portions Copyright 1991 Roger F. James), kotoryj lezhit v tom zhe kataloge, chto i winsock.zip, a ne tot, kotoryj postavlyaetsya vmeste s pktmux! 1.c. Sovmestno s PC NFS (versii nizhe 5.0): Perepisat' WINPKT.COM, a takzhe PKTMUX.EXE i PKTDRV.EXE i PKTSTATS.EXE. V AUTOEXEC.BAT posle paketnogo drajvera dobavit' zagruzku pktmux/pktdrv: c:\nfs\ne2000 -n 0x62 2 0x300 c:\pktmux.exe /8 c:\pktdrv.exe c:\pktdrv.exe /cl c:\nfs\prt * c:\nfs\net init 1.d. Sovmestno s Novell Netware: Perepisat' WINPKT.COM, a takzhe PKTMUX.EXE i PKTDRV.EXE i PKTSTATS.EXE, V AUTOEXEC.BAT posle paketnogo drajvera dobavit' zagruzku pktmux/pktdrv: ne2000 -n 0x60 2 0x300 pktmux 4 pktdrv pktdrv pktdrv pktdrv zdipx netx path c:\dos;c:\network\win31 f: login Esli paketnyj drajver "ne ponimaet" klyuch -n poprobujte ispol'zovat' ODIPKT: @echo off cd \ lh lsl lh \odi\ne2000 cd \net lh ipxodi lh odipkt lh winpkt 0x69 lh netx path c:\dos;c:\net\win31 f: echo on login 2. Peregruzite mashinu. 3. Vyzovite PKTSTATS Zapomnite vydavaemyj im IP-adres vashej mashiny i nomer lyubogo svobodnogo (FREE) vektora preryvaniya. |to potrebuetsya v dal'nejshem, dlya konfiguracii WINSOCK. Primer: PKTSTATS v1.2e: Copyright (C) G W Robinson/SERC 1991-1993. All Rights Reserved. Interrupt 62: PKTMUX multiplexor; Max channels 3; Busy 1 Interrupt 63: PKTDRV - Busy; Channel 0; Interrupt 65: PKTDRV - Free; Send total 3711; Direct 3372; Copied 352; Ignored: err resp 0 Recv total 9189; To App: Direct 8126, Copied 948; Ignored 136 Recv ignored reasons: Broadcast 136 Packet Driver buffer analysis feature off MAC address 0080 C8F0 42FD ; IP address 192.153.171.46 Vektor=65; IP-adres=192.153.171.46 4. Perepisat' v katalog WINDOWS sleduyushchie fajly: winsock.dll sobstvenno sam TCP/IP drajver tcpman.exe programma interfejsa dlya naznacheniya/izmeneniya konfiguracii WINSOCK hosts spisok sootvetstviya IP-adresov imenam teh mashin s kotorymi vy naibolee chasto rabotaete. services spisok sootvetstviya servisa INTERNET TCP/UDP-portu. protocol spisok protokolov INTERNET Esli vy pomestite eti fajly v drugoj katalog, ne zabud'te v AUTOEXEC.BAT dobavit' put' do nih v peremennoj PATH. Pri izmenenii peremennoj PATH ona budet "rabotat'" posle perezagruzki sistemy. 5. Zagruzit' Windows C:\> WIN 6. Vyzvat' TCPMAN, dlya chego v Program Manager'e vybrat' File/Run, a zatem napisat' "tcpman". 7. V menyu TCPMAN vybrat' FILE -> Setup Poyavitsya okno: +-------------------------------------------------------------+ |-| Network Configuration | +-------------------------------------------------------------+ | IP address ____________ | | Netmask ____________ Default Gateway ____________ | | Name server ____________ Time server ____________ | | Domain Suffix ___________________________________________ | | Packet vector ___ MTU ___ TCP RWIN ____ TCP MSS ____ | | Demand Load Timeout (secs)___ | | +---------------------------------------------------------+ | | | _ +---------------------------+ | | | | | | Internal SLIP | Online Status Detection | | | | | ~ _ | | | | | | SLIP SLIP Port |1| | () None | | | | | +-+----+ | () DCD (RLSD) check | | | | | Baud Rate |9600 | | () DSR check | | | | | _ +~~~~~~+ | | | | | | | | Hardware Handshake +---------------------------+ | | | | - | | | | | | Van Jecobson CSLIP compression | | | | ~ | | | +---------------------------------------------------------+ | | ------ ------ | | | Ok | |Cancel| | | ------ ------ | +-------------------------------------------------------------+ 8. Ustanovite trebuyushchuyusya vam konfiguraciyu IP address - IP-adres vashej mashiny (naprimer 192.153.171.46). Dopuskaetsya vmesto adresa ukazyvat' rarp ili bootp, esli vash server podderzhivaet eti protokoly. Togda Winsock popytaetsya sam opredelit' adres dannoj mashiny iz seti. Netmask - naprimer 255.255.255.224 (ili dlya SLIP 255.255.255.0) Default Gateway - IP-adres vashego servera. (naprimer 192.153.171.60) Pol'zovateli NFS mogut uznat' Gateway (ROUTER) i Netmask podav komandu NET NAME. Name server - IP-adres vashego DNS-servera, kotoryj obespechivaet preobrazovanie Internet adres <=> imya, (naprimer 192.153.171.33) Time server - V tekushchej versii ne ispol'zuetsya. Zarezervirovano dlya budushchego ispol'zovaniya. Domain suffix - suffiks vashego domena, ispol'zuetsya DNS. (Primer: elvis.msk.su) Packet Vector - shestnadcatirichnyj adres preryvaniya, obsluzhivaemyj paketnym drajverom (naprimer 60). V sluchae SLIP (t.e. soedinenie cherez modem) etot parametr ne ispol'zuetsya. Programma PKTSTATS vydaet nomera vektorov preryvaniya: C:\> PKTSTATS PKTSTATS v1.2e: Copyright (C) G W Robinson/SERC 1991-1993. All Rights Reserved. Interrupt 62: PKTMUX multiplexor; Max channels 3; Busy 1 Interrupt 63: PKTDRV - Busy; Channel 0; Interrupt 65: PKTDRV - Free; [...] Vybirat' sleduet lyuboj svobodnyj vektor (65 v dannom sluchae) MTU - Maximum Transmission Unit - Maksimal'nyj razmer paketa. (naprimer 1500 dlya EtherNet ili 576 dlya SLIP) TCP RWIN - TCP Receive Window - okno TCP (naprimer 4096) TCP MSS - TCP Maximum Segment Size - maksimal'nyj razmer segmenta TCP (naprimer 1460) Demand Load Timeout - Vremya (v sek.) v techenii kotorogo Winsock ostaetsya zagruzhennym posle zaversheniya vseh vseh ispol'zuyushchih ego prilozhenij. Internal SLIP - Razreshit' ispol'zovat' vstroennuyu podderzhku SLIP-protokola([ ] dlya EtherNet i [X] dlya SLIP) SLIP Port - tol'ko dlya SLIP. Nomer posledovatel'nogo porta k kotoromu podklyuchen modem. (naprimer 2) Baud Rate - tol'ko dlya SLIP. Skorost' obmena s posledovatel'nym portom (naprimer 9600). Dlya mashin s vysokoj taktovoj chastotoj (>33 mGc) rekomenduetsya vybirat' 38400 i bol'she. Hardware Handshake - tol'ko dlya SLIP. Razreshit' kontrol' za perepolneniem po RTS/CTS (primer: [X]). Vozmozhno, potrebuetsya dat' komandu AT&K3 modemu. Van Jacobson CSLIP compression - tol'ko dlya SLIP. Razreshit' ispol'zovat' SLIP protokol so szhatiem dannyh (primer: [X]) Online Status Detection - tol'ko dlya SLIP. Trebuetsya dlya avtomaticheskogo nabora nomera. Pri etom tekushchee sostoyanie linii otslezhivaetsya: NONE - ne opredelyat' status linii. DCD (RLSD) - po DCD modema (vozmozhno, potrebuetsya dat' komandu AT&C1 modemu). DSR check - po DSR modema (vozmozhno, potrebuetsya dat' komandu AT&S1 modemu.). 9. V menyu vybrat' FILE -> Exit 10. V Program Manager'e sozdajte novuyu gruppu WinSock: V menyu Program Manager'a vybrat' File/New. V poyavivshemsya okne postavit': (*) Program Group i nazhat' [OK]. V pole Description napisat' WinSock i nazhat' [OK] 11. Esli vy rabotaete so SLIP-protokolom, rekomenduetsya dobavit' tcpman.exe v etu gruppu. (Primer: V menyu Program Manager'a vybrat' File/New. V poyavivshemsya okne postavit': (*) Program Item i nazhat' [OK] V pole Command Line napisat' tcpman i nazhat' [OK]) 12. Esli vy rabotaete cherez setevoj adapter propustite etot punkt. Esli vy rabotaete cherez Slip-protokol ustanovite soedinenie s serverom: Vyzvat' tcpman, vybrat' v menyu Dialer/Manual login i, zadavaya komandy modemu popytat'sya ustanovit' soedinenie Naprimer: Trumpet Winsock Version 1.00 Alpha #18 Copyright (c) 1993 by Peter R. Tattam All Rights Reserved. SLIP ENABLED Internal SLIP driver COM2 Baud rate = 9600 Hardware handshaking My ip = 131.217.8.4 netmask = 255.255.255.0 gateway = 131.217.250.1 SLIP DISABLED atdp1234567 CONNECT 9600 Annex Command Line Interpreter * Copyright 1991 Xylogics, Inc. Checking authorization, Please wait... Annex username: xxxxxx Annex password: Posle etogo na ekrane periodicheski budet poyavlyat'sya gruppa haoticheskih simvolov, svidetel'stvuyushchaya o postuplenii routingovyh paketov s servera. Nazhat' klavishu . Poyavitsya soobshchenie: SLIP ENABLED, t.e. Trumpet Winsock gotov k rabote. 13. Proverit' pri pomoshchi WS_PING soedinenie s serverom. Dlya chego ustanovit' WS_PING (kak opisano nizhe) i vyzvat'. V menyu vybrat' BlockingPing. V pole Host zadat' adres svoego servera (Default Gateway). Posle togo kak budet nazhata knopka [ Ok ], programma budet peredavat' pakety na server (zazhigaetsya lampochka SD na modeme) i poluchat' otvetnye pakety ot servera (zazhigaetsya lampochka RD na modeme). Na ekran budet vyvoditsya informaciya o vremeni, cherez kotoroe poluchen otvet. 14. Poprobujte zadat' v pole Host programmy WS_PING imya servera vmesto adresa. Esli vse predydushchie operacii zakonchilis' uspeshno, mozhno perehodit' k ustanovke sleduyushchih programmnyh produktov. 15. Dobav'te v gruppu ostal'nye programmy WinSock: WS_PING,WinQVT i t.d., kak ukazano nizhe. Esli po kakim libo prichinam TCPMAN ne vyzyvaetsya, vy mozhete izmenit' setevuyu konfiguraciyu otredaktirovav lyubym tekstovym redaktorom (naprimer Windows Notepad) fajl TRUMPWSK.INI. On nahoditsya v tom zhe kataloge, chto i WINSOCK.DLL. Naznachenie polej sootvetstvuyut polyam v Network Configuration (sm p.7): [Trumpet Winsock] ip - IP address netmask - Netmask gateway - Default Gateway dns - Name server time - Time server domain - Domain S